5## How can I convert a whole directory of files from Markdown to RTF?
9 for f in *.txt; do pandoc "$f" -s -o "${f%.txt}.rtf"; done
14 gci -r -i *.txt |foreach{$rtf=$_.directoryname+"\"+$_.basename+".rtf";pandoc -f markdown -s $_.name -o $rtf}
16## I used pandoc to convert a document to ICML (or OPML or RTF), and when I try to open it I'm told it's invalid. What have I done wrong?
18Be sure to use the `-s` or `--standalone` flag, or you just get a
19fragment, not a full document with the required header:
21 pandoc -s -f markdown -t icml -o my.icml my.md
23## I get a blank document when I try to convert a markdown document in Chinese to PDF.
25By default, pandoc uses pdflatex to generate the PDF, and pdflatex
26doesn't handle Chinese characters. But you can change the default to
27use xelatex instead. You should also make sure you're using a font
28with Chinese glyphs. For example:
30 pandoc -o c.pdf --pdf-engine=xelatex -V mainfont='Adobe Ming Std'
32## The Windows installer does a single user install, rather than installing pandoc for all users. How can I install pandoc for all users?
34Run the following command as admin:
36 msiexec /i pandoc-VERSION.msi ALLUSERS=1
38This will put pandoc in `C:\Program Files\Pandoc`.
39You can install Pandoc to a different directory by setting APPLICATIONFOLDER parameter,
42 msiexec /i pandoc-1.11.1.msi ALLUSERS=1 APPLICATIONFOLDER="C:\Pandoc"
44## How do I change the margins in PDF output?
48 -V geometry:margin=1in
50will set the margins to one inch on each side. If you don't want uniform
51margins, you can do something like
53 -V geometry:"top=2cm, bottom=1.5cm, left=1cm, right=1cm"
57 -V geometry:"left=3cm, width=10cm"
59For more options, see the documentation for the LaTeX [geometry
60package](https://www.ctan.org/pkg/geometry).
62## How does pandoc compare to multimarkdown?
65page](https://github.com/jgm/pandoc/wiki/Pandoc-vs-Multimarkdown)
68## When I specify an image width of 50% and convert to LaTeX, pandoc sets the height to textheight and the aspect ratio isn't preserved. How can I prevent this?
70For example, if you convert an image with `{width="50%"}`, the LaTeX produced
71will be `\includegraphics[width=0.5\textwidth,height=\textheight]`.
73This output presupposes the following code in pandoc's default latex
77% Scale images if necessary, so that they will not overflow the page
78% margins by default, and it is still possible to overwrite the defaults
79% using explicit options in \includegraphics[width, height, ...]{}
80\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
83If you don't have this in your custom template, you should
84add it. If we didn't set the `height` explicitly in this way,
85the image would not be resized correctly unless it was
86being resized to smaller than its original size.
88## Pandoc sometimes uses too much memory. How can I limit the memory used by pandoc?
90`pandoc +RTS -M30m -RTS` will limit heap memory to 30MB.
91When converting a document requires more than this, an out of
92memory error will be issued.
94## When using `--include-in-header` with PDF or LaTeX output, how do I reference tex declarations coming after `$header-includes$` in the default template?
96For various reasons, the `$header-includes$` are not at the very
97end of the LaTeX preamble. This poses a problem when the code
98you are inserting depends on declarations in the preamble coming
99after the `$header-includes$` location. For example, you might
100want to reference the `\author` and `\title` metadata values
101(set at the very bottom of the preamble) and present them in
102margins. In that case you can wrap your code in `etoolbox`'s
103`\AtEndPreamble`. The technique is demonstrated in [this
104gist](https://gist.github.com/JohnLukeBentley/9dda6166b9ee5c4127afd2b8cd16b70a).
105When using `\AtEndPreamble`, keep any `makeatletter` or
106`makeatother` outside of the `\AtEndPreamble`, as shown in the
109## How can I convert PDFs to other formats using pandoc?
111You can't. You can try opening the PDF in Word or Google Docs
112and saving in a format from which pandoc can convert directly.
114## Do I really need to install a 1 GB TeX installation to produce a PDF using pandoc?
116No. You can get by with a relatively small TeX installation,
117for example, by starting with MacTeX's Basic TeX distribution
118and using the `tlmgr` tool to install a few packages required by pandoc
119(see https://pandoc.org/MANUAL.html#creating-a-pdf).
121Or, you can produce PDFs via HTML and `wkhtmltopdf`,
122or via groff ms and `pdfroff`. (These don't produce as nice
123topography as TeX, particularly when it comes to math, but they
124may be fine for many purposes.)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list