Lettrine.sty verstehen und konfigurieren

Lettrine.sty verstehen und konfigurieren

Der folgende Code enthält zwei Absätze mit einer Lettrine. Warum sind sie unterschiedlich formatiert? Der zweite hat den gewünschten Code (mit einem Konfigurationsbefehl), aber nur der erste erzeugt die gewünschte Ausgabe (es wäre jedoch erforderlich, bei jeder Verwendung eine lange Befehlsfolge hinzuzufügen).

Warum passiert das? Ich möchte die gewünschte Ausgabe mit der Konfigurationsmethode des zweiten Absatzes erhalten. Vielen Dank im Voraus für jede Hilfe. (Ich verwende Lettrine ver1.64, wie in Texlive 2014 enthalten)

\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}

Antwort1

Sie müssen die Zeilen hinzufügen

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

in einer Konfigurationsdatei ( W.cflsagen wir) und rufen Sie dann

\renewcommand{\DefaultOptionsFile}{W.cfl}

Sie können Folgendes tun:

\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 Ihrer Tex-Datei. Beachten Sie auch, dass \rm(alle zweistelligen Schriftarten ändernden Befehle wie \bfusw. \it) veraltet sind. Um diesen Effekt zu erzielen, können Sie verwenden

\renewcommand{\LettrineTextFont}{\normalfont}

in Ihrer Präambel.

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}

Bildbeschreibung hier eingeben

verwandte Informationen