diff options
author | Karl Berry <karl@freefriends.org> | 2020-10-09 20:23:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-10-09 20:23:21 +0000 |
commit | f5438b19073108cb30f66378d020f7e892668cb0 (patch) | |
tree | 643ea97c40720dcc3d49774a8f337f6ec7618b87 /Master/texmf-dist/tex | |
parent | e47f575477177e0773807d3dad6dd7e1a3f31d11 (diff) |
polyglossia (9oct20)
git-svn-id: svn://tug.org/texlive/trunk@56613 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
40 files changed, 470 insertions, 396 deletions
diff --git a/Master/texmf-dist/tex/latex/polyglossia/babelsh.def b/Master/texmf-dist/tex/latex/polyglossia/babelsh.def index 61c3e6d1fd8..68a0a45ada7 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/babelsh.def +++ b/Master/texmf-dist/tex/latex/polyglossia/babelsh.def @@ -216,6 +216,17 @@ % % ------------------------------------------------------------------------------ % +% lines 293 to 301 from babel.def +% +% NOTE: In order to avoid importing more unneeded definitions, this macro +% does nothing for us. +% +% ------------------------------------------------------------------------------ +% +\def\bbl@usehooks#1#2{} +% +% ------------------------------------------------------------------------------ +% % lines 443 to 558 from babel.def % % ------------------------------------------------------------------------------ diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-afrikaans.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-afrikaans.ldf index 545ecd34292..6ca384200d9 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-afrikaans.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-afrikaans.ldf @@ -79,7 +79,7 @@ } \def\noextras@afrikaans{% - \noafrikaans@shorthands% + \ifafrikaans@babelshorthands\noafrikaans@shorthands\fi% } \def\blockextras@afrikaans{% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf index 6cd68bdb7f6..3ba44837895 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf @@ -1,10 +1,4 @@ \ProvidesFile{gloss-arabic.ldf}[polyglossia: module for arabic] -\ifluatex - \xpg@warning{Arabic is not supported with LuaTeX.\MessageBreak -I will proceed with the compilation, but\MessageBreak -the output is not guaranteed to be correct\MessageBreak -and may look very wrong.} -\fi \RequireBidi \RequirePackage{arabicnumbers} \RequirePackage{hijrical} @@ -39,6 +33,8 @@ and may look very wrong.} \setlanguagealias*[locale=default]{arabic}{apd} \setlanguagealias*[locale=mashriq]{arabic}{ar-PS} +\define@boolkey{arabic}[arabic@]{abjadalph}[true]{} + \newif\ifeastern@numerals \def\tmp@mashriq{mashriq} \def\tmp@maghrib{maghrib} @@ -173,6 +169,19 @@ and may look very wrong.} \def\@ornatebracearabic#1{\RL{\char"FD3F\@arabic#1\char"FD3E}} \def\@ornatebracealph#1{\RL{\char"FD3F\@alph#1\char"FD3E}} +\def\abjadalph#1{\expandafter\arabic@abjad@alph{\number#1}} + +% This is a poor man's Arabic alphanumeric. It just uses the alphabet and +% thus ends at 28. +\def\arabic@abjad@alph#1{\ifcase#1% + \or ا\or ب\or\abjad@three\or د\or و\or ه\or ز% + \or ح\or ط\or ي\or ك\or ل\or م\or ن% + \or س\or ع\or ف\or ص\or ق\or ر\or ش% + \or ت\or ث\or خ\or ذ\or ض\or ظ\or غ% + \else\xpg@ill@value{#1}{arabic@abjad@alph}\fi% +} + + \def\abjadmaghribi#1{% \ifnum#1>1999\xpg@ill@value{#1}{abjad}% \else @@ -207,8 +216,13 @@ and may look very wrong.} \ifnum#1=\z@\fi\abj@maghribi@num@iii} \def\arabic@numbers{% + \ifarabic@abjadalph + \let\@alph\abjadalph% + \let\@Alph\abjadalph% + \else \let\@alph\abjad% \let\@Alph\abjad% + \fi } \def\noarabic@numbers{% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf index dad28a48535..1d1c2f1fd80 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf @@ -112,7 +112,7 @@ \def\@Ccdash{\leavevmode \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}% \ifx\cyrdash\undefined - \def\cyrdash{\hbox to.8em{--\hss--}}% + \def\cyrdash{\hbox to.8em{\textendash\hss\textendash}}% \fi \declare@shorthand{belarusian}{",}{\nobreak\hskip.2em\ignorespaces}% } @@ -297,7 +297,7 @@ \def\noextras@belarusian{% \ifcyrillic@numerals\nobelarusian@numbers\fi% - \nobelarusian@shorthands% + \ifbelarusian@babelshorthands\nobelarusian@shorthands\fi% } \def\blockextras@belarusian{% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf index 94f56070905..80400b7b4a0 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf @@ -3,13 +3,6 @@ \ProvidesFile{gloss-bengali.ldf}[polyglossia: module for bengali] -\ifluatex - \xpg@warning{Bengali is not supported with LuaTeX.\MessageBreak - I will proceed with the compilation, but\MessageBreak - the output is not guaranteed to be correct\MessageBreak - and may look very wrong.} -\fi - \RequirePackage{devanagaridigits} \RequirePackage{bengalidigits} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-catalan.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-catalan.ldf index a2a5d7c420f..42c57c6a2b4 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-catalan.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-catalan.ldf @@ -41,18 +41,23 @@ \csname normal@char\string"\endcsname l% \else \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt% - \setbox0\hbox{l}\setbox1\hbox{l\/}% + \setbox0\hbox{l}% \xpg@if@char@available{00B7}% - {\setbox2\hbox{\char"00B7}}% - {\setbox2\hbox{.}}% - \advance\raiselldim by \the\fontdimen5\the\font + {\setbox2\hbox{\char"00B7}\setbox1\hbox{l}}% + {\setbox2\hbox{.}\setbox1\hbox{l\/}}% + \setbox3\hbox{.}% + \advance\raiselldim by \the\fontdimen5\the\font% \advance\raiselldim by -\ht2% \leftllkern=-.25\wd0% \advance\leftllkern by \wd1% \advance\leftllkern by -\wd0% + \advance\leftllkern by -0.5\wd2% + \advance\leftllkern by 0.5\wd3% \rightllkern=-.25\wd0% \advance\rightllkern by -\wd1% \advance\rightllkern by \wd0% + \advance\rightllkern by -0.5\wd2% + \advance\rightllkern by 0.5\wd3% \allowhyphens\discretionary{l-}{l}% {\hbox{l}\kern\leftllkern\xpg@raiseddot% \kern\rightllkern\hbox{l}}\allowhyphens @@ -64,19 +69,24 @@ \csname normal@char\string"\endcsname L% \else \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt% - \setbox0\hbox{L}\setbox1\hbox{L\/}% + \setbox0\hbox{L}% \xpg@if@char@available{00B7}% - {\setbox2\hbox{\char"00B7}}% - {\setbox2\hbox{.}}% + {\setbox2\hbox{\char"00B7}\setbox1\hbox{L}}% + {\setbox2\hbox{.}\setbox1\hbox{L\/}}% + \setbox3\hbox{.}% \advance\raiselldim by .5\ht0% \advance\raiselldim by -.5\ht2% \leftllkern=-.125\wd0% \advance\leftllkern by \wd1% \advance\leftllkern by -\wd0% + \advance\leftllkern by -0.5\wd2% + \advance\leftllkern by 0.5\wd3% \rightllkern=-\wd0% \divide\rightllkern by 6% \advance\rightllkern by -\wd1% \advance\rightllkern by \wd0% + \advance\rightllkern by -0.5\wd2% + \advance\rightllkern by 0.5\wd3% \allowhyphens\discretionary{L-}{L}% {\hbox{L}\kern\leftllkern\xpg@raiseddot% \kern\rightllkern\hbox{L}}\allowhyphens @@ -134,7 +144,7 @@ \space de~\number\year}} \def\noextras@catalan{% - \nocatalan@shorthands% + \ifcatalan@babelshorthands\nocatalan@shorthands\fi% } \def\blockextras@catalan{% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf index 1d7fe73f9b5..4a698be9fa7 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf @@ -163,7 +163,7 @@ } \def\noextras@croatian{% - \nocroatian@shorthands% + \ifcroatian@babelshorthands\nocroatian@shorthands\fi% } \def\blockextras@croatian{% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf index afa8ef435c9..7246b20dd4e 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf @@ -77,7 +77,7 @@ \chardef\czech@boundary=4095 % \def\newXeTeXintercharclass{% \e@alloc\XeTeXcharclass\chardef - \xe@alloc@intercharclass\m@ne\@ucharclass@boundary} + \xe@alloc@intercharclass\m@ne\@ucharclass@boundary}% \else \chardef\czech@boundary=255 \fi @@ -106,6 +106,24 @@ % Add nonbreakable space after single-letter word to % prevent them to land at the end of a line +% vlna code taken and adapted from xevlna.sty +\ifxetex + \def\czech@nointerchartoks{\let\czech@interchartoks\czech@PreCSpreposition}% + \def\czech@PreCSpreposition{% + \def\next{}% + \ifnum\catcode`\ =10 % nothing will be done in verbatim + \ifmmode % nothing in math + \else + \let\czech@interchartoks\czech@nointerchartoks + \let\next\czech@ExamineCSpreposition + \fi\fi + \next% + }% + \def\czech@ExamineCSpreposition #1{#1\futurelet\next\czech@ProcessCSpreposition}% + \def\czech@ProcessCSpreposition{\ifx\next\czech@XeTeXspace\nobreak\fi}% + \futurelet\czech@XeTeXspace{ }\czech@nointerchartoks +\fi + \def\czech@vlna{% \ifluatex \preventsingleon @@ -132,21 +150,8 @@ \XeTeXcharclass `\a \czech@nonsyllabicpreposition \XeTeXcharclass `\I \czech@nonsyllabicpreposition \XeTeXcharclass `\i \czech@nonsyllabicpreposition - \XeTeXinterchartoks \czech@boundary \czech@nonsyllabicpreposition {\czech@interchartoks} - \XeTeXinterchartoks \czech@openpunctuation \czech@nonsyllabicpreposition {\czech@interchartoks} - \def\czech@nointerchartoks{\let\czech@interchartoks\czech@PreCSpreposition} - \def\czech@PreCSpreposition{\def\next{}% - \ifnum\catcode`\ =10 % nothing will be done in verbatim - \ifmmode % nothing in math - \else - \let\czech@interchartoks\czech@nointerchartoks - \let\next\czech@ExamineCSpreposition - \fi \fi - \next% - } - \def\czech@ExamineCSpreposition ##1{##1\futurelet\next\czech@ProcessCSpreposition} - \def\czech@ProcessCSpreposition{\ifx\next\czech@XeTeXspace\nobreak\fi} - \futurelet\czech@XeTeXspace{ }\czech@nointerchartoks + \XeTeXinterchartoks \czech@boundary \czech@nonsyllabicpreposition {\czech@interchartoks}% + \XeTeXinterchartoks \czech@openpunctuation \czech@nonsyllabicpreposition {\czech@interchartoks}% \fi } @@ -212,7 +217,7 @@ } \def\noextras@czech{% - \noczech@shorthands% + \ifczech@babelshorthands\noczech@shorthands\fi% \noczech@hyphens% \noczech@vlna% \ifxetex\XeTeXinterchartokenstate=0\fi% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-danish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-danish.ldf index a4356d67c1f..f135f70efda 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-danish.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-danish.ldf @@ -34,11 +34,12 @@ \def\proofname{Bevis}% \def\glossaryname{Gloseliste}% } + \def\datedanish{% \def\today{\number\day.~\ifcase\month\or januar\or februar\or marts\or april\or maj\or juni\or juli\or august\or september\or oktober\or november\or december\fi - \space\number\year} + \space\number\year}% } \endinput diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-divehi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-divehi.ldf index 188e5bae6ff..c58dbc1525e 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-divehi.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-divehi.ldf @@ -1,10 +1,5 @@ \ProvidesFile{gloss-divehi.ldf}[polyglossia: module for divehi] -\ifluatex - \xpg@warning{Divehi is not supported with LuaTeX.\MessageBreak -I will proceed with the compilation, but\MessageBreak -the output is not guaranteed to be correct\MessageBreak -and may look very wrong.} -\fi + \RequireBidi \PolyglossiaSetup{divehi}{ bcp47=dv, diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf index 1ec5c0e2889..4bc454b4eda 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf @@ -79,7 +79,7 @@ } \def\noextras@dutch{% - \nodutch@shorthands% + \ifdutch@babelshorthands\nodutch@shorthands\fi% } \def\blockextras@dutch{% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf index 1745b6f8a0c..0537a0386c1 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf @@ -76,7 +76,7 @@ \space\number\year}} \def\noextras@finnish{% - \nofinnish@shorthands% + \iffinnish@babelshorthands\nofinnish@shorthands\fi% } \def\blockextras@finnish{% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-georgian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-georgian.ldf index 1fa2091b93e..7d84e5bad01 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-georgian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-georgian.ldf @@ -72,7 +72,7 @@ \def\@Ccdash{\leavevmode \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}% \ifx\cyrdash\undefined - \def\cyrdash{\hbox to.8em{--\hss--}}% + \def\cyrdash{\hbox to.8em{\textendash\hss\textendash}}% \fi \declare@shorthand{georgian}{",}{\nobreak\hskip.2em\ignorespaces}% } @@ -217,7 +217,7 @@ \def\noextras@georgian{% \ifgeorgian@numerals\nogeorgian@numbers\fi% - \nogeorgian@shorthands% + \ifgeorgian@babelshorthands\nogeorgian@shorthands\fi% } \def\blockextras@georgian{% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf index 12147e1a45b..a26bb7805f8 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf @@ -198,14 +198,14 @@ \declare@shorthand{german}{"R}{\textormath{\bbl@disc@german R{RR}}{R}}% \declare@shorthand{german}{"t}{\textormath{\bbl@disc@german t{tt}}{t}}% \declare@shorthand{german}{"T}{\textormath{\bbl@disc@german T{TT}}{T}}% - \declare@shorthand{german}{"f}{\textormath{\bbl@discff}{f}}% + \declare@shorthand{german}{"f}{\texorpdfstring{\textormath{\bbl@discff}{f}}{f}}% \def\bbl@discff{\penalty\@M - \afterassignment\bbl@insertff \let\bbl@nextff= }% + \afterassignment\bbl@insertff \cslet{bbl@nextff}{ }}% \def\bbl@insertff{% \if f\bbl@nextff \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi {\relax\discretionary{ff-}{f}{ff}\allowhyphens}{f\bbl@nextff}}% - \let\bbl@nextff=f% + \cslet{bbl@nextff}{f}% \declare@shorthand{german}{"-}{\nobreak\-\nobreak\hskip\z@skip}% \declare@shorthand{german}{"|}{\textormath{\penalty\@M\discretionary{-}{}{\kern.03em}}{}}% \declare@shorthand{german}{""}{\hskip\z@skip}% @@ -310,15 +310,15 @@ } \def\noextras@german{% - \nogerman@shorthands% + \ifgerman@babelshorthands\nogerman@shorthands\fi% } \def\blockextras@german{% - \ifgerman@babelshorthands\german@shorthands\fi + \ifgerman@babelshorthands\german@shorthands\fi% } \def\inlineextras@german{% - \ifgerman@babelshorthands\german@shorthands\fi + \ifgerman@babelshorthands\german@shorthands\fi% } \endinput diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf index a72e0a03334..2c69288d635 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf @@ -1,10 +1,5 @@ \ProvidesFile{gloss-hebrew.ldf}[polyglossia: module for hebrew] -\ifluatex - \xpg@warning{Hebrew is not supported with LuaTeX.\MessageBreak -I will proceed with the compilation, but\MessageBreak -the output is not guaranteed to be correct\MessageBreak -and may look very wrong.} -\fi + \RequireBidi \RequirePackage{hebrewcal} @@ -111,23 +106,23 @@ and may look very wrong.} \fi } -% Bidi inserts an RTL mark (0x200f) before any number, forcing numbers to -% RTL. Hebrew uses LTR numbers, though. So we insert an LTR mark to revert -% the directionality \ifxetex - \newcommand\xpg@hebrew@DigitsDotDashInterCharToks{\ifbool{@nonlatin}{\char"200E }{}} + \let\xpg@orig@DigitsDotDashInterCharToks\DigitsDotDashInterCharToks% \fi \def\hebrew@ltr@numbers{% \ifxetex - \XeTeXinterchartoks \bidi@sepmark@charclass \bidi@digits@charclass = {\xpg@hebrew@DigitsDotDashInterCharToks}% + % Bidi inserts an RTL mark (0x200f) between number and number separator (- .), + % forcing numbers to RTL. This is wrong for Hebrew. + % So we defunc the respective command. + \renewcommand*{\DigitsDotDashInterCharToks}{} \fi% } \def\nohebrew@ltr@numbers{% \ifxetex - % This is bidi's original intervention - \XeTeXinterchartoks \bidi@sepmark@charclass \bidi@digits@charclass = {\DigitsDotDashInterCharToks}% + % Restore bidi's \DigitsDotDashInterCharToks + \let\DigitsDotDashInterCharToks\xpg@orig@DigitsDotDashInterCharToks% \fi% } diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf index 3fa551dd56a..c9fbad0cd95 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf @@ -75,7 +75,7 @@ \def\listfigurename{चित्रों की सूची}% \def\listtablename{तालिकाओं की सूची}% \def\pagename{पृष्ठ}% - \def\partname{खणड}% + \def\partname{खण्ड}% \def\prefacename{प्रस्तावना}% प्राक्कथन \def\refname{हवाले}% \def\tablename{तालिका}% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-italian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-italian.ldf index fb284be12c2..aea21a2f3fa 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-italian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-italian.ldf @@ -120,21 +120,21 @@ \def\noextras@italian{% - \lccode\string"2019=\z@ - \noitalian@shorthands - \xpgit@savedvalues + \lccode\string"2019=\z@% + \ifitalian@babelshorthands\noitalian@shorthands\fi% + \xpgit@savedvalues% } \def\blockextras@italian{% - \lccode\string"2019=\string"2019 - \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000 - \finalhyphendemerits=50000000 - \ifitalian@babelshorthands\italian@shorthands\fi + \lccode\string"2019=\string"2019% + \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000% + \finalhyphendemerits=50000000% + \ifitalian@babelshorthands\italian@shorthands\fi% } \def\inlineextras@italian{% - \lccode\string"2019=\string"2019 - \ifitalian@babelshorthands\italian@shorthands\fi + \lccode\string"2019=\string"2019% + \ifitalian@babelshorthands\italian@shorthands\fi% } %%% CHANGES END %%% \endinput diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-kannada.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-kannada.ldf index 0fc557bf0ba..524c1b863cf 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-kannada.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-kannada.ldf @@ -17,12 +17,7 @@ % % This work consists of the file gloss-kannada.ldf \ProvidesFile{gloss-kannada.ldf}[polyglossia: module for kannada] -\ifluatex - \xpg@warning{Kannada is not supported with LuaTeX.\MessageBreak -I will proceed with the compilation, but\MessageBreak -the output is not guaranteed to be correct\MessageBreak -and may look very wrong.} -\fi + \PolyglossiaSetup{kannada}{ bcp47=kn, script=Kannada, diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf index 5871a435a82..840e0f50f0b 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf @@ -1,5 +1,7 @@ % Created on September 1, 2019 -% Sina Ahmadi (https://sinaahmadi.github.io/) +% Last updated on May 17, 2020 +% Sina Ahmadi (ahmadi.sina@outlook.com) +% For more information, visit the Kurdish XeLaTeX Users Group at https://github.com/KurdishXeLaTeX \ProvidesFile{gloss-kurdish.ldf}[polyglossia: module for Kurdish] \RequireBidi @@ -127,7 +129,6 @@ \define@key{kurdish}{locale}[default]{% \def\@kurdish@locale{#1}} - %TODO add option for CALENDAR % Register default options @@ -138,9 +139,9 @@ }% \def\kurdishNativemonth#1{\ifcase#1% - \or رێبهندان\or رهشهمێ\or خاكهلێوه\or گوڵان\or جۆزهردان\or پووشپهڕ\or خهرمانان\or گهلاوێژ\or رهزبهر\or گهڵارێزان\or سهرماوهز\or بهفرانبار\fi} + \or رێبەندان\or رەشەمێ\or خاكەلێوە\or گوڵان\or جۆزەردان\or پووشپەڕ\or خەرمانان\or گەلاوێژ\or رەزبەر\or گەڵارێزان\or سەرماوەز\or بەفرانبار\fi} \def\kurdishmonth#1{\ifcase#1% - \or کانونی دووەم\or شوبات\or ئازار\or نیسان\or ئایار\or حوزهیران\or تهممووز\or ئاب\or ئهیلوول\or تشرینی یهكهم\or تشرینی دووههم\or كانوونی یهكهم\fi} + \or كانوونی دووهەم\or شوبات\or ئازار\or نیسان\or ئایار\or حوزەیران\or تەممووز\or ئاب\or ئەیلوول\or تشرینی یەكەم\or تشرینی دووهەم\or كانوونی یەكەم\fi} %\Hijritoday is now locale-aware and will format the date with this macro: \DefineFormatHijriDate{kurdish}{% @@ -150,27 +151,27 @@ } \def\captionskurdish@sorani@arabic{% - \def\prefacename{\@ensure@RTL{پێشهكی}}% - \def\refname{\@ensure@RTL{سهرچاوهکان}}% - \def\abstractname{\@ensure@RTL{پوخته}}% - \def\bibname{\@ensure@RTL{کتێبنامه}}% - \def\chaptername{\@ensure@RTL{بهندی}}% + \def\prefacename{\@ensure@RTL{پێشەكی}}% + \def\refname{\@ensure@RTL{سەرچاوەکان}}% + \def\abstractname{\@ensure@RTL{پوختە}}% + \def\bibname{\@ensure@RTL{کتێبنامە}}% + \def\chaptername{\@ensure@RTL{بەندی}}% \def\appendixname{\@ensure@RTL{پاشکۆ}}% - \def\contentsname{\@ensure@RTL{نێوهڕۆک}}% - \def\listfigurename{\@ensure@RTL{لیستی وێنهکان}}% - \def\listtablename{\@ensure@RTL{لیستی خشتهکان}}% + \def\contentsname{\@ensure@RTL{نێوەڕۆک}}% + \def\listfigurename{\@ensure@RTL{لیستی وێنەکان}}% + \def\listtablename{\@ensure@RTL{لیستی خشتەکان}}% \def\indexname{\@ensure@RTL{پێنوێن}}% - \def\figurename{\@ensure@RTL{وێنه}}% - \def\tablename{\@ensure@RTL{خشتە}}% - \def\partname{\@ensure@RTL{بهشی}}% + \def\figurename{\@ensure@RTL{وێنەی}}% + \def\tablename{\@ensure@RTL{خشتەی}}% + \def\partname{\@ensure@RTL{بەشی}}% \def\enclname{\@ensure@RTL{هاوپێچ}}% - \def\ccname{\@ensure@RTL{روونووس}}% + \def\ccname{\@ensure@RTL{ڕوونووس}}% \def\headtoname{\@ensure@RTL{بۆ}}% - \def\pagename{\@ensure@RTL{لاپهڕه}}% - \def\seename{\@ensure@RTL{چاو لێکهن}}% - \def\alsoname{\@ensure@RTL{ههروهها چاو لێکهن}}% + \def\pagename{\@ensure@RTL{لاپەڕە}}% + \def\seename{\@ensure@RTL{چاو لێکەن}}% + \def\alsoname{\@ensure@RTL{هەروەها چاو لێکەن}}% \def\proofname{\@ensure@RTL{سەلماندن}}% - \def\glossaryname{\@ensure@RTL{فهرههنگۆک}}% + \def\glossaryname{\@ensure@RTL{فەرهەنگۆک}}% } \def\captionskurdish@sorani@latin{% @@ -180,17 +181,17 @@ \def\bibname{Kitêbname}% \def\chaptername{Bendî}% \def\appendixname{Paşko}% - \def\contentsname{Nêwerrok}% + \def\contentsname{Nêweřok}% \def\listfigurename{Lîstî Wênekan}% \def\listtablename{Lîstî Xiştekan}% - \def\indexname{Pêrrist}% + \def\indexname{Pêřist}% \def\figurename{Wêney}% \def\tablename{Xiştey}% \def\partname{Beşî}% \def\enclname{Hawpêç}% - \def\ccname{Rûnûs}% + \def\ccname{Řûnûs}% \def\headtoname{Bo}% - \def\pagename{Laperre}% + \def\pagename{Lapeře}% \def\seename{Çaw lêken}% \def\alsoname{Herweha çaw lêken}% \def\proofname{Selmandin}% @@ -199,7 +200,7 @@ \def\captionskurdish@kurmanji@latin{% \def\prefacename{Peşgotin}% - \def\refname{Pirtuken bijartî}% + \def\refname{Jêder}% \def\abstractname{Kurtebîr}% \def\bibname{Çavkanîya Pirtukan}% \def\chaptername{Serê}% @@ -216,14 +217,14 @@ \def\headtoname{Ji bo}% \def\pagename{Rûpelê}% \def\seename{binêra}% - \def\alsoname{le vêya ji binêra}% + \def\alsoname{li vêya jî binêra}% \def\proofname{Delîl}% \def\glossaryname{Çavkanîya lêkolînê}% } \def\captionskurdish@kurmanji@arabic{% \def\prefacename{\@ensure@RTL{پێشگۆتن}}% - \def\refname{\@ensure@RTL{پرتووکێن بژارتی}}% + \def\refname{\@ensure@RTL{ژێدەر}}% \def\abstractname{\@ensure@RTL{کورتەبیر}}% \def\bibname{\@ensure@RTL{چاڤکانییا پرتووکان}}% \def\chaptername{\@ensure@RTL{سەرێ}}% @@ -255,17 +256,17 @@ \def\datekurdish@sorani@latin{% \def\today{% - \number\day.~\ifcase\month\or + \number\day ~\ifcase\month\or \januaryname\or \februaryname\or \marchname\or \aprilname\or \mayname\or \junename\or \julyname\or \augustname\or \septembername\or \octobername\or \novembername\or \decembername\or \@ctrerr\fi~\number\year}% \def\ontoday{% - \number\day’ê~\ifcase\month\or + \number\day î~\ifcase\month\or \januaryname\or \februaryname\or \marchname\or \aprilname\or \mayname\or \junename\or \julyname\or \augustname\or \septembername\or \octobername\or \novembername\or - \decembername\or \@ctrerr\fi ê~\number\year}% + \decembername\or \@ctrerr\fi î~\number\year}% \def\januaryname{Kanûnî Yekem}% \def\februaryname{Şubat}% \def\marchname{Azar}% @@ -282,13 +283,13 @@ \def\datekurdish@kurmanji@latin{% \def\today{% - \number\day.~\ifcase\month\or + \number\day ~\ifcase\month\or \januaryname\or \februaryname\or \marchname\or \aprilname\or \mayname\or \junename\or \julyname\or \augustname\or \septembername\or \octobername\or \novembername\or \decembername\or \@ctrerr\fi~\number\year}% \def\ontoday{% - \number\day’ê~\ifcase\month\or + \number\day ê~\ifcase\month\or \januaryname\or \februaryname\or \marchname\or \aprilname\or \mayname\or \junename\or \julyname\or \augustname\or \septembername\or \octobername\or \novembername\or @@ -307,8 +308,11 @@ \def\decembername{Çileya Pêşîn}% } +\def\kurdishmonthkurmanji#1{\ifcase#1% + چلەیا پاشین \or شبات \or ئادار \or نیسان \or گولان \or حەزیران \or تیرمەهـ \or تەباخ \or ئیلۆن \or چریا پێشین \or چریا پاشین \or چلەیا پێشین\fi} + \def\datekurdish@kurmanji@arabic{% - \datekurdish@sorani@arabic% FIXME: correct? + \def\today{\@ensure@RTL{\kurdishnumber\day\space\kurdishmonthkurmanji{\month}\space\kurdishnumber\year}}% } % TODO: babel-kurmanji has these "alternative" month names diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-lao.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-lao.ldf index 5786584703d..9e128de6a79 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-lao.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-lao.ldf @@ -1,10 +1,5 @@ \ProvidesFile{gloss-lao.ldf}[polyglossia: module for Lao] -\ifluatex - \xpg@warning{Lao is not supported with LuaTeX.\MessageBreak -I will proceed with the compilation, but\MessageBreak -the output is not guaranteed to be correct\MessageBreak -and may look very wrong.} -\fi + \PolyglossiaSetup{lao}{ bcp47=lo, script=Lao, diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf index 0700ad2637d..7fe7690693d 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf @@ -625,7 +625,7 @@ % prosodic shorthand environment. % The active ' character may cause problems with the unicode-math package % (in case Latin is used as a secondary language, see #394). We have to -% turn it of if Latin is not the main language. +% turn it off if Latin is not the main language. \protected@write \@auxout { } { \shorthandoff {=} } % for the aux file diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-malayalam.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-malayalam.ldf index c8ed7780207..55771c44f9c 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-malayalam.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-malayalam.ldf @@ -1,10 +1,5 @@ \ProvidesFile{gloss-malayalam.ldf}[polyglossia: module for malayalam] -\ifluatex - \xpg@warning{Malayalam is not supported with LuaTeX.\MessageBreak -I will proceed with the compilation, but\MessageBreak -the output is not guaranteed to be correct\MessageBreak -and may look very wrong.} -\fi + % Translations provided by Kevin & Siji, 01-11-2009 \PolyglossiaSetup{malayalam}{ diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf index 9e7d09d81c2..1558d8cea7c 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf @@ -3,12 +3,7 @@ % TODO implement Hindu calendar (not used in day-to-day practice) \ProvidesFile{gloss-marathi.ldf}[polyglossia: module for marathi] -\ifluatex - \xpg@warning{Marathi is not supported with LuaTeX.\MessageBreak -I will proceed with the compilation, but\MessageBreak -the output is not guaranteed to be correct\MessageBreak -and may look very wrong.} -\fi + \RequirePackage{devanagaridigits} \PolyglossiaSetup{marathi}{ @@ -62,7 +57,7 @@ and may look very wrong.} \def\appendixname{परिशिष्ट}% \def\contentsname{अनुक्रमणिका}% \def\listfigurename{आकृत्यांची सूची}% - \def\listtablename{कोष्टक सूची}% + \def\listtablename{कोष्टकसूची}% \def\indexname{सूची}% \def\figurename{आकृती}% \def\tablename{कोष्टक}% @@ -71,10 +66,10 @@ and may look very wrong.} \def\seename{पाहा}% \def\alsoname{हेदेखील पाहा}% \def\enclname{समाविष्ट}% - \def\ccname{सी.सी.}% + \def\ccname{प्रत}% \def\headtoname{प्रति}% \def\proofname{सिद्धता}% - \def\glossaryname{संक्षेपसूची}% + \def\glossaryname{संज्ञांची सूची}% \def\authorsand{आणि}% } @@ -100,23 +95,23 @@ and may look very wrong.} }% } -\def\devanagari@akshar#1{\ifcase#1\or अ\or आ\or इ\or ई\or उ\or ऊ\or ए\or ऐ\or ओ\or औ\or अं\or अः\else\@ctrerr\fi} +\def\devanagari@akshar#1{\ifcase#1\or अ\or आ\or इ\or ई\or उ\or ऊ\or ऋ\or ऌ\or ए\or ॲ\or ऐ\or ओ\or ऑ\or औ\or अं\or अः\else\@ctrerr\fi} \def\devanagari@alph#1{% \ifcase#1\or क\or ख\or ग\or घ\or ङ\or च\or छ\or ज\or झ\or ञ\or ट\or ठ\or ड\or ढ\or ण\or त\or थ\or द% - \or ध\or न\or प\or फ\or ब\or भ\or म\or य\or र\or ल\or व\or श\or ष\or स\or ह\or ळ\else\@ctrerr% + \or ध\or न\or प\or फ\or ब\or भ\or म\or य\or र\or ल\or व\or श\or ष\or स\or ह\or ळ\or क्ष \or ज्ञ \else\@ctrerr% \fi% } \def\devanagari@letter#1{% \ifcase#1\or एक\or दोन\or तीन\or चार\or पाच\or सहा\or सात\or आठ\or नऊ\or दहा\or अकरा\or बारा\or तेरा\or चौदा% - \or पंधरा\or सोळा\or सतरा\or अठरा\or एकोणीस\or वीसएकवीस\or बावीस\or तेवीस\or चोवीस\or पंचवीस\or सव्वीस\or सत्तावीस\or अठाव्वीस% - \or एकोणतीस\or तीस\or एकतीस\or बत्तीस\or तेहेत्तीस \or चौतीस \or पस्तीस \or छत्तीस \or सतदिस \or अडतीस \or एकोणचाळीस \or चाळीस % - \or एक्केचाळीस \or बेचाळीस \or त्रेचाळीस \or चौवेचाळीस\or पंचेचाळीस \or सेहेचाळीस \or सत्तेचाळीस \or अठ्ठेचाळीस \or एकोणपन्नास \or पन्नास % - \or एक्कावन्न \or बावन्न \or त्रेपन्न \or चोपन्न \or पंचावन्न \or छपन्न\or सत्तावन्न \or अठ्ठावन्न \or एकोणसाठ \or साठ \or एकसष्ठ \or बासष्ठ \or त्रेसष्ट % - \or चौसष्ठ \or पासष्ठ \or सहासष्ठ \or सदुष्ठ \or अडुसष्ठ \or एकोणसत्तर\or सत्तर \or एकाहत्तर \or बहात्तर \or त्र्याहत्तर \or चौऱ्याहत्तर \or पंच्याहत्तर % - \or शहात्तर \or सत्याहत्तर \or अठ्याहत्तर \or एकोणऐशी \or ऐंशी\or एक्याऐंशी \or ब्याऐंशी \or त्र्याऐंशी \or चौऱ्याऐंशी \or पंच्याऐंशी \or शह्यांशी \or सत्यांऐंशी % - \or अठ्ठ्याऐंशी \or एकोणनव्वद \or नव्वद \or एक्याण्णव\or ब्याण्णव \or त्र्याण्णव \or चौऱ्याण्णव \or पंच्याण्णव \or शहाण्णव \or सत्याण्णव \or अठ्याण्णव % + \or पंधरा\or सोळा\or सतरा\or अठरा\or एकोणीस\or वीस\or एकवीस\or बावीस\or तेवीस\or चोवीस\or पंचवीस\or सव्वीस\or सत्तावीस\or अठ्ठावीस% + \or एकोणतीस\or तीस\or एकतीस\or बत्तीस\or तेहतीस \or चौतीस \or पस्तीस \or छत्तीस \or सदतीस \or अडतीस \or एकोणचाळीस \or चाळीस % + \or एकेचाळीस \or बेचाळीस \or त्रेचाळीस \or चव्वेचाळीस \or पंचेचाळीस \or शेहेचाळीस \or सत्तेचाळीस \or अठ्ठेचाळीस \or एकोणपन्नास \or पन्नास % + \or एकावन्न \or बावन्न \or त्रेपन्न \or चौपन्न \or पंचावन्न \or छप्पन्न\or सत्तावन्न \or अठ्ठावन्न \or एकोणसाठ \or साठ \or एकसष्ट \or बासष्ट \or त्रेसष्ट % + \or चौसष्ट \or पासष्ट \or सहासष्ट \or सदुष्ट \or अडुसष्ट \or एकोणसत्तर\or सत्तर \or एकाहत्तर \or बाहत्तर \or त्र्याहत्तर \or चौऱ्याहत्तर \or पंचाहत्तर % + \or शाहत्तर \or सत्त्याहत्तर \or अठ्ठ्याहत्तर \or एकोणऐंशी \or ऐंशी\or एक्याऐंशी \or ब्याऐंशी \or त्र्याऐंशी \or चौऱ्याऐंशी \or पंच्याऐंशी \or श्याऐंशी \or सत्त्याऐंशी % + \or अठ्ठ्याऐंशी \or एकोणनव्वद \or नव्वद \or एक्याण्णव\or ब्याण्णव \or त्र्याण्णव \or चौऱ्याण्णव \or पंचाण्णव \or शहाण्णव \or सत्त्याण्णव \or अठ्याण्णव % \or नव्याण्णव \or शंभर\else\@ctrerr% \fi% } @@ -138,17 +133,4 @@ and may look very wrong.} \let\@Roman\xpg@save@Roman } -\def\blockextras@marathi{% - \let\xpg@orig@baselinestretch\baselinestrech% - \renewcommand{\baselinestretch}{1.2}% - \renewcommand{\labelitemii}{$\rightarrow$}% -} - -\let\xpg@orig@labelitemii\labelitemii - -\def\noextras@marathi{% - \let\baselinestrech\xpg@orig@baselinestretch% - \let\labelitemii\xpg@orig@labelitemii% -} - \endinput diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf index 62b5ce7f3d0..5fe17ffd4d0 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf @@ -98,7 +98,7 @@ \def\@Ccdash{\leavevmode \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}% \ifx\cyrdash\undefined - \def\cyrdash{\hbox to.8em{--\hss--}}% + \def\cyrdash{\hbox to.8em{\textendash\hss\textendash}}% \fi \declare@shorthand{mongolian}{",}{\nobreak\hskip.2em\ignorespaces}% } @@ -212,7 +212,7 @@ \def\noextras@mongolian{% \ifcyrillic@numerals\nomongolian@numbers\fi% - \nomongolian@shorthands% + \ifmongolian@babelshorthands\nomongolian@shorthands\fi% } \def\blockextras@mongolian{% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf index b494272b0d8..08884434c07 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf @@ -140,20 +140,20 @@ \finalhyphendemerits=\the\finalhyphendemerits} } \def\noextras@occitan{% - \lccode\string"2019=\z@ - \nooccitan@shorthands - \xpgoc@savedvalues + \lccode\string"2019=\z@% + \ifoccitan@babelshorthands\nooccitan@shorthands\fi% + \xpgoc@savedvalues% } \def\blockextras@occitan{% - \lccode\string"2019=\string"2019 - \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000 - \finalhyphendemerits=50000000 - \ifoccitan@babelshorthands\occitan@shorthands\fi + \lccode\string"2019=\string"2019% + \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000% + \finalhyphendemerits=50000000% + \ifoccitan@babelshorthands\occitan@shorthands\fi% } \def\inlineextras@occitan{% - \lccode\string"2019=\string"2019 - \ifoccitan@babelshorthands\occitan@shorthands\fi + \lccode\string"2019=\string"2019% + \ifoccitan@babelshorthands\occitan@shorthands\fi% } %% Distributable under the LaTeX Project Public License, %% version 1.3c or higher (your choice). The latest version of diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf index 6d6f60c2e6f..f8fef6f6088 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf @@ -1,10 +1,5 @@ \ProvidesFile{gloss-persian.ldf}[polyglossia: module for persian] -\ifluatex - \xpg@warning{Persian is not supported with LuaTeX.\MessageBreak -I will proceed with the compilation, but\MessageBreak -the output is not guaranteed to be correct\MessageBreak -and may look very wrong.} -\fi + \RequireBidi \RequirePackage{arabicnumbers} \RequirePackage{farsical} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-piedmontese.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-piedmontese.ldf index 536ff648efb..61d5d7b1d2d 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-piedmontese.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-piedmontese.ldf @@ -99,21 +99,21 @@ \def\noextras@piedmontese{% - \lccode\string"2019=\z@ - \nopiedmontese@shorthands - \xpgpms@savedvalues + \lccode\string"2019=\z@% + \ifpiedmontese@babelshorthands\nopiedmontese@shorthands\fi% + \xpgpms@savedvalues% } \def\blockextras@piedmontese{% - \lccode\string"2019=\string"2019 - \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000 - \finalhyphendemerits=50000000 - \ifpiedmontese@babelshorthands\piedmontese@shorthands\fi + \lccode\string"2019=\string"2019% + \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000% + \finalhyphendemerits=50000000% + \ifpiedmontese@babelshorthands\piedmontese@shorthands\fi% } \def\inlineextras@piedmontese{% - \lccode\string"2019=\string"2019 - \ifpiedmontese@babelshorthands\piedmontese@shorthands\fi + \lccode\string"2019=\string"2019% + \ifpiedmontese@babelshorthands\piedmontese@shorthands\fi% } %%% CHANGES END %%% \endinput diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf index a58e9784c30..048ad1c671c 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf @@ -28,10 +28,8 @@ % brazilian: \def\portuguese@variant{brazil}% \SetLanguageKeys{portuguese}{babelname=brazil,bcp47=pt-BR}% - \xpg@ifdefined{brazil}{}% - {\xpg@warning{No hyphenation patterns were loaded for "Portuguese (Brazil)"\MessageBreak - I will use the standard patterns for Portuguese instead}% - \adddialect\l@brazil\l@portuges\relax}% + % There are no specific brazil patterns + \adddialect\l@brazil\l@portuges\relax% \fi \xpg@info{Option: portuguese, variant=\xpg@val}% }{\xpg@warning{Unknown portuguese variant `#1'}} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf index 60681c5d034..acad46ca854 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf @@ -59,19 +59,26 @@ \xpg@info{Option: Russian, numerals=\xpg@val}% }{\xpg@warning{Unknown Russian numerals value `#1'}} -\define@boolkey{russian}[russian@]{indentfirst}[true]{ - \ifrussian@indentfirst - \SetLanguageKeys{russian}{indentfirst=true} - \else - \SetLanguageKeys{russian}{indentfirst=false} - \fi +\define@boolkey{russian}[russian@]{indentfirst}[true]{% + \ifrussian@indentfirst + \SetLanguageKeys{russian}{indentfirst=true}% + \else + \SetLanguageKeys{russian}{indentfirst=false}% + \fi% } \define@boolkey{russian}[russian@]{babelshorthands}[true]{} +% Force punctuation after heading number +\define@boolkey{russian}[russian@]{forceheadingpunctuation}[true]{} + % Register default options -\xpg@initialize@gloss@options{russian}{babelshorthands=false,spelling=modern,numerals=arabic,indentfirst=false} +\xpg@initialize@gloss@options{russian}{babelshorthands=false, + spelling=modern, + numerals=arabic, + indentfirst=true, + forceheadingpunctuation=true} \ifsystem@babelshorthands @@ -119,7 +126,7 @@ \def\@Ccdash{\leavevmode \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}% \ifx\cyrdash\undefined - \def\cyrdash{\hbox to.8em{--\hss--}}% + \def\cyrdash{\hbox to.8em{\textendash\hss\textendash}}% \fi \declare@shorthand{russian}{",}{\nobreak\hskip.2em\ignorespaces}% } @@ -216,39 +223,46 @@ \space \number\year\space г.}% } -% The following is based on some ideas from ruscor.sty +% Russian needs trailing dots in all headings +\def\xpg@save@autodot{} +\ifdef{\KOMAScript}{% + \let\xpg@save@autodot\autodot% +} + \def\russian@capsformat{% + \ifrussian@forceheadingpunctuation% \ifdef{\KOMAScript}{% - \ifdef{\chapterformat}{% - \renewcommand{\chapterformat}{\prechapter\thechapter\postchapter}}{}% - \ifdef{\sectionformat}{% - \renewcommand{\sectionformat}{\presection\thesection\postsection}}{}% - \ifdef{\subsectionformat}{% - \renewcommand{\subsectionformat}{\presubsection\thesubsection\postsubsection}}{}% - \ifdef{\subsubsectionformat}{% - \renewcommand{\subsubsectionformat}{\presubsubsection\thesubsubsection\postsubsubsection}}{}% - \ifdef{\paragraphformat}{% - \renewcommand{\paragraphformat}{\preparagraph\theparagraph\postparagraph}}{}% - \ifdef{\subparagraphformat}{% - \renewcommand{\subparagraphformat}{\presubparagraph\thesubparagraph\postsubparagraph}}{}% + \renewcommand*\autodot{.}% }{% + % The following is based on some ideas from ruscor.sty \def\@seccntformat##1{\csname pre##1\endcsname% \csname the##1\endcsname% \csname post##1\endcsname}% - }% - \def\@aftersepkern{\hspace{0.5em}}% - \def\postchapter{.\@aftersepkern}% - \def\postsection{.\@aftersepkern}% - \def\postsubsection{.\@aftersepkern}% - \def\postsubsubsection{.\@aftersepkern}% - \def\postparagraph{.\@aftersepkern}% - \def\postsubparagraph{.\@aftersepkern}% - \def\prechapter{}% - \def\presection{}% - \def\presubsection{}% - \def\presubsubsection{}% - \def\preparagraph{}% - \def\presubparagraph{}% + \def\@aftersepkern{\hspace{0.5em}}% + \def\postchapter{.\@aftersepkern}% + \def\postsection{.\@aftersepkern}% + \def\postsubsection{.\@aftersepkern}% + \def\postsubsubsection{.\@aftersepkern}% + \def\postparagraph{.\@aftersepkern}% + \def\postsubparagraph{.\@aftersepkern}% + \def\prechapter{}% + \def\presection{}% + \def\presubsection{}% + \def\presubsubsection{}% + \def\preparagraph{}% + \def\presubparagraph{}% + }% + \fi% +} + +\def\norussian@capsformat{% + \ifrussian@forceheadingpunctuation% + \ifdef{\KOMAScript}{% + \let\autodot\xpg@save@autodot% + }{% + \def\@seccntformat##1{\csname the##1\endcsname\quad}% = LaTeX kernel + }% + \fi% } \newcommand{\russiannumerals}[2]{\russiannumber{#2}} @@ -323,24 +337,9 @@ } \def\noextras@russian{% - \ifdef{\KOMAScript}{% - \ifdef{\chapterformat}{% - \renewcommand{\chapterformat}{\thechapter\autodot\enskip}}{}% - \ifdef{\sectionformat}{% - \renewcommand{\sectionformat}{\thesection\autodot\enskip}}{}% - \ifdef{\subsectionformat}{% - \renewcommand{\subsectionformat}{\thesubsection\autodot\enskip}}{}% - \ifdef{\subsubsectionformat}{% - \renewcommand{\subsubsectionformat}{\thesubsubsection\autodot\enskip}}{}% - \ifdef{\paragraphformat}{% - \renewcommand{\paragraphformat}{\theparagraph\autodot\enskip}}{}% - \ifdef{\subparagraphformat}{% - \renewcommand{\subparagraphformat}{\thesubparagraph\autodot\enskip}}{}% - }{% - \def\@seccntformat##1{\csname the##1\endcsname\quad}% = LaTeX kernel - }% + \norussian@capsformat% \ifcyrillic@numerals\norussian@numbers\fi% - \norussian@shorthands% + \ifrussian@babelshorthands\norussian@shorthands\fi% } \def\blockextras@russian{% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf index 07f4c3e4689..2e940d9556f 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf @@ -1,10 +1,4 @@ \ProvidesFile{gloss-sanskrit.ldf}[polyglossia: module for sanskrit] -\ifluatex - \xpg@warning{Sanskrit is not supported with LuaTeX.\MessageBreak -I will proceed with the compilation, but\MessageBreak -the output is not guaranteed to be correct\MessageBreak -and may look very wrong.} -\fi \RequirePackage{devanagaridigits} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf index afcfba36aa2..6e28a96ccd2 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf @@ -14,7 +14,8 @@ indentfirst=true, fontsetup=false, localnumeral=serbiannumerals, - Localnumeral=Serbiannumerals + Localnumeral=Serbiannumerals, + babelname=serbian %TODO localalph } @@ -36,7 +37,7 @@ \or % latin: \@serbian@cyrfalse - \SetLanguageKeys{serbian}{scripttag=latn,script=Latin,bcp47=sr-Latn} + \SetLanguageKeys{serbian}{scripttag=latn,script=Latin,babelname=serbian,bcp47=sr-Latn} \xpg@fontsetup@latin{serbian}% %TODO \def\serbian@language{\language=\l@serbianlat}% % or should we use Croatian patterns as a fallback for the time being??? diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf index 51ca090ff0d..c64a408b9b4 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf @@ -85,7 +85,7 @@ \chardef\slovak@boundary=4095 % \def\newXeTeXintercharclass{% \e@alloc\XeTeXcharclass\chardef - \xe@alloc@intercharclass\m@ne\@ucharclass@boundary} + \xe@alloc@intercharclass\m@ne\@ucharclass@boundary}% \else \chardef\slovak@boundary=255 \fi @@ -114,6 +114,24 @@ % Add nonbreakable space after single-letter word to % prevent them to land at the end of a line +% vlna code taken and adapted from xevlna.sty +\ifxetex + \def\slovak@nointerchartoks{\let\slovak@interchartoks\slovak@PreCSpreposition}% + \def\slovak@PreCSpreposition{% + \def\next{}% + \ifnum\catcode`\ =10 % nothing will be done in verbatim + \ifmmode % nothing in math + \else + \let\slovak@interchartoks\slovak@nointerchartoks + \let\next\slovak@ExamineCSpreposition + \fi\fi + \next% + }% + \def\slovak@ExamineCSpreposition #1{#1\futurelet\next\slovak@ProcessCSpreposition}% + \def\slovak@ProcessCSpreposition{\ifx\next\slovak@XeTeXspace\nobreak\fi}% + \futurelet\slovak@XeTeXspace{ }\slovak@nointerchartoks +\fi + \def\slovak@vlna{% \ifluatex \preventsingleon @@ -140,21 +158,8 @@ \XeTeXcharclass `\a \slovak@nonsyllabicpreposition \XeTeXcharclass `\I \slovak@nonsyllabicpreposition \XeTeXcharclass `\i \slovak@nonsyllabicpreposition - \XeTeXinterchartoks \slovak@boundary \slovak@nonsyllabicpreposition {\slovak@interchartoks} - \XeTeXinterchartoks \slovak@openpunctuation \slovak@nonsyllabicpreposition {\slovak@interchartoks} - \def\slovak@nointerchartoks{\let\slovak@interchartoks\slovak@PreCSpreposition} - \def\slovak@PreCSpreposition{\def\next{}% - \ifnum\catcode`\ =10 % nothing will be done in verbatim - \ifmmode % nothing in math - \else - \let\slovak@interchartoks\slovak@nointerchartoks - \let\next\slovak@ExamineCSpreposition - \fi \fi - \next% - } - \def\slovak@ExamineCSpreposition ##1{##1\futurelet\next\slovak@ProcessCSpreposition} - \def\slovak@ProcessCSpreposition{\ifx\next\slovak@XeTeXspace\nobreak\fi} - \futurelet\slovak@XeTeXspace{ }\slovak@nointerchartoks + \XeTeXinterchartoks \slovak@boundary \slovak@nonsyllabicpreposition {\slovak@interchartoks}% + \XeTeXinterchartoks \slovak@openpunctuation \slovak@nonsyllabicpreposition {\slovak@interchartoks}% \fi } @@ -220,7 +225,7 @@ } \def\noextras@slovak{% - \noslovak@shorthands% + \ifslovak@babelshorthands\noslovak@shorthands\fi% \noslovak@hyphens% \noslovak@vlna% \ifxetex\XeTeXinterchartokenstate=0\fi% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-syriac.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-syriac.ldf index 3347e8f55a0..da16930acf5 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-syriac.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-syriac.ldf @@ -1,10 +1,5 @@ \ProvidesFile{gloss-syriac.ldf}[polyglossia: module for syriac] -\ifluatex - \xpg@warning{Syriac is not supported with LuaTeX.\MessageBreak -I will proceed with the compilation, but\MessageBreak -the output is not guaranteed to be correct\MessageBreak -and may look very wrong.} -\fi + \RequireBidi \RequirePackage{arabicnumbers} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-tamil.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-tamil.ldf index 5ddb42b0b72..a4822a9992c 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-tamil.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-tamil.ldf @@ -1,10 +1,5 @@ \ProvidesFile{gloss-tamil.ldf}[polyglossia: module for tamil] -\ifluatex - \xpg@warning{Tamil is not supported with LuaTeX.\MessageBreak -I will proceed with the compilation, but\MessageBreak -the output is not guaranteed to be correct\MessageBreak -and may look very wrong.} -\fi + % Translations provided by Kevin & Siji, 01-11-2009 \PolyglossiaSetup{tamil}{ diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-telugu.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-telugu.ldf index 4f382fb3b17..a5da39e3d96 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-telugu.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-telugu.ldf @@ -1,10 +1,5 @@ \ProvidesFile{gloss-telugu.ldf}[polyglossia: module for telugu] -\ifluatex - \xpg@warning{Telugu is not supported with LuaTeX.\MessageBreak -I will proceed with the compilation, but\MessageBreak -the output is not guaranteed to be correct\MessageBreak -and may look very wrong.} -\fi + % Translations provided by Anmol Sharma <unmole.in@gmail.com> \PolyglossiaSetup{telugu}{ diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-thai.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-thai.ldf index b5657a20370..23582abe2b8 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-thai.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-thai.ldf @@ -8,12 +8,6 @@ %%%% Thai Linux Working Group %%%% http://linux.thai.net/ %%%% -\ifluatex - \xpg@warning{Thai is not supported with LuaTeX.\MessageBreak -I will proceed with the compilation, but\MessageBreak -the output is not guaranteed to be correct\MessageBreak -and may look very wrong.} -\fi \PolyglossiaSetup{thai}{ bcp47=th, script=Thai, diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf index 7b82a76c775..417e258f2a8 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf @@ -96,7 +96,7 @@ \def\@Ccdash{\leavevmode \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}% \ifx\cyrdash\undefined - \def\cyrdash{\hbox to.8em{--\hss--}} + \def\cyrdash{\hbox to.8em{\textendash\hss\textendash}}% \fi \declare@shorthand{ukrainian}{",}{\nobreak\hskip.2em\ignorespaces}% } @@ -174,7 +174,7 @@ \def\ukrainiannumber#1{% \ifcyrillic@numerals \ifcyrillic@asbuk@numerals - \serbian@asbuk@alph{#1}% + \ukrainian@asbuk@alph{#1}% \else \cyr@alph{#1}% \fi @@ -186,7 +186,7 @@ \def\Ukrainiannumber#1{% \ifcyrillic@numerals \ifcyrillic@asbuk@numerals - \serbian@asbuk@Alph{#1}% + \ukrainian@asbuk@Alph{#1}% \else \cyr@Alph{#1}% \fi @@ -206,25 +206,29 @@ % This is a poor man's cyrillic alphanumeric. It just uses the alphabet and % thus ends at 30. -\def\ukranian@asbuk@Alph#1{\ifcase#1\or +\def\ukrainian@asbuk@Alph#1{\ifcase#1\or А\or Б\or В\or Г\or Д\or Е\or Ж\or З\or И\or К\or Л\or М\or Н\or О\or П\or Р\or С\or Т\or У\or Ф\or Х\or Ц\or Ч\or Ш\or Щ\or Э\or Ю\or Я% - \else\xpg@ill@value{#1}{ukranian@asbuk@Alph}\fi% + \else\xpg@ill@value{#1}{ukrainian@asbuk@Alph}\fi% } -\def\ukranian@asbuk@alph#1{\ifcase#1\or +\def\ukrainian@asbuk@alph#1{\ifcase#1\or а\or б\or в\or г\or д\or е\or ж\or з\or и\or к\or л\or м\or н\or о\or п\or р\or с\or т\or у\or ф\or х\or ц\or ч\or ш\or щ\or э\or ю\or я% - \else\xpg@ill@value{#1}{ukranian@asbuk@alph}\fi% + \else\xpg@ill@value{#1}{ukrainian@asbuk@alph}\fi% } \def\ukrainian@numbers{% - \let\@Alph\ukrainian@Alph% - \let\@alph\ukrainian@alph% + \ifcyrillic@numerals + \def\ukrainian@alph##1{\expandafter\ukrainiannumeral\expandafter{\the##1}}% + \def\ukrainian@Alph##1{\expandafter\Ukrainiannumeral\expandafter{\the##1}}% + \let\@Alph\ukrainian@Alph% + \let\@alph\ukrainian@alph% + \fi } \def\noukrainian@numbers{% @@ -235,13 +239,13 @@ \def\noextras@ukrainian{% \def\@seccntformat##1{\csname the##1\endcsname\quad}% = LaTeX kernel \ifcyrillic@numerals\noukrainian@numbers\fi - \noukrainian@shorthands% + \ifukrainian@babelshorthands\noukrainian@shorthands\fi% } \def\blockextras@ukrainian{% \ukrainian@capsformat% - \ifcyrillic@numerals\ukrainian@numbers\fi - \ifukrainian@babelshorthands\ukrainian@shorthands\fi + \ifcyrillic@numerals\ukrainian@numbers\fi% + \ifukrainian@babelshorthands\ukrainian@shorthands\fi% } \def\inlineextras@ukrainian{% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-urdu.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-urdu.ldf index 9bb37148fc1..3e436780a78 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-urdu.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-urdu.ldf @@ -1,11 +1,6 @@ %%% Adapted from a file contributed by Kamal Abdali \ProvidesFile{gloss-urdu.ldf}[polyglossia: module for Urdu] -\ifluatex - \xpg@warning{Urdu is not supported with LuaTeX.\MessageBreak -I will proceed with the compilation, but\MessageBreak -the output is not guaranteed to be correct\MessageBreak -and may look very wrong.} -\fi + \RequireBidi \RequirePackage{arabicnumbers} \RequirePackage{hijrical} diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-punct.lua b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-punct.lua index 98367dd016c..67e32d74453 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-punct.lua +++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-punct.lua @@ -93,21 +93,21 @@ local left_bracket_chars = { -- all right bracket characters, referenced by their Unicode slot local right_bracket_chars = { - [0x29] = true, -- right parenthesis - [0x5D] = true, -- right square bracket - [0x7D] = true, -- right curly bracket + [0x29] = true, -- right parenthesis + [0x5D] = true, -- right square bracket + [0x7D] = true, -- right curly bracket [0x27E9] = true -- mathematical right angle bracket } -- question and exclamation marks, referenced by their Unicode slot local question_exclamation_chars = { - [0x21] = true, -- exclamation mark ! - [0x3F] = true, -- question mark ? + [0x21] = true, -- exclamation mark ! + [0x3F] = true, -- question mark ? [0x203C] = true, -- double exclamation mark ‼ [0x203D] = true, -- interrobang ‽ [0x2047] = true, -- double question mark ⁇ [0x2048] = true, -- question exclamation mark ⁈ - [0x2049] = true, -- exclamation question mark ⁉ + [0x2049] = true -- exclamation question mark ⁉ } -- from nodes-tst.lua, adapted @@ -233,9 +233,12 @@ local function process(head) if id == glyph_code then local attr = has_attribute(current, punct_attr) if attr then - local char = utf8.char(current.char) -- requires Lua 5.3 - local leftspace = left_space[attr][char] - local rightspace = right_space[attr][char] + local char, leftspace, rightspace + if current.char <= 0x10FFFF then -- greater values may cause problems with utf8.char + char = utf8.char(current.char) + leftspace = left_space[attr][char] + rightspace = right_space[attr][char] + end if leftspace or rightspace then local fontparameters = fonts.hashes.parameters[current.font] local unit, stretch, shrink, spacing_node @@ -243,14 +246,14 @@ local function process(head) local prev = getprev(current) local space_exception = false if prev then - local prevprev = getprev(prev) -- do not add space after left (opening) bracket and between question/exclamation marks space_exception = someleftbracket(prev) or question_exclamation_sequence(prev, current) - if somespace(prev) then -- TODO: there is a question here: do we override a preceding space or not?... - if somepenalty(prevprev, 10000) then - head = remove_node(head, prevprev) - end + while somespace(prev) do + head = remove_node(head, prev) + prev = getprev(current) + end + if somepenalty(prev, 10000) then head = remove_node(head, prev) end end @@ -280,10 +283,10 @@ local function process(head) space_exception = somerightbracket(next) local nextnext = getnext(next) if somepenalty(next, 10000) and somespace(nextnext) then - head = remove_node(head, next) - head = remove_node(head, nextnext) - elseif somespace(next) then - head = remove_node(head, next) + head, next = remove_node(head, next) + end + while somespace(next) do + head, next = remove_node(head, next) end end if rightspace.unit == "quad" then diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty index 620d946b416..42d3da86aa4 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty +++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty @@ -1,17 +1,12 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{polyglossia}[2020/04/08 v1.49 +\ProvidesPackage{polyglossia}[2020/10/09 v1.50 Modern multilingual typesetting with XeLaTeX and LuaLaTeX] \RequirePackage{etoolbox} \RequirePackage{makecmds} \RequirePackage{xkeyval}[2008/08/13] % Will raise error if used with anything else than XeTeX or LuaTeX \RequirePackage{fontspec}[2010/06/08]% v2.0 -% Ironically, ifluatex.sty is included by some other package if we run -% LuaTeX, but it's not if we run XeTeX, and we need it to know which of -% the two engines it is! Hence we include it here. -\RequirePackage{ifluatex} -% For symmetry with ifluatex -\RequirePackage{ifxetex} +\RequirePackage{iftex} \RequirePackage{expl3} \RequirePackage{l3keys2e} \RequirePackage{xparse} @@ -32,6 +27,7 @@ \def\bbl@cs#1{\csname bbl@#1\endcsname}% \AtEndPreamble{\let\bbl@set@language\xpg@set@language@aux} %for biblatex \AtEndPreamble{\let\bbl@main@language\xpg@main@language} %for biblatex +\providecommand\texorpdfstring[2]{#1}% dummy command if hyperref is not loaded \ifluatex \RequirePackage{luatexbase} % already included by fontspec, but needed here @@ -1031,16 +1027,27 @@ } \newcommand{\xpg@input}[1]{% - \chardef\xpg@atcatcode\catcode`\@ + % Store catcode of @ before making at letter + \chardef\xpg@saved@at@catcode\catcode`\@ \makeatletter - \input{#1}\catcode`\@=\xpg@atcatcode} + \input{#1}% + % restore former @ catcode + \catcode`\@=\xpg@saved@at@catcode% +} % try to load a language file \cs_new:Nn \polyglossia_load_lang_definition:nn { \file_if_exist:nTF{gloss-#2.ldf} { + % Temporarily force catcode of ~ to 13 since babelsh.def + % requires it. This is needed particularly with LaTeX3 + % packages which force \ExplSyntaxOn (#425) + \protected\edef\xpg@restore@tilde@catcode{\catcode 126 = \the\catcode 126\relax} + \catcode 126 = 13 \xpg@input{gloss-#2.ldf} \setkeys{#2}{#1} + % restore former ~ catcode + \xpg@restore@tilde@catcode } { \xpg@nogloss{#2} @@ -1054,8 +1061,8 @@ { \exp_args:Nx\polyglossia@define@language@cmd:n{#1}% }{} - \csgdef{#1@loaded}{} - \global\edef\xpg@loaded{#1\ifx\xpg@loaded\@empty\else,\xpg@loaded\fi}% + \polyglossia@register@language:nn{}{#1}% + \csgdef{#1@loaded}{}% } @@ -1116,17 +1123,38 @@ \tl_if_blank:nF {#2} {\csgdef{#4@alias@opts}{#2}}% } +\cs_new:Nn \polyglossia@register@language:nn { + % register polyglossia language name + \ifcsundef{#2@registered}{% + \global\edef\xpg@loaded{% + \ifx\xpg@loaded\@empty\else\xpg@loaded,\fi #2% + }% + }{} + \csgdef{#2@registered}{}% + \tl_if_blank:nF {#1}{% + % Register the language options + \polyglossia@set@lang@options:nn {#2} {#1}% + }% + % register babelname + \def\xpg@tmp@babelname{\prop_item:Nn{\polyglossia@langsetup}{#2/babelname}}% + \ifcsundef{\csname xpg@tmp@babelname\endcsname @bbl@registered}{% + \global\edef\xpg@bloaded{% + \ifx\xpg@bloaded\@empty\else\xpg@bloaded,\fi\xpg@tmp@babelname}% + }{}% + \csgdef{\csname xpg@tmp@babelname\endcsname @bbl@registered}{}% + % register BCP-47 ID + \def\xpg@tmp@bcpname{\prop_item:Nn{\polyglossia@langsetup}{#2/bcp47}}% + \ifcsundef{\csname xpg@tmp@bcpname\endcsname @bcp@registered}{% + \global\edef\xpg@bcp@loaded{% + \ifx\xpg@bcp@loaded\@empty\else\xpg@bcp@loaded,\fi\xpg@tmp@bcpname}% + }{}% + \csgdef{\csname xpg@tmp@bcpname\endcsname @bcp@registered}{}% +} + + \newcommand{\setdefaultlanguage}[2][]{% \ifcsundef{#2@loaded}% { - % latex is an internal language, so do not record - \ifstrequal{#2}{latex}{}{% - \global\edef\xpg@loaded{#2\ifx\xpg@loaded\@empty\else,\xpg@loaded\fi}% - \global\edef\xpg@bloaded{\prop_item:Nn{\polyglossia@langsetup}{#2/babelname}% - \ifx\xpg@bloaded\@empty\else,\xpg@bloaded\fi}% - \global\edef\xpg@bcp@loaded{\prop_item:Nn{\polyglossia@langsetup}{#2/bcp47}% - \ifx\xpg@bcp@loaded\@empty\else,\xpg@bcp@loaded\fi}% - }% \polyglossia_load_lang_definition:nn{#1}{#2} % define environment and command (except for internal latex language) \ifstrequal{#2}{latex}{}{% @@ -1151,18 +1179,6 @@ \cs_new:Nn \polyglossia@set@default@language:nn { - \ifcsundef{#2@loaded}% - { - % latex is an internal language, so do not record - \ifstrequal{#2}{latex}{}{% - \global\edef\xpg@loaded{#2\ifx\xpg@loaded\@empty\else,\xpg@loaded\fi}% - \global\edef\xpg@bloaded{\prop_item:Nn{\polyglossia@langsetup}{#2/babelname}% - \ifx\xpg@bloaded\@empty\else,\xpg@bloaded\fi}% - \global\edef\xpg@bcp@loaded{\prop_item:Nn{\polyglossia@langsetup}{#2/bcp47}% - \ifx\xpg@bcp@loaded\@empty\else,\xpg@bcp@loaded\fi}% - }% - \csgdef{#2@loaded}{}% - }{} \gdef\xpg@main@language{#2}% \tl_if_blank:nTF {#1}{\gdef\mainlanguagevariant{}}{% % Register the language options @@ -1393,9 +1409,9 @@ \else\csuse@warn{#1@font@rm}\fi\fi} \def\xpg@set@normalfont#1{% - \letcs{\rmfamily}{#1@font@rm}% - \letcs{\sffamily}{#1@font@sf}% - \letcs{\ttfamily}{#1@font@tt}% + \DeclareRobustCommand\rmfamily{\csuse{#1@font@rm}}% + \DeclareRobustCommand\sffamily{\csuse{#1@font@sf}}% + \DeclareRobustCommand\ttfamily{\csuse{#1@font@tt}}% \gdef\normalfont{\protect\xpg@select@fontfamily{#1}% \fontseries{\seriesdefault}\selectfont% \fontshape{\shapedefault}\selectfont}% @@ -1431,11 +1447,9 @@ \newcommand{\setotherlanguage}[2][]{% \ifcsundef{#2@loaded} { - \global\edef\xpg@loaded{#2\ifx\xpg@loaded\@empty\else,\xpg@loaded\fi}% \polyglossia_load_lang_definition:nn{#1}{#2} % define environment and command \exp_args:Nx\polyglossia@define@language@cmd:n{#2} - \csgdef{#2@loaded}{}% \ifcsdef{#2@alias@lang}{% \ifcsdef{#2@alias@opts}{% \exp_args:Nxx \polyglossia_load_lang_definition:nn {\csuse{#2@alias@opts},#1} {\csuse{#2@alias@lang}}% @@ -1446,17 +1460,14 @@ }{% \polyglossia@set@other@language:nn {#1} {#2}% }% + \csgdef{#2@loaded}{}% } {} } \cs_new:Nn \polyglossia@set@other@language:nn { - \ifcsundef{#2@loaded} - { - \global\edef\xpg@loaded{#2\ifx\xpg@loaded\@empty\else,\xpg@loaded\fi}% - \csgdef{#2@loaded}{}% - }{} + \polyglossia@register@language:nn{#1}{#2}% % If a variant is set, store it. \gdef\otherlanguagevariant{} \tl_if_blank:nTF {#1}{}{% @@ -1523,6 +1534,7 @@ % wrapper for foreignlanguage and otherlanguage* \newcommand*\polyglossia@setforeignlanguage[2][]{ \select@@language[#1]{#2} + \polyglossia@register@language:nn{#1}{#2}% % Store babelname of current language (for external packages such as biblatex) \tl_if_blank:nTF {#1}{% \ifcsundef{#2@gbabelname}{% @@ -1678,14 +1690,7 @@ \directlua{polyglossia.select_language('\luatexluaescapestring{\string#3}', \the\csname l@#3\endcsname)}% \fi% - \def\xpg@tmp@babelname{\prop_item:Nn{\polyglossia@langsetup}{#3/babelname}} - % Store babelname in \xpg@bloaded csv list - \ifcsundef{\csname xpg@tmp@babelname\endcsname @bbl@loaded} - { - \global\edef\xpg@bloaded{\xpg@tmp@babelname% - \ifx\xpg@bloaded\@empty\else,\xpg@bloaded\fi}% - \csgdef{\csname xpg@tmp@babelname\endcsname @bbl@loaded}{}% - }{} + \polyglossia@register@language:nn{#2}{#3}% } @@ -1876,14 +1881,6 @@ }{% \csedef{bcp47id}{\prop_item:Nn{\polyglossia@langsetup}{#2/bcp47}}% }% - % Store bcp47 in \xpg@bcp@loaded csv list - \def\xpg@tmp@bcpname{\csuse{bcp47id}}% - \ifcsundef{\csname xpg@tmp@bcpname\endcsname @bcp@loaded} - { - \global\edef\xpg@bcp@loaded{\xpg@tmp@bcpname% - \ifx\xpg@bcp@loaded\@empty\else,\xpg@bcp@loaded\fi}% - \csgdef{\csname xpg@tmp@bcpname\endcsname @bcp@loaded}{}% - }{} \@select@language[#1]{#2}% % Write to the aux \if@filesw% @@ -2039,7 +2036,7 @@ \cs_if_exist_use:c{date@bbl@\babelname}% \polyglossia@local@marks:n{#2}% \csuse{init@extras@#2}% - \polyglossia@lang@indentfirst:n{#2} + \polyglossia@lang@indentfirst:n{#2}% \csuse{blockextras@#2}% % This is a hook for external packages which want to access variants % via babelname (such as biblatex) @@ -2087,7 +2084,7 @@ \xpg@select@fontfamily{#2}% \csuse@warn{#2@language}% \csuse{#2@numbers}% - \use@localhyphenmins{#2}% + \use@localhyphenmins[#1]{#2}% \polyglossia@lang@frenchspacing:n{#2} } @@ -2124,14 +2121,66 @@ \fi }{% \xpg@warning{\string\setlocalhyphenmin\space~ useless~ for~ unknown~ language~ #1}% - }}% + }% +}% + +% \setlanghyphenmins[options]{lang}{l}{r} +\newcommand*\setlanghyphenmins[4][]{% + % Check for real language name and options + \edef\xpg@tmp@lang{#2}% + \edef\xpg@tmp@opts{#1}% + \ifcsdef{#2@alias@lang}{% + \edef\xpg@tmp@lang{\csuse{#2@alias@lang}}% + \ifcsdef{#2@alias@opts}{% + \edef\xpg@tmp@opts{\csuse{#2@alias@opts},#1}% + }{}% + }{}% + \bgroup + \polyglossia@error@iflangnotloaded:n{\xpg@tmp@lang} + \exp_args:Nne \setkeys{\xpg@tmp@lang}{\xpg@tmp@opts}% + % Store BCP-47 id of language + \tl_if_blank:nTF {\xpg@tmp@opts}{% + \ifcsundef{\csname xpg@tmp@lang\endcsname @gbcp47id}{% + \csedef{tmp@bcp47id}{\exp_args:Nne\prop_item:Nn{\polyglossia@langsetup}{\xpg@tmp@lang /bcp47}}% + }{% + \csedef{tmp@bcp47id}{\csuse{#2@gbcp47id}}% + }% + }{% + \csedef{tmp@bcp47id}{\exp_args:Nne \prop_item:Nn{\polyglossia@langsetup}{\xpg@tmp@lang /bcp47}}% + }% + \xpg@warning{id: \csuse{tmp@bcp47id}}% + \csgdef{\csname tmp@bcp47id\endcsname @hyphenmins}{{#3}{#4}}% + \egroup +} -\def\use@localhyphenmins#1{% - \ifcsundef{#1hyphenmins}{}% - {\expandafter\expandafter\expandafter\set@hyphenmins\csname #1hyphenmins\endcsname\relax} +% \use@localhypenmins[options]{lang} +\newcommand*\use@localhyphenmins[2][]{% + \bgroup + \polyglossia@error@iflangnotloaded:n{#2} + \setkeys{#2}{#1}% + % Store BCP-47 id of language + \tl_if_blank:nTF {#1}{% + \ifcsundef{#2@gbcp47id}{% + \csxdef{tmp@bcp47id}{\prop_item:Nn{\polyglossia@langsetup}{#2/bcp47}}% + }{% + \csxdef{tmp@bcp47id}{\csuse{#2@gbcp47id}}% + }% + }{% + \csxdef{tmp@bcp47id}{\prop_item:Nn{\polyglossia@langsetup}{#2/bcp47}}% + }% + \egroup + \ifcsundef{\csname tmp@bcp47id\endcsname @hyphenmins}{% + \ifcsundef{#2hyphenmins}{}% + {% + \expandafter\expandafter\expandafter\set@hyphenmins\csname #2hyphenmins\endcsname\relax% + } + }{% + \edef\tmpa{\csuse{\csname tmp@bcp47id\endcsname @hyphenmins}}% + \expandafter\expandafter\expandafter\set@hyphenmins\tmpa\relax% + } \ifluatex % Set \totalhyphenmin if specified - \prop_get:NxNTF \polyglossia@langsetup {#1/totalhyphenmin} \l_tmpa_tl + \prop_get:NxNTF \polyglossia@langsetup {#2/totalhyphenmin} \l_tmpa_tl { \xpg@warning{totalhyphenmin: '\l_tmpa_tl'} \expandafter\hyphenationmin \l_tmpa_tl% @@ -2140,6 +2189,47 @@ \fi } +% Babel previously compiled in hyphenrules into the kernel (via hyphen.cfg) +% but this is no longer the case. In any case, we roll our own one now +% and possibly overwrite babel's. +\provideenvironment{hyphenrules}{}{} + +% As opposed to the one inherited from switch.def/babel, our environment +% supports language options and aliases. +\renewenvironment{hyphenrules}[2][] +{% + % We usually embrace the switch in groups to keep the changes local. + % We cannot do this if an LTR environmet starts in an RTL paragraph, + % as bidi interferes here badly with its directionality smartness. + \ifxetex + \str_if_eq:eeT{\exp_args:Nne\prop_item:Nn{\polyglossia@langsetup}{\languagename/direction}}{RL}% + {% + \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#1/direction}}{RL}% + {}% RTL -> RTL + {\ifvmode\else\booltrue{xpg@noset@groups}\fi}% RTL -> LTR + }% + \fi% + \ifbool{xpg@noset@groups}{}{\xpg@set@group@aux}% + % Check for real language name and options + \edef\xpg@tmp@lang{#2}% + \edef\xpg@tmp@opts{#1}% + \ifcsdef{#2@alias@lang}{% + \edef\xpg@tmp@lang{\csuse{#2@alias@lang}}% + \ifcsdef{#2@alias@opts}{% + \edef\xpg@tmp@opts{\csuse{#2@alias@opts},#1}% + }{}% + }{}% + \tl_if_blank:nF {\xpg@tmp@opts}{% + % Register the language options + \polyglossia@set@lang@options:nn {\xpg@tmp@lang} {\xpg@tmp@opts}% + }% + % Now switch patterns + \csuse@warn{\csuse{xpg@tmp@lang}@language}% + % And activate hyphenmins + \use@localhyphenmins[\xpg@tmp@opts]{\xpg@tmp@lang}% +} +{\ifbool{xpg@noset@groups}{}{\xpg@unset@group@aux}} + \AtEndPreamble{% \@ifpackageloaded{bidi}{% \providecommand*{\aemph}[1]{$\overline{\hboxR{#1}}$}% @@ -2172,12 +2262,18 @@ .bool_set:N = \l_polyglossia_babelshorthands_bool, babelshorthands .default:n = true, + + luatexrenderer + .cs_set:Np = \l_polyglossia_luatex_renderer, + luatexrenderer + .value_required:n = true, } \keys_set:nn { polyglossia } { localmarks = false, verbose = true, babelshorthands = false, + luatexrenderer = Harfbuzz } % load by default latex @@ -2185,6 +2281,16 @@ % then process key in order to overwrite \ProcessKeysOptions{polyglossia} +% Set the LuaTeX renderer. As opposed to fontspec, we use Harfbuzz by default. +% This can be changed via the luatexrenderer package option. +\ifluatex + \exp_args:Nee \str_if_eq:nnF{\l_polyglossia_luatex_renderer}{none} + { + \xpg@info{Setting~ LuaTeX~ font~ renderer~ to~ \l_polyglossia_luatex_renderer} + \exp_args:Nee \defaultfontfeatures{Renderer=\l_polyglossia_luatex_renderer} + } +\fi + \bool_if:nTF \l_polyglossia_verbose_bool {} { \gdef\@latex@info#1{\relax}% no latex info \gdef\@font@info#1{\relax}% no latex font info |