-
Notifications
You must be signed in to change notification settings - Fork 390
Description
Pandoc does have a simple way to print PDF (https://pandoc.org/MANUAL.html#creating-a-pdf)
To produce a PDF, specify an output file with a .pdf extension:
--pdf-engine controls the behavior. Default is to look at the output format, a specific method will be used.
- -t latex or none: pdflatex (other options: xelatex, lualatex, tectonic, latexmk)
- -t context: context
- -t html: wkhtmltopdf (other options: prince, weasyprint, pagedjs-cli; see print-css.rocks for a good introduction to PDF generation from HTML/CSS)
- -t ms: pdfroff
- -t typst: typst
Quarto does not really work that way - this currently limit the way to create a PDF, and this is not really consistent across format.
In Quarto we support format: pdf which assumes LaTeX or ConTeXt enine. And format: typst which will produce PDF file by default.
There is special output-ext that can modify PDF render. output-ext: tex when format: pdf renders a .tex file. And output-ext: typ when format: typst render a .typ file. But this variable output-ext is fragile (try setting output-ext to anything it will not error)
When typst was introduced, format: typst has been created but default to render a PDF file. output-ext can be use to get the .typ.
HTML printing to PDF is not really supported in Quarto (#222).
Using format: latex does not exactly work the same as format: typst as it won't produce PDF.
We should probably rethink all this, and offer more mechanism to create PDF according to method available like Pandoc allows
- Easy and robust way to opt-out PDF for a format that default to it
- Allow printing to PDF from HTML using an external pdf-engine that supports that.
- Consistent way to produce PDF from Quarto render; or another quarto command (e.g
quarto print)
Related Issues / Discussions
- Other pdf engines like wkhtmltopdf and weasyprint? #222
- Quarto attempts to install LaTeX packages when using wkhtmltopdf as pdf engine #6084
- Generate PDF from revealjs presentation (consistent with PDF Export in revealjs) #7018
- Support other PDF export tools for revealjs (e.g decktape) #4677
- Removing Pandoc's extension to
--to latexwhen usingformat: pdf(Quotation marks rendering as TeX ligatures #6613 (comment), Allow disabling smart extension for pdf rendering #7966) - The format name `typst`? #9483
- disallow
format: pdf: pdf-engine: typstand do not advertise the option in YAML intelligence #13314