summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/lettrine/lettrine.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/lettrine/lettrine.dtx')
-rw-r--r--Master/texmf-dist/source/latex/lettrine/lettrine.dtx163
1 files changed, 97 insertions, 66 deletions
diff --git a/Master/texmf-dist/source/latex/lettrine/lettrine.dtx b/Master/texmf-dist/source/latex/lettrine/lettrine.dtx
index abfa0e742cb..a522c917b2e 100644
--- a/Master/texmf-dist/source/latex/lettrine/lettrine.dtx
+++ b/Master/texmf-dist/source/latex/lettrine/lettrine.dtx
@@ -1,5 +1,4 @@
-%
-% \CheckSum{611}
+% \CheckSum{650}
%
% \iffalse meta-comment
%
@@ -27,12 +26,12 @@
\ProvidesFile{lettrine.dtx}
%</dtx>
%<*!cfg>
- [2018-08-28 v2.21 (Daniel Flipo)]
+ [2019-04-06 v2.22 (Daniel Flipo)]
%</!cfg>
%
% Lettrine package for LaTeX version 2e
%
-% Copyright © 1999-2018 by Daniel Flipo
+% Copyright © 1999-2019 by Daniel Flipo
%
% Please report errors to: daniel (dot) flipo (at) free (dot) fr
%
@@ -97,12 +96,12 @@
% in the books
% \begin{itemize}
% \item ``Lexique des règles typographiques en usage à
-% l'Imprimerie nationale'' troisième édition (1994),
+% l’Imprimerie nationale’’ troisième édition (1994),
% ISBN-2-11-081075-0,
-% \item ``Mise en page et impression'' Yves~Perrousseaux,
+% \item ``Mise en page et impression’’ Yves~Perrousseaux,
% ISBN-2-911220-01-3.
% \end{itemize}
-% The parameters can be set using David Carlisle's
+% The parameters can be set using David Carlisle’s
% \texttt{keyval.sty} syntax:
% \begin{itemize}
% \item \lopt{lines=}\meta{integer} sets how many lines the
@@ -115,14 +114,14 @@
% be reserved under the baseline, this is meant for dropped
% capital with positive depth, like Q (default=0);
% \item \lopt{lhang=}\meta{decimal} ($0\le|lhang|\le1$) sets
-% how much of the dropped capital's width should hang into
+% how much of the dropped capital’s width should hang into
% the margin (default=0);
% \item \lopt{loversize=}\meta{decimal} ($-1<\lopt{loversize}\le1$)
-% enlarges the dropped capital's height: with
+% enlarges the dropped capital’s height: with
% \lopt{loversize=0.1} its height is enlarged by 10\% so
-% that it raises above the top paragraph's line (default=0);
+% that it raises above the top paragraph’s line (default=0);
% \item \lopt{lraise=}\meta{decimal} does not affect the dropped
-% capital's height, but moves it up (if positive),
+% capital’s height, but moves it up (if positive),
% down (if negative); useful with capitals like |J| or |Q|
% which have a positive depth, (default=0);
% \item \lopt{findent=}\meta{dimen} (positive or negative)
@@ -158,7 +157,7 @@
% renamed as |\LettrineImage|.
%
% \changes{v1.8}{2015/02/06}{Added two keyval options:
-% `grid' (true/false) and `novskip' to override \cs{DiscardVskip}.}
+% `grid’ (true/false) and `novskip’ to override \cs{DiscardVskip}.}
%
% \item \lopt{grid=true} (new to version 1.8) will force
% the vertical skip added above the paragraph starting with
@@ -176,9 +175,9 @@
% exceeds |\DiscardVskip|.
% Consider enlarging |novskip| (or |\DiscardVskip|) to
% prevent small vertical skips from being rounded up to
-% |\baselineskip| when using the `grid' option.
+% |\baselineskip| when using the `grid’ option.
%
-% \changes{v1.9}{2015/08/31}{New keyval option: `realheight'
+% \changes{v1.9}{2015/08/31}{New keyval option: `realheight’
% (true/false) and new global flag \cs{ifLettrineRealHeight}.}
%
% \item \lopt{realheight=true} (new to version 1.9) will
@@ -190,17 +189,17 @@
% customisable string |\LettrineSecondString| instead of
% the real argument. For backward compatibility, option
% \lopt{realheight} defaults to \lopt{false} and
-% |\LettrineSecondString| to `x'.
+% |\LettrineSecondString| to `x’.
%
-% You probably don't need this option if you choose to
+% You probably don’t need this option if you choose to
% typeset the second mandatory argument of |\lettrine| in
% small caps (the default). If you change
% |\LettrineTextFont| to |\relax| or |\upshape|, consider
% these two examples:
% \begin{description}
% \item |\lettrine{H}{ello}| you probably would like the
-% top of the `H' to be aligned with the top of the `ll'
-% rather than with the top of the `e', adding option
+% top of the `H’ to be aligned with the top of the `ll’
+% rather than with the top of the `e’, adding option
% |realheight| does the trick:
% |\lettrine[realheight]{H}{ello}|.\par
% Global variants : |\LettrineRealHeighttrue| or (without
@@ -208,8 +207,8 @@
% |\renewcommand*{\LettrineSecondString}{l}|.
% \item |\lettrine{L}{a misère}| option
% \lopt{realheight=true} would align with the top
-% of the `L' with the top of the grave accent, the
-% default is probably better (top of the `L' aligned with
+% of the `L’ with the top of the grave accent, the
+% default is probably better (top of the `L’ aligned with
% the top of the non accented letters).
% \end{description}
%
@@ -250,7 +249,7 @@
% \file{demo.tex} to see the possible usage of these parameters.
%
% \changes{v1.9}{2015/08/31}{New customisable string
-% \cs{LettrineSecondString} to tune the initial's height.}
+% \cs{LettrineSecondString} to tune the initial’s height.}
%
% The default settings can be customized either in a config file
% \file{lettrine.cfg} (for a global usage), or on a per document
@@ -301,7 +300,7 @@
% $|loversize|=0$ and $|lines|\ge 2$). When \lopt{lines=1},
% size is computed as if \lopt{lines} was~2.\\
% A hook |\LettrineFontHook| is provided to change the font
-% used for the dropped capital, syntax follows \LaTeX{}'s
+% used for the dropped capital, syntax follows \LaTeX{}’s
% low-level font interface (see \LaTeX{} Companion, p.187--192),
% the |\selectfont| command is issued by |\LettrineFont|:\\
% |\renewcommand{\LettrineFontHook}{\fontfamily{ppl}|\ignorespaces
@@ -352,20 +351,20 @@
% \vspace{\baselineskip}
% \textbf{Known issues:}
% \begin{itemize}
-% \item nothing is done to prevent page-breaking in a paragraph
+% \item Nothing is done to prevent page-breaking in a paragraph
% starting with a dropped capital; when it happens to hang
-% into the footer, page-breaking has to be done manually;
-% \item |\lettrine| works within `quote' `quotation', `abstract'
-% environments but does not work within `center' environments
-% (except with option \texttt{[lines=1]});
-% \item |\lettrine| does not work within lists;
-% \item if a \emph{list} has to be included in a paragraph starting
-% with |\lettrine|, it is necessary to add the command
+% into the footer, page-breaking has to be done manually.
+% \item |\lettrine| works within `quote’ `quotation’, `abstract’
+% environments but does not work within `center’ environments
+% except with option \texttt{[lines=1]}.
+% \item |\lettrine| does not work within lists.
+% \item If a \emph{list} has to be included in a paragraph starting
+% with |\lettrine|, it is necessary to add the command
% |\parshape=0| just after the end of the list (starting a new
% paragraph just before or just after the list works too).
-% Remember that `quote', `quotation', `abstract' environments
+% Remember that `quote’, `quotation’, `abstract’ environments
% are implemented as \emph{lists} in \LaTeX{}.
-% \item if you are facing some slight height inaccuracy for a
+% \item If you are facing some slight height inaccuracy for a
% dropped capital, you can try option \lopt{refstring};
% this option is meant for fancy (unaccented) initials.
% Informations about targeted and effective initial’s
@@ -408,7 +407,7 @@
\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}
- \DeclareCurrentRelease{}{2018-08-18}
+ \DeclareCurrentRelease{}{2019-03-30}
\else
\PackageWarning{lettrine}{Your LaTeX kernel is too old to provide
access\MessageBreak to former versions of the lettrine package.%
@@ -440,9 +439,9 @@
% compatibility with previous releases.}
%
% \changes{v2.1}{2018/08/14}{Newif \cs{ifLettrineVone} and
-% new option `Vone' (removed in v2.2, rollback prefered).}
+% new option `Vone’ (removed in v2.2, rollback prefered).}
%
-% \changes{v2.1}{2018/08/14}{New option `refstring' and newif
+% \changes{v2.1}{2018/08/14}{New option `refstring’ and newif
% \cs{ifLettrineSelfRef}.}
%
% \begin{macrocode}
@@ -467,7 +466,7 @@
\newif\ifLettrineSelfRef
% \end{macrocode}
%
-% Then let's define the necessary internal counters, lengths,
+% Then let’s define the necessary internal counters, lengths,
% and commands.
%
% \changes{v1.6}{2004/05/22}{Added newif \cs{ifL@image}.}
@@ -561,7 +560,7 @@
% \draw[<->] (1,3.4) -- (1,3.9);
% \node[left] at (1,3.7) {ht};
% \end{tikzpicture}
-% \caption{Initial's targeted dimensions ($\mbox{\cs{lines}}=4$)}
+% \caption{Initial’s targeted dimensions ($\mbox{\cs{lines}}=4$)}
% \label{fig:target}
% \end{figure}
%
@@ -624,12 +623,12 @@
% for most fonts.
%
% \changes{v1.63}{2012/07/20}{(new) it defaults to
-% `ABCDEFGHIJKLMNOQPRSTUVWXYZ'. In previous versions height
-% computations were based on letter `X' which might not exist
+% `ABCDEFGHIJKLMNOQPRSTUVWXYZ’. In previous versions height
+% computations were based on letter `X’ which might not exist
% in some (rare) fonts. Pointed out by Raphaël Pinson.}
%
-% \changes{v2.0}{2018/07/21}{changed from `ABCDEFGHIJKLMNOQPRSTUVWXYZ'
-% to `EFTZ' as some capitals like C, G, O, Q or X might be slightly
+% \changes{v2.0}{2018/07/21}{changed from `ABCDEFGHIJKLMNOQPRSTUVWXYZ’
+% to `EFTZ’ as some capitals like C, G, O, Q or X might be slightly
% taller (possible optical correction).}
%
% \begin{macrocode}
@@ -650,6 +649,9 @@
% \changes{v2.1}{2018/08/14}{Computation of \cs{L@factor} for
% \cs{fontsize} done by the minifp package.}
%
+% \changes{v2.22}{2018/09/14}{Warn if \cs{fontsize} computation fails
+% due to division by 0.}
+%
% When optional argument \lopt{selfref} is \lopt{true} the initial
% itself is taken as reference to compute |\fontsize|, this can be
% handy when working with fancy fonts (i.e.\ cfr-initials, Yinit).
@@ -665,8 +667,14 @@
\fontsize{\L@height}{\L@height}\selectfont
\Lettrine@RefString}%
\@tempcnta=\ht\@tempboxa
- \@tempcntb=\L@height
- \MFPdiv{\the\@tempcntb}{\the\@tempcnta}\L@factor
+ \ifnum\@tempcnta=0
+ \PackageWarning{lettrine}{Unable to compute \protect\fontsize!%
+ \MessageBreak \protect\LettrineTestString\space empty? reported}
+ \def\L@factor{1}%
+ \else
+ \@tempcntb=\L@height
+ \MFPdiv{\the\@tempcntb}{\the\@tempcnta}\L@factor
+ \fi
}
% \end{macrocode}
% \end{macro}
@@ -752,7 +760,7 @@
% |\LettrineOptionsFor{A}{slope=0.6em, findent=-1em, nindent=0.6em}|\\
% creates an internal command (|\l@A-keys| in this example),
% which expands to the options given as second argument of
-% |\LettrineOptionsFor| for letter `A'.
+% |\LettrineOptionsFor| for letter `A’.
%
% \begin{macrocode}
\newcommand*{\LettrineOptionsFor}[2]{\@namedef{l@#1-keys}{#2}}
@@ -760,7 +768,7 @@
% \end{macro}
%
% \begin{macro}{\lettrine}
-% Now let's define |\lettrine|.
+% Now let’s define |\lettrine|.
%
% \begin{macrocode}
\def\lettrine{\@ifnextchar[\@lettrine{\@lettrine[]}}
@@ -793,14 +801,14 @@
%
% The final initial size depends on the height of |\L@tbox|; the
% content of |\L@tbox| depends on option |realheight|, so we have
-% to read |\lettrine|'s optional argument and initialise the
+% to read |\lettrine|’s optional argument and initialise the
% |\L@tbox| content now\footnote{Now means before eventually
% reading the config file.}.
%
% \changes{v1.9}{2015/08/31}{Use the second mandatory
% argument of \cs{lettrine} or \cs{LettrineSecondString} (which
-% defaults to `x') to compute \cs{L@height}. This is controlled by
-% the `realheight' flag.}
+% defaults to `x’) to compute \cs{L@height}. This is controlled by
+% the `realheight’ flag.}
%
% \begin{macrocode}
\setkeys{L}{#1}%
@@ -858,7 +866,7 @@
\let\@tempc\relax
\expandafter\KV@do\l@LOKeys,\relax,
% \end{macrocode}
-% As some parameters' values \lopt{findent}, \lopt{nindent} and
+% As some parameters’ values \lopt{findent}, \lopt{nindent} and
% \lopt{slope} ---which do not influence the initial’s size--- may
% be given relative to |\LettrineWidth|, the |\L@lbox| has to be
% set up to evaluate |\LettrineWidth|.
@@ -887,7 +895,7 @@
\setupL@lbox
% \end{macrocode}
%
-% \changes{v1.65}{2014/09/04}{Measure and store the initial's
+% \changes{v1.65}{2014/09/04}{Measure and store the initial’s
% final dimensions.}
% Store the initial’s final dimensions,
% \begin{macrocode}
@@ -912,7 +920,7 @@
\MessageBreak reported}%
\endgroup
% \end{macrocode}
-% and reset |\L@tbox|'s content (mandatory in case
+% and reset |\L@tbox|’s content (mandatory in case
% \lopt{realheight=false}):
%
% \changes{v1.6}{2004/05/22}{Add braces around \#3 to allow
@@ -928,12 +936,12 @@
% We use |\L@first| to compute the amount of space to be skipped.
%
% \changes{v0.9}{1998/02/23}{Calculations of length
-% \cs{L@first} changed. Do not `vskip' small lengths ($<$0.2pt),
+% \cs{L@first} changed. Do not `vskip’ small lengths ($<$0.2pt),
% they are just rounding errors.}
%
% \changes{v1.8}{2015/02/06}{The 0.2pt limit for discarded
% vskips is now customisable through \cs{DiscardVskip} and option
-% `novskip'.}
+% `novskip’.}
%
% \changes{v1.2}{2002/03/13}{\cs{baselineskip} may be a
% rubber length, we convert it to a dimen.}
@@ -958,7 +966,7 @@
% \begin{macrocode}
\ifdim\L@first>\L@novskip
% \end{macrocode}
-% When the \lopt{grid} option is \lopt{true}, let's round up
+% When the \lopt{grid} option is \lopt{true}, let’s round up
% |\L@first| to the next integer number of |\baselineskip|.
% \begin{macrocode}
\ifL@grid
@@ -977,7 +985,7 @@
% \end{macrocode}
% Again, 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.
+% reset later on to hold the first line’s length.
% \begin{macrocode}
\setlength{\L@Pindent}{\wd\L@lbox}%
\addtolength{\L@Pindent}{-\L@hang\wd\L@lbox}%
@@ -987,7 +995,7 @@
\setlength{\L@first}{\linewidth}%
\addtolength{\L@first}{-\L@Pindent}%
% \end{macrocode}
-% Now let's compute |\L@Nindent| and |\L@next| for the next lines.
+% Now let’s compute |\L@Nindent| and |\L@next| for the next lines.
% \begin{macrocode}
\addtolength{\L@Nindent}{\L@Pindent}%
\setlength{\L@next}{\linewidth}%
@@ -999,19 +1007,21 @@
% quotation, abstract environments\dots{} but do not change
% \cs{linewidth} which is set by these environments.}
%
-% \changes{v1.4}{2002/10/26}{\cs{lettrine} still didn't
+% \changes{v1.4}{2002/10/26}{\cs{lettrine} still didn’t
% work properly in quote, quotation, abstract environments,
% pointed out by Matthias C.\ Schmidt. \cs{rightmargin} was added
% too early to \cs{L@Nindent}, thus making \cs{\L@next} too short
% by \cs{rightmargin}.}
%
+% \changes{v2.22}{2019/04/04}{\cs{@totalleftmargin} is the correct
+% indentation for quote, quotation and abstract environments.}
+%
% This is for quotation, quote, abstract\dots{} environments:
% |\linewidth| is set by these environments, all we have to do
-% is to shift our text left by |\rightmargin| (amount of space
-% locally added to |\leftmargin| in these environments).
+% is to shift our text left by |\@totalleftmargin|.
% \begin{macrocode}
- \addtolength{\L@Pindent}{\rightmargin}%
- \addtolength{\L@Nindent}{\rightmargin}%
+ \addtolength{\L@Pindent}{\@totalleftmargin}%
+ \addtolength{\L@Nindent}{\@totalleftmargin}%
% \end{macrocode}
% Now, set up the shape of the new paragraph (designed by
% |\parshape|).
@@ -1029,7 +1039,7 @@
\addtolength{\L@Nindent}{\L@slope}%
\addtolength{\L@next}{-\L@slope}%
\advance\@tempcnta\@ne}%
- \edef\L@parshape{\L@parshape \rightmargin \the\linewidth}%
+ \edef\L@parshape{\L@parshape \@totalleftmargin \the\linewidth}%
\noindent
\parshape=\L@parshape\relax
% \end{macrocode}
@@ -1042,13 +1052,34 @@
\smash{\llap{\mbox{\L@ante}\raisebox{\L@lraise}{\usebox{\L@lbox}}%
\hskip \the\L@Findent}}%
\usebox{\L@tbox}%
+% \end{macrocode}
+%
+%\changes{v2.22}{2019/03/30}{\cs{parshape} reset added in lists.}
+%
+% A |\parshape| reset is required in abstract, quote and quotation
+% environments beginning with |\lettrine| and spreading over several
+% paragraphs. When the list ends, |\parshape| returns to~|0|.
+% \begin{macrocode}
+ \ifnum\@listdepth>0 \Lreset@listparshape \fi
}
% \end{macrocode}
% \end{macro}
+% This ends the definition of |\lettrine|; |\Lreset@listparshape|
+% adds the parshape reset to the first occurence of |\everypar|
+% following the |\lettrine| command.
+% \begin{macrocode}
+\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{macrocode}
%
-% This ends the definition of |\lettrine|.
-%
-% Load a local config file if present in \LaTeX{}'s search path.
+% Load a local config file if present in \LaTeX{}’s search path.
% \begin{macrocode}
\InputIfFileExists{lettrine.cfg}
{\typeout{Loading lettrine.cfg}}
@@ -1070,7 +1101,7 @@
%% code, copy this file to your working directory and customize the
%% copy as you like.
%%
-%% Uncomment any of these lines and change the parameters' values
+%% Uncomment any of these lines and change the parameters’ values
%% to fit your needs (see lettrine.dtx).
%%
%%\setcounter{DefaultLines}{2}