summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-09-01 21:52:57 +0000
committerKarl Berry <karl@freefriends.org>2015-09-01 21:52:57 +0000
commit75091deb3b48945ab52aad64b2a982ed76fc5e0e (patch)
tree0a2cab1dcf599f6d4f17e230cb545b49562b76d8 /Master/texmf-dist/tex/latex/lettrine/lettrine.sty
parent7a522185776d442b4d6576cced53c99d2ab1f6ad (diff)
lettrine (1sep15)
git-svn-id: svn://tug.org/texlive/trunk@38268 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.sty107
1 files changed, 64 insertions, 43 deletions
diff --git a/Master/texmf-dist/tex/latex/lettrine/lettrine.sty b/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
index 3f753a0119a..281acaf0755 100644
--- a/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
+++ b/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
@@ -22,7 +22,7 @@
%% in the same archive or directory.)
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesFile{lettrine.sty}
- [2015/02/16 v1.8 (Daniel Flipo)]
+ [2015/08/31 v1.9 (Daniel Flipo)]
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\RequirePackage{keyval}
\newcounter{DefaultLines}
@@ -42,6 +42,7 @@
\setlength{\DiscardVskip}{0.2\p@}
\newif\ifLettrineImage
\newif\ifLettrineOnGrid
+\newif\ifLettrineRealHeight
\newsavebox{\L@lbox}
\newsavebox{\L@tbox}
\newcounter{L@lines}
@@ -62,23 +63,28 @@
\newcommand*{\L@ante}{}
\newif\ifL@image
\newif\ifL@grid
+\newif\ifL@realh
\newcommand*{\LettrineTextFont}{\scshape}
\def\Lettrine@height{%
\@tempdima=\baselineskip
- \setlength{\L@height}{\theL@lines\@tempdima}%
- \ifnum\theL@lines>1
+ \setlength{\L@height}{\value{L@lines}\@tempdima}%
+ \ifnum\value{L@lines}>1
\addtolength{\L@height}{-\@tempdima}%
\fi
- \sbox{\L@tbox}{\LettrineTextFont x}%
+ \ifvoid\L@tbox
+ \sbox{\L@tbox}{\LettrineTextFont{\LettrineSecondString}}%
+ \fi
\addtolength{\L@height}{\ht\L@tbox}%
- \addtolength{\L@height}{\L@oversize\L@height}}
+ \addtolength{\L@height}{\L@oversize\L@height}%
+}
\newcommand*{\LettrineFontHook}{}
\newcommand*{\LettrineTestString}{ABCDEFGHIJKLMNOQPRSTUVWXYZ}
+\newcommand*{\LettrineSecondString}{x}
\newcommand*{\LettrineFont}{%
\Lettrine@height
- \sbox{\L@tbox}{\LettrineFontHook\fontsize{\L@height}{\L@height}%
- \selectfont \LettrineTestString}%
- \@tempcntb=\ht\L@tbox
+ \sbox{\@tempboxa}{\LettrineFontHook\fontsize{\L@height}{\L@height}%
+ \selectfont \LettrineTestString}%
+ \@tempcntb=\ht\@tempboxa
\@tempcnta=\L@height
\multiply\@tempcnta by 100
\divide\@tempcntb by 100
@@ -95,7 +101,8 @@
}
\newcommand*{\LettrineFontEPS}{%
\Lettrine@height\LettrineFontHook
- \includegraphics[height=\L@height]}
+ \includegraphics[height=\L@height]%
+}
\define@key{L}{lines}{\setcounter{L@lines}{#1}}
\define@key{L}{depth}{\setcounter{L@depth}{#1}}
\define@key{L}{lhang}{\renewcommand*{\L@hang}{#1}}
@@ -107,6 +114,7 @@
\define@key{L}{slope}{\setlength{\L@slope}{#1}}
\define@key{L}{image}[true]{\csname L@image#1\endcsname}
\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}}
\newcommand*{\LettrineOptionsFor}[2]{\@namedef{l@#1-keys}{#2}}
\newdimen\LettrineWidth
@@ -114,8 +122,8 @@
\newdimen\LettrineDepth
\def\lettrine{\@ifnextchar[\@lettrine{\@lettrine[]}}
\def\@lettrine[#1]#2#3{%
- \setcounter{L@lines}{\theDefaultLines}%
- \setcounter{L@depth}{\theDefaultDepth}%
+ \setcounter{L@lines}{\value{DefaultLines}}%
+ \setcounter{L@depth}{\value{DefaultDepth}}%
\renewcommand*{\L@hang}{\DefaultLhang}%
\renewcommand*{\L@oversize}{\DefaultLoversize}%
\renewcommand*{\L@raise}{\DefaultLraise}%
@@ -126,6 +134,19 @@
\setlength{\L@novskip}{\DiscardVskip}%
\ifLettrineImage\L@imagetrue\else\L@imagefalse\fi
\ifLettrineOnGrid\L@gridtrue\else\L@gridfalse\fi
+ \ifLettrineRealHeight\L@realhtrue\else\L@realhfalse\fi
+ \setkeys{L}{#1}%
+ \sbox{\L@tbox}{\LettrineTextFont{\LettrineSecondString}}%
+ \ifL@realh
+ \def\@tempa{#3}
+ \ifx\@tempa\@empty
+ \PackageWarning{lettrine.sty}%
+ {Empty second argument,\MessageBreak
+ ignoring option `realheight';}%
+ \else
+ \sbox{\L@tbox}{\LettrineTextFont{#3}}%
+ \fi
+ \fi
\if\DefaultOptionsFile\relax
\else
\begingroup
@@ -152,46 +173,46 @@
\def\KV@prefix{KV@L@}%
\let\@tempc\relax
\expandafter\KV@do\l@LOKeys,\relax,
+ \setkeys{L}{#1}%
\fi
- \setkeys{L}{#1}%
\ifL@image
\sbox{\L@lbox}{\LettrineFontEPS{#2}}%
\else
\sbox{\L@lbox}{\LettrineFont #2}%
\fi
\sbox{\L@tbox}{\LettrineTextFont{#3}}%
- \@tempdima=\baselineskip
- \ifnum\theL@lines=1
- \setlength{\L@first}{\ht\L@lbox}%
- \addtolength{\L@first}{-\ht\L@tbox}%
- \setlength{\L@lraise}{\z@}%
- \else
- \setlength{\L@first}{-\theL@lines\@tempdima}%
- \addtolength{\L@first}{\@tempdima}%
- \sbox{\@tempboxa}{\LettrineTextFont x}%
- \addtolength{\L@first}{-\ht\@tempboxa}%
- \setlength{\L@lraise}{-\L@raise\L@first}%
- \addtolength{\L@first}{\L@lraise}%
- \addtolength{\L@first}{\ht\L@lbox}%
- \addtolength{\L@lraise}{-\theL@lines\@tempdima}%
- \addtolength{\L@lraise}{\@tempdima}%
- \fi
- \par
- \ifdim\L@first>\L@novskip
- \ifL@grid
- \@tempdima=\baselineskip
- \@tempdimb=\@tempdima
- \advance\@tempdimb by \L@novskip
- \@tempcnta=1
- \loop\ifdim\L@first>\@tempdimb
+ \@tempdima=\baselineskip
+ \ifnum\value{L@lines}=1
+ \setlength{\L@first}{\ht\L@lbox}%
+ \addtolength{\L@first}{-\ht\L@tbox}%
+ \setlength{\L@lraise}{\z@}%
+ \else
+ \setlength{\L@first}{-\value{L@lines}\@tempdima}%
+ \addtolength{\L@first}{\@tempdima}%
+ \sbox{\@tempboxa}{\LettrineTextFont x}%
+ \addtolength{\L@first}{-\ht\@tempboxa}%
+ \setlength{\L@lraise}{-\L@raise\L@first}%
+ \addtolength{\L@first}{\L@lraise}%
+ \addtolength{\L@first}{\ht\L@lbox}%
+ \addtolength{\L@lraise}{-\value{L@lines}\@tempdima}%
+ \addtolength{\L@lraise}{\@tempdima}%
+ \fi
+ \par
+ \ifdim\L@first>\L@novskip
+ \ifL@grid
+ \@tempdima=\baselineskip
+ \@tempdimb=\@tempdima
+ \advance\@tempdimb by \L@novskip
+ \@tempcnta=1
+ \loop\ifdim\L@first>\@tempdimb
\advance\@tempcnta by 1
\advance\L@first by -\@tempdima
- \repeat
- \vskip\@tempcnta\baselineskip
- \else
- \vskip\L@first
- \fi
- \fi
+ \repeat
+ \vskip\@tempcnta\baselineskip
+ \else
+ \vskip\L@first
+ \fi
+ \fi
\setlength{\L@Pindent}{\wd\L@lbox}%
\addtolength{\L@Pindent}{-\L@hang\wd\L@lbox}%
\settowidth{\L@first}{\L@ante}%
@@ -208,7 +229,7 @@
\setlength{\LettrineHeight}{\ht\L@lbox}%
\setlength{\LettrineDepth}{\dp\L@lbox}%
\addtocounter{L@lines}{1}%
- \addtocounter{L@lines}{\the\c@L@depth}%
+ \addtocounter{L@lines}{\value{L@depth}}%
\def\L@parshape{\c@L@lines \the\L@Pindent \the\L@first}%
\@tempcnta=\tw@
\@whilenum \@tempcnta<\c@L@lines\do{%