Contour around text

When text is printed over a background, it is much more readable with a contour around in overprinting the background. This contour may be white. This way, there would be nice clearance around the text.

Another utilization would be to improve visibility of text with very light color for better reading on a white background.

Our example will use yellow color for chapter headings in a book. This is hardly readable, so we will add a contour to improve it.

The code is fully explained in the LaTeX Cookbook, Chapter 3, Adjusting Fonts, Adding a contour.

Chapter heading
Edit and compile if you like:

% Contour around text
% Author: Stefan Kottwitz
% https://www.packtpub.com/hardware-and-creative/latex-cookbook
\documentclass{scrbook}
\usepackage[pdftex,outline]{contour}
%\contourlength{1.5pt}% Thickness of copies
%\contournumber{25}% How many copies
\newcommand{\chapterfont}[1]{\contour{black}{\textcolor{yellow}{#1}}}
\setkomafont{chapter}{\Huge\protect\chapterfont}
\begin{document}
\chapter{Introduction}
\thispagestyle{empty}
Text follows.
\end{document}
Click to download: outline.texoutline.pdf
Open in Overleaf: outline.tex