Closed Disonantemus closed 2 weeks ago
I don't consider this a bug, really. Pandoc tries to produce fairly idiomatic output in these formats, and these pdf engines produce different output. (If you want really different output, try weasyprint
!) It's not a goal of the project for these to look the same.
Not the same, it's obvious that different pdfengines use different fonts and sizes, but it seems clear to me, that typst has an unusual small distance between Title and regular text (or List).
There's something that I can change in templates or somewhere else to adjust that?
For pdflatex it's ok this:
# Title
regular text
But in typst I need to add a "\" to have something similar:
# Title
\
regular text
I really love typst, because is 100x smaller I got almost the same quality as pdflatex, I also like groff, but is a little bit rough.
I agree with you that typst's spacing seems too small. Here's a sample I just generated on the online typst.app:
It seems this is intentional: I found this in the typst documentation:
When a paragraph is adjacent to a block that is not a paragraph, that block's above or below property takes precedence over the paragraph spacing. Headings, for instance, reduce the spacing below them by default for a better look.
But unfortunately, the heading
element doesn't have a below
property that you can adjust.
I eventually figured out that you can do this:
#show heading: set block(below: 1em)
There's something that I can change in templates or somewhere else to adjust that?
Yes, you can fully edit the Typst template to your hearts desire. Export default.typst and then add the Typst set and show rules to tweak your layout -- or use Pandoc's header-includes
to inject code from metadata into the template without needing to edit it. You can use the online editor to play in realtime with the layout:
I don't consider this a bug, really. Pandoc tries to produce fairly idiomatic output in these formats, and these pdf engines produce different output. (If you want really different output, try
weasyprint
!) It's not a goal of the project for these to look the same.
I fully agree here, Pandoc should NOT try to normalize the look of the output across different formats, even where drastic differences exist in the default choices of various typesetting engines. The default output should be as generic idiomatic semantic content as the target format allows for.
Of course each user and project is welcome to build on that and include style choices for specific output formats in the conversion process, but the default should be to let the typesetter use its defaults.
I happened to be working no something else and wanted to compare some default spacing choices between PDF engines. Here is the Pandoc manual rendered with a few different engines on the same papersize at the same zoom level with straight engine defaults:
The SILE engine on the top left is not merged to Pandoc yet but maintained in my fork (see #6088). Otherwise this is straight defaults from Pandoc 3.5 and out of the box settings for each engine. Generated with:
for engine in sile typst lualatex xelatex weasyprint pdfroff; do
pandoc --print-default-data-file=MANUAL.txt |
pandoc -V papersize:a4 -t pdf --pdf-engine=$engine -o MANUAL-$engine.pdf
done
Explain the problem.
Testing 3 popular pdfengines supported by pandoc, I did notice, that there are big differences between how is managed the vertical space (distance), specially between title and next text, this is specially awful in typst. Maybe is related to templates.
Image made from screenshots of the PDFs generated by pandoc made at fullscreen in zathura (width mode), joined in gimp.
From the image:
bellow every title. This is clear because both pdflatex and typst has almost same font size, but distances are very different.Commands to create PDFs:
Sample file:
Pandoc version? Latest release