diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/lettrine/lettrine.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/lettrine/lettrine.sty | 75 |
1 files changed, 43 insertions, 32 deletions
diff --git a/Master/texmf-dist/tex/latex/lettrine/lettrine.sty b/Master/texmf-dist/tex/latex/lettrine/lettrine.sty index 281acaf0755..567b7fcaf16 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/08/31 v1.9 (Daniel Flipo)] + [2018/07/21 v2.0 (Daniel Flipo)] \NeedsTeXFormat{LaTeX2e}[1999/12/01] \RequirePackage{keyval} \newcounter{DefaultLines} @@ -56,6 +56,12 @@ \newdimen\L@slope \newdimen\L@height \newdimen\L@novskip +\newdimen\L@target@ht +\newdimen\L@target@dp +\newdimen\L@target@tht +\newdimen\LettrineWidth +\newdimen\LettrineHeight +\newdimen\LettrineDepth \newcommand*{\L@file}{} \newcommand*{\L@hang}{} \newcommand*{\L@oversize}{} @@ -66,19 +72,25 @@ \newif\ifL@realh \newcommand*{\LettrineTextFont}{\scshape} \def\Lettrine@height{% - \@tempdima=\baselineskip - \setlength{\L@height}{\value{L@lines}\@tempdima}% - \ifnum\value{L@lines}>1 - \addtolength{\L@height}{-\@tempdima}% - \fi \ifvoid\L@tbox \sbox{\L@tbox}{\LettrineTextFont{\LettrineSecondString}}% \fi - \addtolength{\L@height}{\ht\L@tbox}% - \addtolength{\L@height}{\L@oversize\L@height}% + \global\setlength{\L@target@ht}{\ht\L@tbox}% + \@tempdima=\baselineskip + \global\setlength{\L@target@dp}{\value{L@lines}\@tempdima}% + \ifnum\value{L@lines}>1 + \global\addtolength{\L@target@dp}{-\@tempdima}% + \else + \global\addtolength{\L@target@ht}{\L@target@dp}% + \global\setlength{\L@target@dp}{0pt}% + \fi + \global\setlength{\L@target@tht}{\L@target@ht}% + \global\addtolength{\L@target@tht}{\L@target@dp}% + \setlength{\L@height}{\L@target@tht}% + \addtolength{\L@height}{\L@oversize\L@target@tht}% } \newcommand*{\LettrineFontHook}{} -\newcommand*{\LettrineTestString}{ABCDEFGHIJKLMNOQPRSTUVWXYZ} +\newcommand*{\LettrineTestString}{EFTZ} \newcommand*{\LettrineSecondString}{x} \newcommand*{\LettrineFont}{% \Lettrine@height @@ -86,8 +98,8 @@ \selectfont \LettrineTestString}% \@tempcntb=\ht\@tempboxa \@tempcnta=\L@height - \multiply\@tempcnta by 100 - \divide\@tempcntb by 100 + \multiply\@tempcnta by 50 + \divide\@tempcntb by 200 \divide\@tempcnta by \@tempcntb \advance\@tempcnta by -9999 \ifnum\@tempcnta>0 @@ -117,9 +129,6 @@ \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 -\newdimen\LettrineHeight -\newdimen\LettrineDepth \def\lettrine{\@ifnextchar[\@lettrine{\@lettrine[]}} \def\@lettrine[#1]#2#3{% \setcounter{L@lines}{\value{DefaultLines}}% @@ -180,22 +189,28 @@ \else \sbox{\L@lbox}{\LettrineFont #2}% \fi + \setlength{\LettrineWidth}{\wd\L@lbox}% + \setlength{\LettrineHeight}{\ht\L@lbox}% + \setlength{\LettrineDepth}{\dp\L@lbox}% + \begingroup + \def\IeC##1{##1}% + \@tempdima=\L@oversize pt\relax + \PackageInfo{lettrine.sty}% + {Targeted height = \the\L@target@tht\MessageBreak + (no accent, loversize=0),\MessageBreak + Lettrine height = \the\LettrineHeight\space (#2)% + \ifdim\@tempdima=\z@\else\space loversize=\L@oversize\fi;% + \MessageBreak reported}% + \endgroup \sbox{\L@tbox}{\LettrineTextFont{#3}}% - \@tempdima=\baselineskip + \setlength{\L@first}{\LettrineHeight}% + \setlength{\L@lraise}{\L@raise\L@target@tht}% + \addtolength{\L@first}{\L@lraise}% \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}% + \addtolength{\L@first}{-\L@target@tht}% + \addtolength{\L@lraise}{-\L@target@dp}% \fi \par \ifdim\L@first>\L@novskip @@ -208,10 +223,9 @@ \advance\@tempcnta by 1 \advance\L@first by -\@tempdima \repeat - \vskip\@tempcnta\baselineskip - \else - \vskip\L@first + \L@first=\@tempcnta\baselineskip \fi + \vskip\L@first \fi \setlength{\L@Pindent}{\wd\L@lbox}% \addtolength{\L@Pindent}{-\L@hang\wd\L@lbox}% @@ -225,9 +239,6 @@ \addtolength{\L@next}{-\L@Nindent}% \addtolength{\L@Pindent}{\rightmargin}% \addtolength{\L@Nindent}{\rightmargin}% - \setlength{\LettrineWidth}{\wd\L@lbox}% - \setlength{\LettrineHeight}{\ht\L@lbox}% - \setlength{\LettrineDepth}{\dp\L@lbox}% \addtocounter{L@lines}{1}% \addtocounter{L@lines}{\value{L@depth}}% \def\L@parshape{\c@L@lines \the\L@Pindent \the\L@first}% |