pandoc

Convert html mathjax to markdown with pandoc

删除回忆录丶 提交于 2019-12-20 06:44:17
问题 I have some html files including mathjax commands. I would like to translate it into php extra markdown using pandoc. The problem is that pandoc add "\" before all math commands. For example \begin{equation} \$ x\^2 etc Do you know how to avoid that with pandoc ? I think a related question is this one : How to convert HTML with mathjax into latex using pandoc? 回答1: You can write a short Haskell program unescape.hs: -- Disable backslash escaping of special characters when writing strings to

Pandoc's environment cslreferences undefined when knitting RMarkdown to PDF in RStudio

一笑奈何 提交于 2019-12-20 03:23:46
问题 Knitting (in RStudio version 1.2.1335) an RMarkdown file to PDF fails when trying to create citations (for pandoc version 2.8.0.1, and R version 3.6.1). (This does not happen when knitting to HTML, for example.) Here is a small rep. ex. in RMarkdown: --- title: "Rep. Ex. for 'LaTeX Error: Environment cslreferences undefined'" output: pdf_document: default bibliography: report.bib --- ```{r generate-bibtex-file, include=FALSE} knitr::write_bib(file = "report.bib", prefix = "") ``` # Used R

Bookdown add URL as footnote

匆匆过客 提交于 2019-12-20 03:16:33
问题 I am having problems getting correct pdf output of figure legends that contain a url. It works as bookdown::gitbook but not as bookdown::pdf_book Here is an example: --- output: bookdown::pdf_book --- ## Reference with URL doesn't work In this experiment, we will use a [spectrophotometer] (https://en.wikipedia.org/wiki/Spectrophotometry) to measure the absorption of light of different wavelength by colored solutions. (ref:spectrum) [Spectrum of light. V, violet; B, blue; G, green Y, yellow; O

How can I use pandoc for all files in the folder in Windows?

北战南征 提交于 2019-12-19 12:25:03
问题 In the FAQ on pandoc.org there is the instruction for Linux and Mac users: for f in *.txt; do pandoc "$f" -s -o "${f%.txt}.rtf"; done but there is no instruction for Windows users. 回答1: From pandoc-discuss: for %F in (*.txt) do pandoc %F > %F~n.html 回答2: I faced the same problem and I couldn't find a solution. The problem is that in PowerShell you can't use wildcards like *.md. This simply is a Unix thing. You will have to work with a single file in windows. 回答3: I was frustrated by this

How can I use pandoc for all files in the folder in Windows?

淺唱寂寞╮ 提交于 2019-12-19 12:23:06
问题 In the FAQ on pandoc.org there is the instruction for Linux and Mac users: for f in *.txt; do pandoc "$f" -s -o "${f%.txt}.rtf"; done but there is no instruction for Windows users. 回答1: From pandoc-discuss: for %F in (*.txt) do pandoc %F > %F~n.html 回答2: I faced the same problem and I couldn't find a solution. The problem is that in PowerShell you can't use wildcards like *.md. This simply is a Unix thing. You will have to work with a single file in windows. 回答3: I was frustrated by this

Authors and affiliations in the YAML of RMarkdown

亡梦爱人 提交于 2019-12-18 21:54:59
问题 I know this question was already asked in the past in this forum (1, 2, 3). Before you mark this as duplicated, I tried all the answers with no success. Most of the questions were asked long ago, and some updates related with pandoc might affect nowadays results. The issue is that I am writing a scientific paper using RMarkdown, and would like to export the results either in HTML, PDF or Word files. More importantly is that there are 12 authors signing the papers. Some of the authors present

Changing the Pandoc monospace font size or style in DOCX output

♀尐吖头ヾ 提交于 2019-12-18 19:39:33
问题 When using markdown code blocks the resulting monospace font size is too large in DOCX documents. I can adjust the font size of paragraphs by specifying a custom template.docx file, but for some reason the generated code blocks do not use a paragraph style, as opposed to most other generated output. Is there any way to: Make code blocks use a specific style so that I can override the style in the template.docx Override the monospace font used in the DOCX representation of code blocks? Updated

How to set the number of decimals in report produced with knitr/pander?

情到浓时终转凉″ 提交于 2019-12-18 15:47:15
问题 I know it's a fairly old problem, and it has been discussed before, but I can't get it work as expected. I have a markdown document, and I would like to use knitr and pander to produce a .docx report with a consistent numeric format with two decimals, such as 0.12, 3.60, 14.00, or 163.21 for both inline and chunk outputs. I have read this thread How to avoid using round() in every \Sexpr{}? where it was suggested that pander can do that automatically. However, it does not seem to work for me.

How can we pass pandoc_args to yaml header in rmarkdown?

允我心安 提交于 2019-12-18 12:29:19
问题 I'm using rmarkdown to produce a word (.docx) report. I would like to change the header of the toc. This seems possible as pandoc_args can be passed as options in the yaml header in the case of a doc file (1). But I'm not doing it right. Could anyone provide a working example ? (1) pandoc.args is included in the rmarkdown possible options and in the pandoc manual, there is a toc-title option --- title: "yaml header" author: "cedric" output: word_document: toc: true pandoc_args: toc-title=

Markdown to docx, including complex template

北慕城南 提交于 2019-12-18 09:54:57
问题 I have automated my build to convert Markdown files to DOCX files using Pandoc. I have even used a reference document for the final document's styling. The command I use is: pandoc -f markdown -t docx --data-dir=docs/rendering/ mydoc.md -o mydoc.docx The reference.docx is picked up by Pandoc from docs/rendering and Pandoc renders mydoc.docx with the same styles as the reference doc. However, reference.docx contains more than just styles. It contains coporate logos, preamble, etc. How can I