2015-11-09 13:52:05 +01:00
|
|
|
# pandoc
|
|
|
|
|
2016-11-09 11:24:52 +00:00
|
|
|
> Convert documents between various formats.
|
2024-10-28 16:46:08 +11:00
|
|
|
> More information: <https://pandoc.org/MANUAL.html>.
|
2015-11-09 13:52:05 +01:00
|
|
|
|
2025-04-06 19:13:37 +00:00
|
|
|
- Convert a Markdown file to PDF using `pdflatex` (the formats are determined by file extensions):
|
2015-11-09 13:52:05 +01:00
|
|
|
|
2025-03-08 23:08:23 +02:00
|
|
|
`pandoc {{path/to/input.md}} {{[-o|--output]}} {{path/to/output.pdf}}`
|
2016-11-09 11:24:52 +00:00
|
|
|
|
2025-04-06 19:13:37 +00:00
|
|
|
- Convert a Markdown file to PDF using the specified PDF engine:
|
|
|
|
|
|
|
|
`pandoc {{path/to/input.md}} --pdf-engine {{tectonic|weasyprint|typst|...}} {{[-o|--output]}} {{path/to/output.pdf}}`
|
|
|
|
|
2024-10-08 19:04:56 +03:00
|
|
|
- Convert to a standalone file with the appropriate headers/footers (for LaTeX, HTML, etc.):
|
2016-11-09 11:24:52 +00:00
|
|
|
|
2025-03-08 23:08:23 +02:00
|
|
|
`pandoc {{path/to/input.md}} {{[-s|--standalone]}} {{[-o|--output]}} {{path/to/output.html}}`
|
2016-11-09 11:24:52 +00:00
|
|
|
|
2025-04-06 19:13:37 +00:00
|
|
|
- Manually specify formats (overriding automatic format detection using the filename extension, or when there is no extension):
|
|
|
|
|
|
|
|
`pandoc {{[-f|--from]}} {{docx|...}} {{path/to/input}} {{[-t|--to]}} {{pdf|...}} {{[-o|--output]}} {{path/to/output}}`
|
|
|
|
|
|
|
|
- Transform a document using a Lua script (see <https://pandoc.org/lua-filters.html> for more information):
|
2018-10-24 16:46:08 -06:00
|
|
|
|
2025-04-06 19:13:37 +00:00
|
|
|
`pandoc {{path/to/input}} {{[-L|--lua-filter]}} {{path/to/filter.lua}} {{[-o|--output]}} {{path/to/output}}`
|
2018-10-24 16:46:08 -06:00
|
|
|
|
2016-11-09 13:00:29 +00:00
|
|
|
- List all supported input formats:
|
2016-11-09 11:24:52 +00:00
|
|
|
|
2016-11-09 13:00:29 +00:00
|
|
|
`pandoc --list-input-formats`
|
|
|
|
|
|
|
|
- List all supported output formats:
|
|
|
|
|
|
|
|
`pandoc --list-output-formats`
|