pandoc

Pandoc markdown: Omit text in PDF version but include in HTML version

牧云@^-^@ 提交于 2019-12-01 06:09:42
问题 I'm trying to maintain two versions of my CV, one with lots of gloss and one that's more conventional. The glossy version will be HTML. I have it working with images (e.g. when I include an image using straight-up HTML code, Pandoc non-strict ignores the image and alt text in the PDF version but includes it in the HTML version. However, for straight-up text, it's not working. I've tried wrapping it in <p>text</p> or <div>text</div> , but the PDF version seems to be ignoring the code while

from HTML <figure> and <figcaption> to Microsoft Word

懵懂的女人 提交于 2019-12-01 05:13:40
I have an HTML with the figure , img and figcaption tags and I would like to get them converted to a Microsoft Word document. The image referred by img should be inserted in the Word document and the figcaption should be converted to its caption (also keeping the figure number). I have tried to open the html with Word 2013 but the figcaption is not converted as the figure caption but it is just a simple text below the image. Is there any minimum working sample to get it done? I had a look at https://en.wikipedia.org/wiki/Microsoft_Office_XML_formats#Word_XML_Format_example but it is too

How to make RMarkdown (.Rmd) table captions go at the top

一曲冷凌霜 提交于 2019-12-01 05:03:21
问题 Usually tables have captions at the top. However, RMarkdown always places the caption at the bottom for pdf_document outputs: This is strange because in html docs the caption is automatically placed at the top: How do I make table captions go to the top in the pdf documents also? Reproducible example (replace pdf_document with html_document to see both) - the contents of my file tables.Rmd: --- title: "tables" author: "Robin Lovelace" date: "09/16/2014" output: pdf_document --- text... Table:

Using a custom template for Rmd pdf without changing current setup

爱⌒轻易说出口 提交于 2019-12-01 04:21:49
I have recently learned that modifying the default (Pandoc?) template for a Rmd pdf report gives access to some neat customisation . So in order to modify the default template I first move it to my working directory using: file.copy(system.file("rmd/latex/default-1.17.0.2.tex", package ="rmarkdown"), "template.tex") Next I type up my Rmd file: --- output: pdf_document: template: template.tex keep_tex: true latex_engine: xelatex includes: in_header: in_header.tex number_sections: true --- This is a rmd kind of document. Where in_header.tex includes only one line \geometry{a4paper, top=38mm,

I can't generate \\label{fig:mwe-plot} with knitr

时光毁灭记忆、已成空白 提交于 2019-12-01 03:22:27
I am having trouble generating \label{} for plots when using knitr to go from a *.Rmd file to a *.md file via knitr ; and then converting to *.pdf via pandoc . An MWE for my *.Rmd is included below: ```{r Setup, include=FALSE, results="hide", warning=FALSE} opts_chunk$set(dev="cairo_pdf", fig.lp="fig:", echo=FALSE, results="hide", message=FALSE, warning=FALSE) ``` ```{r mwe-plot, fig.cap = "MWE plot."} library(ggplot2) ggplot(mtcars, aes(factor(cyl))) + geom_bar() ``` I knit: knit("mwe.Rmd") Then I use pandoc pandoc -o mwe.pdf mwe.md I should be able to cross-reference the plot with Figure

from HTML <figure> and <figcaption> to Microsoft Word

对着背影说爱祢 提交于 2019-12-01 02:31:31
问题 I have an HTML with the figure , img and figcaption tags and I would like to get them converted to a Microsoft Word document. The image referred by img should be inserted in the Word document and the figcaption should be converted to its caption (also keeping the figure number). I have tried to open the html with Word 2013 but the figcaption is not converted as the figure caption but it is just a simple text below the image. Is there any minimum working sample to get it done? I had a look at

Special characters not showing in pandoc html output

两盒软妹~` 提交于 2019-12-01 02:08:52
I am trying to get special characters (for foreign surnames) working in pandoc. I followed the instructions here and made sure all special characters are represented using UTF encoding (as per this page . I chose HTML Entity (decimal) option. The resulting files work well when converting to docx or pdf but not html. Is there an encoding that will work for all three output types, or do I need to include some other option? Here is a line of markdown code for conversion using the special character encoding some example text with special characters Å, ä,ö (Sorry, can't figure out how to stop the

Using a custom template for Rmd pdf without changing current setup

こ雲淡風輕ζ 提交于 2019-12-01 01:35:19
问题 I have recently learned that modifying the default (Pandoc?) template for a Rmd pdf report gives access to some neat customisation. So in order to modify the default template I first move it to my working directory using: file.copy(system.file("rmd/latex/default-1.17.0.2.tex", package ="rmarkdown"), "template.tex") Next I type up my Rmd file: --- output: pdf_document: template: template.tex keep_tex: true latex_engine: xelatex includes: in_header: in_header.tex number_sections: true --- This

How to cite within a figure caption w/ rmarkdown native citation?

倾然丶 夕夏残阳落幕 提交于 2019-12-01 00:31:47
In R Markdown, I want a figure caption with a linked citation in R Markdown native citation style [@ref] . However, when I insert the [@hawking_thermodynamics_1983] snippet at the end into the caption, it's throwing just an error: ! Missing $ inserted. <inserted text> $ l.94 ...iontextfoo [@hawking_thermodynamics_1983]} pandoc.exe: Error producing PDF Error: pandoc document conversion failed with error 43 Example : This is my code: --- title: "Untitled" author: "Author" output: pdf_document # bibliography: bibliography.bib references: - id: hawking_thermodynamics_1983 author: - family: Hawking

Special characters not showing in pandoc html output

你离开我真会死。 提交于 2019-11-30 21:34:59
问题 I am trying to get special characters (for foreign surnames) working in pandoc. I followed the instructions here and made sure all special characters are represented using UTF encoding (as per this page. I chose HTML Entity (decimal) option. The resulting files work well when converting to docx or pdf but not html. Is there an encoding that will work for all three output types, or do I need to include some other option? Here is a line of markdown code for conversion using the special