1

This post refers to a two-color lettrine provided by egreg in Centering an Initfamily Letter within a Colorbox and Sizing It for Use as a Two-Color Lettrine.

Consider the code

\documentclass{book}
\usepackage{lipsum}
\usepackage{lettrine}
\usepackage{lmodern}
\usepackage{xcolor}
\usepackage[tracking=true]{microtype}

\definecolor{brownish}{RGB}{141, 81, 24}

\input{GoudyIn.fd} \newcommand*\initfamily{\usefont{U}{GoudyIn}{xl}{n}} \newlength{\goudycorr} \newcommand{\egreglettrine}[1]{% \begingroup \setlength{\fboxsep}{0pt}% \fontsize{85}{0}\initfamily \colorbox{black}{% \makebox[\height][l]{\color{brownish}#1}% }% \endgroup }

\begin{document} \thispagestyle{empty} \large

\lettrine[lines=3,loversize=0.55]{\color{brownish}{\initfamily{T}}}{he Lorem ipsum} \lipsum[3]

\vspace*{20pt}

\noindent\egreglettrine{T} \textbf{egreg lettrine that I would like to make use of.}

\vspace*{20pt}

\noindent\egreglettrine{T}[lines=3,loversize=0.55]{\color{brownish}{\initfamily{T}}}{he Lorem ipsum} \lipsum[3] \end{document}

which produces

enter image description here

The first paragraph displays an ordinary initfamily with positioning parameters [lines=3,loversize=0.55] given in the code.

The second paragraph of the output is the egreg lettrine that I would like to make use of in a document. However, specifying \noindent\egreglettrine{T}[lines=3,loversize=0.55]{\color{brownish}{\initfamily{T}}}{he Lorem ipsum} \lipsum[3] produces what we see in the third paragraph of the output.

QUESTION: Can someone advise me as to how to I can specify positioning parameters for the egreg lettrine according to those found in https://mirror.math.princeton.edu/pub/CTAN/macros/latex/contrib/lettrine/doc/lettrine.pdf according to David Carlisle’s keyval.sty syntax? i.e., analogous to the way in which they are specified for an ordinary lettrine.

Thank you.

DDS
  • 8,816
  • 4
  • 9
  • 36
  • 1
    it seems unrelated to egreg's code, in the second one you have used the optional arguments of \lettrine but not actually used \lettrine – David Carlisle Feb 10 '22 at 21:25
  • 1
    your \egreglettrine isn't a lettrine (ie drop cap) at all it's just a big fancy T so use it in the first argument of \lettrine in place of \initfamily{T} which should be \initfamily T as it doesn't take an argument. – David Carlisle Feb 10 '22 at 21:27

1 Answers1

2

enter image description here

You have simply omited the \lettrine command but used its optional argument, so the output is as if in the first case you had

%\lettrine
[lines=3,loversize=0.55]{\color{brownish}{\initfamily{T}}}{he Lorem ipsum} \lipsum[3]

Adding the \lettrine back and fixing the argument order, produces the effect above. The \makebox gave an error on nesting inside lettrine which is an unrelated issue but I just used a save box to avoid the nesting to save debugging lettrine internals.

\documentclass{book}
\usepackage{lipsum}
\usepackage{lettrine}
\usepackage{lmodern}
\usepackage{xcolor}
\usepackage[tracking=true]{microtype}

\definecolor{brownish}{RGB}{141, 81, 24}

\input{GoudyIn.fd} \newcommand*\initfamily{\usefont{U}{GoudyIn}{xl}{n}} \newlength{\goudycorr} \newcommand{\egreglettrine}[1]{% \begingroup \setlength{\fboxsep}{0pt}% \fontsize{85}{0}\initfamily \colorbox{black}{% \makebox[\height][l]{\color{brownish}#1}% }% \endgroup }

\begin{document} \thispagestyle{empty} \large

\lettrine[lines=3,loversize=0.55]{\color{brownish}{\initfamily{T}}}{he Lorem ipsum} \lipsum[3]

\vspace*{20pt}

%\noindent\egreglettrine{T} \textbf{egreg lettrine that I would like to make use of.}

\vspace*{20pt}

\sbox0{\egreglettrine{T}}% \lettrine[lines=3,loversize=0.55]{\usebox0}{he Lorem ipsum} \lipsum[3] \end{document}

You probably want to adjust the space befpre He Lorem as in your previous question.

David Carlisle
  • 757,742