latex

自用的一套LaTeX文档模式备忘

ぐ巨炮叔叔 提交于 2019-12-06 11:47:32
  这里记录一份自用的LaTeX文档模式以备忘。   环境:   操作系统:Ubuntu 18.04.3   编译方式:LuaLaTeX   目录结构: 目录说明:   1、database是一个项目存放目录,有多少项目就会有多少这样的文件夹。这里是名为综合资料的项目;   2、package是自定义LaTeX宏包、类的存放区;   3、resource是素材区,存放图片、音频、视频等;   4、tool_lib是工具区,主要是lua源代码、c/c++编写的链接库等。 主要文件源代码:   1、综合资料.tex \documentclass{book}% % % 注意宏包顺序,有可能会报错 \usepackage{ctex}% 中文支持 \usepackage{geometry}% 用于页面设置 \usepackage[dvipsnames, svgnames, x11names]{xcolor} % 颜色支持 \usepackage{graphics}% 图形支持 \usepackage[colorlinks,linkcolor=blue]{hyperref} \usepackage{enumerate}% 枚举支持 \usepackage{listings}% 代码显示支持 \usepackage{tabularx}% 表格支持 \usepackage{lakeside

Sublime Text 2 LatexTools not launching SumatraPDF

别来无恙 提交于 2019-12-06 11:45:09
I'm trying to run the LaTexTools plugin in Sublime Text 2.0.2, build 2221. I'm running a 64-bit, Windows 8.1 computer. LaTexTools is installed and working - it produces a compiled PDF, which is viewable in SumtraPDF and Adobe Reader if I open it manually from the windows folder location. However after building the Tex file, the PDF does not automatically launch. When I try to shift the view to the PDF, Sublime Text throws the following error: Cannot launch Viewer. Make sure it is on you PATH. Doing a normal build on the .tex file produces the following output: [Compiling C:\Users\Mpaull15

xtable package: Skipping some rows in the output

和自甴很熟 提交于 2019-12-06 10:46:52
In the xtable output, if I want some rows to have nothing in them I will put NA 's in the elements of the matrix that correspond to the row that I want skipped. However this will lead to xtable output of something like & & & & & & & & \\ . What I want to know is how do I make it so it's ONLY \\ for that row that I wish to skip. Still not sure whether I understand right but I give it a shot. The most important assumption I'm making here is that your multicolumn rows in that template are always at the same spot. You use R to create a matrix or dataframe with no (useful) data in these rows. For

Adjusting R Markdown Title Position in PDF output

耗尽温柔 提交于 2019-12-06 09:53:33
问题 I am creating an R Markdown report and can´t find a way to move my title down the page. Here is a minimal example, where I would like to move the title down 5cm: --- title: "This is my title to display at 5cm below the top" output: pdf_document: includes: in_header: header.tex --- \thispagestyle{titlepage} The header.tex file include some custom styling: \usepackage{fancyhdr} \fancypagestyle{titlepage}{ \fancyfoot[LE,RO]{\thepage\ of \pageref{LastPage}} \fancyfoot[LE,LO]{Project} \fancyhead[L

Insert values from a file in a latex document

淺唱寂寞╮ 提交于 2019-12-06 09:21:31
If a have a latex document, how can I read some key-value pairs from a file an insert them into the document? Something like this: Latex code: customer ID: ${customerID} Text file: customerID=123456 And the resulting .pdf file should contain the customer ID. We can always write a perl script to expand them... defs.txt: customerID=123456 customerTel=22530000000 doc.tex: \documentclass{article} \begin{document} latex customer ID: ${customerID} and ${address} costum telphone ID: ${customerTel} \end{document} perl script tex-defs: #!/usr/bin/perl -n BEGIN{$tex=0;} if(not $tex and /^(\w+)=(.*)/) {

Write latex formulas in fabric.js

旧街凉风 提交于 2019-12-06 08:59:37
问题 I would like to be able to write formulas in latex in a fabric.js canvas, perhaps with MathJax. http://fabricjs.com/fabric-intro-part-2#text Is it possible to do that? 回答1: I would use the SVG renderer of MathJax to create a SVG file and then load that SVG into fabric.js. Here's an example: <!-- It is important to use the SVG configuration of MathJax! --> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_SVG"> </script> <!--

Unable to knit pdf from Rmardown from Rstudio in Windows 10 PC

无人久伴 提交于 2019-12-06 08:56:09
I created a new Rmd file in the latest R and Rstudio version, and with the complete version of MiKTeX installed. In my windows 10 machine. When I tried to knit it I got the following error ! LaTeX Error: File `fancyvrb.sty' not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) Enter file name: ! Emergency stop. <read *> l.34 \newcommand pandoc.exe: Error producing PDF Error: pandoc document conversion failed with error 43 Además: Warning message: comando ejecutado '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS pdfprueba.utf8.md --to latex

Rreport/LaTeX quality output package

岁酱吖の 提交于 2019-12-06 08:20:09
I'm looking for some LaTeX template for creating quality output. On R-bloggers I've bumped on Frank Harrel's Rreport package. Due to my quite modest LaTeX abilities, only a user-friendly (and noob-friendly) interface should suffice. Here's a link to an official website. I'm following the instructions, but I cannot manage to install an app. I use Ubuntu 9.10, R version is 2.10.1 (updated regularly from UCLA's CRAN server), and of course, cvs is installed on my system. Now, I'd like to know if there is some user-friendly LaTeX template package (Sweave is still to advanced/spartan for me). I'm

Convert HTML and inline Mathjax math to LaTeX with pandoc ruby

半世苍凉 提交于 2019-12-06 07:59:23
问题 I'm building a Rails app and I'm looking for a way to convert database entries with html and inline MathJax math (TeX) to LaTeX for pdf creation. I found similar questions like mine: Convert html mathjax to markdown with pandoc How to convert HTML with mathjax into latex using pandoc? and I see two options here: Create a Haskell executable which leaves stuff like \(y=f(x)\) alone when converting html to LaTeX Write a ruby method which does the following things: Take the string and split it

How to decimal-align regression coefficients in Latex table output in rmarkdown document

我只是一个虾纸丫 提交于 2019-12-06 07:49:59
问题 In an rmarkdown document, I'm creating a Latex table of regression coefficients with standard errors to compare several regression models in a single table. I'd like to vertically align the coefficients for each model so that the decimal points of the coefficients line up vertically down a column. I'm using texreg to create the table. The coefficients aren't decimal-aligned by default (instead, each string is centered within its column) and I'm looking for a way to get the coefficents decimal