A custom callout block in \(\LaTeX\)

Not all of my posts will be this short
Latex
Author

Yann McLatchie

Published

May 6, 2025

Some \(\LaTeX\) code to start the week

Well, we’re back from the bank holiday weekend, I’m writing up a short note in \(\LaTeX\) for a project I want to work on in the future, and I want to write a small callout in a similar way to how one would in Quarto. Anyway, I quite like the pandoc-esque style of callout that’s implemented in Quarto, and since for this note I’m using Overleaf I figured I would spend a few minutes re-implementing it. Here it is. In the preamble:

% packages required 
\usepackage{tcolorbox} % for the base `tcolorbox` environment
\usepackage{xcolor}    % for colours
\tcbuselibrary{skins}  % in order to use the `enhanced` and `overlay` features

% custom calloutbox definition
\newtcolorbox{mycalloutbox}[1]{%
  enhanced,                                   % for the fancy drawing code
  colback=white,                              % no background color
  colframe=white,                             % no visible frame
  coltitle=gray,                              % title colour
  coltext=gray,                               % title colour
  overlay={\draw[gray, line width=1pt] 
    (frame.south west)--(frame.north west);}, % thin vertical line on the left
  fonttitle=\bfseries\sffamily,               % sans serif title
  title={#1}                                  % custom title
}

And in the main body:

\begin{mycalloutbox}{This is my title}
%
And this is my content.
%
\end{mycalloutbox}

Enjoy!

Citation

BibTeX citation:
@online{mclatchie2025,
  author = {Yann McLatchie},
  title = {A Custom Callout Block in {\$\textbackslash LaTeX\$}},
  date = {2025-05-06},
  url = {https://yannmclatchie.github.io/blog/posts/callouts},
  langid = {en}
}
For attribution, please cite this work as:
Yann McLatchie. 2025. “A Custom Callout Block in $\LaTeX$.” May 6, 2025. https://yannmclatchie.github.io/blog/posts/callouts.