Skip to content

YAML arguments not being passed to my Typst template partials #11459

Answered by cderv
mattwarkentin asked this question in Q&A
Discussion options

You must be logged in to vote

I believe this is quiet specific to how Pandoc's handle metadata as variable for template, and how toc specifically is handled.

Let's start by Pandoc's documentation about variable for template and how they are counted inside if() https://pandoc.org/MANUAL.html#conditionals

The following values count as true:

  • any map
  • any array containing at least one true value
  • any nonempty string
  • boolean True

Note that in YAML metadata (and metadata specified on the command line using -M/--metadata), unquoted true and false will be interpreted as Boolean values. But a variable specified on the command line using -V/--variable will always be given a string value. Hence a conditional if(foo) will be t…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@mattwarkentin
Comment options

@mattwarkentin
Comment options

@mattwarkentin
Comment options

@cderv
Comment options

Answer selected by mattwarkentin
@mattwarkentin
Comment options

@cderv
Comment options

@mattwarkentin
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
extensions relates to Quarto extensions mechanism typst
3 participants