Hacking Quarto Callout in LaTeX

a small customization victory

Quarto
LaTeX
TIL
Author

Enrico Spinielli

Published

May 1, 2023

The Quarto Guide goes into details about how to define callout blocks and eventually customize them.

Of course, I was asked to change the color of the callout box, which is not out-of-the-box available. A look at the generated LaTeX file shows that quarto-callout-note-color is set as

\definecolor{quarto-callout-note-color-frame}{HTML}{4582ec}

I then tried to add a different definition using include-in-header:…but the default definitions of the callout boxes colors came after mine!

So I dug in the PDF template and saw that latest place where to set things before the LaTeX body is to provide a custom title.tex partial

...
$title.tex()$
\begin{document}
$before-body.tex()$
...

The solution: I copied the default title.tex and added my color definition. Finally I set the YAML of my Quarto document as follows:

...
  pdf:
    ...
    template-partials:
      - title.tex
...

TADA!

Reuse

Citation

BibTeX citation:
@online{spinielli2023,
  author = {Spinielli, Enrico},
  title = {Hacking {Quarto} {Callout} in {LaTeX}},
  date = {2023-05-01},
  url = {https://enrico.spinielli.net/posts/2023-05-01-quarto-callout-hack},
  langid = {en}
}
For attribution, please cite this work as:
Spinielli, Enrico. 2023. “Hacking Quarto Callout in LaTeX.” May 1, 2023. https://enrico.spinielli.net/posts/2023-05-01-quarto-callout-hack.