texlive[67923] Master/texmf-dist: lettrine (14aug23)

commits+karl at tug.org commits+karl at tug.org
Mon Aug 14 22:19:20 CEST 2023


Revision: 67923
          http://tug.org/svn/texlive?view=revision&revision=67923
Author:   karl
Date:     2023-08-14 22:19:20 +0200 (Mon, 14 Aug 2023)
Log Message:
-----------
lettrine (14aug23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-de.pdf
    trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-fr.pdf
    trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-lua.pdf
    trunk/Master/texmf-dist/doc/latex/lettrine/lettrine.pdf
    trunk/Master/texmf-dist/source/latex/lettrine/lettrine.dtx
    trunk/Master/texmf-dist/tex/latex/lettrine/lettrine.sty

Modified: trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-de.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-fr.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-lua.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/lettrine/lettrine.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/lettrine/lettrine.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/lettrine/lettrine.dtx	2023-08-13 23:43:22 UTC (rev 67922)
+++ trunk/Master/texmf-dist/source/latex/lettrine/lettrine.dtx	2023-08-14 20:19:20 UTC (rev 67923)
@@ -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,11 +182,22 @@
 %    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 at image
 \newif\ifL at grid
 \newif\ifL at realh
+\newcommand*{\L at viewport}{}
 %    \end{macrocode}
 %
 % \begin{macro}{\LettrineTestString}
@@ -606,7 +620,7 @@
     image.if          = LettrineImage                   ,
     grid.if           = LettrineOnGrid                  ,
     realheight.if     = LettrineRealHeight              ,
-    refstring.default:n = \l at initial                    ,
+    refstring.default:n = \L at initial                    ,
     refstring.store   = \LettrineTestString             ,
     optionsfile.store = \DefaultOptionsFile
   }
@@ -629,10 +643,11 @@
     slope.code        = \setlength{\L at slope}{#1}         ,
     novskip.code      = \setlength{\L at novskip}{#1}       ,
     image.if          = L at image                          ,
+    viewport.store    = \L at viewport                      ,
     grid.if           = L at grid                           ,
     realheight.if     = L at realh                          ,
-    refstring.default:n = \l at initial                     ,
-    refstring.store   = \l at refstring
+    refstring.default:n = \L at initial                     ,
+    refstring.store   = \L at refstring
  }
 %    \end{macrocode}
 %
@@ -770,10 +785,10 @@
 %    In most cases, the default is a better choice .
 %    \begin{macrocode}
 \def\compute at fontsize{%
-  \ifx\l at refstring\@empty
+  \ifx\L at refstring\@empty
     \def\Lettrine at RefString{\LettrineTestString}%
   \else
-    \def\Lettrine at RefString{\l at refstring}%
+    \def\Lettrine at RefString{\L at refstring}%
   \fi
   \sbox{\@tempboxa}{\LettrineFontHook
                     \fontsize{\L at height}{\L at 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 at height]%
-}
-%    \end{macrocode}
-% \end{macro}
-%
 % \begin{macro}{\setupL at lbox}
 %    The next (internal) command computes the requested size for the
 %    initial (letter or image) and prepares a box |\L at lbox| holding it.
@@ -834,10 +825,17 @@
 \def\setupL at lbox{%
   \computeL at height
   \ifL at image
-    \sbox{\L at lbox}{\LettrineImage{\l at initial}}%
+    \ifx\L at viewport\@empty
+      \sbox{\L at lbox}{\includegraphics[height=\L at height]{\L at initial}}%
+    \else
+      \sbox{\L at lbox}{%
+        \expanded{\noexpand\includegraphics%
+                  [viewport=\L at viewport, height=\L at height]{\L at initial}%
+                 }}%
+    \fi
   \else
     \compute at fontsize
-    \sbox{\L at lbox}{\LettrineFont \l at initial}%
+    \sbox{\L at lbox}{\LettrineFont \L at initial}%
   \fi
 }
 %    \end{macrocode}
@@ -854,18 +852,18 @@
 %
 %    \begin{macrocode}
 \newcommand*{\LettrineOptionsFor}[2]{%
-  \edef\l at tmpa{#1}%
+  \edef\L at tmpa{#1}%
 %    \end{macrocode}
 %    Gobble potential color commands for the initial.
 %    \begin{macrocode}
   \begingroup
-    \def\color##1##{\l at color{##1}}%
-    \let\l at color\@gobbletwo
-    \def\textcolor##1##{\l at textcolor{##1}}%
-    \def\l at textcolor##1##2##3{##3}%
-    \xdef\l at tmpb{\l at initial}%
+    \def\color##1##{\L at color{##1}}%
+    \let\L at color\@gobbletwo
+    \def\textcolor##1##{\L at textcolor{##1}}%
+    \def\L at textcolor##1##2##3{##3}%
+    \xdef\L at tmpb{\L at initial}%
   \endgroup
-  \ifx\l at tmpa\l at tmpb \SetKeys[LettrineLocal]{#2}\fi
+  \ifx\L at tmpa\L at 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 at initial{#2}\let\l at refstring\@empty
+  \def\L at initial{#2}\def\L at refstring{}\def\L at 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 at LOKeys| which will expand to the list of
+%    global  command |\L at LOKeys| which will expand to the list of
 %    options given by |\LettrineOptionsFor| for the current initial
 %    (defined by |#2|)…
 %

Modified: trunk/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lettrine/lettrine.sty	2023-08-13 23:43:22 UTC (rev 67922)
+++ trunk/Master/texmf-dist/tex/latex/lettrine/lettrine.sty	2023-08-14 20:19:20 UTC (rev 67923)
@@ -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 at image
 \newif\ifL at grid
 \newif\ifL at realh
+\newcommand*{\L at 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 at initial                    ,
+    refstring.default:n = \L at initial                    ,
     refstring.store   = \LettrineTestString             ,
     optionsfile.store = \DefaultOptionsFile
   }
@@ -102,10 +103,11 @@
     slope.code        = \setlength{\L at slope}{#1}         ,
     novskip.code      = \setlength{\L at novskip}{#1}       ,
     image.if          = L at image                          ,
+    viewport.store    = \L at viewport                      ,
     grid.if           = L at grid                           ,
     realheight.if     = L at realh                          ,
-    refstring.default:n = \l at initial                     ,
-    refstring.store   = \l at refstring
+    refstring.default:n = \L at initial                     ,
+    refstring.store   = \L at refstring
  }
 \newcommand*{\LettrineTextFont}{\scshape}
 \newcommand*{\LettrineSecondString}{x}
@@ -126,10 +128,10 @@
   \addtolength{\L at height}{\L at oversize\L at target@tht}%
 }
 \def\compute at fontsize{%
-  \ifx\l at refstring\@empty
+  \ifx\L at refstring\@empty
     \def\Lettrine at RefString{\LettrineTestString}%
   \else
-    \def\Lettrine at RefString{\l at refstring}%
+    \def\Lettrine at RefString{\L at refstring}%
   \fi
   \sbox{\@tempboxa}{\LettrineFontHook
                     \fontsize{\L at height}{\L at height}\selectfont
@@ -149,32 +151,36 @@
    \fontsize{\L at factor\L at height}{\L at factor\L at height}%
    \selectfont
 }
-\newcommand*{\LettrineImage}{%
-   \LettrineFontHook\includegraphics[height=\L at height]%
-}
 \def\setupL at lbox{%
   \computeL at height
   \ifL at image
-    \sbox{\L at lbox}{\LettrineImage{\l at initial}}%
+    \ifx\L at viewport\@empty
+      \sbox{\L at lbox}{\includegraphics[height=\L at height]{\L at initial}}%
+    \else
+      \sbox{\L at lbox}{%
+        \expanded{\noexpand\includegraphics%
+                  [viewport=\L at viewport, height=\L at height]{\L at initial}%
+                 }}%
+    \fi
   \else
     \compute at fontsize
-    \sbox{\L at lbox}{\LettrineFont \l at initial}%
+    \sbox{\L at lbox}{\LettrineFont \L at initial}%
   \fi
 }
 \newcommand*{\LettrineOptionsFor}[2]{%
-  \edef\l at tmpa{#1}%
+  \edef\L at tmpa{#1}%
   \begingroup
-    \def\color##1##{\l at color{##1}}%
-    \let\l at color\@gobbletwo
-    \def\textcolor##1##{\l at textcolor{##1}}%
-    \def\l at textcolor##1##2##3{##3}%
-    \xdef\l at tmpb{\l at initial}%
+    \def\color##1##{\L at color{##1}}%
+    \let\L at color\@gobbletwo
+    \def\textcolor##1##{\L at textcolor{##1}}%
+    \def\L at textcolor##1##2##3{##3}%
+    \xdef\L at tmpb{\L at initial}%
   \endgroup
-  \ifx\l at tmpa\l at tmpb \SetKeys[LettrineLocal]{#2}\fi
+  \ifx\L at tmpa\L at tmpb \SetKeys[LettrineLocal]{#2}\fi
   }
 \def\lettrine{\@ifnextchar[\@lettrine{\@lettrine[]}}
 \def\@lettrine[#1]#2#3{%
-  \def\l at initial{#2}\let\l at refstring\@empty
+  \def\L at initial{#2}\def\L at refstring{}\def\L at viewport{}%
   \setcounter{L at lines}{\value{DefaultLines}}%
   \setcounter{L at depth}{\value{DefaultDepth}}%
   \renewcommand*{\L at hang}{\DefaultLhang}%



More information about the tex-live-commits mailing list.