Live data from Hacker News

Using Pandoc and Typst to Produce PDFs

imaginarytext.ca

11–20 of 21 posts

Re: Using Pandoc and Typst to Produce PDFs

#11

An alternative stack that circumvents LaTeX and that I've successfully used for a book-scale project would be pandoc+weasyprint.

https://github.com/Kozea/WeasyPrint

> From a technical point of view, WeasyPrint is a visual rendering engine for HTML and CSS that can export to PDF. It aims to support web standards for printing. WeasyPrint is free software made available under a BSD license.

Hmm, I wonder if you could use servo for a similar purpose.

Re: Using Pandoc and Typst to Produce PDFs

#12

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?

Typst is 2-3 orders of magnitude faster than latex, which for book-sized projects can be the difference between a minute and sub-second compilation time.

Re: Using Pandoc and Typst to Produce PDFs

#13
I've similarly found the combination of pandoc + typst to be quite exciting. I've found it particularly useful for typesetting academic papers - I'm quite averse to word in general, don't require extensive mathematical typesetting support, and find latex to generally be quite unapproachable (just look at the size of the default pandoc template!), and so it gives me a method of making a decent pdf whilst simultaneously producing a .docx for my collaborators. Being able to track changes with git is also a huge advantage, although never had the chance to work with someone who is comfortable using git :(

The recently added support for PDF/A is also quite exciting, as I've never found a satisfactory solution to this with latex. Now I just wish journals would support markdown submissions...

Re: Using Pandoc and Typst to Produce PDFs

#15

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?

Something I found useful is that you can create a much more minimal pandoc template for typst than for latex. Obviously if familiar with latex it probably won't be an issue, but when I tried to make my own barebones pandoc template (i.e., stripping out beamer) I gave up.

Re: Using Pandoc and Typst to Produce PDFs

#17
I am currently finishing a similar project, producing PDF from original Markdown input, with the added difficulty that input is spread over many files and directories. I chose LaTeX as the typesetting engine, since I know it fairly well and learning a completely different engine (Typst) with no clear advantage made no sense. Pandoc did a fine job with the low-level conversion from Markdown to LaTeX; then other files combined the generated .tex files into a coherent complete work.

Actually, the task was more difficult, because the input should also be used to produce a website -- and mkdocs was used for this.

I have a list of problems that came up and required not-insignificant amount of work to be solved. Many of them were about the handling of images.

Re: Using Pandoc and Typst to Produce PDFs

#18
I love Typst, but I've found its typesetting not quite on par with LaTeX last time I checked. Not sure why you wouldn't just convert your Markdown to LaTeX if you're not writing source code yourself anyhow. There's even a package that allows you to parse Markdown as part of your LaTeX build, which works really well in combination with Overleaf if you want this workflow available from anywhere with next to no preliminary setup.

Re: Using Pandoc and Typst to Produce PDFs

#20

I love Typst, but I've found its typesetting not quite on par with LaTeX last time I checked. Not sure why you wouldn't just convert your Markdown to LaTeX if you're not writing source code yourself anyhow. There's even a package that allows you to parse Markdown as part of your LaTeX build, which works really well in combination with Overleaf if you want this workflow available from anywhere with next to no prelimin…

Which package do you mean? Last time I tried this it was kind of clunky.
Post reply on HN