summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/lettrine
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-08-21 21:52:33 +0000
committerKarl Berry <karl@freefriends.org>2018-08-21 21:52:33 +0000
commite37b523eeee35826ced48838c29b610085d65ce1 (patch)
treeca4fc87f65da44170b74862033a729a80caaf049 /Master/texmf-dist/source/latex/lettrine
parent71b38ef4b645d159383b9039b45bd5b20039eb60 (diff)
lettrine (21aug18)
git-svn-id: svn://tug.org/texlive/trunk@48450 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/lettrine')
-rw-r--r--Master/texmf-dist/source/latex/lettrine/lettrine.dtx347
1 files changed, 217 insertions, 130 deletions
diff --git a/Master/texmf-dist/source/latex/lettrine/lettrine.dtx b/Master/texmf-dist/source/latex/lettrine/lettrine.dtx
index dc110251129..44609d437b8 100644
--- a/Master/texmf-dist/source/latex/lettrine/lettrine.dtx
+++ b/Master/texmf-dist/source/latex/lettrine/lettrine.dtx
@@ -1,5 +1,5 @@
%
-% \CheckSum{598}
+% \CheckSum{636}
%
% \iffalse meta-comment
%
@@ -27,14 +27,14 @@
\ProvidesFile{lettrine.dtx}
%</dtx>
%<*!cfg>
- [2018/07/31 v2.01 (Daniel Flipo)]
+ [2018/08/18 v2.1 (Daniel Flipo)]
%</!cfg>
%
% Lettrine package for LaTeX version 2e
%
% Copyright © 1999-2018 by Daniel Flipo
%
-% Please report errors to: daniel.flipo at free.fr
+% Please report errors to: daniel (dot) flipo (at) free (dot) fr
%
%<*driver>
\documentclass[a4paper]{ltxdoc}
@@ -46,16 +46,20 @@
\usepackage[numbered]{hypdoc}
\hypersetup{colorlinks,urlcolor=blue,unicode}
\usepackage{lettrine}
+\usepackage{tikz}
+\usetikzlibrary{shapes.arrows}
%
\RecordChanges
\AtEndDocument{%
- \section{Change History}%
+ \clearpage
+ \section{Change History}%
\GlossaryPrologue{}%
Changes are listed in reverse order (latest first) from version~1.0
\PrintChanges
}
%
\newcommand*\file[1]{\texttt{#1}}
+\newcommand*\lopt[1]{\texttt{#1}}
\renewcommand\meta[1]{\textit{<#1>}} % no math mode (see doc.sty)
%
\setlength{\parindent}{0pt}
@@ -101,46 +105,46 @@
% The parameters can be set using David Carlisle's
% \texttt{keyval.sty} syntax:
% \begin{itemize}
-% \item |lines=|\meta{integer} sets how many lines the
+% \item \lopt{lines=}\meta{integer} sets how many lines the
% dropped capital will occupy (default=2);
%
% \changes{v1.7}{2014/09/16}{New counter to add lines for
% dropped capitals with positive depth, like Q.}
%
-% \item |depth=|\meta{integer} sets the number of lines to
+% \item \lopt{depth=}\meta{integer} sets the number of lines to
% be reserved under the baseline, this is meant for dropped
% capital with positive depth, like Q (default=0);
-% \item |lhang=|\meta{decimal} ($0\le|lhang|\le1$) sets
+% \item \lopt{lhang=}\meta{decimal} ($0\le|lhang|\le1$) sets
% how much of the dropped capital's width should hang into
% the margin (default=0);
-% \item |loversize=|\meta{decimal} ($-1<|loversize|\le1$)
+% \item \lopt{loversize=}\meta{decimal} ($-1<\lopt{loversize}\le1$)
% enlarges the dropped capital's height: with
-% |loversize=0.1| its height is enlarged by 10\% so that
-% it raises above the top paragraph's line (default=0);
-% \item |lraise=|\meta{decimal} does not affect the dropped
+% \lopt{loversize=0.1} its height is enlarged by 10\% so
+% 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),
% down (if negative); useful with capitals like |J| or |Q|
% which have a positive depth, (default=0);
-% \item |findent=|\meta{dimen} (positive or negative)
+% \item \lopt{findent=}\meta{dimen} (positive or negative)
% controls the horizontal gap between the dropped capital
% and the indented block of text (default=0pt);
-% \item |nindent=|\meta{dimen} shifts all indented lines,
+% \item \lopt{nindent=}\meta{dimen} shifts all indented lines,
% starting from the second one, horizontally by
% \meta{dimen} (this shift is relative to the first
% line, default=0.5em);
-% \item |slope=|\meta{dimen} can be used with dropped
+% \item \lopt{slope=}\meta{dimen} can be used with dropped
% capitals like |A| or |V| to add \meta{dimen}
% (positive or negative) to the indentation of each line
-% starting from the third one (no effect if |lines=2|,
+% starting from the third one (no effect if \lopt{lines=2},
% default=0pt);
-% \item |ante=|\meta{text} can be used to typeset \meta{text}
+% \item \lopt{ante=}\meta{text} can be used to typeset \meta{text}
% \emph{before} the dropped capital (typical use is for
% French guillemets starting the paragraph).
%
% \changes{v1.6}{2004/05/22}{Add a flag to switch to
% images in eps or pdf format. Suggested by Bill Jetzer.}
%
-% \item |image=|\meta{true} (new to version 1.6) will force
+% \item \lopt{image=true} (new to version 1.6) will force
% |\lettrine| to replace the letter normally used as
% dropped capital by an image in eps format (latex) or
% in pdf, jpg, etc.\ format (pdflatex); this needs the
@@ -149,25 +153,25 @@
% |\lettrine[image]{A}{n exemple}| will load |A.eps|
% or |A.pdf| instead of letter~A. This was suggested
% by Bill Jetzer. Redefining \verb+\LettrineFont+ as
-% \verb+\LettrineFontEPS+ still works for compatibility
-% but is deprecated.
+% \verb+\LettrineFontEPS+ is no longer supported.
%
% \changes{v1.8}{2015/02/06}{Added two keyval options:
% `grid' (true/false) and `novskip' to override \cs{DiscardVskip}.}
%
-% \item |grid=|\meta{true} (new to version 1.8) will force
+% \item \lopt{grid=true} (new to version 1.8) will force
% the vertical skip added above the paragraph starting with
% |\lettrine| to be rounded up to an integer number of
% |\baselineskip|.
% This option is meant for grid typesetting.
-% \item |novskip=|\meta{dimen} (new to version 1.8)
+% \item \lopt{novskip=}\meta{dimen} (new to version 1.8)
% overrides |\DiscardVskip| (default=0.2pt). In some cases
-% (see options |lraise|, |loversize| or accentuated dropped
-% capitals,\dots) the top of the dropped capital will raise
-% above the top of following text (usually in small caps),
-% this will trigger a corresponding vertical skip above
-% the paragraph starting with |\lettrine|,
-% \emph{only if} this skip exceeds |\DiscardVskip|.
+% (see options \lopt{lraise}, \lopt{loversize} or
+% accentuated dropped capitals,\dots) the top of the
+% dropped capital will raise above the top of following
+% text (usually in small caps), this will trigger
+% a corresponding vertical skip above the paragraph
+% starting with |\lettrine|, \emph{only if} this skip
+% exceeds |\DiscardVskip|.
% Consider enlarging |novskip| (or |\DiscardVskip|) to
% prevent small vertical skips from being rounded up to
% |\baselineskip| when using the `grid' option.
@@ -175,7 +179,7 @@
% \changes{v1.9}{2015/08/31}{New keyval option: `realheight'
% (true/false) and new global flag \cs{ifLettrineRealHeight}.}
%
-% \item |realheight=|\meta{true} (new to version 1.9) will
+% \item \lopt{realheight=true} (new to version 1.9) will
% compute the default height of the initial so that the
% top of it is exactly aligned with the top of the text
% entered as second mandatory argument of |\lettrine|
@@ -183,7 +187,7 @@
% Otherwise, the default height is computed using a
% customisable string |\LettrineSecondString| instead of
% the real argument. For backward compatibility, option
-% |realheight| defaults to false and
+% \lopt{realheight} defaults to \lopt{false} and
% |\LettrineSecondString| to `x'.
%
% You probably don't need this option if you choose to
@@ -200,13 +204,28 @@
% Global variants : |\LettrineRealHeighttrue| or (without
% |realheight| option)
% |\renewcommand*{\LettrineSecondString}{l}|.
-% \item |\lettrine{L}{a misère}| option |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 the top of the non accented
-% letters).
+% \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
+% the top of the non accented letters).
% \end{description}
%
+% \item \lopt{refstring}\,\footnote{Unlike \lopt{grid} or
+% \lopt{realheight}, \lopt{refstring} is not a flag
+% (\emph{do not} add \lopt{=true}!); it is possible to set
+% \lopt{refstring=}\meta{string} to override
+% \cs{LettrineTestString} locally.}
+% (new to version 2.1) is meant for fancy initials with
+% irregular heights (i.e.\ taken in fonts like Yinit
+% (OpenType), \file{cfr-initials},\dots).
+% \lopt{refstring} forces the |\fontsize| computations to
+% be run on the initial given as |\lettrine|’s first
+% mandatory argument instead of the reference string
+% |\LettrineTestString|. In most cases, this option should
+% \emph{not} be used: think of accentuated initials or
+% capitals with optical correction.
+%
% \end{itemize}
%
% Example: |\lettrine[lines=4, lraise=0.1, nindent=0em, |%
@@ -244,6 +263,8 @@
% \item |\LettrineImagefalse|,
% \item |\LettrineOnGridfalse|,
% \item |\LettrineRealHeightfalse|,
+% \item |\LettrineSelfReffalse|,
+% \item |\LettrineVonefalse|,
% \item |\setlength{\DefaultFindent}{0pt}|,
% \item |\setlength{\DefaultNindent}{0.5em}|,
% \item |\setlength{\DefaultSlope}{0pt}|.
@@ -259,10 +280,11 @@
% See examples of such config files in the subdirectory
% \file{contrib}.
%
-% The dimensional parameters |findent|, |nindent| and |slope|,
-% can be set in \textit{filename} relative to |\LettrineWidth| if
-% needed. The settings read from this file will be overridden by
-% the optional arguments eventually given to |\lettrine|.
+% The dimensional parameters \lopt{findent}, \lopt{nindent} and
+% \lopt{slope}, can be set in \textit{filename} relative to
+% |\LettrineWidth| if needed. The settings read from this file
+% will be overridden by the optional arguments eventually given to
+% |\lettrine|.
%
% |\LettrineTextFont| sets the font used for the second argument
% of |\lettrine|, its default definition is
@@ -275,8 +297,8 @@
% the font size is computed so that, a \emph{standard} dropped
% capital (say Z, not À) when sitting on its baseline, gets
% its top aligned with the top of the following text (provided
-% $|loversize|=0$ and $|lines|\ge 2$). When $|lines|=1$,
-% size is computed as if |lines| was~2.\\
+% $|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
% low-level font interface (see \LaTeX{} Companion, p.187--192),
@@ -344,16 +366,17 @@
% Remember that `quote', `quotation', `abstract' environments
% are implemented as \emph{lists} in \LaTeX{}.
% \item if you are facing some slight height inaccuracy for a
-% dropped capital, you can try changing |\LettrineTestString|:\\
-% |\renewcommand*{\LettrineTestString}{|\meta{letter}|}|\\
-% where \meta{letter} is the used dropped capital \emph{without
-% accent}. Informations about targeted and effective initial’s
+% dropped capital, you can try option \lopt{refstring};
+% this option is meant for fancy (unaccented) initials.
+% Informations about targeted and effective initial’s
% height are available in the \file{.log} file. Using LuaTeX
% or XeTeX engines with OpenType fonts may be an option
% (some TFM files for Type1 fonts are slightly inaccurate).
% \item |\LettrineTestString|’s value has changed over the time;
% to achieve strict backward compatibility with previous versions,
-% please look at the end of \file{lettrine.cfg}.
+% please look at the end of \file{lettrine.cfg} and consider adding
+% the \lopt{Vone} option to the |\lettrine| command or setting
+% |\LettrineVonetrue| for global action on the whole document.
% \end{itemize}
%
% \StopEventually{}
@@ -367,7 +390,7 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\RequirePackage{keyval}
+\RequirePackage{keyval,minifp}
% \end{macrocode}
%
% Default initializations: define the necessary counters, lengths,
@@ -384,6 +407,12 @@
% and new dimen \cs{DiscardVskip}, default (0.2pt) set for
% compatibility with previous releases.}
%
+% \changes{v2.1}{2018/08/14}{Newif \cs{ifLettrineVone} and
+% new option `Vone'.}
+%
+% \changes{v2.1}{2018/08/14}{Newif \cs{ifLettrineSelfRef} and
+% new option `refstring'.}
+%
% \begin{macrocode}
\newcounter{DefaultLines}
\setcounter{DefaultLines}{2}
@@ -403,6 +432,8 @@
\newif\ifLettrineImage
\newif\ifLettrineOnGrid
\newif\ifLettrineRealHeight
+\newif\ifLettrineVone
+\newif\ifLettrineSelfRef
% \end{macrocode}
%
% Then let's define the necessary internal counters, lengths,
@@ -440,6 +471,8 @@
\newif\ifL@image
\newif\ifL@grid
\newif\ifL@realh
+\newif\ifL@vone
+\newif\ifL@selfref
% \end{macrocode}
%
% Provide commands for the fonts used to typeset the two
@@ -452,31 +485,56 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\LettrineTestString}
+% \begin{macro}{\LettrineSecondString}
% \begin{macro}{\LettrineFontHook}
% \begin{macro}{\LettrineFont}
% The default size for the dropped capital is computed so that the
% top of it is exactly aligned with the top of the following text;
-% an extra height (positive or negative) may be added with
-% |Defaultloversize| or with an optional argument |loversize=|.
-% If |lines=1|, the default size for the dropped capital is
-% computed as if |lines=2|.
+% an extra height (positive or negative) may be added globally by
+% redefining |\Defaultloversize| or locally using optional
+% argument \lopt{loversize=}.
+% If \lopt{lines=1}, the default size for the dropped capital is
+% computed as if \lopt{lines=2}.
+% \begin{figure}[ht]
+% \centering
+% \begin{tikzpicture}[>=stealth]
+% \node[font=\fontfamily{lmr}\fontsize{160}{160}\mdseries]
+% at (3,2) {F} ;
+% \node[right, font=\fontfamily{lmr}\fontsize{20}{20}\bfseries]
+% at (4.6,3.65) {IRST};
+% \node[right, font=\fontfamily{lmr}\fontsize{28}{28}\bfseries]
+% at (5,2.63) {bla bla};
+% \node[right, font=\fontfamily{lmr}\fontsize{28}{28}\bfseries]
+% at (5,1.53) {bla bla};
+% \node[right, font=\fontfamily{lmr}\fontsize{28}{28}\bfseries]
+% at (5,0.43) {bla bla};
+% \draw[dotted] (0,3.9) -- (9,3.9);
+% \draw (1,3.4) -- (9,3.4);
+% \draw[dashed] (1.5,2.3) -- (9,2.3);
+% \draw[dashed] (1.5,1.2) -- (9,1.2);
+% \draw[dashed] (0,0.1) -- (9,0.1);
+% \draw[<->] (0,0.1) -- (0,3.9);
+% \node[left] at (0,2.1) {tht};
+% \draw[<->] (1.3,0.1) -- (1.3,3.4);
+% \node[left] at (1.3,1.8) {dp};
+% \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$)}
+% \label{fig:target}
+% \end{figure}
%
% |\Lettrine@height| computes the targeted height for the dropped
-% capital and stores it into |\L@target@tht| which depends only
-% on |L@lines| and on the height of |\L@tbox|. So options
-% \emph{must} be read and |\L@tbox| must be properly initialised
-% \emph{before} executing |\Lettrine@height| (see below in
-% |\@lettrine| code).
-% A default initialisation of |\L@tbox| is provided just in case
-% |\LettrineFont| would be used outside |\lettrine|.
+% capital and stores it into |\L@target@tht| which depends only on
+% on |L@lines| and on the height of |\L@tbox| (see
+% fig.~\ref{fig:target}). So options \emph{must} be read and
+% |\L@tbox| must be properly initialised \emph{before} executing
+% |\Lettrine@height| (see below in |\@lettrine| code).
%
% |\L@height| is set to |\L@target@tht| raised by the |\L@oversize|
% factor.
%
-% \changes{v0.9}{1998/02/23}{Size of the dropped capital
-% changed when `lines' value is 1 (was \cs{Huge}).}
-% \changes{v0.9}{1998/03/13}{\cs{Lettrine@height} added.}
-% \changes{v0.9}{1998/03/13}{\cs{LettrineFontHook} added.}
% \changes{v1.2}{2002/03/13}{\cs{baselineskip} may be a
% rubber length, we convert it to a dimen.}
%
@@ -498,18 +556,18 @@
% \changes{v2.0}{2018/07/21}{Store targeted dimensions of the
% dropped capital (ht, dp, tht) for further use.}
%
-% \changes{v2.01}{2018/07/31}{Faulty code \cs{global}\cs{setlength}
-% removed. Thanks to Ulrike Fischer for providing the patch.}
+%\changes{v2.1}{2018/08/01}{\cs{Lettrine@height} moved out of
+% \cs{LettrineFont}: \cs{global} settings no longer required.
+% \cs{fontsize} computations moved into \cs{Lettrine@height}.}
%
% \begin{macrocode}
+\newcommand*{\LettrineTestString}{EFTZ}
+\newcommand*{\LettrineSecondString}{x}
\def\Lettrine@height{%
- \ifvoid\L@tbox
- \sbox{\L@tbox}{\LettrineTextFont{\LettrineSecondString}}%
- \fi
\setlength{\L@target@ht}{\ht\L@tbox}%
% \end{macrocode}
% As |\baselineskip| might be a rubber length, let’s convert it
-% into a `dimen' using |\@tempdima|.
+% into a `dimen’ using |\@tempdima|.
% \begin{macrocode}
\@tempdima=\baselineskip
\setlength{\L@target@dp}{\value{L@lines}\@tempdima}%
@@ -521,11 +579,69 @@
\fi
\setlength{\L@target@tht}{\L@target@ht}%
\addtolength{\L@target@tht}{\L@target@dp}%
- \global\L@target@ht=\L@target@ht
- \global\L@target@dp=\L@target@dp
- \global\L@target@tht=\L@target@tht
\setlength{\L@height}{\L@target@tht}%
\addtolength{\L@height}{\L@oversize\L@target@tht}%
+ \ifL@image
+ \else
+% \end{macrocode}
+% |\L@height| now holds the exact height required for the
+% dropped capital, let’s compute the matching |\fontsize|’s value
+% (unless the initial is a picture);
+% we first measure the height of a ``standard’’ capital
+% (i.e.\ either listed in |\LettrineTestString| or the initial
+% itself) scaled by |\fontsize| with argument |\L@height|.
+% Mind that some font designers apply optical correction to
+% capitals C, G, O, or Q (they are slightly taller than `T’ or
+% `Z’), that’s why they are not part of |\LettrineTestString|.
+% 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).
+% \begin{macrocode}
+ \ifL@selfref
+ \def\Lettrine@RefString{\l@refstring}%
+ \else
+ \def\Lettrine@RefString{\LettrineTestString}%
+ \fi
+ \sbox{\@tempboxa}{\LettrineFontHook
+ \fontsize{\L@height}{\L@height}\selectfont
+ \Lettrine@RefString}%
+ \@tempcnta=\ht\@tempboxa
+ \@tempcntb=\L@height
+% \end{macrocode}
+% |\@tempcntb| holds the target height converted into sp (integer)
+% and |\@tempcnta| holds the height in sp of the ``standard’’
+% initial scaled by |\fontsize| with |\L@height| as argument;
+% let’s divide |\@tempcntb| by |\@tempcnta| to compute a (4 decimal
+% accurate) scaling factor |\L@factor|.
+% |\fontsize|’s argument providing the requested |\L@height| is
+% |\L@factor\L@height|.
+%
+% \changes{v2.0}{2018/07/21}{Change factors 100/100 to 50/200
+% to reach larger sizes (initial's height up to 20cm).}
+%
+% \changes{v2.1}{2018/08/14}{Computation of \cs{L@factor} for
+% \cs{fontsize} done by the minifp package.}
+%
+% Up to v2.01, possible values for |\L@factor| were either 1 or any
+% value $\geq 1.1$ which was fine for almost every font but not
+% all (i.e.\ \file{cfr-initials}). Starting with v2.1, |\L@factor|
+% is computed more accurately by \file{minifp.sty}; option
+% \lopt{Vone} is provided for backward compatibility.
+% \begin{macrocode}
+ \ifL@vone
+ \multiply\@tempcntb by 100
+ \divide\@tempcnta by 100
+ \divide\@tempcntb by \@tempcnta
+ \advance\@tempcntb by -9999
+ \ifnum\@tempcntb>0
+ \def\L@factor{1.\the\@tempcntb}%
+ \else
+ \def\L@factor{1}%
+ \fi
+ \else
+ \MFPdiv{\the\@tempcntb}{\the\@tempcnta}\L@factor
+ \fi
+ \fi
}
% \end{macrocode}
%
@@ -535,53 +651,16 @@
%
% \begin{macrocode}
\newcommand*{\LettrineFontHook}{}
-\newcommand*{\LettrineTestString}{EFTZ}
-\newcommand*{\LettrineSecondString}{x}
\newcommand*{\LettrineFont}{%
- \Lettrine@height
-% \end{macrocode}
-% |\L@height| now holds the exact height required for the dropped
-% capital, let’s compute the matching |\fontsize|’s value:
-% we divide |\L@height| (converted into sp) by the ``standard’’
-% capitals’ height (see the list in |\LettrineTestString|) to get
-% a scaling factor (always $\ge1$).
-% All capitals in |\LettrineTestString| are expected to have the
-% same height, in case this assumption would be wrong for some
-% special font, |\LettrineTestString| can be customised to any
-% non empty subset of capitals, the maximal height of these
-% capitals will be taken into account.
-% Mind that some fonts apply optical correction to capitals C, G,
-% O, or Q (they are slightly taller than `T’ or `Z’), that’s why
-% they are not part of |\LettrineTestString|.
-% \begin{macrocode}
- \sbox{\@tempboxa}{\LettrineFontHook\fontsize{\L@height}{\L@height}%
- \selectfont \LettrineTestString}%
-% \end{macrocode}
-% Arithmetic calculations convert the dimensions into integers
-% (in sp) and compute a (4 decimal accurate) scaling factor.
-%
-% \changes{v2.0}{2018/07/21}{Change factors 100/100 to 50/200
-% to reach larger sizes (height up to 600pt).}
-%
-% \begin{macrocode}
- \@tempcntb=\ht\@tempboxa
- \@tempcnta=\L@height
- \multiply\@tempcnta by 50
- \divide\@tempcntb by 200
- \divide\@tempcnta by \@tempcntb
- \advance\@tempcnta by -9999
- \ifnum\@tempcnta>0
- \def\@tempa{1.\the\@tempcnta}%
- \else
- \def\@tempa{1}%
- \fi
\LettrineFontHook
- \fontsize{\@tempa\L@height}{\@tempa\L@height}%
+ \fontsize{\L@factor\L@height}{\L@factor\L@height}%
\selectfont
}
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \changes{v0.9}{1998/03/13}{\cs{LettrineFontEPS} added.}
%
@@ -598,8 +677,7 @@
%
% \begin{macrocode}
\newcommand*{\LettrineFontEPS}{%
- \Lettrine@height\LettrineFontHook
- \includegraphics[height=\L@height]%
+ \LettrineFontHook\includegraphics[height=\L@height]%
}
% \end{macrocode}
% \end{macro}
@@ -620,6 +698,9 @@
\define@key{L}{grid}[true]{\csname L@grid#1\endcsname}
\define@key{L}{realheight}[true]{\csname L@realh#1\endcsname}
\define@key{L}{novskip}{\setlength{\L@novskip}{#1}}
+\define@key{L}{refstring}[\l@initial]{\L@selfreftrue
+ \def\l@refstring{#1}}
+\define@key{L}{Vone}[true]{\csname L@vone#1\endcsname}
% \end{macrocode}
%
% \changes{v1.5}{2003/08/18}{\cs{LettrineOptionsFor} and
@@ -645,10 +726,9 @@
% \begin{macrocode}
\def\lettrine{\@ifnextchar[\@lettrine{\@lettrine[]}}
\def\@lettrine[#1]#2#3{%
+ \def\l@initial{#2}\let\l@refstring\l@initial
% \end{macrocode}
%
-% \changes{v0.81}{1997/02/26}{\cs{DefaultLoversize} added.}
-%
% \changes{v1.9}{2015/08/31}{\cs{theDefaultLines} changed to
% \cs{value\{DefaultLines\}}, same with \cs{theDefaultDepth}.
% Needed for babel-hebrew which redefines \cs{@arabic}.
@@ -669,11 +749,13 @@
\ifLettrineImage\L@imagetrue\else\L@imagefalse\fi
\ifLettrineOnGrid\L@gridtrue\else\L@gridfalse\fi
\ifLettrineRealHeight\L@realhtrue\else\L@realhfalse\fi
+ \ifLettrineVone\L@vonetrue\else\L@vonefalse\fi
+ \ifLettrineSelfRef\L@selfreftrue\else\L@selfreffalse\fi
% \end{macrocode}
%
-% |\LettrineFont| and |\LettrineFontEPS| both execute
-% |\Lettrine@height| to set |\L@height| which depends on
-% |\L@tbox|. The content of |\L@tbox| depends on option
+% |\LettrineFont| and |\LettrineFontEPS| both rely on |\L@height|
+% which depends on |\L@tbox|, thus requiring prior execution of
+% |\Lettrine@height|. The content of |\L@tbox| depends on option
% |realheight|, so we have to read |\lettrine|'s optional argument
% and initialise the |\L@tbox| content now%
% \footnote{Now means before eventually reading the config file.}.
@@ -698,7 +780,7 @@
\fi
% \end{macrocode}
% \changes{v1.5}{2003/08/18}{Added reading of an optional
-% config file \cs{DefaultOptionsFile}.}
+% config file \cs{DefaultOptionsFile}.}
% Then try to read an optional file (its name is given by
% |\DefaultOptionsFile|), do this inside a group, and define a
% global command |\l@LOKeys| which will expand to the list of
@@ -739,11 +821,13 @@
\let\@tempc\relax
\expandafter\KV@do\l@LOKeys,\relax,
% \end{macrocode}
-% As some parameters' values |findent|, |nindent| and |slope|
-% ---which do not influence the initial’s size--- may be given
-% relative to |\LettrineWidth|, this has to be done again after
-% measuring the lettrine for |\LettrineWidth| to be set properly.
+% 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|, this has to be done again
+% after measuring the lettrine for |\LettrineWidth| to be set
+% properly.
% \begin{macrocode}
+ \Lettrine@height
\sbox{\L@lbox}{\LettrineFont #2}%
\setlength{\LettrineWidth}{\wd\L@lbox}%
\def\KV@prefix{KV@L@}%
@@ -761,10 +845,11 @@
% scaled into |\L@lbox|. Depending on the boolean |image|,
% |\LettrineFont| or |\LettrineFontEPS| is used.
% \begin{macrocode}
+ \Lettrine@height
\ifL@image
- \sbox{\L@lbox}{\LettrineFontEPS{#2}}%
+ \sbox{\L@lbox}{\LettrineFontEPS{#2}}%
\else
- \sbox{\L@lbox}{\LettrineFont #2}%
+ \sbox{\L@lbox}{\LettrineFont #2}%
\fi
% \end{macrocode}
%
@@ -794,7 +879,7 @@
\endgroup
% \end{macrocode}
% and reset |\L@tbox|'s content (mandatory in case
-% |realheight=false|):
+% \lopt{realheight=false}):
%
% \changes{v1.6}{2004/05/22}{Add braces around \#3 to allow
% commands taking an argument (such as \cs{MakeLowercase}) in
@@ -839,8 +924,8 @@
% \begin{macrocode}
\ifdim\L@first>\L@novskip
% \end{macrocode}
-% When the `grid' option is true, let's round up |\L@first| to the
-% next integer number of |\baselineskip|.
+% 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
\@tempdima=\baselineskip
@@ -915,8 +1000,8 @@
\parshape=\L@parshape\relax
% \end{macrocode}
% \changes{v1.64}{2013/03/14}{Remove \$ around \cs{smash}
-% and add \cs{relax}. Bug pointed out by David Monniaux.
-% Correction by Enrico Gregorio.}
+% and add \cs{relax}. Bug pointed out by David Monniaux.
+% Correction by Enrico Gregorio.}
% Write the dropped capital into the left margin, and wrap
% the rest of paragraph around it.
% \begin{macrocode}
@@ -937,7 +1022,7 @@
% \iffalse
%</sty>
% \fi
-%
+% \clearpage
% \section{Configuration file}
%
% \iffalse
@@ -971,6 +1056,8 @@
%%\LettrineImagefalse
%%\LettrineOnGridfalse
%%\LettrineRealHeightfalse
+%%\LettrineSelfReffalse
+%%\LettrineVonefalse
%%
%% Theses are *commands* (value=string, only height matters):
%%\renewcommand*{\LettrineTestString}{EFTZ}