logoalt Hacker News

mr_mitmyesterday at 7:11 PM2 repliesview on HN

You can pass a JSON structure to a Typst document and render it however you like. No need for a templating engine or anything like that.

Pandoc probably uses latex under the hood, and Typst is order of magnitudes faster. Also, much better error messages.

Typst is vastly superior for usage in automation or when developing document classes.

If that's not your use case, don't bother.


Replies

aleks_me2yesterday at 11:06 PM

you can tell pandoc to use typst as pdf-engine.

I use this command to create pdf from my md file.

  Downloads/pandoc-3.9/bin/pandoc \
  README.md \
  -o "my-output.pdf" \
  --pdf-engine=typst \
  -V papersize=a4 \
  -V fontsize=10pt \
  -V margin-left=2.5cm \
  -V margin-right=2.5cm \
  -V margin-top=2.5cm \
  -V margin-bottom=2.5cm \
  -V title="My title" \
  -V lang=de \
  --include-in-header=typst-header.typ \
  --toc --toc-depth=3 2>&1
That's the typst-header.typ

  #set figure(placement: none)
  #show figure: set block(breakable: true)
  #set table(
    inset: 5pt,
    stroke: 0.5pt + rgb("#cccccc"),
  )
  #show table: set text(size: 8pt)
  #show table.cell: it => {
    set text(hyphenate: true)
    show raw: set text(size: 6.5pt)
    it
  }
  #set par(justify: true)
  #show heading: it => block(sticky: true, it)
applicativeyesterday at 7:18 PM

To produce a pdf, pandoc uses typst, pdfroff, lualatex, whatever you please. There is no particular connection to latex. The idea exhibits complete ignorance.

show 1 reply