- 3 Minutes Wednesdays
- Posts
- Can Quarto really have the same branding across output formats?
Can Quarto really have the same branding across output formats?
Guten Tag! 👋
Many greetings from Munich, Germany. In my last email I mentioned that you can build one Quarto document and get
a properly branded webpage and
a properly branded PDF out of it.
If you’re anything like me, your first reaction to that is probably something like:
Sounds nice in theory. But does it actually hold up once real branding and real tables get involved?
Totally fair question. So let me show you that it does indeed work.
I’ve built a small demo extension around a fictional investment firm called BIRD Investment. It’s a monthly fund fact sheet with
a logo in the header,
a primary color in headings,
a styled table using the primary colors, and
a couple of highlighted numbers inside the text.
The quarto file for that can be found here:
If you look at the code, you’ll find Quarto snippets like this:

These are custom block environments and inline-style instructions. Rendered to HTML, it looks like this:

Notice how this uses brand color (in this case purple) all over the place. And the inline color also works smoothly.
And rendered to a Typst PDF, from the exact same .qmd file, it keeps
the same logo,
the same purple,
the same fonts, and
the table is also set up to let the surrounding paragraph text wrap around it instead of getting shoved onto its own page.

Sure, there are small differences. After all, a PDF has page margins that an HTML website does not have. Or a company guideline might require different font settings in websites vs. PDFs. But this doesn’t change the fact that the branding is clearly the same.
So, yes: Branding from a Quarto file with two different outputs works. And as regular readers of my newsletter know, the glue that makes all of that work is Lua. That’s exactly what I want to get into next.
Until then, quick question: when you’ve tried to get the same report working as both HTML and PDF, what broke first? Fonts, colors, or tables? Hit reply, I’m curious.
Talk soon,
Albert
Whenever you’re ready, there are three I can help you:
Automate Your Data Reports: This course helps data analysts eliminate manual copy-paste reporting by automating PDF reports end-to-end, saving hours every cycle and preventing costly mistakes. (Using the lovely Typst language 😍)
Generate Insights in Minutes, not Hours: This comprehensive course teaches you to handle data faster, smarter, and more efficiently.
Bespoke Data Science Solutions: I’ve helped clients build their own data science solutions. Whether building custom web apps, PDF reports, AI automations or teaching workshops, I’ve got you covered. You can reach out to me via this form (or simply hit reply to this email)

Reply