7

I want to print initials in the EB Garamond Initials font with the lettrine package. However, the text is overlapping the initial below. Am I doing something wrong with the setup?

\documentclass{article}

\usepackage{fontspec}
\newfontface{\initials}{EB Garamond Initials}
\setmainfont{EB Garamond}

\usepackage{lettrine}
\setcounter{DefaultLines}{5}
\renewcommand{\LettrineFontHook}{\initials}

\usepackage{lipsum}

\begin{document}
    \lettrine{L}{orem ipsum} dolor sit amet, consectetuer adipiscing elit. \lipsum[2]
\end{document}

enter image description here

  • you are cutting out 5 lines, do you want to cut out 7 or make the initial smaller? – David Carlisle Apr 27 '18 at 6:46
  • @DavidCarlisle Let's say make the initial smaller. I basically only changed DefaultLines to make the effect more visable. – John Dorian Apr 27 '18 at 6:49
  • 1
    Try setting the length \DefaultDepth to a positive value, say 2. – Paul Stanley Apr 27 '18 at 7:03
7

It is possible to add lines with the parameter depth=2 . Here, the space below becomes too large, so you can decrease the size of the lettrin with the lowersize=-0.1 parameter and depth=1, which leaves an extra space above that you decrease with lraise=0.1.

\documentclass{article}

\usepackage{fontspec}
\newfontface{\initials}{EB Garamond Initials}
\setmainfont{EB Garamond}

\usepackage{lettrine}
\setcounter{DefaultLines}{5}
\renewcommand{\LettrineFontHook}{\initials}

\usepackage{lipsum}

\begin{document}
    \lettrine[depth=1]% Add 1 line
    {L}{orem ipsum} dolor sit amet, consectetuer adipiscing elit. \lipsum[2]
\bigskip

        \lettrine[depth=2]% Add 2 lines
    {L}{orem ipsum} dolor sit amet, consectetuer adipiscing elit. \lipsum[2]
 \bigskip

        \lettrine[depth=1, loversize=-0.1]%add 1 line and 10% decrease.
    {L}{orem ipsum} dolor sit amet, consectetuer adipiscing elit. \lipsum[2]
\bigskip

        \lettrine[depth=1, loversize=-0.1, lraise=0.1]%add 1 line, 10% decrease and Go up 10%.
    {L}{orem ipsum} dolor sit amet, consectetuer adipiscing elit. \lipsum[2]
\end{document}

Output:

lettrine-examples

8

The problem is that EB Garamond initials have a depth, which is about 40% of the height. At 10pt font size, the height of L is 7.39227pt, its depth is 2.87pt.

This shows why, when you reserve five lines for the height, two lines are overlapped.

You can play with loversize and lraise:

\documentclass{article}

\usepackage[latin]{babel}% just to avoid overfull boxes

\usepackage{fontspec}

\usepackage{lettrine}

\usepackage{lipsum}

% fonts
\setmainfont{EB Garamond}
\newfontface{\initials}{EB Garamond Initials}

% lettrine settings
\setcounter{DefaultLines}{5}
\renewcommand{\DefaultLraise}{0.25}
\renewcommand{\DefaultLoversize}{-0.25}
\renewcommand{\LettrineFontHook}{\initials}


\begin{document}

\lettrine{L}{orem ipsum} dolor sit amet, consectetuer adipiscing elit. \lipsum[2]

\end{document}

enter image description here

The following code after \begin{document} will print the dimensions for the letter L in EB Garamond Initials:

{\initials\xdef\initialsfont{\the\font}}
\noindent
Height: \the\fontcharht\initialsfont`L \\
Depth: \the\fontchardp\initialsfont`L

enter image description here

  • How do the numbers 7.39pt and 2.87pt relate to the parameters passed to \DefaultLraise and \DefaultLoversize ? – Tommiie Feb 28 at 14:27
  • @Tommiie I guess I did trial and error. – egreg Feb 28 at 14:40
  • I guess it doesn't matter. I discovered I can only use the letters "A", "G", "T" so I need to find a different solution. Thanks anyway. – Tommiie Feb 28 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.