summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/lettrine/lettrine.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-03-27 03:01:30 +0000
committerNorbert Preining <norbert@preining.info>2020-03-27 03:01:30 +0000
commit6c0ddfe655a39b71d1ab6a4a95d57a7ea0d94243 (patch)
tree65567ae2d29e1e8af56375fccfc1debc19b190c5 /macros/latex/contrib/lettrine/lettrine.dtx
parent2bd4f7f317b392c32ce18c70d03fd5ba9ddd9e6d (diff)
CTAN sync 202003270301
Diffstat (limited to 'macros/latex/contrib/lettrine/lettrine.dtx')
-rw-r--r--macros/latex/contrib/lettrine/lettrine.dtx284
1 files changed, 143 insertions, 141 deletions
diff --git a/macros/latex/contrib/lettrine/lettrine.dtx b/macros/latex/contrib/lettrine/lettrine.dtx
index a522c917b2..c357e97aba 100644
--- a/macros/latex/contrib/lettrine/lettrine.dtx
+++ b/macros/latex/contrib/lettrine/lettrine.dtx
@@ -2,7 +2,7 @@
%
% \iffalse meta-comment
%
-% Copyright © 1999-2018 Daniel Flipo.
+% Copyright © 1999-2020 Daniel Flipo.
%
% This program can be distributed and/or modified under the terms
% of the LaTeX Project Public License either version 1.3c of this
@@ -26,20 +26,25 @@
\ProvidesFile{lettrine.dtx}
%</dtx>
%<*!cfg>
- [2019-04-06 v2.22 (Daniel Flipo)]
+ [2020-03-14 v2.23 (Daniel Flipo)]
%</!cfg>
%
% Lettrine package for LaTeX version 2e
%
-% Copyright © 1999-2019 by Daniel Flipo
+% Copyright © 1999-2020 by Daniel Flipo
%
% Please report errors to: daniel (dot) flipo (at) free (dot) fr
%
%<*driver>
\documentclass[a4paper]{ltxdoc}
+\usepackage[dvipsnames]{xcolor}
\usepackage{unicode-math}
-\setmainfont{Latin Modern Roman}
-\setmathfont{XITS Math}
+\setmainfont{erewhon}
+\setsansfont{Cabin}[Scale=MatchLowercase]
+\setmonofont{Inconsolatazi4}[Scale=MatchLowercase, Color=Sepia,
+ HyphenChar=None,StylisticSet={2,3}]
+\setmathfont{Erewhon-Math.otf}
+\usepackage{fourier-orns}
\usepackage[expansion=true,protrusion=true]{microtype}
\usepackage{url}
\usepackage[numbered]{hypdoc}
@@ -47,6 +52,7 @@
\usepackage{lettrine}
\usepackage{tikz}
\usetikzlibrary{shapes.arrows}
+\renewcommand{\labelitemi}{\starredbullet}
%
\RecordChanges
\AtEndDocument{%
@@ -59,15 +65,15 @@
%
\newcommand*\file[1]{\texttt{#1}}
\newcommand*\lopt[1]{\texttt{#1}}
-\renewcommand\meta[1]{\textit{<#1>}} % no math mode (see doc.sty)
+\renewcommand\meta[1]{\textit{\color{Sepia}<#1>}} % no math mode (see doc.sty)
%
\setlength{\parindent}{0pt}
\setlength{\parskip}{.3\baselineskip}
\begin{document}
\GetFileInfo{lettrine.dtx}
\begin{center}
- \textbf{\Large Typesetting dropped capitals in \LaTeXe{} documents}
- \\[.2\baselineskip]^^A\]
+ \textbf{\Large Typesetting dropped capitals with LaTeX}
+ \\[.5\baselineskip]^^A\]
{\large Daniel Flipo}\\
\texttt{daniel.flipo@free.fr}
\end{center}
@@ -84,7 +90,9 @@
% \filedate.}, provides a command |\lettrine| which requires two
% mandatory arguments, and an optional one.
%
-% Adding |\usepackage{lettrine}| in the preamble of a document
+% \changes{v2.23}{2020/03/14}{Documentation cleanup.}
+%
+% Adding |\usepackage{lettrine}| in the preamble of a document
% defines the command |\lettrine|, the simplest use of which is
% |\lettrine{|\meta{letter}|}{|\meta{text}|}|.
% It produces a dropped capital \meta{letter} (2 lines high),
@@ -110,122 +118,106 @@
% \changes{v1.7}{2014/09/16}{New counter to add lines for
% dropped capitals with positive depth, like Q.}
%
-% \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 \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 \lopt{loversize=}\meta{decimal} ($-1<\lopt{loversize}\le1$)
-% 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);
-% \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 \lopt{findent=}\meta{dimen} (positive or negative)
-% controls the horizontal gap between the dropped capital
-% and the indented block of text (default=0pt);
-% \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 \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 \lopt{lines=2},
-% default=0pt);
-% \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).
+% \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 \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 \lopt{loversize=}\meta{decimal} ($-1<\lopt{loversize}\le1$)
+% 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);
+% \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 \lopt{findent=}\meta{dimen} (positive or negative) controls the
+% horizontal gap between the dropped capital and the indented block
+% of text (default=0pt);
+% \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 \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
+% \lopt{lines=2}, default=0pt);
+% \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 \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
-% |graphicx| package to be loaded in the preamble of course.
-% |\lettrine[image=true]{A}{n exemple}| or just
-% |\lettrine[image]{A}{n exemple}| will load |A.eps|,
-% |A.jpg|, |A.png| or |A.pdf| instead of letter~A.
-% This was suggested by Bill Jetzer.\\
-% N.B.: Redefining |\LettrineFont| as |\LettrineFontEPS|
-% is no longer supported and |\LettrineFontEPS| has been
-% renamed as |\LettrineImage|.
+% \item \lopt{image=true} 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, xelatex, lualatex);
+% this requires the |graphicx| package to be loaded in the preamble.
+% |\lettrine[image=true]{A}{n exemple}|\quad or just\\
+% |\lettrine[image]{A}{n exemple}|\\
+% will load |A.eps|, |A.jpg|, |A.png| or |A.pdf| instead of letter~A.\\
+% N.B.: Redefining |\LettrineFont| as |\LettrineFontEPS| is no longer
+% supported and |\LettrineFontEPS| has been renamed as
+% |\LettrineImage|.
%
% \changes{v1.8}{2015/02/06}{Added two keyval options:
% `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
-% |\lettrine| to be rounded up to an integer number of
-% |\baselineskip|.
-% This option is meant for grid typesetting.
-% \item \lopt{novskip=}\meta{dimen} (new to version 1.8)
-% overrides |\DiscardVskip| (default=0.2pt). In some cases
-% (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.
+% \item \lopt{grid=true} 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 \lopt{novskip=}\meta{dimen} overrides |\DiscardVskip|
+% (default=0.2pt). In some cases (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.
%
% \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
-% 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|
-% taking possible accents into account.
-% Otherwise, the default height is computed using a
-% customisable string |\LettrineSecondString| instead of
-% the real argument. For backward compatibility, option
-% \lopt{realheight} defaults to \lopt{false} and
-% |\LettrineSecondString| to `x’.
-%
-% 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
-% |realheight| does the trick:
-% |\lettrine[realheight]{H}{ello}|.\par
-% Global variants : |\LettrineRealHeighttrue| or (without
-% |realheight| option)
-% |\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
-% 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.
+% \item \lopt{realheight=true} 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|
+% taking possible accents into account. Otherwise, the default
+% height is computed using a customisable string
+% |\LettrineSecondString| instead of the real argument. For
+% backward compatibility, option \lopt{realheight} defaults to
+% \lopt{false} and |\LettrineSecondString| to `x’.
+%
+% 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 might 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 |realheight| does the trick:
+% |\lettrine[realheight]{H}{ello}|.\par
+% Global variants : |\LettrineRealHeighttrue| or (without the
+% |realheight| option) |\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 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.} 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}
%
@@ -235,8 +227,9 @@
% |{V}{oici} un exemple |\dots
%
% Coloured initials are possible in conjonction with package
-% \file{color}, examples: |\lettrine{\textcolor{red}{A}}{n} example|
-% \quad or\\ |\lettrine{\textcolor[gray]{0.5}{A}}{nother} one| \\
+% \file{color}, examples: \\
+% |\lettrine{\textcolor{red}{A}}{n} example|\quad or\\
+% |\lettrine{\textcolor[gray]{0.5}{A}}{nother} one| \\
% see package \file{color} for the syntax of colour commands.
% Another possibility to colour initials globally is described
% below, see |\LettrineFontHook|.
@@ -244,9 +237,10 @@
% Three dimensions, |\LettrineWidth|, |\LettrineHeight| and
% |\LettrineDepth|, store the final size of the initial.
%
-% Once \file{lettrine.sty} will be installed (run \texttt{latex}
-% on \file{lettrine.ins} to extract it), compile and print
-% \file{demo.tex} to see the possible usage of these parameters.
+% Once \file{lettrine.sty} will be installed (run \texttt{lualatex}
+% on \file{lettrine.ins} to extract it), compile \file{demo-fr.tex}
+% and \file{demo-lua.tex} print the resulting PDFs 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.}
@@ -289,24 +283,31 @@
% |\LettrineTextFont| sets the font used for the second argument
% of |\lettrine|, its default definition is
% |\newcommand{\LettrineTextFont}{\scshape}| (second argument in
-% small caps, this can be changed using |\renewcommand|).
-%
-% |\LettrineFont| sets the font used for the dropped capital,
-% usually the current font in a (large) size, computed
-% automatically from the number of lines it will fill:
-% 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 \lopt{lines=1},
-% size is computed as if \lopt{lines} was~2.\\
+% small caps), this can be changed using |\renewcommand|.
+%
+% |\LettrineFont| \emph{is not customisable} see |\LettrineFontHook|
+% below, it sets the font used for the dropped capital, usually the
+% current font in a (large) size, computed automatically from the
+% number of lines it will fill: 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
+% \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),
+% 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
% |\fontseries{bx}}%|\\
% | \fontshape{sl}}|,\\
-% selects Palatino bold expanded slanted for the dropped capital.\\
+% selects Palatino bold expanded slanted for the dropped capital.
+%
+% With LuaLaTeX or XeLaTeX changing the lettrine’s font is
+% even easier, simply use the |\fontspec| command:\\
+% |\renewcommand{\LettrineFontHook}{\fontspec{LinLibertine_I.otf}|\\
+% will switch to Linux Libertine Initials.
+%
% |\LettrineFontHook| can also be used to change the colour of
% all initials in a (part of) document:
% |\renewcommand{\LettrineFontHook}{\color[gray]{0.5}}| \\
@@ -348,7 +349,7 @@
% (Palatino, Times, Utopia\dots), or any OpenType font, they are
% fully scalable too!
%
-% \vspace{\baselineskip}
+% \newpage{}
% \textbf{Known issues:}
% \begin{itemize}
% \item Nothing is done to prevent page-breaking in a paragraph
@@ -363,7 +364,7 @@
% |\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
-% are implemented as \emph{lists} in \LaTeX{}.
+% are implemented as \emph{lists} in LaTeX.
% \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.
@@ -380,9 +381,9 @@
% order to produce exactly the same output as with former
% versions: you can request
% |\usepackage{lettrine}[=v1.6]|\footnote{Don’t forget the
-% \texttt{=} sign!} for 1999-2012 documents or
-% |\usepackage{lettrine}[=v1.9]| (documents from 2012 to
-% July 2018) or |\usepackage{lettrine}[=v2.0]| (August 2018).
+% \texttt{=} sign!} for 1999-2012 documents or\\
+% |\usepackage{lettrine}[=v1.9]| (documents from 2012 to July 2018)
+% or\\ |\usepackage{lettrine}[=v2.0]| (August 2018).
% Using any date in ISO format works too:
% |\usepackage{lettrine}[=2014-03-15]| will load v1.9.
% \end{itemize}
@@ -407,7 +408,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{}{2019-03-30}
+ \DeclareCurrentRelease{}{2020-03-14}
\else
\PackageWarning{lettrine}{Your LaTeX kernel is too old to provide
access\MessageBreak to former versions of the lettrine package.%
@@ -417,7 +418,7 @@
\fi
% \end{macrocode}
%
-% This package only runs with \LaTeXe{} and requires files
+% This package only runs with LaTeX and requires files
% \file{keyval.sty} and \file{minifp.sty}.
%
% \begin{macrocode}
@@ -698,7 +699,7 @@
%
% \begin{macro}{\LettrineImage}
% The following definition is for use with dropped capitals defined
-% as images: EPS, PDF, JPG, PNG files (see examples in demo.tex).
+% as images: EPS, PDF, JPG, PNG files (see examples in demo-fr.tex).
% Its use requires the |graphicx| package to be loaded in the
% preamble with |\usepackage{graphicx}|. The required size is
% computed just as in the standard case, |\includegraphics|
@@ -914,7 +915,7 @@
\@tempdima=\L@oversize pt\relax
\PackageInfo{lettrine.sty}%
{Targeted height = \the\L@target@tht\MessageBreak
- (no accent, loversize=0),\MessageBreak
+ (for loversize=0, accent excluded),\MessageBreak
Lettrine height = \the\LettrineHeight\space (#2)%
\ifdim\@tempdima=\z@\else\space loversize=\L@oversize\fi;%
\MessageBreak reported}%
@@ -1079,7 +1080,7 @@
}
% \end{macrocode}
%
-% 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}}
@@ -1166,4 +1167,5 @@
%%% Local Variables:
%%% fill-column: 72
%%% coding: utf-8
+%%% TeX-engine: luatex
%%% End: