pandoc

Table layouts for use with Pandoc

∥☆過路亽.° 提交于 2019-12-06 00:57:40
I'm trying to create a document generation workflow (professional documents). The goal is to write as much as possible in Markdown. The resulting document should be PDF, while still being able to export to .docx if necessary. I've settled on Pandoc, for which I'll create a Latex template and use a YAML document to hold the document metadata. So far so good. However, from time to time I need to use tables, ranging from very simple ones to more complex layouts with e.g. column spanning. Markdown is hardly usable for anything but the most simple tables. I tried HTML to define a more complex table

Converting Rmarkdown to PDF without RStudio

大城市里の小女人 提交于 2019-12-05 22:49:51
I would like to convert a *.Rmd to document to PDF without rstudio being available. Current approach Current approach follows the following steps: *.Rmd document is passed to knitr : knit(input = "report.Rmd")) Obtained md is converted via pandoc: # Convert pandoc --smart --to latex \ --latex-engine pdflatex \ -s report.md \ -o report.PDF Problems This results in the following problems, the top section of the Rmarkdown document: --- title: "Report Title" author: "Person" output: pdf_document classoption: landscape --- and shows as: all text is centered, whereas I would like for it to be left

Accessing YAML parameters as macros within external LaTeX files

强颜欢笑 提交于 2019-12-05 21:24:33
问题 I'm looking for ways to add variables (or LaTeX macros) to the YAML header or soon after such that they can be used in external .tex files that are a part of my (modularised) report. My .rmd file --- output: pdf_document: latex_engine: xelatex includes: before_body: some.tex params: cat: "Felix" numb: 14 --- # chapter Oh my \textbf{`r params$cat`}. $x = `r 2*params$numb`^2$ <!-- Trying again to get the parameter --> \input{some.tex} My some.tex file: `r params\$cat` Output Hoped-for output I

Increment section numbers in PDF output

雨燕双飞 提交于 2019-12-05 21:22:17
I'm trying to increment the section headers in my rMarkdown (PDF output) file by 1. Instead of # First resulting in 1 First , I'd like 2 First. I found a way to define the offset in html_output using the following syntax, but it doesn't work for pdf_output. --- title: "Untitled" author: "author" date: "date" output: html_document: toc: true pandoc_args: [ "--number-sections", "--number-offset=1" ] --- # First Header # First SubHeader This results in 2 First Header 2.1 First Subheader However, this syntax does not work for PDF documents: --- title: "Untitled" author: "author" date: "date"

how to add grid to table with pander?

梦想与她 提交于 2019-12-05 16:37:27
I am working with R, knitr and pander, and I can't find the option that would allow me to print a grid on a table with pander. I tried : pander(tableToPrint, style='grid') but it doesn't do anything, neither with this option or with 'multiline', 'rmarkdown'... I always get an horizontal line, then the column names, another horizontal line, all my data and an horizontal line. I would like to have an horizontal line between every line. Another option would be to alternate row colors. scoa There is an old answer that gives the trick to do that in latex, but in needs a bit of adaptation to pandoc.

pandoc: How to link to a section in another markdown file?

旧街凉风 提交于 2019-12-05 16:05:48
I would like to create two markdown files with links between their sections. The challenge here it's that I want the files to work correctly whether I ask pandic to concatenate them to a single HTML file, or to separate HTML files. The trouble is that in the latter case the link needs to know there name of the other HTML file in order to work properly. It's there some way for pandoc to manage this without creating distinct versions of the markdown input? The following uses lua filters to fix your links. It assumes that links are written by prefixing them with the file in which the link is

Preserve line breaks in title using pandoc

北战南征 提交于 2019-12-05 15:09:13
问题 Consider the following title block in pandoc-flavored Markdown: % Higgelty Pigglety Pop! or There Must Be More to Life % Maurice Sendak Here, line breaks are part of the title. It is possible to reformat the title in order to insert it into regular text flow, e.g. "Higgelty Pigglety Pop! Or, There Must Be More to Life", but when not talked about but used on the title page of a document, preserving the line breaks is crucial. Depending on the style, it might look like this: Higgelty Pigglety

R Markdown horizontal rule that will also work with LaTeX pdf?

给你一囗甜甜゛ 提交于 2019-12-05 13:39:48
I am aware that *** is Pandoc's Markdown for a horizontal rule. This horizontal line looks good on HTML, but if I knit my Markdown into a pdf the horizontal rule only runs half the width of the pdf, and it is centered. This combination just makes the horizontal rule look plain ugly. How do I properly put a horizontal rule in my R Markdown that can render properly to both HTML and pdf? Properly == full length/full width . And while I'm at it, can I format the horizontal rule (color, thickness, etc.) without getting into much CSS which I know nothing about. Make a tex file, say header.tex ,

how to include an abstract in a rmakdown Rmd file

最后都变了- 提交于 2019-12-05 11:09:56
In a .Rmd file with the header below, I want to include an abstract, so I tried the standard LateX article form, \abstract{This paper explores a variety of topics related to the question of testing the equality of covariance matrices in multivariate linear models, particularly in the MANOVA setting. The main focus is on graphical methods that can be used to understand features of data related to this question.} But, surprisingly (I know this seems weird), the references in my References section become badly formatted -- no spacing between references, odd indentations. So, how can I include

How to force image to text when converting markdown to pdf using pandoc

孤者浪人 提交于 2019-12-05 08:34:10
I made a GitHub wiki - a manual to a software package - and I want to transform it into a beautiful pdf manual. However, I have some trouble with figures - many of them are put in one of the following pages, much after the place in the text where it should be, what turns the document very difficult to read. To do so, I followed basically what was suggested here . Basically the idea is to: Clone the GitHub wiki; Convert the markdown files to a single pdf using pandoc: pandoc -s FirstSection.md FirstSection.md FirstSection.md -o manual.pdf What happens is that I have a sequence of short