pandoc

Adding background image to R Markdown (.rmd) file for PDF output?

僤鯓⒐⒋嵵緔 提交于 2019-12-04 14:16:21
问题 Is it possible to add a background image to a R Markdown (.rmd) file for PDF output? I have scoured through Pandoc's R Markdown documentation but cannot find any mention of adding a background image. 回答1: From this tex.SE answer: save the following as header.tex (replacing image.jpg by the path to your background image): \usepackage{background} \backgroundsetup{ scale=1, color=black, opacity=0.4, angle=0, pages=all, contents={% \includegraphics[width=\paperwidth,height=\paperheight]{image.jpg

Convert HTML and inline Mathjax math to LaTeX with pandoc ruby

女生的网名这么多〃 提交于 2019-12-04 13:24:36
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 into an array with a regex ( string.split(regex) ) loop through the created array and if content matches

Automate RStudio processed RMarkdown?

时光总嘲笑我的痴心妄想 提交于 2019-12-04 13:01:32
I have an RMarkdown file that I use to generate a nice HTML report. The problem is, I want to be able to automate it so that it can run on a headless server. As such there will be nobody there to start Rstudio and press the 'knithtml' button and it seems that Rstudio is doing a LOT of additional magic like having it's own version of pandoc, running all the necessary commands, applying css styles etc. How can I take this report and generate the same thing Rstudio is generating when I press the 'knithtml' button, but by just running an R script? Thanks. Try using rmarkdown::render("/PATH/TO/YOUR

How to use a “R-generated” plot as a semi-transparent background in an HTML5 slide made by knitr?

做~自己de王妃 提交于 2019-12-04 12:10:11
I want to add a plot to my first page of the (HTML5) slide. Can I achieve this in a dynamically way? Say, the background image will be generated by R code, rather than insert a semi-transparent PNG image. Thank you. Update : What I want is You can use the chunk option dev.args to achieve this. You will need to size the image correctly to fit your slide. ```{r dev.args = list(bg = 'transparent')} plot(1:10, 1:10) ``` This chunk will generate a transparent png. Please read the documentation ? png to get a list of arguments you can pass. Here is one useful piece onf info from the docs. png

Using a YAML header argument in knitr

浪子不回头ぞ 提交于 2019-12-04 11:33:06
问题 I am making a set of slides using rmarkdown and the LaTeX option of outputting it to beamer . I have two templates I use in my slides - one specific for the LaTeX options, and one pandoc template that I have modified to account for some additional feature of my slides. I have defined an option in the YAML header called to_print which is a boolean TRUE/FALSE that I pass to the pandoc template that tells it to add a package and clean up the slides for printing. I also want to use this variable

How to left align a whole table in markdown (pandoc)?

≡放荡痞女 提交于 2019-12-04 10:52:31
问题 How do you left align an entire table in Markdown/Pandoc? I know about different ways of specifying tables and how alignment of columns are done, but I cannot find a way to shift the table from center aligned to left aligned (have even tryed embedding <div style="float: left>..</div> which didn't work). Do I have to switch to LaTeX to do this? I will export to pdf later on, if that makes a difference. 回答1: I now found a solution to this problem at tex.stackexchange.com. Apparently pandoc

Generate Markdown tables?

柔情痞子 提交于 2019-12-04 10:26:36
Is there any way to generate tables from objects (Python/Ruby/Java/C#)? I'd like to create a simple table programatically. I have some objects and I'd like to map some properties to headers and the collection to rows. Why Markdown? Because I'd like to edit that document manually later. Right now, the whole process looks like this: reporting engine is in C# there are objects from which DOCX are generated (there is intermediate XML or something like that) almost always I have to do minor fixes and I have to open that docx documents in MS Word it's troublesome to ask the developer team to fix

Can't knit to pdf with custom styles

时光总嘲笑我的痴心妄想 提交于 2019-12-04 09:50:00
Trying to knit to pdf from RStudio using a custom mystyles.sty file. This used to work fine but now that I have upgraded to RStudio 1.044 I get an error. Example: --- title: "Test" output: pdf_document: includes: in_header: mystyles.sty --- ## R Markdown This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>. When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the

Pandoc: What are the available syntax highlighters?

≯℡__Kan透↙ 提交于 2019-12-04 07:39:31
问题 Bullet point 18 of http://pandoc.org/demos.html#examples shows how to change the syntax highlighter used by giving an argument to --highlight-style . For example: pandoc code.text -s --highlight-style pygments -o example18a.html pandoc code.text -s --highlight-style kate -o example18b.html pandoc code.text -s --highlight-style monochrome -o example18c.html pandoc code.text -s --highlight-style espresso -o example18d.html pandoc code.text -s --highlight-style haddock -o example18e.html pandoc

Add X-UA-Compatible in rmarkdown html output

℡╲_俬逩灬. 提交于 2019-12-04 07:02:46
I'm trying to add the following tag <meta http-equiv="X-UA-Compatible" content="IE=edge" /> as the first one after <header> in the output of rmkardown HTML document. This is necessary for Internet Explorer, as explained in this MSDN article . This answer does not work for me because the tag is added at the end of <head> and is ignored. My HTML output has some script embedded that is written before the X-UA-Compatible meta tag. Is there a way to add the tag as the first one automatically in rmarkdown? I just ran into this issue too. As people have said in the comments, editing the template html