1

I'm trying to use lettrine and everything was going well until a short paragraph appeared. The text started overlapping with the first char.

Minimum working example:

\documentclass{book}

\usepackage{lettrine}

\begin{document}
\lettrine[lines=3]{T}{his} are a few words.

Now some more words overlapping the ``T''. This paragraph must be long enough so the problem appears.

Now some more words overlapping the ``T''. This paragraph must be long enough so the problem appears.

Now some more words overlapping the ``T''. This paragraph must be long enough so the problem appears.
\end{document}

So I found this solution, but it doesn't work.

Minimum (not) working example with above solution:

\documentclass{book}

\newcount\zzc
\makeatletter
\def\zz{%
\ifnum\prevgraf<\c@L@lines
\zzc\z@
\loop
\ifnum\zzc<\prevgraf
\advance\zzc\@ne
\afterassignment\zzda\count@\L@parshape\relax
\repeat
\parshape\L@parshape
\fi}
\def\zzda{\afterassignment\zzdb\dimen@}
\def\zzdb{\afterassignment\zzdef\dimen@}
\def\zzdef#1\relax{\edef\L@parshape{\the\numexpr\count@-1\relax\space #1}}
\makeatother

\usepackage{lettrine}

\begin{document}
\lettrine[lines=2]{T}{his} are a few words.

\zz
Now some more words overlapping the ``T''. This paragraph must be long enough so the problem appears.

\zz
Now some more words overlapping the ``T''. This paragraph must be long enough so the problem appears.

\zz
Now some more words overlapping the ``T''. This paragraph must be long enough so the problem appears.
\end{document}

! Missing number, treated as zero.\relax\zz

Does anyone can help me with this problem?

2

commands starting \zz always work:-)

enter image description here

But just use it on the following paragraph

\documentclass{book}

\newcount\zzc
\makeatletter
\def\zz{%
\ifnum\prevgraf<\c@L@lines
\zzc\z@
\loop
\ifnum\zzc<\prevgraf
\advance\zzc\@ne
\afterassignment\zzda\count@\L@parshape\relax
\repeat
\parshape\L@parshape
\fi}
\def\zzda{\afterassignment\zzdb\dimen@}
\def\zzdb{\afterassignment\zzdef\dimen@}
\def\zzdef#1\relax{\edef\L@parshape{\the\numexpr\count@-1\relax\space #1}}
\makeatother

\usepackage{lettrine}

\begin{document}
\lettrine[lines=2]{T}{his} are a few words.

\zz
Now some more words overlapping the ``T''. This paragraph must be long enough so the problem appears.

%\zz
Now some more words overlapping the ``T''. This paragraph must be long enough so the problem appears.

%\zz
Now some more words overlapping the ``T''. This paragraph must be long enough so the problem appears.
\end{document}
2

Welcome to TeX.SE! Well, I would say as a general rule use \lettrine better with longer paragraphs, it simply looks better then ...

In your case I would prefere the other solution given in the second answer in your linked question. Please see the following mwe

\documentclass{book}

\usepackage{lettrine}

\def\Fpar{\hfil\vadjust{\vskip\parskip}\break\indent} % <===============
\def\Fparn{\hfil\vadjust{\vskip\parskip}\break\noindent} % <============


\begin{document}
\lettrine[lines=2]{T}{his} are a few words.\Fparn % <=================== 1
Now some more words overlapping the ``T''. 
This paragraph must be long enough so the problem appears.
Now some more words overlapping the ``T''. 
This paragraph must be long enough so the problem appears.

Now some more words overlapping the ``T''. 
This paragraph must be long enough so the problem appears.

Now some more words overlapping the ``T''. 
This paragraph must be long enough so the problem appears.

\lettrine[lines=2]{T}{his} are a few words. % <========================= 2
Now some more words overlapping the ``T''. 
This paragraph must be long enough so the problem appears.
Now some more words overlapping the ``T''. 
This paragraph must be long enough so the problem appears.

\lettrine[lines=2]{T}{his} is a short paragraph.\Fpar % <=============== 3
This is a longer one, which fills all the lines taken up by the large 
letter, but unfortunately is not properly indented to accommodate that 
letter.

This is a longer one, which fills all the lines taken up by the large 
letter, but unfortunately is not properly indented to accommodate that 
letter.

\end{document}

and see the following resulting pdf:

resulting pdf with marks

Please see the read 1 in the image: There I used \Fparn including no indent for the new paragraph. It looks like there is a small indent, but please follow red line 4 to marking with red arrow marked with 2. There you see the same behaviour in an longer paragraph. Red arrow with 3 shows the used indent for the second paragraph with lettrine. That does not look pretty to me ...

The standard indent for new paragraphs you can see marked with line 5.

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.