diff options
author | Karl Berry <karl@freefriends.org> | 2023-08-14 20:19:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-08-14 20:19:20 +0000 |
commit | cf0f4703f236165d8b7599b3ba0debdeb589c5fc (patch) | |
tree | 5ff14447ef64c7895d83500b3dfaeae6d0b72c59 | |
parent | 0f0b8c4ce549cf8684b36a17bc2919102509bab1 (diff) |
lettrine (14aug23)
git-svn-id: svn://tug.org/texlive/trunk@67923 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/lettrine/lettrine-demo-de.pdf | bin | 128252 -> 128252 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/lettrine/lettrine-demo-fr.pdf | bin | 168279 -> 168279 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/lettrine/lettrine-demo-lua.pdf | bin | 74185 -> 74185 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/lettrine/lettrine.pdf | bin | 125776 -> 126080 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/lettrine/lettrine.dtx | 98 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/lettrine/lettrine.sty | 44 |
6 files changed, 73 insertions, 69 deletions
diff --git a/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-de.pdf b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-de.pdf Binary files differindex 4b3ff4d6e17..84ba7a43446 100644 --- a/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-de.pdf +++ b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-de.pdf diff --git a/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-fr.pdf b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-fr.pdf Binary files differindex c616adba039..a780c1c0a6e 100644 --- a/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-fr.pdf +++ b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-fr.pdf diff --git a/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-lua.pdf b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-lua.pdf Binary files differindex cc433b0fabc..a88972db814 100644 --- a/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-lua.pdf +++ b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-lua.pdf diff --git a/Master/texmf-dist/doc/latex/lettrine/lettrine.pdf b/Master/texmf-dist/doc/latex/lettrine/lettrine.pdf Binary files differindex ad1c4ac4c0f..0fde23f12d2 100644 --- a/Master/texmf-dist/doc/latex/lettrine/lettrine.pdf +++ b/Master/texmf-dist/doc/latex/lettrine/lettrine.pdf diff --git a/Master/texmf-dist/source/latex/lettrine/lettrine.dtx b/Master/texmf-dist/source/latex/lettrine/lettrine.dtx index 3c1a1917805..4f17f5f6b6b 100644 --- a/Master/texmf-dist/source/latex/lettrine/lettrine.dtx +++ b/Master/texmf-dist/source/latex/lettrine/lettrine.dtx @@ -106,7 +106,7 @@ \ProvidesFile{lettrine.dtx} %</dtx> %<*sty|dtx> - [2023-07-04 v2.51 (Daniel Flipo)] + [2023-08-14 v2.52 (Daniel Flipo)] %</sty|dtx> % \fi % @@ -182,10 +182,21 @@ % this requires the |graphicx| package to be loaded in the preamble. % |\lettrine[image=true]{A}{n exemple}|\quad or just\\ % |\lettrine[image]{A}{n exemple}|\\ -% will load |A.eps|, |A.jpg|, |A.png| or |A.pdf| instead of letter~A.\\ -% N.B.: Redefining |\LettrineFont| as |\LettrineFontEPS| is no longer -% supported and |\LettrineFontEPS| has been renamed as -% |\LettrineImage|. +% will load |A.eps|, |A.jpg|, |A.png| or |A.pdf| instead of letter~A. +% +% \changes{v2.52}{2023/08/14}{New option`viewport’ to be passed to +% \cs{includegraphics}.} +% +% \item \lopt{viewport=}\meta{llx lly urx ury} is passed to +% |\includegraphics| (same four dimen parameters); when present, +% |\lettrine| only considers the contents of the rectangle defined by +% its lower left and upper right corners to compute the size of the +% final image. It’s up to the user to deal with the rest of the +% image… f.i.\ providing a |\vspace*{...}| in case a significant part +% sticks out on top of the defined rectangle. This option may be +% useful in some special cases, see +% \url{https://tex.stackexchange.com/questions/693270/} or when the +% image’s bounding box is inaccurate. % % \changes{v1.8}{2015/02/06}{Added two keyval options: % `grid’ (true/false) and `novskip’ to override \cs{DiscardVskip}.} @@ -276,8 +287,9 @@ % specified as options passed to the \pkg{lettrine} \emph{package}. % These options are the same as those of the |\lettrine| command % previously described% -% \footnote{With the exception of \lopt{ante} which doesn’t make -% sense for a global usage.}: f.i. |\usepackage[lines=3]{lettrine}| +% \footnote{With the exception of \lopt{ante} and \lopt{viewport} +% which do not make sense for a global usage.}: +% f.i.\ |\usepackage[lines=3]{lettrine}| % will set the default to three lines of text. % Options passed to the \pkg{lettrine} package override the defaults % set in the \file{lettrine.cfg} file (see below) and will be @@ -333,7 +345,7 @@ % % 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), +% low-level font interface (see LaTeX Companion III, section~I-9.3), % the |\selectfont| command is issued by |\LettrineFont|:\\ % |\renewcommand{\LettrineFontHook}{\fontfamily{ppl}|\ignorespaces % |\fontseries{bx}%|\\ @@ -354,7 +366,7 @@ % mention the cm-super fonts and the type1ec package by % Vladimir Volovich.} % -% \vspace{\baselineskip} +% \vspace{.5\baselineskip} % \textbf{Important notice:} % the sizing works fine with \emph{fully scalable} fonts (like the % standard PostScript or OpenType fonts), but might not work well @@ -386,7 +398,7 @@ % (Palatino, Times, Utopia…), or any OpenType font, they are % fully scalable too! % -% \newpage +% \vspace{.5\baselineskip} % \textbf{Breaking change in version~2.50:} in order to improve the % alignment of side by side parboxes starting with a dropped cap, the % internals of the |\lettrine{}| command have changed. Formerly, the @@ -404,6 +416,7 @@ % for an example. Using the rollback mechanism to switch back to % version~2.40 is another option: |\usepackage{lettrine}[=v2.4]|. % +% \vspace{.5\baselineskip} % \textbf{Known issues:} % \begin{itemize} % \item Nothing is done to prevent page-breaking in a paragraph @@ -552,6 +565,7 @@ \newif\ifL@image \newif\ifL@grid \newif\ifL@realh +\newcommand*{\L@viewport}{} % \end{macrocode} % % \begin{macro}{\LettrineTestString} @@ -606,7 +620,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 } @@ -629,10 +643,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 } % \end{macrocode} % @@ -770,10 +785,10 @@ % In most cases, the default is a better choice . % \begin{macrocode} \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 @@ -803,30 +818,6 @@ % \end{macrocode} % \end{macro} % -% \changes{v0.9}{1998/03/13}{\cs{LettrineFontEPS} added.} -% -% \changes{v2.21}{2018/08/28}{\cs{LettrineFontEPS} renamed as -% \cs{LettrineImage}.} -% -% \begin{macro}{\LettrineImage} -% The following definition is for use with dropped capitals defined -% as images: EPS, PDF, JPG, PNG files (see examples in -% lettrine-demo-fr.tex). -% Its requires the |graphicx| package to be loaded in the -% preamble with |\usepackage{graphicx}|. The image’s height is -% computed just as in the standard case and passed to -% |\includegraphics|. -% -% \changes{v1.6}{2004/05/22}{Added \cs{LettrineFontHook} -% to \cs{LettrineFontEPS}. This is needed for color options.} -% -% \begin{macrocode} -\newcommand*{\LettrineImage}{% - \LettrineFontHook\includegraphics[height=\L@height]% -} -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\setupL@lbox} % The next (internal) command computes the requested size for the % initial (letter or image) and prepares a box |\L@lbox| holding it. @@ -834,10 +825,17 @@ \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 } % \end{macrocode} @@ -854,18 +852,18 @@ % % \begin{macrocode} \newcommand*{\LettrineOptionsFor}[2]{% - \edef\l@tmpa{#1}% + \edef\L@tmpa{#1}% % \end{macrocode} % Gobble potential color commands for the initial. % \begin{macrocode} \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 } % \end{macrocode} % \end{macro} @@ -876,7 +874,7 @@ % \begin{macrocode} \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{}% % \end{macrocode} % % \changes{v1.9}{2015/08/31}{\cs{theDefaultLines} changed to @@ -930,7 +928,7 @@ % config file \cs{DefaultOptionsFile}.} % 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 +% global command |\L@LOKeys| which will expand to the list of % options given by |\LettrineOptionsFor| for the current initial % (defined by |#2|)… % 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}% |