summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/lettrine
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-07-04 03:00:52 +0000
committerNorbert Preining <norbert@preining.info>2023-07-04 03:00:52 +0000
commitab7f5e4df027c13f5aef4fbdb032184cf2f3d5c3 (patch)
tree0b38ffb066618d85c27ed23a0095689acbb45b6e /macros/latex/contrib/lettrine
parent4b749d92c46780575d3bd3dd7544030300a51301 (diff)
CTAN sync 202307040300
Diffstat (limited to 'macros/latex/contrib/lettrine')
-rw-r--r--macros/latex/contrib/lettrine/doc/lettrine-demo-de.pdfbin128266 -> 128252 bytes
-rw-r--r--macros/latex/contrib/lettrine/doc/lettrine-demo-fr.pdfbin139142 -> 168279 bytes
-rw-r--r--macros/latex/contrib/lettrine/doc/lettrine-demo-fr.tex42
-rw-r--r--macros/latex/contrib/lettrine/doc/lettrine-demo-lua.pdfbin74184 -> 74185 bytes
-rw-r--r--macros/latex/contrib/lettrine/doc/lettrine.pdfbin122711 -> 125776 bytes
-rw-r--r--macros/latex/contrib/lettrine/lettrine-2023-04-18.sty290
-rw-r--r--macros/latex/contrib/lettrine/lettrine.dtx137
7 files changed, 414 insertions, 55 deletions
diff --git a/macros/latex/contrib/lettrine/doc/lettrine-demo-de.pdf b/macros/latex/contrib/lettrine/doc/lettrine-demo-de.pdf
index bf74f1840c..5e71166cd7 100644
--- a/macros/latex/contrib/lettrine/doc/lettrine-demo-de.pdf
+++ b/macros/latex/contrib/lettrine/doc/lettrine-demo-de.pdf
Binary files differ
diff --git a/macros/latex/contrib/lettrine/doc/lettrine-demo-fr.pdf b/macros/latex/contrib/lettrine/doc/lettrine-demo-fr.pdf
index c14ada6737..b12099b93a 100644
--- a/macros/latex/contrib/lettrine/doc/lettrine-demo-fr.pdf
+++ b/macros/latex/contrib/lettrine/doc/lettrine-demo-fr.pdf
Binary files differ
diff --git a/macros/latex/contrib/lettrine/doc/lettrine-demo-fr.tex b/macros/latex/contrib/lettrine/doc/lettrine-demo-fr.tex
index 21e525ed06..d49d889089 100644
--- a/macros/latex/contrib/lettrine/doc/lettrine-demo-fr.tex
+++ b/macros/latex/contrib/lettrine/doc/lettrine-demo-fr.tex
@@ -10,6 +10,7 @@
\renewcommand{\ttdefault}{lmtt} % Courier chasse trop !
\fi
\usepackage{microtype}
+\usepackage{multicol,ragged2e}
\usepackage{Rothdn, Typocaps} % cfr-initials (p. 3)
\usepackage{graphicx,color}
@@ -230,6 +231,47 @@ l'une des « abbayes de sel» dont il ne reste que quelques vestiges.
\newpage
\begin{center}
+\large\bfseries Multicolonnes : Ajustement de \texttt{novskip}
+\end{center}
+
+\renewcommand{\LettrineFontHook}{}
+
+Avec \texttt{loversize=0.2} pas de problème :
+
+\vspace{\baselineskip}
+\begin{multicols}{2}\RaggedRight
+ \lettrine[loversize=0.2]{E}{n plein marais de la Souteyranne},
+à quelques kilomètres au nord d'Aigues-Mortes la Tour Carbonnière.
+Construite au XIII\ieme~siècle, elle contrôlait l'unique voie d'accès
+terrestre de la ville fortifiée, celle qui menait à Psalmody,
+l'une des « abbayes de sel» dont il ne reste que des vestiges.
+\end{multicols}
+
+Avec \texttt{loversize=0.6} il y a un gros décallage entre colonnes :
+
+\vspace{\baselineskip}
+\begin{multicols}{2}\RaggedRight
+ \lettrine[loversize=0.6]{E}{n plein marais de la Souteyranne},
+à quelques kilomètres au nord d'Aigues-Mortes la Tour Carbonnière.
+Construite au XIII\ieme~siècle, elle contrôlait l'unique voie d'accès
+terrestre de la ville fortifiée, celle qui menait à Psalmody,
+l'une des « abbayes de sel» dont il ne reste que des vestiges.
+\end{multicols}
+
+Correction : ajouter \texttt{novskip=13pt} ($>$ Top vskip = 12.16344pt lu
+dans le fichier \texttt{.log})
+
+\begin{multicols}{2}\RaggedRight
+ \lettrine[loversize=0.6,novskip=13pt]{E}{n plein marais de la Souteyranne},
+à quelques kilomètres au nord d'Aigues-Mortes la Tour Carbonnière.
+Construite au XIII\ieme~siècle, elle contrôlait l'unique voie d'accès
+terrestre de la ville fortifiée, celle qui menait à Psalmody,
+l'une des « abbayes de sel» dont il ne reste que des vestiges.
+\end{multicols}
+
+
+\newpage
+\begin{center}
\large\bfseries Utilisation d'une image comme lettrine
\end{center}
diff --git a/macros/latex/contrib/lettrine/doc/lettrine-demo-lua.pdf b/macros/latex/contrib/lettrine/doc/lettrine-demo-lua.pdf
index 40694cd70b..31d231ce83 100644
--- a/macros/latex/contrib/lettrine/doc/lettrine-demo-lua.pdf
+++ b/macros/latex/contrib/lettrine/doc/lettrine-demo-lua.pdf
Binary files differ
diff --git a/macros/latex/contrib/lettrine/doc/lettrine.pdf b/macros/latex/contrib/lettrine/doc/lettrine.pdf
index 5f4c521e91..0299b73102 100644
--- a/macros/latex/contrib/lettrine/doc/lettrine.pdf
+++ b/macros/latex/contrib/lettrine/doc/lettrine.pdf
Binary files differ
diff --git a/macros/latex/contrib/lettrine/lettrine-2023-04-18.sty b/macros/latex/contrib/lettrine/lettrine-2023-04-18.sty
new file mode 100644
index 0000000000..58ca5035c5
--- /dev/null
+++ b/macros/latex/contrib/lettrine/lettrine-2023-04-18.sty
@@ -0,0 +1,290 @@
+%%
+%% This is file `lettrine.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% lettrine.dtx (with options: `sty')
+%%
+%% IMPORTANT NOTICE:
+%% For the copyright see the source file `lua-typo.dtx’.
+%%
+\NeedsTeXFormat{LaTeX2e}[2022-06-01]
+\ProvidesFile{lettrine.sty}
+ [2023-04-18 v2.40 (Daniel Flipo)]
+\DeclareRelease{v1.6}{1999-03-03}{lettrine-2006-03-17.sty}
+\DeclareRelease{v1.9}{2012-07-20}{lettrine-2015-08-31.sty}
+\DeclareRelease{v2.0}{2018-07-21}{lettrine-2018-08-18.sty}
+\DeclareRelease{v2.3}{2022-09-25}{lettrine-2022-09-25.sty}
+\DeclareCurrentRelease{}{2023-04-18}
+\RequirePackage{xfp}
+\newcounter{DefaultLines}
+\setcounter{DefaultLines}{2}
+\newcounter{DefaultDepth}
+\newcommand*{\DefaultOptionsFile}{\relax}
+\newcommand*{\DefaultLoversize}{0}
+\newcommand*{\DefaultLraise}{0}
+\newcommand*{\DefaultLhang}{0}
+\newdimen\DefaultFindent
+\setlength{\DefaultFindent}{\z@}
+\newdimen\DefaultNindent
+\setlength{\DefaultNindent}{0.5em}
+\newdimen\DefaultSlope
+\setlength{\DefaultSlope}{\z@}
+\newdimen\DiscardVskip
+\setlength{\DiscardVskip}{0.2\p@}
+\newif\ifLettrineImage
+\newif\ifLettrineOnGrid
+\newif\ifLettrineRealHeight
+\newsavebox{\L@lbox}
+\newsavebox{\L@tbox}
+\newcounter{L@lines}
+\newcounter{L@depth}
+\newdimen\L@Pindent
+\newdimen\L@Findent
+\newdimen\L@Nindent
+\newdimen\L@lraise
+\newdimen\L@first
+\newdimen\L@next
+\newdimen\L@slope
+\newdimen\L@height
+\newdimen\L@novskip
+\newdimen\L@target@ht
+\newdimen\L@target@dp
+\newdimen\L@target@tht
+\newdimen\LettrineWidth
+\newdimen\LettrineHeight
+\newdimen\LettrineDepth
+\newcommand*{\L@file}{}
+\newcommand*{\L@hang}{}
+\newcommand*{\L@oversize}{}
+\newcommand*{\L@raise}{}
+\newcommand*{\L@ante}{}
+\newif\ifL@image
+\newif\ifL@grid
+\newif\ifL@realh
+\newcommand*{\LettrineTestString}{EFTZ}
+\InputIfFileExists{lettrine.cfg}
+ {\typeout{Loading lettrine.cfg}}
+ {\typeout{lettrine.cfg not found, using default values}}
+\DeclareKeys[LettrineGlobal]
+ {
+ lines.code = \setcounter{DefaultLines}{#1} ,
+ depth.code = \setcounter{DefaultDepth}{#1} ,
+ lhang.store = \DefaultLhang ,
+ loversize.store = \DefaultLoversize ,
+ lraise.store = \DefaultLraise ,
+ findent.code = \setlength{\DefaultFindent}{#1} ,
+ nindent.code = \setlength{\DefaultNindent}{#1} ,
+ slope.code = \setlength{\DefaultSlope}{#1} ,
+ novskip.code = \setlength{\DiscardVskip}{#1} ,
+ image.if = LettrineImage ,
+ grid.if = LettrineOnGrid ,
+ realheight.if = LettrineRealHeight ,
+ refstring.default:n = \l@initial ,
+ refstring.store = \LettrineTestString ,
+ optionsfile.store = \DefaultOptionsFile
+ }
+\ProcessKeyOptions[LettrineGlobal]
+\DeclareKeys[LettrineLocal]
+ {
+ lines.code = \setcounter{L@lines}{#1} ,
+ depth.code = \setcounter{L@depth}{#1} ,
+ lhang.code = \renewcommand*{\L@hang}{#1} ,
+ loversize.code = \renewcommand*{\L@oversize}{#1} ,
+ lraise.code = \renewcommand*{\L@raise}{#1} ,
+ ante.code = \renewcommand*{\L@ante}{#1} ,
+ findent.code = \setlength{\L@Findent}{#1} ,
+ nindent.code = \setlength{\L@Nindent}{#1} ,
+ slope.code = \setlength{\L@slope}{#1} ,
+ novskip.code = \setlength{\L@novskip}{#1} ,
+ image.if = L@image ,
+ grid.if = L@grid ,
+ realheight.if = L@realh ,
+ refstring.default:n = \l@initial ,
+ refstring.store = \l@refstring
+ }
+\newcommand*{\LettrineTextFont}{\scshape}
+\newcommand*{\LettrineSecondString}{x}
+\newcommand*{\LettrineFontHook}{}
+\def\computeL@height{%
+ \setlength{\L@target@ht}{\ht\L@tbox}%
+ \@tempdima=\baselineskip
+ \setlength{\L@target@dp}{\value{L@lines}\@tempdima}%
+ \ifnum\value{L@lines}>1
+ \addtolength{\L@target@dp}{-\@tempdima}%
+ \else
+ \addtolength{\L@target@ht}{\L@target@dp}%
+ \setlength{\L@target@dp}{0pt}%
+ \fi
+ \setlength{\L@target@tht}{\L@target@ht}%
+ \addtolength{\L@target@tht}{\L@target@dp}%
+ \setlength{\L@height}{\L@target@tht}%
+ \addtolength{\L@height}{\L@oversize\L@target@tht}%
+}
+\def\compute@fontsize{%
+ \ifx\l@refstring\@empty
+ \def\Lettrine@RefString{\LettrineTestString}%
+ \else
+ \def\Lettrine@RefString{\l@refstring}%
+ \fi
+ \sbox{\@tempboxa}{\LettrineFontHook
+ \fontsize{\L@height}{\L@height}\selectfont
+ \Lettrine@RefString}%
+ \@tempcnta=\ht\@tempboxa
+ \ifnum\@tempcnta=0
+ \PackageWarning{lettrine}{Unable to compute \protect\fontsize!%
+ \MessageBreak \protect\LettrineTestString\space empty? reported}
+ \def\L@factor{1}%
+ \else
+ \@tempcntb=\L@height
+ \def\L@factor{\fpeval{\the\@tempcntb/\the\@tempcnta}}%
+ \fi
+}
+\newcommand*{\LettrineFont}{%
+ \LettrineFontHook
+ \fontsize{\L@factor\L@height}{\L@factor\L@height}%
+ \selectfont
+}
+\newcommand*{\LettrineImage}{%
+ \LettrineFontHook\includegraphics[height=\L@height]%
+}
+\def\setupL@lbox{%
+ \computeL@height
+ \ifL@image
+ \sbox{\L@lbox}{\LettrineImage{\l@initial}}%
+ \else
+ \compute@fontsize
+ \sbox{\L@lbox}{\LettrineFont \l@initial}%
+ \fi
+}
+\newcommand*{\LettrineOptionsFor}[2]{%
+ \edef\l@tmpa{#1}%
+ \begingroup
+ \def\color##1##{\l@color{##1}}%
+ \let\l@color\@gobbletwo
+ \def\textcolor##1##{\l@textcolor{##1}}%
+ \def\l@textcolor##1##2##3{##3}%
+ \xdef\l@tmpb{\l@initial}%
+ \endgroup
+ \ifx\l@tmpa\l@tmpb \SetKeys[LettrineLocal]{#2}\fi
+ }
+\def\lettrine{\@ifnextchar[\@lettrine{\@lettrine[]}}
+\def\@lettrine[#1]#2#3{%
+ \def\l@initial{#2}\let\l@refstring\@empty
+ \setcounter{L@lines}{\value{DefaultLines}}%
+ \setcounter{L@depth}{\value{DefaultDepth}}%
+ \renewcommand*{\L@hang}{\DefaultLhang}%
+ \renewcommand*{\L@oversize}{\DefaultLoversize}%
+ \renewcommand*{\L@raise}{\DefaultLraise}%
+ \renewcommand*{\L@ante}{}%
+ \setlength{\L@Findent}{\DefaultFindent}%
+ \setlength{\L@Nindent}{\DefaultNindent}%
+ \setlength{\L@slope}{\DefaultSlope}%
+ \setlength{\L@novskip}{\DiscardVskip}%
+ \ifLettrineImage\L@imagetrue\else\L@imagefalse\fi
+ \ifLettrineOnGrid\L@gridtrue\else\L@gridfalse\fi
+ \ifLettrineRealHeight\L@realhtrue\else\L@realhfalse\fi
+ \SetKeys[LettrineLocal]{#1}%
+ \sbox{\L@tbox}{\LettrineTextFont{\LettrineSecondString}}%
+ \ifL@realh
+ \def\@tempa{#3}%
+ \ifx\@tempa\@empty
+ \PackageWarning{lettrine.sty}%
+ {Empty second argument,\MessageBreak
+ ignoring option `realheight';}%
+ \else
+ \sbox{\L@tbox}{{\LettrineTextFont{#3}}}%
+ \fi
+ \fi
+ \if\DefaultOptionsFile\relax
+ \else
+ \setupL@lbox
+ \setlength{\LettrineWidth}{\wd\L@lbox}%
+ \InputIfFileExists{\DefaultOptionsFile}%
+ {}%
+ {\PackageWarning{lettrine.sty}%
+ {File \DefaultOptionsFile\space not found}%
+ }%
+ \SetKeys[LettrineLocal]{#1}%
+ \fi
+ \setupL@lbox
+ \setlength{\LettrineWidth}{\wd\L@lbox}%
+ \setlength{\LettrineHeight}{\ht\L@lbox}%
+ \setlength{\LettrineDepth}{\dp\L@lbox}%
+ \begingroup
+ \def\IeC##1{##1}%
+ \@tempdima=\L@oversize pt\relax
+ \PackageInfo{lettrine.sty}%
+ {Targeted height = \the\L@target@tht\MessageBreak
+ (for loversize=0, accent excluded),\MessageBreak
+ Lettrine height = \the\LettrineHeight\space (#2)%
+ \ifdim\@tempdima=\z@\else\space loversize=\L@oversize\fi;%
+ \MessageBreak reported}%
+ \endgroup
+ \sbox{\L@tbox}{{\LettrineTextFont{#3}}}%
+ \setlength{\L@first}{\LettrineHeight}%
+ \setlength{\L@lraise}{\L@raise\L@target@tht}%
+ \addtolength{\L@first}{\L@lraise}%
+ \ifnum\value{L@lines}=1
+ \addtolength{\L@first}{-\ht\L@tbox}%
+ \else
+ \addtolength{\L@first}{-\L@target@tht}%
+ \addtolength{\L@lraise}{-\L@target@dp}%
+ \fi
+ \par
+ \ifdim\L@first>\L@novskip
+ \ifL@grid
+ \@tempdima=\baselineskip
+ \@tempdimb=\@tempdima
+ \advance\@tempdimb by \L@novskip
+ \@tempcnta=1
+ \loop\ifdim\L@first>\@tempdimb
+ \advance\@tempcnta by 1
+ \advance\L@first by -\@tempdima
+ \repeat
+ \L@first=\@tempcnta\baselineskip
+ \fi
+ \vskip\L@first
+ \fi
+ \setlength{\L@Pindent}{\wd\L@lbox}%
+ \addtolength{\L@Pindent}{-\L@hang\wd\L@lbox}%
+ \settowidth{\L@first}{\L@ante}%
+ \addtolength{\L@Pindent}{\L@first}%
+ \addtolength{\L@Pindent}{\L@Findent}%
+ \setlength{\L@first}{\linewidth}%
+ \addtolength{\L@first}{-\L@Pindent}%
+ \addtolength{\L@Nindent}{\L@Pindent}%
+ \setlength{\L@next}{\linewidth}%
+ \addtolength{\L@next}{-\L@Nindent}%
+ \addtolength{\L@Pindent}{\@totalleftmargin}%
+ \addtolength{\L@Nindent}{\@totalleftmargin}%
+ \addtocounter{L@lines}{1}%
+ \addtocounter{L@lines}{\value{L@depth}}%
+ \def\L@parshape{\c@L@lines \the\L@Pindent \the\L@first}%
+ \@tempcnta=\tw@
+ \@whilenum \@tempcnta<\c@L@lines\do{%
+ \edef\L@parshape{\L@parshape \the\L@Nindent \the\L@next}%
+ \addtolength{\L@Nindent}{\L@slope}%
+ \addtolength{\L@next}{-\L@slope}%
+ \advance\@tempcnta\@ne}%
+ \edef\L@parshape{\L@parshape \@totalleftmargin \the\linewidth}%
+ \noindent
+ \parshape=\L@parshape\relax
+ \smash{\llap{\mbox{\L@ante}\raisebox{\L@lraise}{\usebox{\L@lbox}}%
+ \hskip \the\L@Findent}}%
+ \unhcopy\L@tbox\relax
+ \ifnum\@listdepth>0 \Lreset@listparshape \fi
+}
+\newtoks\Llist@everypar
+\def\Lreset@listparshape{%
+ \let\Lnew@everypar\everypar
+ \Llist@everypar=\expandafter{\the\everypar}%
+ \Lnew@everypar={\the\Llist@everypar
+ \parshape=\@ne \@totalleftmargin \linewidth \relax
+ \let\everypar\Llist@everypar
+ }%
+}
+%%
+%%
+%% End of file `lettrine.sty'.
diff --git a/macros/latex/contrib/lettrine/lettrine.dtx b/macros/latex/contrib/lettrine/lettrine.dtx
index be96ffe2f8..8403bc644b 100644
--- a/macros/latex/contrib/lettrine/lettrine.dtx
+++ b/macros/latex/contrib/lettrine/lettrine.dtx
@@ -106,7 +106,7 @@
\ProvidesFile{lettrine.dtx}
%</dtx>
%<*sty|dtx>
- [2023-04-18 v2.40 (Daniel Flipo)]
+ [2023-07-02 v2.50 (Daniel Flipo)]
%</sty|dtx>
% \fi
%
@@ -195,7 +195,7 @@
% number of |\baselineskip|. This option is meant for grid
% typesetting.
% \item \lopt{novskip=}\meta{dimen} overrides |\DiscardVskip|
-% (default=0.2pt). In some cases (see options \lopt{lraise},
+% (default=1pt). In some cases (see options \lopt{lraise},
% \lopt{loversize} or accentuated dropped capitals,…) the top of
% the dropped capital will raise above the top of following text
% (usually in small caps), this will trigger a corresponding vertical
@@ -260,8 +260,10 @@
% Another possibility to colour initials globally is described
% below, see |\LettrineFontHook|.
%
-% Three dimensions, |\LettrineWidth|, |\LettrineHeight| and
-% |\LettrineDepth|, store the final size of the initial.
+% Three dimensions, |\LettrineHeight|, |\LettrineDepth| and
+% |\LettrineWidth| hold the final size of the initial
+% (\textit{height} and \textit{depth} being measured from
+% the paragraph’s $n$-th baseline if |lines=|$n$.
%
% Have a look at files \file{lettrine-demo-fr.tex} and
% \file{lettrine-demo-lua.tex} and at the resulting PDFs in the
@@ -293,7 +295,7 @@
% \item |\setlength{\DefaultFindent}{0pt}|,
% \item |\setlength{\DefaultNindent}{0.5em}|,
% \item |\setlength{\DefaultSlope}{0pt}|.
-% \item |\setlength{\DiscardVskip}{0.2pt}|,
+% \item |\setlength{\DiscardVskip}{1pt}|,
% \item |\LettrineImagefalse|,
% \item |\LettrineOnGridfalse|,
% \item |\LettrineRealHeightfalse|.
@@ -384,7 +386,24 @@
% (Palatino, Times, Utopia…), or any OpenType font, they are
% fully scalable too!
%
-% \newpage{}
+% \newpage
+% \textbf{Breaking change in version~2.50:} in order to improve the
+% alignment of side by side parboxes starting with a dropped cap, the
+% internals of the |\lettrine{}| command have changed. Formerly, the
+% initial was completely smashed (\textit{height}=0,
+% \textit{depth}=0) and a |\vskip| was added in case the initial
+% sticked out too much above the paragraph’s first baseline. From
+% version~2.50 on, the initial gets a null \textit{depth} and its
+% proper \textit{height} (measured from the paragraph’s first
+% baseline, please note that it is different from |\LettrineHeight|).
+% This change has the following side effect: in multicolumn
+% typesetting, when a dropped cap starts a column and sticks out
+% significantly above the baseline, it might be necessary to `smash’
+% the dropped cap and eventually to add a |\vspace{}| before
+% the multicolumn environment. See \file{lettrine-demo-fr.pdf} p.~4
+% for an example. Using the rollback mechanism to switch back to
+% version~2.40 is another option: |\usepackage{lettrine}[=v2.4]|.
+%
% \textbf{Known issues:}
% \begin{itemize}
% \item Nothing is done to prevent page-breaking in a paragraph
@@ -425,6 +444,7 @@
%
% \StopEventually{}
%
+% \newpage
% \section{\TeX{}nical details}
%
% \iffalse
@@ -447,7 +467,8 @@
\DeclareRelease{v1.9}{2012-07-20}{lettrine-2015-08-31.sty}
\DeclareRelease{v2.0}{2018-07-21}{lettrine-2018-08-18.sty}
\DeclareRelease{v2.3}{2022-09-25}{lettrine-2022-09-25.sty}
-\DeclareCurrentRelease{}{2023-04-18}
+\DeclareRelease{v2.4}{2023-04-18}{lettrine-2023-04-18.sty}
+\DeclareCurrentRelease{}{2023-07-02}
\RequirePackage{xfp}
% \end{macrocode}
%
@@ -470,6 +491,9 @@
%
% \changes{v2.1}{2018/08/14}{New option `refstring’.}
%
+% \changes{v2.50}{2023/05/30}{\cs{DiscardVskip} default value enlarged
+% from 0.2pt to 1pt.}
+%
% \begin{macrocode}
\newcounter{DefaultLines}
\setcounter{DefaultLines}{2}
@@ -485,7 +509,7 @@
\newdimen\DefaultSlope
\setlength{\DefaultSlope}{\z@}
\newdimen\DiscardVskip
-\setlength{\DiscardVskip}{0.2\p@}
+\setlength{\DiscardVskip}{1\p@}
\newif\ifLettrineImage
\newif\ifLettrineOnGrid
\newif\ifLettrineRealHeight
@@ -499,6 +523,7 @@
% \changes{v1.6}{2015/02/06}{Added newif \cs{ifL@grid}.}
%
% \begin{macrocode}
+\newsavebox{\L@lettrine}
\newsavebox{\L@lbox}
\newsavebox{\L@tbox}
\newcounter{L@lines}
@@ -512,6 +537,7 @@
\newdimen\L@slope
\newdimen\L@height
\newdimen\L@novskip
+\newdimen\L@ruleht
\newdimen\L@target@ht
\newdimen\L@target@dp
\newdimen\L@target@tht
@@ -944,23 +970,6 @@
\setlength{\LettrineHeight}{\ht\L@lbox}%
\setlength{\LettrineDepth}{\dp\L@lbox}%
% \end{macrocode}
-%
-% \changes{v2.0}{2018/07/21}{Add informations about targeted
-% and actual height of the initial to the .log file.}
-%
-% and print some informations about accuracy to the log file,
-% \begin{macrocode}
- \begingroup
- \def\IeC##1{##1}%
- \@tempdima=\L@oversize pt\relax
- \PackageInfo{lettrine.sty}%
- {Targeted height = \the\L@target@tht\MessageBreak
- (for loversize=0, accent excluded),\MessageBreak
- Lettrine height = \the\LettrineHeight\space (#2)%
- \ifdim\@tempdima=\z@\else\space loversize=\L@oversize\fi;%
- \MessageBreak reported}%
- \endgroup
-% \end{macrocode}
% and reset |\L@tbox|’s content (mandatory in case
% \lopt{realheight=false}):
%
@@ -972,9 +981,9 @@
\sbox{\L@tbox}{{\LettrineTextFont{#3}}}%
% \end{macrocode}
%
-% Start a new paragraph, skipping the necessary amount of space
-% if the dropped capital sticks out of the top of paragraph.
-% We use |\L@first| to compute the amount of space to be skipped.
+% Start a new paragraph and compute in |\L@ruleht| the height of
+% the top part of the dropped capital which raises above the
+% paragraph’s first baseline.
%
% \changes{v0.9}{1998/02/23}{Calculations of length
% \cs{L@first} changed. Do not `vskip’ small lengths ($<$0.2pt),
@@ -991,40 +1000,53 @@
% |\LettrineFont|) is |\L@target@tht|.
%
% \begin{macrocode}
- \setlength{\L@first}{\LettrineHeight}%
+ \par
+ \setlength{\L@ruleht}{\LettrineHeight}%
\setlength{\L@lraise}{\L@raise\L@target@tht}%
- \addtolength{\L@first}{\L@lraise}%
- \ifnum\value{L@lines}=1
- \addtolength{\L@first}{-\ht\L@tbox}%
- \else
- \addtolength{\L@first}{-\L@target@tht}%
+ \addtolength{\L@ruleht}{\L@lraise}%
+ \ifnum\value{L@lines}>\@ne
+ \@tempcnta=\value{L@lines}%
+ \advance\@tempcnta \m@ne
+ \addtolength{\L@ruleht}{-\@tempcnta\baselineskip}%
\addtolength{\L@lraise}{-\L@target@dp}%
\fi
- \par
-% \end{macrocode}
-% |\L@first| now holds the height of the needed |\vskip|; if too
-% small it will be discarded.
-% \begin{macrocode}
- \ifdim\L@first>\L@novskip
% \end{macrocode}
-% When the \lopt{grid} option is \lopt{true}, let’s round up
-% |\L@first| to the next integer number of |\baselineskip|.
+% When |\L@ruleht| is larger than |\baselineskip - \L@novskip| and
+% the \lopt{grid} option is \lopt{true}, let’s skip an integer number
+% of |\baselineskip| (and smash the dropped cap, see below).
% \begin{macrocode}
+ \@tempdima=\L@ruleht
+ \advance\@tempdima \L@novskip
+ \@tempdimb=\baselineskip
+ \ifdim\@tempdima>\@tempdimb
\ifL@grid
- \@tempdima=\baselineskip
- \@tempdimb=\@tempdima
- \advance\@tempdimb by \L@novskip
- \@tempcnta=1
- \loop\ifdim\L@first>\@tempdimb
- \advance\@tempcnta by 1
- \advance\L@first by -\@tempdima
+ \@tempcnta=\z@
+ \loop\ifdim\@tempdima>\@tempdimb
+ \advance\@tempcnta \@ne
+ \advance\@tempdima -\@tempdimb
\repeat
- \L@first=\@tempcnta\baselineskip
+ \vskip\@tempcnta\baselineskip
\fi
- \vskip\L@first
\fi
% \end{macrocode}
-% Again, we (mis)use the length |\L@first| to compute the width of
+%
+% \changes{v2.0}{2018/07/21}{Add informations about targeted
+% and actual height of the initial to the .log file.}
+%
+% Print some informations about accuracy to the log file,
+% \begin{macrocode}
+ \begingroup
+ \def\IeC##1{##1}%
+ \@tempdima=\L@oversize pt\relax
+ \PackageInfo{lettrine.sty}%
+ {Targeted height = \the\L@target@tht\MessageBreak
+ (for loversize=0, accent excluded),\MessageBreak
+ Lettrine height = \the\LettrineHeight\space (#2)%
+ \ifdim\@tempdima>\z@\space loversize=\L@oversize\fi;%
+ \MessageBreak reported}%
+ \endgroup
+% \end{macrocode}
+% We (mis)use the length |\L@first| to compute the width of
% the text eventually coming before the dropped capital. It is
% reset later on to hold the first line’s length.
% \begin{macrocode}
@@ -1091,11 +1113,16 @@
% \changes{v2.40}{2023/04/18}{Replace \cs{usebox} by \cs{unhcopy}
% for box \cs{L@tbox} to allow footnote calls and microtype action.}
%
+% \changes{v2.50}{2023/07/02}{Remove the top \cs{vskip}, smash the
+% dropped cap, add a \cs{rule} to mimic its height above the baseline
+% instead.}
+%
% Write the dropped capital into the left margin, and wrap
% the rest of paragraph around it.
% \begin{macrocode}
- \smash{\llap{\mbox{\L@ante}\raisebox{\L@lraise}{\usebox{\L@lbox}}%
- \hskip \the\L@Findent}}%
+ \llap{\mbox{\L@ante}\smash{\raisebox{\L@lraise}{\usebox{\L@lbox}}}%
+ \ifL@grid\else\rule{0pt}{\L@ruleht}\fi
+ \hskip \the\L@Findent}%
\unhcopy\L@tbox\relax
% \end{macrocode}
%
@@ -1155,7 +1182,7 @@
%%\setlength{\DefaultFindent}{0pt}
%%\setlength{\DefaultNindent}{0.5em}
%%\setlength{\DefaultSlope}{0mm}
-%%\setlength{\DiscardVskip}{0.2pt}
+%%\setlength{\DiscardVskip}{1pt}
%%
%% Theses are *flags* (value=true/false):
%%\LettrineImagefalse