4

I'm trying to create drop caps with the lettrine package, and I'm running into trouble when the first paragraph is too short. It appears that the package only indents the paragraph where it appears, with all lines on subsequent paragraphs being unaffected.

Here's a MWE:

\documentclass{book}
\usepackage{lmodern}
\usepackage{lettrine}

\begin{document}
\lettrine[lines=3]{T}{his} is a short paragraph.

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}

This yields the following bad result:

The second paragraph is typeset in exactly the same place it would normally be, overlapping the large letter.

One solution would be to remove the paragraph break and instead use \\ \hspace*{\parindent}. Is there a more elegant, semantic solution?

  • it would be possible (using code based on the code wrapfig used to re-start a cut out on a new paragraph) but it's rather rare to use drop caps on such small paragraphs so I haven't seen this implemented. – David Carlisle May 15 '17 at 16:47
  • 2
    IMNSHO, a three-row lettrine makes little or no typographic sense if the associated paragraph doesn't have at least 5 or 6 lines. If the chapter's opening paragraph spans only 1 or 2 lines, do you have the option to place the lettrine in the second paragraph (assuming, naturally, that the 2nd paragraph spans 5 or more lines...)? – Mico May 15 '17 at 16:56
  • 1
    @ChrisH yes, yes (\prevgraf) – David Carlisle May 15 '17 at 17:55
  • 1
    @alephzero - To compare the hand-made drop-cap letters -- really, sumptuous and stupendous works of art in their own right! -- of late medieval and early modern era books with what can be produced by the lettrine package is to go rather deep into apples-to-oranges-comparison territory. My comment was aimed at a much more modest level, i.e., it was meant to address what can be done with LaTeX and, in particular, the lettrine package. I thought this was obvious; however, apparently this wasn't the case. I'm truly sorry for having misled you and for having wasted your time. – Mico May 15 '17 at 17:58
  • 3
    @Mico fortunately my macros are sumptuous and stupendous works of art in their own right as well:-) – David Carlisle May 15 '17 at 19:08
8

enter image description here

Put \zz immediately before the following paragraph and it will extend the cutout if needed.

\documentclass{book}
\usepackage{lmodern}

\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=3]{T}{his} is a short paragraph.

\zz
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.



\lettrine[lines=3]{T}{his} is not a short paragraph.
This is is not a short paragraph. This is is not a short paragraph.
This is is not a short paragraph. This is is not a short paragraph.
This is is not a short paragraph. This is is not a short paragraph.

\zz
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}
  • This is fantastic (as usual!). However, to get the same indentation as for a normal paragraph, I had also to set \setlength{\DefaultNindent}{0em} (equivalently, nindent=0em as an option to \lettrine). I also renamed the macros; maybe that would be a good idea for more general use? – Reuben Thomas Jun 15 '17 at 5:37
  • Even better would be to make the code subtract \DefaultNindent from the indent used. – Reuben Thomas Jun 15 '17 at 6:32
3

I once had a requirement to build multiple complicated parshapes, each of which had to span multiple paragraphs. I didn't want to define a parshape per paragraph, as that would have been a lot more work.

I don't remember anymore where this came from, I don't claim any credit for this, but you can actually "fake" a \par command by doing:

\def\Fpar{\hfil\vadjust{\vskip\parskip}\break\indent}

As lettrine seems to use \parshape internally, this solution also works for your requirement.

MWE:

\documentclass{book}
\usepackage{lmodern}
\usepackage{lettrine}
\def\Fpar{\hfil\vadjust{\vskip\parskip}\break\indent}
\begin{document}
\lettrine[lines=3]{T}{his} is a short paragraph.\Fpar
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}

Output:

enter image description here

The reason why this works seems to be that, while \Fpar produces the same document output as a \par would, it is not recognized by \parshape as being the end of a paragraph, and thus the \lettrine command has more text to work with.

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.