Example: Contour around text

Published 2015-09-23 | Author: Stefan Kottwitz

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.

Download as: [PDF] [TEX]  •  [Open in Overleaf]

Contour around text
% 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\chapterfont}
\begin{document}
\chapter{Introduction}
\thispagestyle{empty}
Text follows.
\end{document}

Comments

Adding comments is currently not enabled.

There are currently 0 comments on this entry.

Features
Tags
LaTeX Cookbook

Cookbook

LaTeX Beginners Guide

Limited discount 50%
coupon code tDRet6Y

Creative Commons License