I've modified the code found here that uses rlap to write two lettrines, one atop the other. The font I want to use happens to allow for three colors, so I've nested another one on there. It works without a supplemental lettrine.cfg file. It works with such a file if the file doesn't itself reference an optfile.cfl file. However, if lettrine.cfg does point to optfile.cfl, it fails with "Missing \endcsname inserted." How can I get it to work in this last instance?
Here's an ugly, illustrative MWE with the standard font.
%\RequirePackage{filecontents}% uncomment to reproduce error - cfr
\begin{filecontents}{lettrine.cfg}
\setcounter{DefaultLines}{4}
\setlength{\DefaultFindent}{-0.1ex}
\setlength{\DefaultNindent}{0ex}
\renewcommand*{\DefaultLhang}{0.06}
\LettrineRealHeighttrue
\renewcommand{\DefaultOptionsFile}{optfile.cfl}
\endinput
\end{filecontents}
\begin{filecontents}{optfile.cfl}
\LettrineOptionsFor{X}{findent=6ex}
\LettrineOptionsFor{Y}{findent=5ex}
\endinput
\end{filecontents}
\documentclass{article}
\usepackage{lettrine}
\usepackage{xcolor}
\usepackage{lipsum}
\definecolor{Steel}{HTML}{66676A}
\definecolor{Mgold}{HTML}{D4AF37}
\definecolor{Offblack}{HTML}{1E1E1E}
\newcommand{\LettrineBackColor}{Mgold}
\newcommand{\LettrineDecoColor}{Steel}
\newcommand{\LettrineLetterColor}{Offblack}
\newcommand{\layerlettrine}[3][]{%
\lettrine[#1]{%
\rlap{\rlap{\color{\LettrineDecoColor} #2}%
{\color{\LettrineBackColor} \em{#2}}}%
{\color{\LettrineLetterColor}\lowercase{#2}}}{#3}%
}
\begin{document}
\lettrine{X}{omot} \lipsum[1]
\layerlettrine{Y}{olanda} \lipsum[2]
\end{document}
Fails at:
("C:\Program Files\MiKTeX 2.9\tex\latex\lipsum\lipsum.sty")
No file mwe_lettrine.aux.
(optfile.cfl) (optfile.cfl)
! Missing \endcsname inserted.
<to be read again>
\hbox
l.25 \layerlettrine{Y}{olanda}
\lipsum[2]
?
\emdoesn't take an argument. – cfr Sep 20 '17 at 02:58cflfile. (I'm not really sure why it does things the way it does, but I don't think it is going to be able to handle the option setting plus the EB Garamond stuff.) However, I may be completely wrong. – cfr Sep 20 '17 at 03:52\layerlettrine[findent=4em]{Y}{olanda} \lipsum[2], but that seems not to be the preferred way. I'll kludge if I must though. – Sue Dunham Sep 22 '17 at 02:57