How to add a header logo in Typst template partial? #9530
-
DescriptionI'm trying to add a logo in the header of my pdf like this and was able to successfully do it using only typst with the code below (see the image too):
In Quarto I tried to add the chunk of code to add the logo to via When I add the code as a template-partial I get this error [typst]: Compiling index.typ to index.pdf...error: unknown variable: article. It looks like the partial is really messing with the .typ output but im not sure why. This is the part of the file it flags:
What am I missing here? What do I need to add to the partial? Here is a reprex: typst-template.typ
index.qmd
_quarto.yml
quarto check
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Beta Was this translation helpful? Give feedback.
I figured it out. It appears as though you can't just add a #set page to the existing Typst templates by putting it in via
include-in-header
because this includes the chunk after the header. And in Typst that causes an error that the page config is inside a container:and likewise with adding the chunk via
template-partials
, it was not liking the fact that i was adding a chunk to an existing template.What I did was I made a quarto extension in a new folder. The base extension for Typst projects gives you a
typst-template.typ
file and atypst-show.typ
file and it explains what each does. I then copy and pasted these example files into my project and adjusted them (added the logo in heade…