2

The following code has two paragraphs with a lettrine. Why do they format differently? The second one has the desired code (with a configuration command), but only the first produces the desired output (but it would require to add a long string of commands at every instance of use).

Why does this happen? I would like to have the desired output with the configuration method of the second paragraph. Thank you in advance for any help. (I am using lettrine ver1.64 as included in texlive 2014)

\documentclass{book} 
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}     
\usepackage{lettrine}

\LettrineOptionsFor{W}{lines=3,lhang=0.070,findent=.40em,nindent=-0.3em,slope=-0.40em}
\setcounter{DefaultLines}{3}

\begin{document}

\lettrine[lines=3,lhang=0.070,findent=.40em,nindent=-0.3em,slope=-0.40em]{W}{\rm
  hat}
are interactions? At the start of this volume, when we summarized\linebreak
hat relates the Planck units to relativity and to quantum theory,\linebreak e
pointed out that the nature of interactions at Planck scales was still in the
dark. In this chapter ...

\lettrine{W}{\rm hat} are interactions? At the start of this volume, when we
summarized\linebreak hat relates the Planck units to relativity and to quantum
theory,\linebreak e pointed out that the nature of interactions at Planck
scales was still in the dark. In this chapter ...

\end{document}

1 Answers1

3

You have to add the lines

\LettrineOptionsFor{W}{lines=3,lhang=0.070,findent=.40em,nindent=-0.3em,slope=-0.40em}

in a configuration file (W.cfl say) and then call

\renewcommand{\DefaultOptionsFile}{W.cfl}

You may do this:

\usepackage{filecontents}
\begin{filecontents}{W.cfl}
\LettrineOptionsFor{W}{lines=3,lhang=0.070,findent=.40em,nindent=-0.3em,slope=-0.40em}
\end{filecontents}

\renewcommand{\DefaultOptionsFile}{W.cfl}

in your tex file. Also note that the \rm (all two letter font changing commands like \bf, \it etc) is deprecated. To have this effect you can use

\renewcommand{\LettrineTextFont}{\normalfont}

in your preamble.

Code:

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{lettrine}

\usepackage{filecontents}
\begin{filecontents}{W.cfl}
\LettrineOptionsFor{W}{lines=3,lhang=0.070,findent=.40em,nindent=-0.3em,slope=-0.40em}
\end{filecontents}

\renewcommand{\DefaultOptionsFile}{W.cfl}
\renewcommand{\LettrineTextFont}{\normalfont}

\begin{document}

\lettrine[lines=3,lhang=0.070,findent=.40em,nindent=-0.3em,slope=-0.40em]{W}{hat}
are interactions? At the start of this volume, when we summarized\linebreak
hat relates the Planck units to relativity and to quantum theory,\linebreak e
pointed out that the nature of interactions at Planck scales was still in the
dark. In this chapter ...

\lettrine{W}{hat} are interactions? At the start of this volume, when we
summarized\linebreak hat relates the Planck units to relativity and to quantum
theory,\linebreak e pointed out that the nature of interactions at Planck
scales was still in the dark. In this chapter ...

\end{document}

enter image description here

  • Thank you, this works well and answers the question! It is as bizarre solution though; ideally, the package filecontents.sty should not be necessary in a future version of lettrine ... –  Feb 21 '15 at 11:40