Skip to content
Discussion options

You must be logged in to vote

This is a typst issue:

[typst]: Compiling letter.typ to letter.pdf...error: expected relative length or fraction, found content

You are providing

  gap: [$gap$],

so this will be

  gap: [5cm],

which content type, and you don't want that. You want a fraction or relative length.

So based on the doc, you probably only need

$if(gap)$
  gap: $gap$,
$endif$

and this in your YAML

gap: 5cm

Alternatively, it would be nice to read in the parameter as a number and then create the unit.

Pandoc's templating is just string substition in template doc. So if you do

$if(gap)$
  gap: $gap$cm,
$endif$

and in yaml

gap: 5

it would be as if you write in .typ

gap: 5cm

Overall, you need to learn more about

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@royfrancis
Comment options

Answer selected by royfrancis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants