So reading the docs on --metadata-file I assumed I could use this instead, so I make a new yaml file saved to the data dir metadata folder and call it from the defaults file. In the metadata.yaml file I put:

header-includes: |
`#set heading(numbering: "(I)")`{=typst}
    
and this gives me #set heading(numbering: "(I)") -- good, pandoc parsed the markdown and didn't escape the # .However I then tried a block:

header-includes: |
```{=typst}
#set heading(numbering: "(I)")
```


And the output is `{=typst} #set heading(numbering: "(I)")` — hm not so clear why the block generates this unesscaped but transformed markdown?

Ian
On Tuesday, 10 October 2023 at 20:44:41 UTC+8 iandol wrote:
Thanks John, so there is no way to stop the escaping as even if I remove the raw attribute, the # of the typst set command also gets escaped stopping it from working...?

Best, Ian

On Tuesday, 10 October 2023 at 12:03:44 UTC+8 John MacFarlane wrote:
metadata in a defaults file is parsed as plain text not markdown (remember, default files are basically equivalent to specifying something on the command line, and this is how --metadata behaves). So the raw attribute won't be recognized.


> On Oct 9, 2023, at 6:06 PM, iandol <ian...@gmail.com> wrote:
>
> I want to use header-includes: in a defaults file, so assuming it is metadata (i.e. converted to variables for the template) do this in my typst.yaml defaults file:
>
> metadata:
> header-includes: |
> ```{=typst}
> #set heading(numbering: "(I)")
> ```
> mainfont: "Alegreya Sans"
>
> But the output is escaped. The same header-includes text works when added to the document metadata header directly. I'm probably doing something stupid but didn't yet grok what that is... Any help appreciated!
>
> Best, Ian
>
> --
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/cd6c5731-19c7-4189-9b45-ab783decfdb4n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/69a8684d-d7db-421f-9a8c-3454ca012511n%40googlegroups.com.