summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-08-30 19:35:26 +0000
committerKarl Berry <karl@freefriends.org>2018-08-30 19:35:26 +0000
commit34cdddfd71f044f50f5d08ee9ddeaab7bb061574 (patch)
tree11f6f0ada99e68f21a090661f04da8aad9df17d5 /Master/texmf-dist/tex/latex/lettrine/lettrine.sty
parenta05022b9d4b59c110ad226ec4428e762919fa82d (diff)
lettrine (30aug18)
git-svn-id: svn://tug.org/texlive/trunk@48513 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/lettrine/lettrine.sty')
-rw-r--r--Master/texmf-dist/tex/latex/lettrine/lettrine.sty86
1 files changed, 44 insertions, 42 deletions
diff --git a/Master/texmf-dist/tex/latex/lettrine/lettrine.sty b/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
index 36588a71988..d9060306c3f 100644
--- a/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
+++ b/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
@@ -9,7 +9,7 @@
%% This file is a generated file part of the lettrine package.
%% -----------------------------------------------------------
%%
-%% For the copyright see the source file lettine.dtx.
+%% For the copyright see the source file `lettine.dtx'.
%%
%% This file can be distributed and/or modified under the terms
%% of the LaTeX Project Public License either version 1.3c of this
@@ -27,7 +27,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[2018-04-01]
\ProvidesFile{lettrine.sty}
- [2018-08-25 v2.2 (Daniel Flipo)]
+ [2018-08-28 v2.21 (Daniel Flipo)]
\ifdefined\DeclareRelease
\DeclareRelease{v1.6}{1999-03-03}{lettrine-2006-03-17.sty}
\DeclareRelease{v1.9}{2012-07-20}{lettrine-2015-08-31.sty}
@@ -89,46 +89,54 @@
\newif\ifL@realh
\newif\ifL@selfref
\newcommand*{\LettrineTextFont}{\scshape}
-\newcommand*{\LettrineTestString}{EFTZ}
\newcommand*{\LettrineSecondString}{x}
-\def\Lettrine@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}%
- \ifL@image
- \else
- \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
- \MFPdiv{\the\@tempcntb}{\the\@tempcnta}\L@factor
- \fi
-}
\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}%
+}
+\newcommand*{\LettrineTestString}{EFTZ}
+\def\compute@fontsize{%
+ \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
+ \MFPdiv{\the\@tempcntb}{\the\@tempcnta}\L@factor
+}
\newcommand*{\LettrineFont}{%
\LettrineFontHook
\fontsize{\L@factor\L@height}{\L@factor\L@height}%
\selectfont
}
-\newcommand*{\LettrineFontEPS}{%
+\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
+}
\define@key{L}{lines}{\setcounter{L@lines}{#1}}
\define@key{L}{depth}{\setcounter{L@depth}{#1}}
\define@key{L}{lhang}{\renewcommand*{\L@hang}{#1}}
@@ -165,7 +173,7 @@
\setkeys{L}{#1}%
\sbox{\L@tbox}{\LettrineTextFont{\LettrineSecondString}}%
\ifL@realh
- \def\@tempa{#3}
+ \def\@tempa{#3}%
\ifx\@tempa\@empty
\PackageWarning{lettrine.sty}%
{Empty second argument,\MessageBreak
@@ -195,20 +203,14 @@
\def\KV@prefix{KV@L@}%
\let\@tempc\relax
\expandafter\KV@do\l@LOKeys,\relax,
- \Lettrine@height
- \sbox{\L@lbox}{\LettrineFont #2}%
+ \setupL@lbox
\setlength{\LettrineWidth}{\wd\L@lbox}%
\def\KV@prefix{KV@L@}%
\let\@tempc\relax
\expandafter\KV@do\l@LOKeys,\relax,
\setkeys{L}{#1}%
\fi
- \Lettrine@height
- \ifL@image
- \sbox{\L@lbox}{\LettrineFontEPS{#2}}%
- \else
- \sbox{\L@lbox}{\LettrineFont #2}%
- \fi
+ \setupL@lbox
\setlength{\LettrineWidth}{\wd\L@lbox}%
\setlength{\LettrineHeight}{\ht\L@lbox}%
\setlength{\LettrineDepth}{\dp\L@lbox}%