From 07a8d9a5d992d3e861591e63b38de862804caf37 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 26 Jul 2012 22:47:32 +0000 Subject: lettrine (20jul12) git-svn-id: svn://tug.org/texlive/trunk@27185 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/lettrine/lettrine.dtx | 132 +++++++++++---------- 1 file changed, 72 insertions(+), 60 deletions(-) (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/lettrine/lettrine.dtx b/Master/texmf-dist/source/latex/lettrine/lettrine.dtx index 62b490600a3..c5692a6d68c 100644 --- a/Master/texmf-dist/source/latex/lettrine/lettrine.dtx +++ b/Master/texmf-dist/source/latex/lettrine/lettrine.dtx @@ -1,18 +1,18 @@ % -% \CheckSum{445} +% \CheckSum{448} % % \iffalse meta-comment % -% Copyright (C) 1999-2007 Daniel Flipo. +% Copyright (C) 1999-2012 Daniel Flipo. % % This program can be redistributed and/or modified under the terms % of the LaTeX Project Public License either version 1.3 of this % license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX +% and version 1.3 or later is part of all distributions of LaTeX % version 2003/12/01 or later. -% +% % This file has the LPPL maintenance status "maintained". % % NO PERMISSION is granted to produce or to distribute a @@ -30,14 +30,14 @@ \ProvidesFile{lettrine.dtx} % %<*!cfg> - [2007/08/08 v1.62 (Daniel Flipo)] + [2012/07/20 v1.63 (Daniel Flipo)] % % % Lettrine package for LaTeX version 2e % -% Copyright (C) 1999-2007 by Daniel Flipo +% Copyright (C) 1999-2012 by Daniel Flipo % -% Please report errors to: Daniel.Flipo at univ-lille1.fr +% Please report errors to: daniel.flipo at free.fr % %<*driver> \documentclass[a4paper]{ltxdoc} @@ -59,7 +59,7 @@ \textbf{\Large Typesetting `lettrines' in \LaTeXe{} documents} \\[.2\baselineskip]^^A\] {\large Daniel \textsc{Flipo}}\\ - \texttt{Daniel.Flipo\at univ-lille1.fr} + \texttt{daniel.flipo\at free.fr} \end{center} \DocInput{lettrine.dtx} \end{document} @@ -111,7 +111,7 @@ % controls the horizontal gap between the dropped capital % and the indented block of text (default=0pt); % \item |nindent=|\emph{$<$dimen$>$} shifts all indented lines, -% starting from the second one, horizontally by +% starting from the second one, horizontally by % \emph{$<$dimen$>$} (this shift is relative to the first % line, default=0.5em); % \item |slope=|\emph{$<$dimen$>$} can be used with dropped @@ -125,21 +125,21 @@ % the paragraph). % % \changes{lettrine-1.6}{2004/05/22}{Add a flag to switch to -% images in eps or pdf format. Suggested by Bill Jetzer.} +% images in eps or pdf format. Suggested by Bill Jetzer.} % % \item |image=|\emph{$<$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 +% 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| % or |A.pdf| instead of letter~A. This was suggested -% by Bill Jetzer. Redefining \verb+\LettrineFont+ as +% by Bill Jetzer. Redefining \verb+\LettrineFont+ as % \verb+\LettrineFontEPS+ still works for compatibility % but is deprecated. % \end{itemize} -% +% % Example: |\lettrine[lines=4, lraise=0.1, nindent=0em, |% % |slope=-.5em]%|\\ % \mbox{}\phantom{\tt Example: lettrine}% @@ -158,7 +158,7 @@ % % The default settings can be customized either in a config file % \file{lettrine.cfg} (for a global usage), or on a per document -% basis, in the preamble of each document. The following list +% basis, in the preamble of each document. The following list % shows the syntax to set them and their default values: % \begin{itemize} % \item |\setcounter{DefaultLines}{2}|, @@ -200,14 +200,14 @@ % the font size is computed so that, a \emph{standard} dropped % capital (say X, not \`A) 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$, +% $|loversize|=0$ and $|lines|\ge 2$). When $|lines|=1$, % size is computed as if |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), % the |\selectfont| command is issued by |\LettrineFont|:\\ % |\renewcommand{\LettrineFontHook}{\fontfamily{ppl}|\ignorespaces -% |\fontseries{bx}}%|\\ +% |\fontseries{bx}}%|\\ % | \fontshape{sl}}|,\\ % selects Palatino bold expanded slanted for the dropped capital.\\ % |\LettrineFontHook| can also be used to change the colour of @@ -228,7 +228,7 @@ % and the largest size (25pt or 35pt) is often too small. % The CM fonts are now available in PostScript type1 format for % free (courtesy of BlueSky/Y\&Y), to make them fully scalable, -% it is mandatory to add |\usepackage{type1cm}| in the preamble +% it is mandatory to add |\usepackage{type1cm}| in the preamble % of your document. % The EC fonts are also available in type1 format for free % (thanks to Vladimir Volovich, they are called cm-super), and @@ -240,16 +240,17 @@ % or EC fonts, you will need \emph{PostScript versions} of these % fonts \emph{and} one of the packages |type1cm.sty| or % |type1ec.sty|. -% -% The newly released LM fonts, which should replace both CM and -% EC fonts sooner or later, are fully scalable, so, if you have -% them installed, you should use them instead of CM or EC fonts. -% |\usepackage{lmodern}| is the command to switch them on (add -% |\usepackage[T1]{fontenc}| when composing in one of the western -% languages other than English in order to get proper hyphenation). +% +% The LM fonts are a good replacement for both CM and EC fonts they +% are fully scalable, so you should use them instead of CM or EC +% fonts. |\usepackage{lmodern}| is the command to switch them on +% (add |\usepackage[T1]{fontenc}| when composing in one of the +% western languages other than English in order to get proper +% hyphenation). % % You can also consider using one of the standard PostScript fonts -% (Palatino, Times, Utopia\dots), they are fully scalable too! +% (Palatino, Times, Utopia\dots), or any OpenType font, they are +% fully scalable too! % % \vspace{\baselineskip} % \textbf{Known problems:} @@ -286,14 +287,14 @@ % % Default initializations: define the necessary counters, lengths, % and commands to hold the default settings and set these default -% settings. They can be overwritten in file |lettrine.cfg|. +% settings. They can be overwritten in file |lettrine.cfg|. % -% \changes{lettrine-1.2}{2002/03/13}{\cs{newlength} changed to +% \changes{lettrine-1.2}{2002/03/13}{\cs{newlength} changed to % \cs{newdimen}, to correct a bug with seminar.cls (pointed out % by Peter M\"unster).} % % \changes{lettrine-1.6}{2004/05/22}{Added newif \cs{ifLettrineImage}.} -% +% % \begin{macrocode} \newcounter{DefaultLines} \setcounter{DefaultLines}{2} @@ -312,7 +313,7 @@ % % Then let's define the necessary internal counters, lengths, % and commands. -% +% % \changes{lettrine-1.6}{2004/05/22}{Added newif \cs{ifL@image}.} % % \begin{macrocode} @@ -345,9 +346,8 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\LettrineFont} % \begin{macro}{\LettrineFontHook} -% \begin{macro}{\LettrineFontEPS} +% \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 @@ -359,17 +359,22 @@ % As |\baselineskip| might be a rubber length, we convert it into % a `dimen' using |\@tempdima|. % |\LettrineFontHook| enables to select another font for the -% dropped capital. Its default definition is empty (the current +% dropped capital. Its default definition is empty (the current % text font is used). % % \changes{lettrine-0.9}{1998/02/23}{Size of the dropped capital -% when lines=1 changed (was \cs{Huge}).} +% changed when `lines' value is 1 (was \cs{Huge}).} % \changes{lettrine-0.9}{1998/03/13}{\cs{Lettrine@height} added.} % \changes{lettrine-0.9}{1998/03/13}{\cs{LettrineFontHook} added.} -% \changes{lettrine-0.9}{1998/03/13}{\cs{LettrineFontEPS} added.} -% \changes{lettrine-1.2}{2002/03/13}{\cs{baselineskip} may be a +% \changes{lettrine-1.2}{2002/03/13}{\cs{baselineskip} may be a % rubber length, we convert it to a dimen.} % +% \changes{lettrine-1.63}{2012/07/20}{Added command +% \cs{LettrineTestString} which defaults to +% `ABCDEFGHIJKLMNOQPRSTUVWXYZ'. In previous versions height +% computations were based on letter `X' which might not exist +% in some (rare) fonts. Pointed out by Rapha\"el Pinson.} +% % \begin{macrocode} \def\Lettrine@height{% \@tempdima=\baselineskip @@ -381,17 +386,21 @@ \addtolength{\L@height}{\ht\L@tbox}% \addtolength{\L@height}{\L@oversize\L@height}} \newcommand*{\LettrineFontHook}{} +\newcommand*{\LettrineTestString}{ABCDEFGHIJKLMNOQPRSTUVWXYZ} \newcommand*{\LettrineFont}{% \Lettrine@height % \end{macrocode} % |\L@height| now holds the exact height required for the dropped % capital, setting |\fontsize| to that height would not give the % expected result (capital too small), some computing has to be -% done: we measure how high an `X' capital would be and compute -% a scaling factor (always $\ge1$). +% done: we measure the maximal capitals' height and compute a +% scaling factor (always $\ge1$). All capitals 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. % \begin{macrocode} \sbox{\L@tbox}{\LettrineFontHook\fontsize{\L@height}{\L@height}% - \selectfont X}% + \selectfont \LettrineTestString}% % \end{macrocode} % Arithmetic calculations convert the dimensions into integers % (in sp) and compute a (4 decimal accurate) scaling factor. @@ -412,16 +421,21 @@ \selectfont } % \end{macrocode} +% \end{macro} +% \end{macro} +% +% \changes{lettrine-0.9}{1998/03/13}{\cs{LettrineFontEPS} added.} % +% \begin{macro}{\LettrineFontEPS} % The following definition is for use with dropped capitals defined % as images: EPS, PDF, JPG, PNG files (see examples in demo.tex). % Its use requires the |graphicx| package to be loaded in the -% preamble with |\usepackage{graphicx}|. The required size is +% preamble with |\usepackage{graphicx}|. The required size is % computed just as in the standard case, |\includegraphics| % prints the EPS file at this size. -% -% \changes{lettrine-1.6}{2004/05/22}{Added newif \cs{LettrineFontHook} -% to \cs{LettrineFontEPS}. This is needed for color options.} +% +% \changes{lettrine-1.6}{2004/05/22}{Added \cs{LettrineFontHook} +% to \cs{LettrineFontEPS}. This is needed for color options.} % % \begin{macrocode} \newcommand*{\LettrineFontEPS}{% @@ -429,8 +443,6 @@ \includegraphics[height=\L@height]} % \end{macrocode} % \end{macro} -% \end{macro} -% \end{macro} % % Set up keyval initializations. % @@ -455,7 +467,7 @@ % of parameters on a per character basis, for instance:\\ % |\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 +% which expands to the options given as second argument of % |\LettrineOptionsFor| for letter `A'. % % \begin{macrocode} @@ -488,10 +500,10 @@ % \end{macrocode} % \changes{lettrine-1.5}{2003/08/18}{Added reading of an optional % config file \cs{DefaultOptionsFile}.} -% then try to read an optional file, the name of which is found -% in |\DefaultOptionsFile|, do this inside a group, and define a +% 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 -% options given by |\LettrineOptionsFor| for the current lettrine +% options given by |\LettrineOptionsFor| for the current lettrine % (defined by |#2|)\dots % \begin{macrocode} \if\DefaultOptionsFile\relax @@ -522,7 +534,7 @@ % \end{macrocode} % Now apply these options (the following code executes % |\setkeys{L}{\l@LOKeys}}| where |\l@LOKeys| is expanded, -% see \file{keyval.sty}). +% see \file{keyval.sty}). % \begin{macrocode} \def\KV@prefix{KV@L@}% \let\@tempc\relax @@ -571,10 +583,10 @@ % it into a `dimen' using |\@tempdima|. % % \changes{lettrine-0.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{lettrine-1.2}{2002/03/13}{\cs{baselineskip} may be a +% \changes{lettrine-1.2}{2002/03/13}{\cs{baselineskip} may be a % rubber length, we convert it to a dimen.} % % \begin{macrocode} @@ -591,7 +603,7 @@ % \end{macrocode} % Now, |\L@first| holds (the opposite of) the raw height of a % standard dropped capital (like~'X'), excluding the effect of -% |\L@oversize|. This is the basis for |\L@raise| +% |\L@oversize|. This is the basis for |\L@raise| % (and |\L@oversize|, see |\LettrineFont|). % \begin{macrocode} \setlength{\L@lraise}{-\L@raise\L@first}% @@ -623,13 +635,13 @@ % \end{macrocode} % % \changes{lettrine-1.1}{1999/08/18}{Add \cs{rightmargin} to -% \cs{L@Pindent} for \cs{Lettrine} to work properly in quote, -% quotation, abstract environments\dots{} but do not change +% \cs{L@Pindent} for \cs{Lettrine} to work properly in quote, +% quotation, abstract environments\dots{} but do not change % \cs{linewidth} which is set by these environments.} % % \changes{lettrine-1.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 +% 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}.} % @@ -641,7 +653,7 @@ \addtolength{\L@Pindent}{\rightmargin}% \addtolength{\L@Nindent}{\rightmargin}% % \end{macrocode} -% Now, set up the shape of the new paragraph (designed by +% Now, set up the shape of the new paragraph (designed by % |\parshape|). % \begin{macrocode} \addtocounter{L@lines}{1}% @@ -686,7 +698,7 @@ %% %% If you want to customize lettrine, please *do not* hack into the %% code, copy this file to the directory where lettrine.sty lies -%% and customize it as you like. +%% and customize it as you like. %% %% Uncomment these lines and change the parameters' values to fit %% your needs (see lettrine.dtx). @@ -743,5 +755,5 @@ %%% Local Variables: %%% fill-column: 70 -%%% coding: latin-1 +%%% coding: us-ascii %%% End: -- cgit v1.2.3