Live data from Hacker News

Using Pandoc and Typst to Produce PDFs

imaginarytext.ca

1–10 of 21 posts

Re: Using Pandoc and Typst to Produce PDFs

#5
post #4

Can Typst only produce PDFs? Are other output formats on the development roadmap? (I know that pandoc is incredibly flexible.)

Currently it only outputs PDF, PNG and SVG. The next release will have preliminary support for HTML. This will be a structured output so from there it will be easier to support other formats either directly or in post-processing e.g. through pandoc. Pandoc itself supports Typst input but I'm not sure how reliable that is.

Re: Using Pandoc and Typst to Produce PDFs

#6

I really wish there were more resources for Typst out there. The reference documentation seems comprehensive, but as somebody who is neither a developer nor experienced in LaTeX, I seem to need a bit more handholding.

There is a community project called typst by examples, see this link https://sitandr.github.io/typst-examples-book/book/

Re: Using Pandoc and Typst to Produce PDFs

#8

I can see why someone would prefer Typst over LaTeX when the source is written in Typst or LaTeX, but what are the advantages if your source document is in Markdown? Is there anything else beyond the (presumably) smaller install size of Typst?

When compiling the Markdown to PDF, you might want to customize the PDF template. That's arguably easier and more pleasant to do with a Typst template than a Latex template. Also the compilation with Typst is often much faster.

Re: Using Pandoc and Typst to Produce PDFs

#9
post #5
post #4

Can Typst only produce PDFs? Are other output formats on the development roadmap? (I know that pandoc is incredibly flexible.)

Currently it only outputs PDF, PNG and SVG. The next release will have preliminary support for HTML. This will be a structured output so from there it will be easier to support other formats either directly or in post-processing e.g. through pandoc. Pandoc itself supports Typst input but I'm not sure how reliable that is.

Don’t know either, but some things are unrepresentable in the pandoc internal format. It can internally represent an intersection of all its supported formats.

Re: Using Pandoc and Typst to Produce PDFs

#10
Browser support to print HTML sucked. No page counter / max pages, no way to properly style headers and footers. Chrome 131 recently added CSS support for @page [1][2] and cross-references in the same doc (giving you the page number), which is a great step forward. I think this simplifies Markdown → PDF even more on the tooling side.

[1] https://developer.chrome.com/blog/print-margins

[2] https://developer.mozilla.org/en-US/docs/Web/CSS/@page

Post reply on HN