pandoc

pandoc doesn't text-wrap code blocks when converting to pdf

你离开我真会死。 提交于 2019-12-03 14:50:55
问题 I'm using pandoc with xelatex engine to convert markdown to pdf. I'm running pandoc like this: pandoc -s 'backbone-fundamentals'.md -o 'backbone-fundamentals'.pdf \ --title-prefix 'Developing Backbone.js Applications' \ --normalize \ --smart \ --toc \ --latex-engine=`which xelatex` If a code line is longer than the pdf document width it just gets cutoff. Is there anyway to have pandoc text wrap long code lines? 回答1: Not having the text wrapped is (part of) the point of code blocks. As far as

How to suppress automatic figure numbering in Rmarkdown / pandoc

允我心安 提交于 2019-12-03 13:15:10
问题 I have the following Rmarkdown (.Rmd) document where I call existing .png images and create a .pdf with captions. By default, pandoc? is automatically adding "Figure #." before the caption for each picture. I can see how this would be the normal thing to do, but in my case I would like to define this. I have found variations on this topic but don't seem to find a solution. Below is an example of how my .Rmd file looks: --- title: "TITLE" author: "ME" date: "`r Sys.Date()`" output: pdf

LaTeX multicolumn block in Pandoc markdown [duplicate]

风流意气都作罢 提交于 2019-12-03 12:31:49
This question already has an answer here: Slides with Columns in Pandoc 6 answers I want to convert a markdown file to html and pdf using pandoc. For the pdf file, which is intended for printing, I'd like to render a block of (narrow) text in two column format. This is what I came up with (and doesn't work): --- papersize: a4 documentclass: article header-includes: - \usepackage{multicol} ... H1 ============== H2 - A -------------- \begin{multicols}{2} ### H3 - a Blah blah blah... ### H3 - b Blah blah blah... ### H3 - c Blah blah blah... \end{multicols} H2 - B -------------- Blah blah blah...

Using CSS when converting Markdown to PDF with Pandoc

此生再无相见时 提交于 2019-12-03 12:19:40
I'm trying out Pandoc on OS X, and results thus far are impressive. One blocking problem, however, is getting CSS styles to work on inline code samples. I'm converting from Markdown to PDF. I have this string in my source: * Create a simple HTML document (<span class="filename">simple.html</span>) and load it into the browser via the file system I've also tried this: * Create a simple HTML document (`simple.html`{.filename}) and load it into the browser via the file system I'd like to apply the class "filename" to the enclosed text in each case, but it doesn't seem to do anything to the output

Pandoc: Converting markdown to HTML, syntax highlighter

那年仲夏 提交于 2019-12-03 11:53:07
I'm converting markdown to HTML, and I want to include syntax-highlighted code. I'm working from some markdown that contains syntax like: ~~~ {.c} long factorial (int n) { long result = 1; while (n > 1) result *= n--; return result; } ~~~ but I don't know which syntax highlighting extension was used to process this syntax. What's a good extension? Answer from comments, please edit before giving negative rating. Solution Pandoc does syntax highlighting automatically. You don't need an external extension. Just be sure to use the -s flag so you get a standalane HTML file with the CSS needed for

Poor resolution in knitr using Rmd

帅比萌擦擦* 提交于 2019-12-03 11:37:40
问题 I have a .Rmd file and I am trying to create a .docx file via the function pandoc. I want to have a figure with final resolution of 504x504 pixels (i.e., 7x7inch with 72dpi). Unfortunately, the default 72 dpi is too poor in quality, and I would like to increase it to, say, 150 dpi without altering the final resolution (so it will already have the correct size within the .docx file). If I keep options fig.width and fig.height=7 and set dpi=150, I get the quality I want but the final resolution

knit DT::datatable without pandoc

天涯浪子 提交于 2019-12-03 10:36:18
I am trying to use DT::datatable to output a nicely formatted, interactive table in R. ...only problem is that I want a heroku job to knit the document for me, and I've learned that RStudio and rmarkdown::render() use pandoc under the hood -- but pandoc doesn't ship in the stripped down R Buildpack for heroku. Is there any way to get the old markdown engine ( knitr:knit2html or markdown:markdownToHTML ) to pass the javascript that powers datatable through? Or to be more precise, to generate the sample table below without using pandoc? Here is a minimal example: testing.Rmd --- title: "testing"

Why Pandoc does not retrieve the image file?

久未见 提交于 2019-12-03 10:12:34
问题 On RStudio version 0.98.501 I had a long .Rmd file which was easily converted to html once I clicked KnitHtml button. The Knitting process, as I understand, created several folders including images (some manually added by myself), figures, cache and a knitHtml folder which included final .html file. I recently downloaded RStudio version 0.98.894 (preview release) because I wanted to use more features. Now, when I click knitHtml I get following error: pandoc.exe: Failed to retrieve C:/Users

Plots in beamer slides converted from .md by pandoc are extremely large

二次信任 提交于 2019-12-03 09:30:16
问题 Normal plots generated by R chunks in R markdown files are exactly there when converted to html slides or pdf. However, when they are converted to beamer slides by pandoc -t beamer ex.md -V theme:Warsaw -o beamer.pdf , the plots become extremely large, especially for those generated by par(mfrow=c(n,m)) , in which case only a little part of the plot is displayed. I tried to fix by setting the chunk option dev='pdf' , but it doesn't work out. The plot in html is The plot in beamer is 回答1: The

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

徘徊边缘 提交于 2019-12-03 09:05:11
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. 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} }% } And add to your yaml: --- output: pdf_document: includes: in_header: header.tex --- See the