texlive[69508] Master/texmf-dist: lettrine (20jan24)
commits+karl at tug.org
commits+karl at tug.org
Sat Jan 20 22:08:05 CET 2024
Revision: 69508
https://tug.org/svn/texlive?view=revision&revision=69508
Author: karl
Date: 2024-01-20 22:08:05 +0100 (Sat, 20 Jan 2024)
Log Message:
-----------
lettrine (20jan24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/lettrine/README.md
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.cfg
trunk/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.pdf
trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.tex
trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-xetex-bidi.def
Modified: trunk/Master/texmf-dist/doc/latex/lettrine/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lettrine/README.md 2024-01-20 21:07:17 UTC (rev 69507)
+++ trunk/Master/texmf-dist/doc/latex/lettrine/README.md 2024-01-20 21:08:05 UTC (rev 69508)
@@ -33,7 +33,7 @@
to install it by yourself
1. run luatex on lettrine.dtx to strip the comments and create
lettrine.sty and lettrine.cfg;
-2. run lualatex on lettrine.dtx to get the documentation (lettrine.pdf).
+2. move all the files to the `right' place:
Files lettrine.sty, lettrine.cfg, lettrine-*.sty and *.cfl go to to
a directory searched by TeX, typically $TEXMF/tex/latex/lettrine.
@@ -41,7 +41,7 @@
Files README, lettrine-demo*, lettrine.pdf go to a doc directory,
typically $TEXMF/doc/latex/lettrine.
-Files lettrine.dtx goes to a source directory, typically
+Files lettrine.dtx goes to a source directory, typically
$TEXMF/source/latex/lettrine
Changes
@@ -50,5 +50,5 @@
See the included manual lettrine.pdf, section "Change History".
--
-Copyright 1999--2023 Daniel Flipo
+Copyright 1999--2024 Daniel Flipo
E-mail: daniel (dot) flipo (at) free (dot) fr
Added: trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.pdf 2024-01-20 21:07:17 UTC (rev 69507)
+++ trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.pdf 2024-01-20 21:08:05 UTC (rev 69508)
Property changes on: trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.tex 2024-01-20 21:08:05 UTC (rev 69508)
@@ -0,0 +1,38 @@
+%%% This example is adapted from
+%%% https://tex.stackexchange.com/questions/152184/lettrine-and-arabic-script/
+%%%
+%%% This file can be compiled either with LuaLaTeX or XeLaTeX.
+%%% The syntax for loading babel slightly differs between Lua- and Xe-LaTeX.
+%%% Compiling this file with XeLaTeX works within this directory which holds
+%%% a specific version of "lettrine-xetex-bidi.def", or requires to
+%%% remove the official file "lettrine-xetex-bidi.def" (v0.8).
+
+\documentclass{article}
+\usepackage{iftex}
+\usepackage{fontspec}
+\setmainfont{FreeSerif}
+\usepackage{lettrine}
+\renewcommand{\LettrineTextFont}{\upshape} % No small caps
+\renewcommand{\LettrineTestString}{۱} % No Latin letter
+\renewcommand{\LettrineSecondString}{هد} % No Latin letter
+\ifluatex
+ \usepackage[bidi=basic]{babel}
+ \babelprovide[import, main]{persian}
+\fi
+\ifxetex
+ \usepackage[bidi=bidi-r]{babel}
+ \babelprovide[import, main]{persian}
+\fi
+\begin{document}
+\lettrine[lines=3]{۱}{} تقدیم به عالیجناب تئوفیلوس:\\
+تا به حال نویسندگان بسیاری به نوشتن شرح وقایعی كه در بین ما رخ داده است، اقدام کردهاند
+تا به حال نویسندگان بسیاری به نوشتن شرح وقایعی كه در بین ما رخ داده است، اقدام کردهاند
+تا به حال نویسندگان بسیاری به نوشتن شرح وقایعی كه در بین ما رخ داده است، اقدام کردهاند
+\end{document}
+
+%%% Local Variables:
+%%% coding: utf-8-unix
+%%% mode: latex
+%%% TeX-master: t
+%%% TeX-engine: luatex
+%%% End:
Property changes on: trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
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)
Added: trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-xetex-bidi.def
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-xetex-bidi.def (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-xetex-bidi.def 2024-01-20 21:08:05 UTC (rev 69508)
@@ -0,0 +1,12 @@
+%%
+%% This is file `lettrine-xetex-bidi.def', by Daniel Flipo,
+%% as a replacement for Vafa Khalighi's original (outdated) file.
+%%
+\ProvidesFile{lettrine-xetex-bidi.def}%
+ [2024/01/20 v1.0 bidi adaptations for lettrine package for XeTeX engine]
+\IfPackageAtLeastTF{lettrine}{2024-01-20}{}%
+{\PackageWarning{bidi}{Please upgrade your lettrine package\MessageBreak
+ to version 2.60 or higher}}
+\endinput
+%%
+%% End of file `lettrine-xetex-bidi.def'.
Property changes on: trunk/Master/texmf-dist/doc/latex/lettrine/lettrine-xetex-bidi.def
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
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 2024-01-20 21:07:17 UTC (rev 69507)
+++ trunk/Master/texmf-dist/source/latex/lettrine/lettrine.dtx 2024-01-20 21:08:05 UTC (rev 69508)
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright © 1999-2023 Daniel Flipo.
+% Copyright © 1999-2024 Daniel Flipo.
%
% This program can be distributed and/or modified under the terms
% of the LaTeX Project Public License either version 1.3c of this
@@ -47,7 +47,8 @@
\setmainfont{erewhon}
\setsansfont{Cabin}[Scale=MatchLowercase]
\setmonofont{Inconsolatazi4}[Scale=MatchLowercase, Color=Sepia,
- HyphenChar=None,StylisticSet={2,3}]
+ HyphenChar=None,StylisticSet={2,3},
+ ]
\setmathfont{Erewhon-Math.otf}
\usepackage{fourier-orns}
\usepackage[expansion=true,protrusion=true]{microtype}
@@ -97,7 +98,7 @@
%
%<*sty>
%% IMPORTANT NOTICE:
-%% For the copyright see the source file `lua-typo.dtx’.
+%% For the copyright see the source file `lettrine.dtx’.
%%
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesFile{lettrine.sty}
@@ -106,7 +107,7 @@
\ProvidesFile{lettrine.dtx}
%</dtx>
%<*sty|dtx>
- [2023-08-14 v2.52 (Daniel Flipo)]
+ [2024-01-20 v2.60 (Daniel Flipo)]
%</sty|dtx>
% \fi
%
@@ -178,7 +179,7 @@
%
% \item \lopt{image[=true]} will force |\lettrine| to replace the letter
% normally used as dropped capital by an image in eps format (latex)
-% or in pdf, jpg, etc.\ format (pdflatex, xelatex, lualatex);
+% or in pdf, jpg, png, etc.\ format (pdflatex, xelatex, lualatex);
% 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}|\\
@@ -190,13 +191,15 @@
% \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.
+% its lower left and upper right corners to compute the scaling
+% ratio (which will apply to the whole image). It’s up to the user to
+% ensure that the rest of the image will not overwrite the
+% surrounding text, f.i.\ providing a |\vspace*{...}| in case
+% a significant part sticks out on top of the defined rectangle.
+% This option may be useful in case the letter covers only a limited
+% part of the image,
+% see \url{https://tex.stackexchange.com/questions/693270/} for an
+% example, 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}.}
@@ -310,7 +313,11 @@
% \item |\setlength{\DiscardVskip}{1pt}|,
% \item |\LettrineImagefalse|,
% \item |\LettrineOnGridfalse|,
-% \item |\LettrineRealHeightfalse|.
+% \item |\LettrineRealHeightfalse|,
+% \item |\renewcommand*{\LettrineTextFont}{\scshape}|,
+% \item |\renewcommand*{\LettrineTestString}{EFTZ}|,
+% \item |\renewcommand*{\LettrineSecondString}{x}|,
+% \item |\renewcommand{\DefaultOptionsFile}{optfile.cfl}|.
% \end{itemize}
%
% Instead of giving optional parameters to the |\lettrine| command,
@@ -334,6 +341,14 @@
% |\newcommand{\LettrineTextFont}{\scshape}| (second argument in
% small caps), this can be changed using |\renewcommand|.
%
+% |\LettrineTestString| and |\LettrineSecondString| provide
+% reasonable defaults for Latin scripts (|EFTZ| and |x|).
+% For other scripts they \emph{should be changed} respectively to
+% uppercase and lowercase letters of the given script, as the
+% dropped cap’s height computation is based on these strings;
+% another possibility is to use the previously described
+% \lopt{refstring} and \lopt{realheight} options.
+%
% |\LettrineFont| \emph{is not customisable} see |\LettrineFontHook|
% below, it sets the font used for the dropped capital, usually the
% current font in a (large) size, computed automatically from the
@@ -417,6 +432,17 @@
% version~2.40 is another option: |\usepackage{lettrine}[=v2.4]|.
%
% \vspace{.5\baselineskip}
+% \textbf{New in version~2.60:} the |\lettrine| command is now
+% compatible with right to left typesetting, with LuaLaTeX and
+% XeLaTeX (+\pkg{babel} or \pkg{polyglossia}). With XeLaTeX, file
+% \file{lettrine-xetex-bidi.def} (v0.8 [2022/11/06]) is automatically
+% loaded by the \pkg{bidi} package; it redefines the |\@lettrine|
+% command based on version~2.30 of \pkg{lettrine}. This code is
+% \emph{incompatible} with versions~2.50 and newer, you can safely
+% remove \file{lettrine-xetex-bidi.def} when installing v2.60 of
+% \pkg{lettrine}.
+
+% \vspace{.5\baselineskip}
% \textbf{Known issues:}
% \begin{itemize}
% \item Nothing is done to prevent page-breaking in a paragraph
@@ -426,6 +452,13 @@
% environments but does not work within `center’ environments
% except with option \texttt{[lines=1]}.
% \item |\lettrine| does not work within lists.
+% \item The LaTeX |\raggedright| command doesn’t work well with the
+% TeX |\parshape| command used internally by |\lettrine|.
+% Please use the |\RaggedRight| command from the \pkg{ragged2e}
+% package together with appropriate settings, f.i. \\
+% |\setlength{\RaggedRightRightskip}{0pt plus .1\hsize}|. \\
+% See \url{https://tex.stackexchange.com/questions/97808/} for
+% details.
% \item If a \emph{list} has to be included in a paragraph starting
% with |\lettrine|, it is necessary to add the command
% |\parshape=0| just after the end of the list (starting a new
@@ -481,7 +514,7 @@
\DeclareRelease{v2.0}{2018-07-21}{lettrine-2018-08-18.sty}
\DeclareRelease{v2.3}{2022-09-25}{lettrine-2022-09-25.sty}
\DeclareRelease{v2.4}{2023-04-18}{lettrine-2023-04-18.sty}
-\DeclareCurrentRelease{}{2023-07-02}
+\DeclareCurrentRelease{}{2023-01-20}
\RequirePackage{xfp}
% \end{macrocode}
%
@@ -565,6 +598,7 @@
\newif\ifL at image
\newif\ifL at grid
\newif\ifL at realh
+\let\ifL at RTL\iffalse
\newcommand*{\L at viewport}{}
% \end{macrocode}
%
@@ -1085,22 +1119,39 @@
\addtolength{\L at Nindent}{\@totalleftmargin}%
% \end{macrocode}
% Now, set up the shape of the new paragraph (designed by
-% |\parshape|).
+% |\parshape|). It obiously depends on the text direction,
+% the code previously available in \file{lettrine-xetex-bidi.def}
+% for right to left scripts is integrated here now.
%
% \changes{v1.9}{2015/08/31}{\cs{theL at depth} changed to
% \cs{value\{L at depth\}}.}
%
+% \changes{v2.60}{2024/01/20}{\cs{L at parshape} compatible with
+% xetex bidi RTL typesetting.}
+%
% \begin{macrocode}
\addtocounter{L at lines}{1}%
\addtocounter{L at lines}{\value{L at depth}}%
- \def\L at parshape{\c at L@lines \the\L at Pindent \the\L at first}%
+ \ifL at RTL
+ \def\L at parshape{\c at L@lines \z@ \the\L at first}%
+ \else
+ \def\L at parshape{\c at L@lines \the\L at Pindent \the\L at first}%
+ \fi
\@tempcnta=\tw@
\@whilenum \@tempcnta<\c at L@lines\do{%
- \edef\L at parshape{\L at parshape \the\L at Nindent \the\L at next}%
+ \ifL at RTL
+ \edef\L at parshape{\L at parshape \z@ \the\L at next}%
+ \else
+ \edef\L at parshape{\L at parshape \the\L at Nindent \the\L at next}%
+ \fi
\addtolength{\L at Nindent}{\L at slope}%
\addtolength{\L at next}{-\L at slope}%
\advance\@tempcnta\@ne}%
- \edef\L at parshape{\L at parshape \@totalleftmargin \the\linewidth}%
+ \ifL at RTL
+ \edef\L at parshape{\L at parshape \z@ \the\linewidth}%
+ \else
+ \edef\L at parshape{\L at parshape \@totalleftmargin \the\linewidth}%
+ \fi
\noindent
\parshape=\L at parshape\relax
% \end{macrocode}
@@ -1148,6 +1199,13 @@
}%
}
% \end{macrocode}
+% Compatibility with the \pkg{bidi} package (loaded \emph{after}
+% \pkg{lettrine}).
+% \begin{macrocode}
+\AtBeginDocument{%
+ \IfPackageLoadedTF{bidi}{\eqnewif{\ifL at RTL}{\if at RTL}}{}%
+}
+% \end{macrocode}
%
% \iffalse
%</sty>
@@ -1187,6 +1245,10 @@
%%\LettrineOnGridfalse
%%\LettrineRealHeightfalse
%%
+%% This is a *command*, define it as \relax if you dont want the second
+%% mandatory argument of \lettrine[]{}{} to be typset in small caps.
+%%\renewcommand*{\LettrineTextFont}{\scshape}|
+%%
%% Theses are *commands* (value=string, only height matters):
%%\renewcommand*{\LettrineTestString}{EFTZ}
%%\renewcommand*{\LettrineSecondString}{x}
Modified: trunk/Master/texmf-dist/tex/latex/lettrine/lettrine.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lettrine/lettrine.cfg 2024-01-20 21:07:17 UTC (rev 69507)
+++ trunk/Master/texmf-dist/tex/latex/lettrine/lettrine.cfg 2024-01-20 21:08:05 UTC (rev 69508)
@@ -1,3 +1,4 @@
+
%% lettrine.cfg: configuration file for lettrine.sty
%%
%% If you want to customize lettrine, please *do not* hack into the
@@ -26,6 +27,10 @@
%%\LettrineOnGridfalse
%%\LettrineRealHeightfalse
%%
+%% This is a *command*, define it as \relax if you dont want the second
+%% mandatory argument of \lettrine[]{}{} to be typset in small caps.
+%%\renewcommand*{\LettrineTextFont}{\scshape}|
+%%
%% Theses are *commands* (value=string, only height matters):
%%\renewcommand*{\LettrineTestString}{EFTZ}
%%\renewcommand*{\LettrineSecondString}{x}
Modified: trunk/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lettrine/lettrine.sty 2024-01-20 21:07:17 UTC (rev 69507)
+++ trunk/Master/texmf-dist/tex/latex/lettrine/lettrine.sty 2024-01-20 21:08:05 UTC (rev 69508)
@@ -7,17 +7,18 @@
%% lettrine.dtx (with options: `sty')
%%
%% IMPORTANT NOTICE:
-%% For the copyright see the source file `lua-typo.dtx’.
+%% For the copyright see the source file `lettrine.dtx’.
%%
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesFile{lettrine.sty}
- [2023-08-14 v2.52 (Daniel Flipo)]
+ [2024-01-20 v2.60 (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}
\DeclareRelease{v2.3}{2022-09-25}{lettrine-2022-09-25.sty}
\DeclareRelease{v2.4}{2023-04-18}{lettrine-2023-04-18.sty}
-\DeclareCurrentRelease{}{2023-07-02}
+\DeclareCurrentRelease{}{2023-01-20}
\RequirePackage{xfp}
\newcounter{DefaultLines}
\setcounter{DefaultLines}{2}
@@ -66,6 +67,7 @@
\newif\ifL at image
\newif\ifL at grid
\newif\ifL at realh
+\let\ifL at RTL\iffalse
\newcommand*{\L at viewport}{}
\newcommand*{\LettrineTestString}{EFTZ}
\InputIfFileExists{lettrine.cfg}
@@ -269,14 +271,26 @@
\addtolength{\L at Nindent}{\@totalleftmargin}%
\addtocounter{L at lines}{1}%
\addtocounter{L at lines}{\value{L at depth}}%
- \def\L at parshape{\c at L@lines \the\L at Pindent \the\L at first}%
+ \ifL at RTL
+ \def\L at parshape{\c at L@lines \z@ \the\L at first}%
+ \else
+ \def\L at parshape{\c at L@lines \the\L at Pindent \the\L at first}%
+ \fi
\@tempcnta=\tw@
\@whilenum \@tempcnta<\c at L@lines\do{%
- \edef\L at parshape{\L at parshape \the\L at Nindent \the\L at next}%
+ \ifL at RTL
+ \edef\L at parshape{\L at parshape \z@ \the\L at next}%
+ \else
+ \edef\L at parshape{\L at parshape \the\L at Nindent \the\L at next}%
+ \fi
\addtolength{\L at Nindent}{\L at slope}%
\addtolength{\L at next}{-\L at slope}%
\advance\@tempcnta\@ne}%
- \edef\L at parshape{\L at parshape \@totalleftmargin \the\linewidth}%
+ \ifL at RTL
+ \edef\L at parshape{\L at parshape \z@ \the\linewidth}%
+ \else
+ \edef\L at parshape{\L at parshape \@totalleftmargin \the\linewidth}%
+ \fi
\noindent
\parshape=\L at parshape\relax
\llap{\mbox{\L at ante}\smash{\raisebox{\L at lraise}{\usebox{\L at lbox}}}%
@@ -294,6 +308,9 @@
\let\everypar\Llist at everypar
}%
}
+\AtBeginDocument{%
+ \IfPackageLoadedTF{bidi}{\eqnewif{\ifL at RTL}{\if at RTL}}{}%
+}
%%
%%
%% End of file `lettrine.sty'.
More information about the tex-live-commits
mailing list.