# Contour line around Truetype font in chapterstyle

I am sorry if this is already covered, but all the tips I've found seemed very hard to implement. You'll need the Mikodacs font in FONTDIR.

\documentclass[book,dvipsnames]{memoir}
\usepackage{xcolor}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\newfontfamily{\archivo}[Path=/FONTDIR/]{Mikodacs.ttf}
\makechapterstyle{lucknerto}{%
\setlength{\beforechapskip}{-2\onelineskip}%
\setlength{\afterchapskip}{2\onelineskip}%
\renewcommand*{\printchaptername}{}%
\renewcommand*{\chapnumfont}{\normalfont\large\sffamily\bfseries}%
\renewcommand*{\afterchapternum}{}%
\renewcommand{\printchaptertitle}{\centering\archivo\color{White}\fontsize{23}{27.6}\selectfont\MakeUppercase}
}
\chapterstyle{lucknerto}

\begin{document}
\chapter*{Foobar}
\end{document}


I am looking for something like this:

I hope you can help!

• What makes you think this is possible? What tips did you find? – cfr Apr 11 '17 at 0:59
• @cfr I left them out as not to clutter my question. – Kristian Nordestgaard Apr 11 '17 at 6:16
• @DanieEls I just tried the shadowfy macro from the first question, but can't get it to work with chapterstyle. – Kristian Nordestgaard Apr 11 '17 at 6:17
• Maybe the contour package with the outline option, black contour color and white text color, would work? – lblb Apr 11 '17 at 7:46

I couldn't get your MWE to compile, even after having commented out the font-specific commands, so I minimised it further:

\documentclass{book}
\usepackage{xcolor}

\usepackage[outline]{contour}
\contourlength{0.01em}

\newcommand\contourchap[1]{\chapter*{\color{white}\contour{black}{#1}}}

\begin{document}
\contourchap{Foobar}
\end{document}


The reason your approach with \contour in the comments doesn't compile is that \contour requires two arguments, the latter holds the content that gets the contour applied. You can't use such a command in \renewcommand{\printchaptertitle}{...}, because only switches are allowed there that are executed before printing the chapter title. Because of this, my MWE defines a new chapter command where the title is put inside the \contour command.

• Hmm. This works in itself, but it fails when I add it to my document. With xelatex I get ! TeX capacity exceeded, sorry [main memory size=16999999] (after fiddling with memory settings) and with lualatex I get  830 words of node memory still in use: 7 hlist, 1 vlist, 4 rule, 3 glue, 1 kern, 1 penalty, 1 glyph, 8 attribute, 14 9 glue_spec, 8 attribute_list, 2 if_stack, 1 write, 1 dir, 1 pdf_colorstack node s avail lists: 1:3,2:261,3:35,4:292,5:64,6:301,7:14,8:1,9:123,10:44,11:1 ! ==> Fatal error occurred, no output PDF file produced! after removing the archivo font. – Kristian Nordestgaard Apr 13 '17 at 10:48
• Maybe contour is only compatible with pdflatex, I can't check now. – lblb Apr 13 '17 at 13:51