pandoc

How to make a figure caption in Rmarkdown?

假如想象 提交于 2019-12-31 13:44:15
问题 I am thinking about writing my thesis with rmarkdown and latex. I'm getting the hang of how it all works, however, when I try to add a figure (not an R plot) to the text and render it to pdf, the caption and in-text reference dissappear. This is the code snippet I use to add a figure: --- title: "Untitled" output: pdf_document --- see figure \ref{fig1}. ![picture \label{fig1}](figure1.png) This is what knitr creates: This is what pandoc creates: Question: How do I make figure captions and in

How to make a figure caption in Rmarkdown?

孤者浪人 提交于 2019-12-31 13:43:41
问题 I am thinking about writing my thesis with rmarkdown and latex. I'm getting the hang of how it all works, however, when I try to add a figure (not an R plot) to the text and render it to pdf, the caption and in-text reference dissappear. This is the code snippet I use to add a figure: --- title: "Untitled" output: pdf_document --- see figure \ref{fig1}. ![picture \label{fig1}](figure1.png) This is what knitr creates: This is what pandoc creates: Question: How do I make figure captions and in

Reduce cell width and font size of table using pandoc.table()

余生颓废 提交于 2019-12-31 12:25:12
问题 I'm using knitr and pander to make a table in a markdown file. I'm converting the markdown file to a PDF using Pandoc from within R. This code: library(knitr) ```{r myTable, echo=FALSE, message=FALSE, results='asis', comment=""} library(pander) pandoc.table(head(iris)) ``` then running this function within R: knitsPDF <- function(name) { knit(paste0(name, ".Rmd"), encoding = "utf-8") callformat <-"pandoc -V geometry:margin=1in %s.md -o %s.pdf" system(sprintf(callformat, name, name)) }

How to write (bullet) lists in a table using rmarkdown and pandoc

你离开我真会死。 提交于 2019-12-30 10:49:09
问题 I am looking to create a table in a PDF document using rmarkdown , knitr and pander . The table should be nearly identical to Table 1 shown below, except the asterisks should be bullets. Is this at all possible using only the R libraries listed above? Here is my code to produce the PDF document (and thus the table above): --- title: "xxx" author: "xxx" date: "xxx" output: word_document: default pdf_document: fig_height: 4 fig_width: 10 highlight: tango geometry: margin=3cm --- ```{r global

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

雨燕双飞 提交于 2019-12-30 08:17:10
问题 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")

How to control cell width in pandoc/markdown table?

我的梦境 提交于 2019-12-30 01:00:09
问题 Is there a way to control the maximum cell width in a pandoc table? For example: | | | |----------|------------| | I want to the contents of this cell to fit on one line| XXXXXXX | I want to control how the line in the left cell is broken or, in other words, I want to control the maximum width of a cell. 回答1: {CAVEATS: This answer applies to Pandoc only, and only when making use of the multiline_table extension to the input in the Markdown syntax. So it won't work for Github Flavored Markdown

Add styling rules in pandoc tables for odt/docx output (table borders)

守給你的承諾、 提交于 2019-12-29 18:25:16
问题 I'm generating some odt/docx reports via markdown using knitr and pandoc and am now wondering how you'd go about formating tables. Primarily I'm interested in adding rules (at least top, bottom and one below the header, but being able to add arbitrary ones inside the table would be nice too). Running the following example from the pandoc documentation through pandoc (without any special parameters) just yields a "plain" table without any kind of rules/colours/guides (in either -t odt or -t

Add styling rules in pandoc tables for odt/docx output (table borders)

丶灬走出姿态 提交于 2019-12-29 18:25:14
问题 I'm generating some odt/docx reports via markdown using knitr and pandoc and am now wondering how you'd go about formating tables. Primarily I'm interested in adding rules (at least top, bottom and one below the header, but being able to add arbitrary ones inside the table would be nice too). Running the following example from the pandoc documentation through pandoc (without any special parameters) just yields a "plain" table without any kind of rules/colours/guides (in either -t odt or -t

Vim syntax and Latex math inside markdown

Deadly 提交于 2019-12-29 07:35:10
问题 I write documentation in markdown using ViM and I also put math using the latex $$ symbol (I compile using pandoc). The thing is that ViM syntax wouldn't ignore the underscores _ inside the dollar symbols and it is pretty annoying. For instance if I write this: $$ a_1 = 0 $$ Then Vim will highlight all the following text as italics due to to the underscore used. How can I change that? Also it would be nice if I could highlight what's inside $ with a different format. 回答1: I have put these

Figure sizes with pandoc conversion from markdown to docx

不打扰是莪最后的温柔 提交于 2019-12-29 03:36:12
问题 I type a report with Rmarkdown in Rstudio. When converting it in html with knitr, there is also a markdown file produced by knitr. I convert this file with pandoc as follows : pandoc -f markdown -t docx input.md -o output.docx The output.docx file is nice except for one problem: the sizes of the figures are altered, I need to manually resize the figures in Word. Is there something to do, maybe an option with pandoc , to get the right figures sizes ? 回答1: An easy way consists in including a