summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-08-14 20:19:20 +0000
committerKarl Berry <karl@freefriends.org>2023-08-14 20:19:20 +0000
commitcf0f4703f236165d8b7599b3ba0debdeb589c5fc (patch)
tree5ff14447ef64c7895d83500b3dfaeae6d0b72c59 /Master/texmf-dist/tex/latex/lettrine/lettrine.sty
parent0f0b8c4ce549cf8684b36a17bc2919102509bab1 (diff)
lettrine (14aug23)
git-svn-id: svn://tug.org/texlive/trunk@67923 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.sty44
1 files changed, 25 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/latex/lettrine/lettrine.sty b/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
index fe93771c47b..8cc81e30bab 100644
--- a/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
+++ b/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
@@ -11,7 +11,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesFile{lettrine.sty}
- [2023-07-04 v2.51 (Daniel Flipo)]
+ [2023-08-14 v2.52 (Daniel Flipo)]
\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}
@@ -66,6 +66,7 @@
\newif\ifL@image
\newif\ifL@grid
\newif\ifL@realh
+\newcommand*{\L@viewport}{}
\newcommand*{\LettrineTestString}{EFTZ}
\InputIfFileExists{lettrine.cfg}
{\typeout{Loading lettrine.cfg}}
@@ -84,7 +85,7 @@
image.if = LettrineImage ,
grid.if = LettrineOnGrid ,
realheight.if = LettrineRealHeight ,
- refstring.default:n = \l@initial ,
+ refstring.default:n = \L@initial ,
refstring.store = \LettrineTestString ,
optionsfile.store = \DefaultOptionsFile
}
@@ -102,10 +103,11 @@
slope.code = \setlength{\L@slope}{#1} ,
novskip.code = \setlength{\L@novskip}{#1} ,
image.if = L@image ,
+ viewport.store = \L@viewport ,
grid.if = L@grid ,
realheight.if = L@realh ,
- refstring.default:n = \l@initial ,
- refstring.store = \l@refstring
+ refstring.default:n = \L@initial ,
+ refstring.store = \L@refstring
}
\newcommand*{\LettrineTextFont}{\scshape}
\newcommand*{\LettrineSecondString}{x}
@@ -126,10 +128,10 @@
\addtolength{\L@height}{\L@oversize\L@target@tht}%
}
\def\compute@fontsize{%
- \ifx\l@refstring\@empty
+ \ifx\L@refstring\@empty
\def\Lettrine@RefString{\LettrineTestString}%
\else
- \def\Lettrine@RefString{\l@refstring}%
+ \def\Lettrine@RefString{\L@refstring}%
\fi
\sbox{\@tempboxa}{\LettrineFontHook
\fontsize{\L@height}{\L@height}\selectfont
@@ -149,32 +151,36 @@
\fontsize{\L@factor\L@height}{\L@factor\L@height}%
\selectfont
}
-\newcommand*{\LettrineImage}{%
- \LettrineFontHook\includegraphics[height=\L@height]%
-}
\def\setupL@lbox{%
\computeL@height
\ifL@image
- \sbox{\L@lbox}{\LettrineImage{\l@initial}}%
+ \ifx\L@viewport\@empty
+ \sbox{\L@lbox}{\includegraphics[height=\L@height]{\L@initial}}%
+ \else
+ \sbox{\L@lbox}{%
+ \expanded{\noexpand\includegraphics%
+ [viewport=\L@viewport, height=\L@height]{\L@initial}%
+ }}%
+ \fi
\else
\compute@fontsize
- \sbox{\L@lbox}{\LettrineFont \l@initial}%
+ \sbox{\L@lbox}{\LettrineFont \L@initial}%
\fi
}
\newcommand*{\LettrineOptionsFor}[2]{%
- \edef\l@tmpa{#1}%
+ \edef\L@tmpa{#1}%
\begingroup
- \def\color##1##{\l@color{##1}}%
- \let\l@color\@gobbletwo
- \def\textcolor##1##{\l@textcolor{##1}}%
- \def\l@textcolor##1##2##3{##3}%
- \xdef\l@tmpb{\l@initial}%
+ \def\color##1##{\L@color{##1}}%
+ \let\L@color\@gobbletwo
+ \def\textcolor##1##{\L@textcolor{##1}}%
+ \def\L@textcolor##1##2##3{##3}%
+ \xdef\L@tmpb{\L@initial}%
\endgroup
- \ifx\l@tmpa\l@tmpb \SetKeys[LettrineLocal]{#2}\fi
+ \ifx\L@tmpa\L@tmpb \SetKeys[LettrineLocal]{#2}\fi
}
\def\lettrine{\@ifnextchar[\@lettrine{\@lettrine[]}}
\def\@lettrine[#1]#2#3{%
- \def\l@initial{#2}\let\l@refstring\@empty
+ \def\L@initial{#2}\def\L@refstring{}\def\L@viewport{}%
\setcounter{L@lines}{\value{DefaultLines}}%
\setcounter{L@depth}{\value{DefaultDepth}}%
\renewcommand*{\L@hang}{\DefaultLhang}%