summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-01-20 21:08:05 +0000
committerKarl Berry <karl@freefriends.org>2024-01-20 21:08:05 +0000
commita8c780c3a68a007f347bab71ff7f0d22a59e9fee (patch)
treeb6706ae7ddc3a9c43470d77d1289d509963b2908
parent5d17095d877f91c1b9365e78e280fb9ba368b035 (diff)
lettrine (20jan24)
git-svn-id: svn://tug.org/texlive/trunk@69508 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/lettrine/README.md6
-rw-r--r--Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.pdfbin0 -> 13371 bytes
-rw-r--r--Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.tex38
-rw-r--r--Master/texmf-dist/doc/latex/lettrine/lettrine-demo-de.pdfbin128252 -> 128252 bytes
-rw-r--r--Master/texmf-dist/doc/latex/lettrine/lettrine-demo-fr.pdfbin168279 -> 168279 bytes
-rw-r--r--Master/texmf-dist/doc/latex/lettrine/lettrine-demo-lua.pdfbin74185 -> 73166 bytes
-rw-r--r--Master/texmf-dist/doc/latex/lettrine/lettrine-xetex-bidi.def12
-rw-r--r--Master/texmf-dist/doc/latex/lettrine/lettrine.pdfbin126080 -> 131712 bytes
-rw-r--r--Master/texmf-dist/source/latex/lettrine/lettrine.dtx98
-rw-r--r--Master/texmf-dist/tex/latex/lettrine/lettrine.cfg5
-rw-r--r--Master/texmf-dist/tex/latex/lettrine/lettrine.sty29
11 files changed, 161 insertions, 27 deletions
diff --git a/Master/texmf-dist/doc/latex/lettrine/README.md b/Master/texmf-dist/doc/latex/lettrine/README.md
index 57f41e59ffc..88e1a9e9d44 100644
--- a/Master/texmf-dist/doc/latex/lettrine/README.md
+++ b/Master/texmf-dist/doc/latex/lettrine/README.md
@@ -33,7 +33,7 @@ This bundle is included in most TeX distributions, but if you need
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 @@ a directory searched by TeX, typically $TEXMF/tex/latex/lettrine.
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 @@ Changes
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
diff --git a/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.pdf b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.pdf
new file mode 100644
index 00000000000..b2e843d1b74
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.tex b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.tex
new file mode 100644
index 00000000000..0fd17998239
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-arabic.tex
@@ -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:
diff --git a/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-de.pdf b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-de.pdf
index 84ba7a43446..f8c0fc77c28 100644
--- a/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-de.pdf
+++ b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-de.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-fr.pdf b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-fr.pdf
index a780c1c0a6e..f85a80ef420 100644
--- a/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-fr.pdf
+++ b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-fr.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-lua.pdf b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-lua.pdf
index a88972db814..a0c3aa3bdc7 100644
--- a/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-lua.pdf
+++ b/Master/texmf-dist/doc/latex/lettrine/lettrine-demo-lua.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/lettrine/lettrine-xetex-bidi.def b/Master/texmf-dist/doc/latex/lettrine/lettrine-xetex-bidi.def
new file mode 100644
index 00000000000..0f3dbc81200
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/lettrine/lettrine-xetex-bidi.def
@@ -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'.
diff --git a/Master/texmf-dist/doc/latex/lettrine/lettrine.pdf b/Master/texmf-dist/doc/latex/lettrine/lettrine.pdf
index 0fde23f12d2..2866dec763c 100644
--- a/Master/texmf-dist/doc/latex/lettrine/lettrine.pdf
+++ b/Master/texmf-dist/doc/latex/lettrine/lettrine.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/lettrine/lettrine.dtx b/Master/texmf-dist/source/latex/lettrine/lettrine.dtx
index 4f17f5f6b6b..c4bf9472c53 100644
--- a/Master/texmf-dist/source/latex/lettrine/lettrine.dtx
+++ b/Master/texmf-dist/source/latex/lettrine/lettrine.dtx
@@ -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@image
\newif\ifL@grid
\newif\ifL@realh
+\let\ifL@RTL\iffalse
\newcommand*{\L@viewport}{}
% \end{macrocode}
%
@@ -1085,22 +1119,39 @@
\addtolength{\L@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@depth} changed to
% \cs{value\{L@depth\}}.}
%
+% \changes{v2.60}{2024/01/20}{\cs{L@parshape} compatible with
+% xetex bidi RTL typesetting.}
+%
% \begin{macrocode}
\addtocounter{L@lines}{1}%
\addtocounter{L@lines}{\value{L@depth}}%
- \def\L@parshape{\c@L@lines \the\L@Pindent \the\L@first}%
+ \ifL@RTL
+ \def\L@parshape{\c@L@lines \z@ \the\L@first}%
+ \else
+ \def\L@parshape{\c@L@lines \the\L@Pindent \the\L@first}%
+ \fi
\@tempcnta=\tw@
\@whilenum \@tempcnta<\c@L@lines\do{%
- \edef\L@parshape{\L@parshape \the\L@Nindent \the\L@next}%
+ \ifL@RTL
+ \edef\L@parshape{\L@parshape \z@ \the\L@next}%
+ \else
+ \edef\L@parshape{\L@parshape \the\L@Nindent \the\L@next}%
+ \fi
\addtolength{\L@Nindent}{\L@slope}%
\addtolength{\L@next}{-\L@slope}%
\advance\@tempcnta\@ne}%
- \edef\L@parshape{\L@parshape \@totalleftmargin \the\linewidth}%
+ \ifL@RTL
+ \edef\L@parshape{\L@parshape \z@ \the\linewidth}%
+ \else
+ \edef\L@parshape{\L@parshape \@totalleftmargin \the\linewidth}%
+ \fi
\noindent
\parshape=\L@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@RTL}{\if@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}
diff --git a/Master/texmf-dist/tex/latex/lettrine/lettrine.cfg b/Master/texmf-dist/tex/latex/lettrine/lettrine.cfg
index 51b073dd39d..b14efc71182 100644
--- a/Master/texmf-dist/tex/latex/lettrine/lettrine.cfg
+++ b/Master/texmf-dist/tex/latex/lettrine/lettrine.cfg
@@ -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}
diff --git a/Master/texmf-dist/tex/latex/lettrine/lettrine.sty b/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
index 8cc81e30bab..b508a930299 100644
--- a/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
+++ b/Master/texmf-dist/tex/latex/lettrine/lettrine.sty
@@ -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@image
\newif\ifL@grid
\newif\ifL@realh
+\let\ifL@RTL\iffalse
\newcommand*{\L@viewport}{}
\newcommand*{\LettrineTestString}{EFTZ}
\InputIfFileExists{lettrine.cfg}
@@ -269,14 +271,26 @@
\addtolength{\L@Nindent}{\@totalleftmargin}%
\addtocounter{L@lines}{1}%
\addtocounter{L@lines}{\value{L@depth}}%
- \def\L@parshape{\c@L@lines \the\L@Pindent \the\L@first}%
+ \ifL@RTL
+ \def\L@parshape{\c@L@lines \z@ \the\L@first}%
+ \else
+ \def\L@parshape{\c@L@lines \the\L@Pindent \the\L@first}%
+ \fi
\@tempcnta=\tw@
\@whilenum \@tempcnta<\c@L@lines\do{%
- \edef\L@parshape{\L@parshape \the\L@Nindent \the\L@next}%
+ \ifL@RTL
+ \edef\L@parshape{\L@parshape \z@ \the\L@next}%
+ \else
+ \edef\L@parshape{\L@parshape \the\L@Nindent \the\L@next}%
+ \fi
\addtolength{\L@Nindent}{\L@slope}%
\addtolength{\L@next}{-\L@slope}%
\advance\@tempcnta\@ne}%
- \edef\L@parshape{\L@parshape \@totalleftmargin \the\linewidth}%
+ \ifL@RTL
+ \edef\L@parshape{\L@parshape \z@ \the\linewidth}%
+ \else
+ \edef\L@parshape{\L@parshape \@totalleftmargin \the\linewidth}%
+ \fi
\noindent
\parshape=\L@parshape\relax
\llap{\mbox{\L@ante}\smash{\raisebox{\L@lraise}{\usebox{\L@lbox}}}%
@@ -294,6 +308,9 @@
\let\everypar\Llist@everypar
}%
}
+\AtBeginDocument{%
+ \IfPackageLoadedTF{bidi}{\eqnewif{\ifL@RTL}{\if@RTL}}{}%
+}
%%
%%
%% End of file `lettrine.sty'.