Skip to content

Commit

Permalink
get rid of some etoolbox commands in glosses
Browse files Browse the repository at this point in the history
  • Loading branch information
jspitz committed Apr 26, 2024
1 parent d306982 commit 787195f
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 110 deletions.
49 changes: 26 additions & 23 deletions tex/gloss-arabic.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,12 @@
\def\arabicgregmonth@mauritania#1{\ifcase#1%
\or يناير\or فبراير\or مارس\or إبريل\or مايو\or يونيو\or يوليو\or أغشت\or شتمبر\or أكتوبر\or نوفمبر\or دجمبر\fi}

\def\@arabic@month#1{\ifcsdef{arabicgregmonth@#1}{\expandafter\csname arabicgregmonth@#1\endcsname}%
{\xpg@warning{Option `locale=#1' is not defined for Arabic: using `default' instead}%
\arabicgregmonth@default}}
\def\@arabic@month#1{%
\@ifundefined{arabicgregmonth@#1}%
{\xpg@warning{Option `locale=#1' is not defined for Arabic: using `default' instead}%
\arabicgregmonth@default}%
{\expandafter\csname arabicgregmonth@#1\endcsname}%
}

%\Hijritoday is now locale-aware and will format the date with this macro:
\DefineFormatHijriDate{arabic}{\@ensure@RTL{\arabicnumber{\value{Hijriday}}%
Expand Down Expand Up @@ -297,16 +300,16 @@
}

\def\noarabic@xetex@capsformat{%
\ifcsdef{xpg@save@sepmark}{%
\ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
}{}%
\fi%
}

\def\arabic@luatex@capsformat{%
%
% change chapter and part headings
\ifarabic@customsep
\ifcsdef{chapter}{%
\ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
Expand All @@ -318,7 +321,7 @@
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
}{}
\fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
Expand All @@ -333,30 +336,30 @@
}

\def\noarabic@luatex@capsformat{%
\ifcsdef{xpg@save@thesection}{%
\ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
}{}%
\ifcsdef{xpg@save@theequation}{%
\fi%
\ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
}{}%
\ifcsdef{xpg@save@thefigure}{%
\fi%
\ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
}{}%
\ifcsdef{xpg@save@thetable}{%
\fi%
\ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
}{}%
\ifcsdef{xpg@save@thesubsection}{%
\fi%
\ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
\ifcsdef{xpg@save@thesubsubsection}{%
\ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
}{}%
}{}%
\ifcsdef{xpg@save@theparagraph}{%
\fi%
\fi%
\ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
}{}%
\ifcsdef{xpg@save@thesubparagraph}{%
\fi%
\ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
}{}%
\fi%
}

\def\blockextras@arabic{%
Expand Down
40 changes: 20 additions & 20 deletions tex/gloss-kurdish.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -404,16 +404,16 @@
}

\def\nokurdish@xetex@capsformat{%
\ifcsdef{xpg@save@sepmark}{%
\ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
}{}%
\fi%
}

\def\kurdish@luatex@capsformat{%
%
% change chapter and part headings
\ifkurdish@customsep
\ifcsdef{chapter}{%
\ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
Expand All @@ -425,7 +425,7 @@
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
}{}
\fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
Expand All @@ -440,30 +440,30 @@
}

\def\nokurdish@luatex@capsformat{%
\ifcsdef{xpg@save@thesection}{%
\ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
}{}%
\ifcsdef{xpg@save@theequation}{%
\fi%
\ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
}{}%
\ifcsdef{xpg@save@thefigure}{%
\fi%
\ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
}{}%
\ifcsdef{xpg@save@thetable}{%
\fi%
\ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
}{}%
\ifcsdef{xpg@save@thesubsection}{%
\fi%
\ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
\ifcsdef{xpg@save@thesubsubsection}{%
\ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
}{}%
}{}%
\ifcsdef{xpg@save@theparagraph}{%
\fi%
\fi%
\ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
}{}%
\ifcsdef{xpg@save@thesubparagraph}{%
\fi%
\ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
}{}%
\fi%
}

\def\blockextras@kurdish{%
Expand Down
40 changes: 20 additions & 20 deletions tex/gloss-persian.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,16 @@
}

\def\nopersian@xetex@capsformat{%
\ifcsdef{xpg@save@sepmark}{%
\ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
}{}%
\fi%
}

\def\persian@luatex@capsformat{%
%
% change chapter and part headings
\ifpersian@customsep
\ifcsdef{chapter}{%
\ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
Expand All @@ -168,7 +168,7 @@
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
}{}
\fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
Expand All @@ -183,30 +183,30 @@
}

\def\nopersian@luatex@capsformat{%
\ifcsdef{xpg@save@thesection}{%
\ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
}{}%
\ifcsdef{xpg@save@theequation}{%
\fi%
\ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
}{}%
\ifcsdef{xpg@save@thefigure}{%
\fi%
\ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
}{}%
\ifcsdef{xpg@save@thetable}{%
\fi%
\ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
}{}%
\ifcsdef{xpg@save@thesubsection}{%
\fi%
\ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
\ifcsdef{xpg@save@thesubsubsection}{%
\ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
}{}%
}{}%
\ifcsdef{xpg@save@theparagraph}{%
\fi%
\fi%
\ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
}{}%
\ifcsdef{xpg@save@thesubparagraph}{%
\fi%
\ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
}{}%
\fi%
}

\def\blockextras@persian{%
Expand Down
5 changes: 2 additions & 3 deletions tex/gloss-sanskrit.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@
\setlanguagealias*[script=latin]{sanskrit}{sa-Latn}

\define@key{sanskrit}{Script}[devanagari]{%
\ifcsdef{fontsetup@sanskrit@#1}%
\@ifundefined{fontsetup@sanskrit@#1}%
{\xpg@error{`#1' is not a valid script for Sanskrit}}%
{\csname fontsetup@sanskrit@#1\endcsname}%
{\xpg@error{`#1' is not a valid script for Sanskrit}%
}%
}

\define@key{sanskrit}{script}[devanagari]{\setkeys{sanskrit}{Script=#1}}
Expand Down
48 changes: 24 additions & 24 deletions tex/gloss-syriac.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@
\IfCharIsAvailableTF{0661}%
{\@ensure@LTR{\protect\arabicdigits{\number#1}}}%
{\@ensure@LTR{\arabicdigits{\number#1}}
\ifcsdef{arabicfont}%
{\@ensure@LTR{\protect\arabicdigits{\number#1}}%
\xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs:
I am using \string\arabicfont instead}}%
\@ifundefined{arabicfont}%
{\number#1%%% <---changed from \RL{\protect\reset@font\protect\number#1}%
\xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs:
since \string\arabicfont is not defined, we'll use Western numerals instead}}%
{\@ensure@LTR{\protect\arabicdigits{\number#1}}%
\xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs:
I am using \string\arabicfont instead}}%
}%
\else
%%\RL{\protect\reset@font\number#1}%
Expand Down Expand Up @@ -180,16 +180,16 @@
}

\def\nosyriac@xetex@capsformat{%
\ifcsdef{xpg@save@sepmark}{%
\ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
}{}%
\fi%
}

\def\syriac@luatex@capsformat{%
%
% change chapter and part headings
\ifsyriac@customsep
\ifcsdef{chapter}{%
\ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
Expand All @@ -201,7 +201,7 @@
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
}{}
\fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
Expand All @@ -216,30 +216,30 @@
}

\def\nosyriac@luatex@capsformat{%
\ifcsdef{xpg@save@thesection}{%
\ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
}{}%
\ifcsdef{xpg@save@theequation}{%
\fi%
\ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
}{}%
\ifcsdef{xpg@save@thefigure}{%
\fi%
\ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
}{}%
\ifcsdef{xpg@save@thetable}{%
\fi%
\ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
}{}%
\ifcsdef{xpg@save@thesubsection}{%
\fi%
\ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
\ifcsdef{xpg@save@thesubsubsection}{%
\ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
}{}%
}{}%
\ifcsdef{xpg@save@theparagraph}{%
\fi%
\fi%
\ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
}{}%
\ifcsdef{xpg@save@thesubparagraph}{%
\fi%
\ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
}{}%
\fi%
}

\def\blockextras@syriac{%
Expand Down
Loading

0 comments on commit 787195f

Please sign in to comment.