pandoc

pandoc command line parameters for resolving internal links

回眸只為那壹抹淺笑 提交于 2019-12-22 12:25:34
问题 My problem is similar to this post, but not identical. I somehow can't figure out the correct pandoc command line parameters for maintaining/resolving cross-document links when using a couple of interlinked HTML files as the input. Let's say I have two files, chapter1.xhtml and chapter2.xhtml located in the /home/user/Documents folder with the following contents: <?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11

Increment section numbers in PDF output

百般思念 提交于 2019-12-22 09:59:36
问题 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,

How to access MathJax extensions (like siunitx) from Rmarkdown via Pandoc & Knitr?

寵の児 提交于 2019-12-22 09:29:00
问题 Working with Rmarkdown in Rstudio , using pandoc and knitr , I am targetting PDF output via LaTeX and HTML output with MathJax . I would like to use some of the MathJax extensions that are available, to allow richer LaTeX for the PDF target. Specifically, I am trying to use the siunitx extension right now, although I am also interested in others (e.g. physics ). Using siunitx works fine with LaTeX for PDF output, but I've had a hard time getting it working with HTML output. Here an example

Convert html to docx using pandoc

三世轮回 提交于 2019-12-22 09:00:31
问题 I trying to convert this html <p><font color = \"#808080\">SHILPI</p> to docx using pandoc with this command pandoc -s -o "test.docx" -t html5 -t docx html_file But its losing colors, I am getting only text, as far as I know I think html code is correct because when I am using wkhtmltopdf to convert same html to pdf it gives the proper color. What can be the issue ? Thanks in advance. 回答1: That's not how Pandoc works, it doesn't understand CSS, only HTML/Markdown. It preserves the content,

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

百般思念 提交于 2019-12-22 06:51:04
问题 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

knitr/markdown: how to render math equations in vignettes built by CRAN?

ぃ、小莉子 提交于 2019-12-22 06:37:12
问题 In a package, I have several vignettes that use mathematical notation, like: This vignette illustrates the ideas behind solving systems of linear equations of the form $\mathbf{A x = b}$ where - $\mathbf{A}$ is an $m \times n$ matrix of coefficients for $m$ equations in $n$ unknowns - $\mathbf{x}$ is an $n \times 1$ vector unknowns, $x_1, x_2, \dots x_n$ - $\mathbf{b}$ is an $m \times 1$ vector of constants, the "right-hand sides" of the equations When I compile the vignette using R Studio (

tightlist error using Pandoc with Markdown

允我心安 提交于 2019-12-22 04:59:24
问题 I am using pandoc v. 1.18 on Mac OS 10.12 to transform this markdown file to a pdf, using a simple command line: # A list that does not work - one - two - three And I get this error: ! Undefined control sequence. l.53 \tightlist pandoc: Error producing PDF How can this be solved? 回答1: \tightlist was introduced with pandoc 1.14 (see this commit). The most probable cause for this error is that you are using a template from a previous version and did not update it. This can be fixed by adding a

RMarkdown: How to change headline in table of contents in R Markdown?

人走茶凉 提交于 2019-12-22 03:25:00
问题 When I'm using the toc: yes command, the document contains "Content" as the headline of the table of contents. Due to the fact that I want to write this document in german, I also want to change the headline of the table of contents to the equivalent german word. Any suggestions on how to change this? 回答1: With this YAML header that includes LaTeX-Package babel, it works for me: --- title: "TOC in German" header-includes: - \usepackage[ngerman]{babel} output: pdf_document: toc: true number

How do I get a long (more than 1 page) bibliography to print in an R markdown beamer?

…衆ロ難τιáo~ 提交于 2019-12-22 01:31:04
问题 I have an issue rendering bibliographies covering more than one page as only the first one is printed using RMarkdown and beamer output. The same question has been posted at http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html#comment-2398115545 but without any help. --- title: "Sample Document" output: beamer_presentation bibliography: bibliography.bib --- 回答1: You can force a slide to be continued on the next one by setting its class to allowframebreaks . Just do this

Can't knit to pdf with custom styles

淺唱寂寞╮ 提交于 2019-12-21 17:49:33
问题 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