summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/bidi/lettrine-xetex-bidi.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/bidi/lettrine-xetex-bidi.def')
-rw-r--r--Master/texmf-dist/tex/xelatex/bidi/lettrine-xetex-bidi.def136
1 files changed, 6 insertions, 130 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidi/lettrine-xetex-bidi.def b/Master/texmf-dist/tex/xelatex/bidi/lettrine-xetex-bidi.def
index 763b3906759..b60c6af0666 100644
--- a/Master/texmf-dist/tex/xelatex/bidi/lettrine-xetex-bidi.def
+++ b/Master/texmf-dist/tex/xelatex/bidi/lettrine-xetex-bidi.def
@@ -9,7 +9,7 @@
%% __________________________________________________
%% Vafa Khalighi
%%
-%% Copyright (c) 2007--2023 Vafa Khalighi
+%% Copyright (c) 2007--2025 Vafa Khalighi
%% Copyright (c) 2018--2020 bidi-tex GitHub Organization
%%
%% It may be distributed and/or modified under the LaTeX Project Public License,
@@ -20,7 +20,7 @@
%% by Vafa Khalighi.
%%
%%
-%% \CheckSum{58884}
+%% \CheckSum{57328}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -37,143 +37,19 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%%
-\ProvidesFile{lettrine-xetex-bidi.def}[2022/11/06 v0.8 bidi adaptations for lettrine package for XeTeX engine]
-\def\@lettrine[#1]#2#3{%
- \def\l@initial{#2}\let\l@refstring\l@initial
- \setcounter{L@lines}{\value{DefaultLines}}%
- \setcounter{L@depth}{\value{DefaultDepth}}%
- \renewcommand*{\L@hang}{\DefaultLhang}%
- \renewcommand*{\L@oversize}{\DefaultLoversize}%
- \renewcommand*{\L@raise}{\DefaultLraise}%
- \renewcommand*{\L@ante}{}%
- \setlength{\L@Findent}{\DefaultFindent}%
- \setlength{\L@Nindent}{\DefaultNindent}%
- \setlength{\L@slope}{\DefaultSlope}%
- \setlength{\L@novskip}{\DiscardVskip}%
- \ifLettrineImage\L@imagetrue\else\L@imagefalse\fi
- \ifLettrineOnGrid\L@gridtrue\else\L@gridfalse\fi
- \ifLettrineRealHeight\L@realhtrue\else\L@realhfalse\fi
- \setkeys{L}{#1}%
- \sbox{\L@tbox}{\LettrineTextFont{\LettrineSecondString}}%
- \ifL@realh
- \def\@tempa{#3}%
- \ifx\@tempa\@empty
- \PackageWarning{lettrine.sty}%
- {Empty second argument,\MessageBreak
- ignoring option `realheight';}%
- \else
- \sbox{\L@tbox}{\LettrineTextFont{#3}}%
- \fi
- \fi
+\ProvidesFile{lettrine-xetex-bidi.def}[2024/12/08 v0.9 bidi adaptations for lettrine package for XeTeX engine]
+\RemoveFromHook{begindocument}[lettrine]
+\AtBeginDocument[lettrine]{%
\if\DefaultOptionsFile\relax
\else
- \begingroup
\InputIfFileExists{\DefaultOptionsFile}%
{}%
{\PackageWarning{lettrine.sty}%
{File \DefaultOptionsFile\space not found}%
}%
- \def\color##1##{\l@color{##1}}%
- \let\l@color\@gobbletwo
- \def\textcolor##1##{\l@textcolor{##1}}%
- \def\l@textcolor##1##2##3{##3}%
- \expandafter\ifx\csname l@#2-keys\endcsname\relax
- \gdef\l@LOKeys{}%
- \else
- \xdef\l@LOKeys{\csname l@#2-keys\endcsname}%
- \fi
- \endgroup
- \def\KV@prefix{KV@L@}%
- \let\@tempc\relax
- \expandafter\KV@do\l@LOKeys,\relax,
- \setupL@lbox
- \setlength{\LettrineWidth}{\wd\L@lbox}%
- \def\KV@prefix{KV@L@}%
- \let\@tempc\relax
- \expandafter\KV@do\l@LOKeys,\relax,
- \setkeys{L}{#1}%
- \fi
- \setupL@lbox
- \setlength{\LettrineWidth}{\wd\L@lbox}%
- \setlength{\LettrineHeight}{\ht\L@lbox}%
- \setlength{\LettrineDepth}{\dp\L@lbox}%
- \begingroup
- \def\IeC##1{##1}%
- \@tempdima=\L@oversize pt\relax
- \PackageInfo{lettrine.sty}%
- {Targeted height = \the\L@target@tht\MessageBreak
- (for loversize=0, accent excluded),\MessageBreak
- Lettrine height = \the\LettrineHeight\space (#2)%
- \ifdim\@tempdima=\z@\else\space loversize=\L@oversize\fi;%
- \MessageBreak reported}%
- \endgroup
- \sbox{\L@tbox}{\LettrineTextFont{#3}}%
- \setlength{\L@first}{\LettrineHeight}%
- \setlength{\L@lraise}{\L@raise\L@target@tht}%
- \addtolength{\L@first}{\L@lraise}%
- \ifnum\value{L@lines}=1
- \addtolength{\L@first}{-\ht\L@tbox}%
- \else
- \addtolength{\L@first}{-\L@target@tht}%
- \addtolength{\L@lraise}{-\L@target@dp}%
- \fi
- \par
- \ifdim\L@first>\L@novskip
- \ifL@grid
- \@tempdima=\baselineskip
- \@tempdimb=\@tempdima
- \advance\@tempdimb by \L@novskip
- \@tempcnta=1
- \loop\ifdim\L@first>\@tempdimb
- \advance\@tempcnta by 1
- \advance\L@first by -\@tempdima
- \repeat
- \L@first=\@tempcnta\baselineskip
- \fi
- \vskip\L@first
- \fi
- \setlength{\L@Pindent}{\wd\L@lbox}%
- \addtolength{\L@Pindent}{-\L@hang\wd\L@lbox}%
- \settowidth{\L@first}{\L@ante}%
- \addtolength{\L@Pindent}{\L@first}%
- \addtolength{\L@Pindent}{\L@Findent}%
- \setlength{\L@first}{\linewidth}%
- \addtolength{\L@first}{-\L@Pindent}%
- \addtolength{\L@Nindent}{\L@Pindent}%
- \setlength{\L@next}{\linewidth}%
- \addtolength{\L@next}{-\L@Nindent}%
- \addtolength{\L@Pindent}{\@totalleftmargin}%
- \addtolength{\L@Nindent}{\@totalleftmargin}%
- \addtocounter{L@lines}{1}%
- \addtocounter{L@lines}{\value{L@depth}}%
- \if@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{%
- \if@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}%
- \if@RTL
- \edef\L@parshape{\L@parshape \z@ \the\linewidth}%
- \else
- \edef\L@parshape{\L@parshape \@totalleftmargin \the\linewidth}%
\fi
- \noindent
- \parshape=\L@parshape\relax
- \smash{\llap{\mbox{\L@ante}\raisebox{\L@lraise}{\usebox{\L@lbox}}%
- \hskip \the\L@Findent}}%
- \usebox{\L@tbox}%
- \ifnum\@listdepth>0 \Lreset@listparshape \fi
+ \let\ifL@RTL\if@RTL
}
-
\endinput
%%
%% End of file `lettrine-xetex-bidi.def'.