pdflatex

rmarkdown::render to compile LaTeX documents

大兔子大兔子 提交于 2019-12-25 09:14:24
问题 This example LaTeX file compiles just fine for me using Rstudio, TexShop, and pdflatex example.tex . But rmarkdown::render does not work. > rmarkdown::render("example.tex", output_format = "pdf_document") /usr/local/bin/pandoc +RTS -K512m -RTS example.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output example.pdf --template /Library/Frameworks/R.framework/Versions/3.3/Resources/library/rmarkdown/rmd/latex/default.tex --highlight-style

How to convert LaTeX to PDF/PNG by PHP

孤人 提交于 2019-12-24 18:06:22
问题 I have LaTeX code inside PHP (not as .tex file); for example received by $_POST. How can I save the rendered LaTeX as a PNG or PDF file on my server? EDIT: I know that PHP normally does not do this. I will run a shell command within PHP. Thus, I need something to do so in Linux terminal. 回答1: you could exec() pdfTex to generate a PDF URL: http://www.tug.org/applications/pdftex/ Run command pdftex file.tex after you saved your tex-code from $_POST to a file using file_put_contents() - make

Set/change bibliography title in RMarkdown?

坚强是说给别人听的谎言 提交于 2019-12-24 10:47:52
问题 I'm currently experimenting with RMarkdown. However, I would like to change the title of my bibliography. I'm using natbib in this situation. The current RMarkdown setup is shown below: title: .... author: .... output: pdf_document: citation_package: natbib bibliography: Referanser2.bib biblio-style: unsrt header_includes: - \usepackage{amsmath} - \usepackage{kbordermatrix} - \setcitationstyle{numbers,square} [@MyReference] This gives me a simple PDF with 1 reference and a bibliography. Is

Conditional font color R Markdown

扶醉桌前 提交于 2019-12-23 04:31:45
问题 I am unable to find a way to include dynamic font colors in R Markdown based on the value of a variable (>0, ==0, or <0). Could anyone help? I tried an if statement where the return value is latex syntax, but that errored out. To be clear, I'm looking for PDF output. Here's what I tried: ```{r setup, include=FALSE} x <- 4 ``` This is an R Markdown document. `r if (x>0) {\textcolor{red}{Markdown}} else if (x==0) {\textcolor{blue}{Markdown}} else {\textcolor{yellow}{Markdown}}` In this dummy

Conditional font color R Markdown

我怕爱的太早我们不能终老 提交于 2019-12-23 04:31:03
问题 I am unable to find a way to include dynamic font colors in R Markdown based on the value of a variable (>0, ==0, or <0). Could anyone help? I tried an if statement where the return value is latex syntax, but that errored out. To be clear, I'm looking for PDF output. Here's what I tried: ```{r setup, include=FALSE} x <- 4 ``` This is an R Markdown document. `r if (x>0) {\textcolor{red}{Markdown}} else if (x==0) {\textcolor{blue}{Markdown}} else {\textcolor{yellow}{Markdown}}` In this dummy

Pdflatex for windows

笑着哭i 提交于 2019-12-21 03:09:25
问题 Does anyone know how to convert .tex files to .pdf in windows? I tried cygwin but it said the command "pdflatex" was not recognised Thanks Philip 回答1: There's no reason to complicate things with Cygwin. Go download and install a TeX distribution for Windows - I personally use TeX Live, but various other distributions are available, such as MikTeX or W32TeX. If you want to use UTF-8 for your bibliography, and you're using BibTeX, I recommend using bibtexu instead of the regular bibtex (since

Pdflatex for windows

自古美人都是妖i 提交于 2019-12-21 03:09:03
问题 Does anyone know how to convert .tex files to .pdf in windows? I tried cygwin but it said the command "pdflatex" was not recognised Thanks Philip 回答1: There's no reason to complicate things with Cygwin. Go download and install a TeX distribution for Windows - I personally use TeX Live, but various other distributions are available, such as MikTeX or W32TeX. If you want to use UTF-8 for your bibliography, and you're using BibTeX, I recommend using bibtexu instead of the regular bibtex (since

Rstudio pdf knit fails with “Environment Shaded undefined” error

雨燕双飞 提交于 2019-12-20 02:46:12
问题 When trying to knit a PDF using a template from package rticles output: rticles::acm_article I get the following error: ! LaTeX Error: Environment Shaded undefined. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.76 \begin{Shaded} This appears to only happen when I include code chunks within the output document. Reproducible example : You will need to start a new R Markdown document using the New Document -> From Template -> Association for

pandas dataframe as latex or html table nbconvert

淺唱寂寞╮ 提交于 2019-12-18 11:44:25
问题 Is it possible to get a nicely formatted table from a pandas dataframe in ipython notebook when using nbconvert to latex & PDF? The default seems to be just a left-aligned block of numbers in a shoddy looking font. I would like to have something more like the html display of dataframes in the notebook, or a latex table. Saving and displaying a .png image of an HTML rendered dataframe would also be fine, but how exactly to do that has proved elusive. Minimally, I would just like a simple

sphinx customization of latexpdf output?

送分小仙女□ 提交于 2019-12-18 10:36:14
问题 Just curious if anyone knows how to customize the sphinx output when using the latexpdf target? I've seen lots of custom stuff for html output, but cant seem to find any example of custom pdf output. Specifically, I'd be interested in customizing the title page, headers, footers, and possibly adding a few pages of front matter before the contents. Has anyone seen any examples of this kind of customization, or do people pretty much just use the "stock" sphinx output when generating pdfs?