diff options
author | Karl Berry <karl@freefriends.org> | 2020-03-25 21:12:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-03-25 21:12:39 +0000 |
commit | 35f81995c64bc9054dea2309892ec9d1981a0381 (patch) | |
tree | 742db13de0c2f1d15b726db88467f2c6ed10a9ae /Master/texmf-dist/tex/latex/polyglossia | |
parent | fcb69d608481cdc29dc44bf1f5f7a7e63e7701fd (diff) |
polyglossia (25mar20)
git-svn-id: svn://tug.org/texlive/trunk@54549 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/polyglossia')
27 files changed, 187 insertions, 135 deletions
diff --git a/Master/texmf-dist/tex/latex/polyglossia/babelsh.def b/Master/texmf-dist/tex/latex/polyglossia/babelsh.def index c525455fc02..99b1923d956 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/babelsh.def +++ b/Master/texmf-dist/tex/latex/polyglossia/babelsh.def @@ -139,14 +139,30 @@ % % ------------------------------------------------------------------------------ % -% line 108 from babel.def +% lines 108 and 109 from babel.def % % ------------------------------------------------------------------------------ % \def\bbl@csarg#1#2{\expandafter#1\csname bbl@#2\endcsname}% +\def\bbl@cs#1{\csname bbl@#1\endcsname}% + +% ------------------------------------------------------------------------------ +% +% lines 110 to 116 from babel.def % % ------------------------------------------------------------------------------ % + +\def\bbl@loop#1#2#3{\bbl@@loop#1{#3}#2,\@nnil,} +\def\bbl@loopx#1#2{\expandafter\bbl@loop\expandafter#1\expandafter{#2}} +\def\bbl@@loop#1#2#3,{% + \ifx\@nnil#3\relax\else + \def#1{#3}#2\bbl@afterfi\bbl@@loop#1{#2}% + \fi} +\def\bbl@for#1#2#3{\bbl@loopx#1{#2}{\ifx#1\@empty\else#3\fi}} + +% ------------------------------------------------------------------------------ +% % lines 125 to 130 from babel.def % % ------------------------------------------------------------------------------ diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-armenian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-armenian.ldf index add8aa5cb30..042bbabf660 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-armenian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-armenian.ldf @@ -16,15 +16,15 @@ \newif\if@eastern@armenian \@eastern@armenianfalse -\define@choicekey*+{armenian}{variant}[\val\nr]{western,eastern}[western]{% - \ifcase\nr\relax +\define@choicekey*+{armenian}{variant}[\xpg@val\xpg@nr]{western,eastern}[western]{% + \ifcase\xpg@nr\relax % western: \@eastern@armenianfalse% \or % eastern: \@eastern@armeniantrue% \fi - \xpg@info{Option: Armenian, variant=\val}% + \xpg@info{Option: Armenian, variant=\xpg@val}% }{\xpg@warning{Unknown Armenian variant `#1'}} \newif\if@armenian@numerals diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf index f6c78ad7595..dad28a48535 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf @@ -20,8 +20,8 @@ \setlanguagealias*{belarusian}{be} \def\belarusian@spelling{modern} -\define@choicekey*+{belarusian}{spelling}[\val\nr]{modern,classic,tarask}[modern]{% - \ifcase\nr\relax +\define@choicekey*+{belarusian}{spelling}[\xpg@val\xpg@nr]{modern,classic,tarask}[modern]{% + \ifcase\xpg@nr\relax % modern: \def\belarusian@spelling{modern}% \SetLanguageKeys{belarusian}{bcp47=be}% @@ -38,8 +38,8 @@ \newif\ifcyrillic@numerals \newif\ifcyrillic@asbuk@numerals -\define@choicekey*+{belarusian}{numerals}[\val\nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{% - \ifcase\nr\relax +\define@choicekey*+{belarusian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{% + \ifcase\xpg@nr\relax % arabic: \cyrillic@numeralsfalse% \cyrillic@asbuk@numeralsfalse% @@ -56,7 +56,7 @@ \cyrillic@numeralstrue% \cyrillic@asbuk@numeralstrue% \fi - \xpg@info{Option: Belarusian, numerals=\val}% + \xpg@info{Option: Belarusian, numerals=\xpg@val}% }{\xpg@warning{Unknown Belarusian numerals value `#1'}} \define@boolkey{belarusian}[belarusian@]{babelshorthands}[true]{} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf index 802a7db00b1..94f56070905 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf @@ -30,8 +30,8 @@ \newif\ifbengali@devanagari@numerals \newif\ifbengali@bengali@numerals -\define@choicekey*+{bengali}{numerals}[\val\nr]{Devanagari,Bengali,Western}[Devanagari]{% - \ifcase\nr\relax +\define@choicekey*+{bengali}{numerals}[\xpg@val\xpg@nr]{Devanagari,Bengali,Western}[Devanagari]{% + \ifcase\xpg@nr\relax % Devanagari: \bengali@bengali@numeralsfalse% \bengali@devanagari@numeralstrue% @@ -44,7 +44,7 @@ \bengali@bengali@numeralsfalse% \bengali@devanagari@numeralsfalse% \fi - \xpg@info{Option: Bengali, numerals=\val}% + \xpg@info{Option: Bengali, numerals=\xpg@val}% }{\xpg@warning{Unknown Bengali numeral `#1'}} \def\extras@bengali{} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf index 5e5db8a2f46..e7830363820 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf @@ -37,8 +37,8 @@ % Option ordinalmonthday \define@boolkey{english}[english@]{ordinalmonthday}[true]{} -\define@choicekey*+{english}{variant}[\val\nr]{uk,british,us,american,usmax,australian,newzealand,canadian}[us]{% - \ifcase\nr\relax +\define@choicekey*+{english}{variant}[\xpg@val\xpg@nr]{uk,british,us,american,usmax,australian,newzealand,canadian}[us]{% + \ifcase\xpg@nr\relax % uk: \british@hyphentrue \british@dateformattrue diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf index 43040b0c70b..40b1a3a2442 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf @@ -22,8 +22,8 @@ \setlanguagealias[variant=canadian]{french}{canadien} \def\french@variant{french} -\define@choicekey*+{french}{variant}[\val\nr]{french,canadian,acadian,swiss}[french]{% - \ifcase\nr\relax +\define@choicekey*+{french}{variant}[\xpg@val\xpg@nr]{french,canadian,acadian,swiss}[french]{% + \ifcase\xpg@nr\relax % french: \def\french@variant{french}% \SetLanguageKeys{french}{babelname=french,bcp47=fr-FR}% @@ -53,7 +53,7 @@ \adddialect\l@swissfrench\l@french\relax% \french@thincolonspacetrue \fi - \xpg@info{Option: French, variant=\val}% + \xpg@info{Option: French, variant=\xpg@val}% }{\xpg@warning{Unknown French variant `#1'}} @@ -76,7 +76,11 @@ \def\xpg@unskip{\ifhmode\ifdim\lastskip>\z@\unskip\fi\fi} % Save original footnote definition -\let\xpg@orig@makefntext\@makefntext +% Do this at the end of the preamble to catch other +% packages' footnote changes (#391) +\AtEndPreamble{% + \let\xpg@orig@makefntext\@makefntext +} \define@boolkey{french}[french@]{frenchfootnote}[true]{% \AfterPreamble{% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf index b9cdccd0d96..6823821a6b3 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf @@ -18,8 +18,8 @@ \setlanguagealias[variant=scottish]{gaelic}{scottish} \def\gaelic@variant{irish} -\define@choicekey*+{gaelic}{variant}[\val\nr]{irish,scottish}[irish]{% - \ifcase\nr\relax +\define@choicekey*+{gaelic}{variant}[\xpg@val\xpg@nr]{irish,scottish}[irish]{% + \ifcase\xpg@nr\relax % irish: \gdef\gaelic@variant{irish}% \SetLanguageKeys{gaelic}{language=Irish,langtag=IRI,babelname=irish,bcp47=ga}% @@ -30,7 +30,7 @@ \SetLanguageKeys{gaelic}{language=Gaelic,langtag=GAE,babelname=scottish,bcp47=gd}% \xpg@fontsetup@latin{gaelic}% \fi - \xpg@info{Option: gaelic, variant=\val}% + \xpg@info{Option: gaelic, variant=\xpg@val}% }{\xpg@warning{Unknown gaelic variant `#1'}} % Register default options diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf index 0cf07c8c6da..12147e1a45b 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf @@ -41,8 +41,8 @@ \newif\if@german@oldspelling \@german@oldspellingfalse -\define@choicekey*+{german}{spelling}[\val\nr]{new,old,1901,1996}[new]{% - \ifcase\nr\relax +\define@choicekey*+{german}{spelling}[\xpg@val\xpg@nr]{new,old,1901,1996}[new]{% + \ifcase\xpg@nr\relax % new: \@german@oldspellingfalse \or @@ -56,15 +56,15 @@ \@german@oldspellingfalse \fi \german@set@babelname% - \xpg@info{Option: German, spelling=\val}% + \xpg@info{Option: German, spelling=\xpg@val}% }{\xpg@warning{Unknown German spelling `#1'}} \newif\if@austrian@locale \@austrian@localefalse \newif\if@swiss@locale \@swiss@localefalse -\define@choicekey*+{german}{variant}[\val\nr]{german,austrian,swiss}[german]{% - \ifcase\nr\relax +\define@choicekey*+{german}{variant}[\xpg@val\xpg@nr]{german,austrian,swiss}[german]{% + \ifcase\xpg@nr\relax % german: \@swiss@localefalse% \@austrian@localefalse% @@ -84,7 +84,7 @@ }% \fi \german@set@babelname% - \xpg@info{Option: German, variant=\val}% + \xpg@info{Option: German, variant=\xpg@val}% }{\xpg@warning{Unknown German variant `#1'}} \def\german@set@babelname{% @@ -134,8 +134,8 @@ } \newif\if@german@blackletter -\define@choicekey*+{german}{script}[\val\nr]{latin,blackletter,fraktur}[latin]{% - \ifcase\nr\relax +\define@choicekey*+{german}{script}[\xpg@val\xpg@nr]{latin,blackletter,fraktur}[latin]{% + \ifcase\xpg@nr\relax % latin: \@german@blackletterfalse% \or @@ -146,7 +146,7 @@ \@german@blacklettertrue% \fi \german@set@babelname% - \xpg@info{Option: German, script=\val}% + \xpg@info{Option: German, script=\xpg@val}% }{\xpg@warning{Unknown German script `#1'}} % Option defunc'ed, as bot XeTeX and LuaTeX meanwhile diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf index a21d5909cba..a72e0a03334 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf @@ -115,19 +115,19 @@ and may look very wrong.} % RTL. Hebrew uses LTR numbers, though. So we insert an LTR mark to revert % the directionality \ifxetex - \newcommand\xpg@hebrew@DigitsDotDashInterCharToks{\if@nonlatin\char"200E \fi} + \newcommand\xpg@hebrew@DigitsDotDashInterCharToks{\ifbool{@nonlatin}{\char"200E }{}} \fi \def\hebrew@ltr@numbers{% \ifxetex - \XeTeXinterchartoks \bidi@sepmark@charclass \bidi@digits@charclass = {\xpg@hebrew@DigitsDotDashInterCharToks} + \XeTeXinterchartoks \bidi@sepmark@charclass \bidi@digits@charclass = {\xpg@hebrew@DigitsDotDashInterCharToks}% \fi% } \def\nohebrew@ltr@numbers{% \ifxetex % This is bidi's original intervention - \XeTeXinterchartoks \bidi@sepmark@charclass \bidi@digits@charclass = {\DigitsDotDashInterCharToks} + \XeTeXinterchartoks \bidi@sepmark@charclass \bidi@digits@charclass = {\DigitsDotDashInterCharToks}% \fi% } diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf index 78403e33d6f..84a2c26e59f 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf @@ -20,8 +20,8 @@ \newif\if@hungarian@swapcaptions \newif\if@hungarian@swapheadings \newif\if@hungarian@swapheaders -\define@choicekey*+{hungarian}{swapstrings}[\val\nr]{all,captions,headings,headers,hheaders,none}[all]{% - \ifcase\nr\relax +\define@choicekey*+{hungarian}{swapstrings}[\xpg@val\xpg@nr]{all,captions,headings,headers,hheaders,none}[all]{% + \ifcase\xpg@nr\relax % all: \@hungarian@swapcaptionstrue% \@hungarian@swapheadingstrue% @@ -52,7 +52,7 @@ \@hungarian@swapheadingsfalse% \@hungarian@swapheadersfalse% \fi - \xpg@info{Option: Hungarian, swapstrings=\val}% + \xpg@info{Option: Hungarian, swapstrings=\xpg@val}% }{\xpg@warning{Unknown Hungarian swapstrings value `#1'}} % Register default options diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf index 5918062e7a9..9bab8fc2de2 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf @@ -15,18 +15,18 @@ \setlanguagealias*{korean}{ko} % variant : plain (0), classic (1), or modern (2) -\define@choicekey{korean}{variant}[\val\nr]{plain,classic,modern}[plain]{% - \let\xpg@korean@variant\nr +\define@choicekey{korean}{variant}[\xpg@val\xpg@nr]{plain,classic,modern}[plain]{% + \let\xpg@korean@variant\xpg@nr } % captions : hangul (0) or hanja (1) -\define@choicekey{korean}{captions}[\val\nr]{hangul,hanja}[hangul]{% - \let\xpg@korean@captions\nr +\define@choicekey{korean}{captions}[\xpg@val\xpg@nr]{hangul,hanja}[hangul]{% + \let\xpg@korean@captions\xpg@nr } % swapstrings: all (0), headings (1), headers (2), or none (3) \newif\if@korean@swapheadings \newif\if@korean@swapheaders -\define@choicekey*+{korean}{swapstrings}[\val\nr]{all,headings,headers,none}[all]{% - \ifcase\nr\relax +\define@choicekey*+{korean}{swapstrings}[\xpg@val\xpg@nr]{all,headings,headers,none}[all]{% + \ifcase\xpg@nr\relax % all: \@korean@swapheadingstrue% \@korean@swapheaderstrue% @@ -43,7 +43,7 @@ \@korean@swapheadingsfalse% \@korean@swapheadersfalse% \fi - \xpg@info{Option: Korean, swapstrings=\val}% + \xpg@info{Option: Korean, swapstrings=\xpg@val}% }{\xpg@warning{Unknown Korean swapstrings value `#1'}} % Register default options diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf index 8072041b3e6..5871a435a82 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf @@ -34,8 +34,8 @@ \newif\if@kurdish@kurmanji \def\kurdish@variant{sorani} -\define@choicekey*+{kurdish}{variant}[\val\nr]{sorani,kurmanji}[sorani]{% - \ifcase\nr\relax +\define@choicekey*+{kurdish}{variant}[\xpg@val\xpg@nr]{sorani,kurmanji}[sorani]{% + \ifcase\xpg@nr\relax % sorani: \def\kurdish@variant{sorani}% \@kurdish@kurmanjifalse% @@ -45,13 +45,13 @@ \@kurdish@kurmanjitrue% \fi \kurdish@set@variety% - \xpg@info{Option: kurdish, variant=\val}% + \xpg@info{Option: kurdish, variant=\xpg@val}% }{\xpg@warning{Unknown Kurdish variant `#1'}} \newif\if@kurdish@latin \newif\if@kurdish@arabic -\define@choicekey*+{kurdish}{script}[\val\nr]{Arabic,Latin}{% - \ifcase\nr\relax +\define@choicekey*+{kurdish}{script}[\xpg@val\xpg@nr]{Arabic,Latin}{% + \ifcase\xpg@nr\relax % Arabic: \@kurdish@latinfalse% \@kurdish@arabictrue% @@ -61,7 +61,7 @@ \@kurdish@arabicfalse% \fi \kurdish@set@variety% - \xpg@info{Option: kurdish, script=\val}% + \xpg@info{Option: kurdish, script=\xpg@val}% }{\xpg@warning{Unknown Kurdish script `#1'}} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf index 085f1939bc0..0700ad2637d 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf @@ -1,4 +1,4 @@ -\ProvidesFile{gloss-latin.ldf}[polyglossia: module for Latin v.2.2 2020-01-03] +\ProvidesFile{gloss-latin.ldf}[polyglossia: module for Latin v.2.3 2020-03-08] \ExplSyntaxOn @@ -100,9 +100,10 @@ \str_case:Vn \l_polyglossia_latin_variant_str { {classic} { - \str_if_eq:nnTF{#1}{liturgicallatin} - { \adddialect \l@classiclatin { \use:c {l@#1} } } - {} + \str_if_eq:nnF {#1} {classiclatin} + { + \adddialect \l@classiclatin { \use:c {l@#1} } + } } {medieval} { \adddialect \l@medievallatin { \use:c {l@#1} } } {modern} { \adddialect \l@latin { \use:c {l@#1} } } @@ -308,10 +309,15 @@ %%%%% Messages and commands concerning footnotes -\cs_if_exist:NT \@makefntext - { - \cs_set_eq:NN \polyglossia_latin_original_footnote:n \@makefntext - } +% Save original footnote definition +% Do this at the end of the preamble to catch other +% packages' footnote changes (#391) +\AtEndPreamble{% + \cs_if_exist:NT \@makefntext + { + \cs_set_eq:NN \polyglossia_latin_original_footnote:n \@makefntext + } +} % This is the footnote style as defined by the "ecclesiastic" package. \cs_new:Npn \polyglossia_latin_variant_footnote:n #1 @@ -614,9 +620,12 @@ \shorthandoff {^} \shorthandoff {=} -% The active '=' character may cause problems with key=value interfaces. +% The active = character may cause problems with key=value interfaces. % We have to make sure here that no problems can occur outside a Latin % 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. \protected@write \@auxout { } { \shorthandoff {=} } % for the aux file @@ -631,9 +640,13 @@ } { % The following command should not be called if the main language - % defines a '=' shorthand. However, there are no languages besides + % defines a = shorthand. However, there are no languages besides % Latin defining such a shorthand in polyglossia. \shorthandoff {=} + % The following command should not be called if the main language + % defines a ' shorthand. However, there are no languages besides + % Latin defining such a shorthand in polyglossia. + \shorthandoff {'} } } @@ -651,12 +664,18 @@ \polyglossia_latin_apply_quotemark:N } } + % The ' shorthand is normally turned off to avoid problems with the unicode-math + % package. We have to turn it on here. + \shorthandon {'} \bbl@activate {'} \declare@shorthand {latin} {'} { \mode_if_math:TF { \active@math@prime % defined in "latex.ltx" + % This definition is differing from the primes of the unicode-math package. + % TO DO: Make sure that the appearance of primes is the same as with the + % unicode-math package if this package is loaded. } { \polyglossia_latin_put_acute:N @@ -927,7 +946,9 @@ \def \noextras@latin { - \polyglossia_latin_no_shorthands: + \iflatin@babelshorthands + \polyglossia_latin_no_shorthands: + \fi \xpgla@savedvalues \polyglossia_latin_no_punctuation_spacing: \polyglossia_latin_modern_character_codes: diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf index be81a5829fd..a03227174e5 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf @@ -25,8 +25,8 @@ \providebool{malay@melayu} \malay@melayufalse \def\malay@variant{malay} -\define@choicekey*+{malay}{variant}[\val\nr]{indonesian,malaysian}[malaysian]{% - \ifcase\nr\relax +\define@choicekey*+{malay}{variant}[\xpg@val\xpg@nr]{indonesian,malaysian}[malaysian]{% + \ifcase\xpg@nr\relax % indonesian: \def\malay@variant{indonesian}% \malay@melayufalse @@ -72,7 +72,7 @@ }% }% \fi - \xpg@info{Option: malay, variant=\val}% + \xpg@info{Option: malay, variant=\xpg@val}% }{\xpg@warning{Unknown malay variant `#1'}} % Register default options diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf index b644a43d5de..9e7d09d81c2 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf @@ -29,15 +29,15 @@ and may look very wrong.} \newif\ifmarathi@devanagari@numerals \marathi@devanagari@numeralstrue -\define@choicekey*+{marathi}{numerals}[\val\nr]{Western,Devanagari}[Devanagari]{% - \ifcase\nr\relax +\define@choicekey*+{marathi}{numerals}[\xpg@val\xpg@nr]{Western,Devanagari}[Devanagari]{% + \ifcase\xpg@nr\relax % Western: \marathi@devanagari@numeralsfalse% \or % Devanagari: \marathi@devanagari@numeralstrue% \fi - \xpg@info{Option: Marathi, numerals=\val}% + \xpg@info{Option: Marathi, numerals=\xpg@val}% }{\xpg@warning{Unknown Marathi numerals value `#1'}} % Register default options diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf index dd113a2fabc..62b5ce7f3d0 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf @@ -26,8 +26,8 @@ \newif\ifcyrillic@numerals \newif\ifcyrillic@asbuk@numerals -\define@choicekey*+{mongolian}{numerals}[\val\nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{% - \ifcase\nr\relax +\define@choicekey*+{mongolian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{% + \ifcase\xpg@nr\relax % arabic: \cyrillic@numeralsfalse% \cyrillic@asbuk@numeralsfalse% @@ -44,7 +44,7 @@ \cyrillic@numeralstrue% \cyrillic@asbuk@numeralstrue% \fi - \xpg@info{Option: Mongolian, numerals=\val}% + \xpg@info{Option: Mongolian, numerals=\xpg@val}% }{\xpg@warning{Unknown Mongolian numerals value `#1'}} \define@boolkey{mongolian}[mongolian@]{babelshorthands}[true]{} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf index a8d7a857847..59266d675d0 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf @@ -16,8 +16,8 @@ \setlanguagealias[variant=nynorsk]{norwegian}{nynorsk} \def\norwegian@variant{nynorsk} -\define@choicekey*+{norwegian}{variant}[\val\nr]{nynorsk,bokmal}[nynorsk]{% - \ifcase\nr\relax +\define@choicekey*+{norwegian}{variant}[\xpg@val\xpg@nr]{nynorsk,bokmal}[nynorsk]{% + \ifcase\xpg@nr\relax % nynorsk: \def\norwegian@variant{nynorsk}% \SetLanguageKeys{norwegian}{langtag=NYN,babelname=nynorsk,bcp47=nn}% @@ -28,7 +28,7 @@ \SetLanguageKeys{norwegian}{langtag=NOR,babelname=norsk,bcp47=nb}% \xpg@fontsetup@latin{norwegian}% \fi - \xpg@info{Option: norwegian, variant=\val}% + \xpg@info{Option: norwegian, variant=\xpg@val}% }{\xpg@warning{Unknown norwegian variant `#1'}} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf index 1196bc4075f..a58e9784c30 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf @@ -19,8 +19,8 @@ \setlanguagealias[variant=brazilian]{portuguese}{brazil} \def\portuguese@variant{portuges} -\define@choicekey*+{portuguese}{variant}[\val\nr]{portuguese,brazilian}[portuguese]{% - \ifcase\nr\relax +\define@choicekey*+{portuguese}{variant}[\xpg@val\xpg@nr]{portuguese,brazilian}[portuguese]{% + \ifcase\xpg@nr\relax % portuguese: \def\portuguese@variant{portuges}% \SetLanguageKeys{portuguese}{babelname=portuges,bcp47=pt-PT}% @@ -33,7 +33,7 @@ I will use the standard patterns for Portuguese instead}% \adddialect\l@brazil\l@portuges\relax}% \fi - \xpg@info{Option: portuguese, variant=\val}% + \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 0088a6438df..60681c5d034 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf @@ -38,8 +38,8 @@ \newif\ifcyrillic@numerals \newif\ifcyrillic@asbuk@numerals -\define@choicekey*+{russian}{numerals}[\val\nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{% - \ifcase\nr\relax +\define@choicekey*+{russian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{% + \ifcase\xpg@nr\relax % arabic: \cyrillic@numeralsfalse% \cyrillic@asbuk@numeralsfalse% @@ -56,7 +56,7 @@ \cyrillic@numeralstrue% \cyrillic@asbuk@numeralstrue% \fi - \xpg@info{Option: Russian, numerals=\val}% + \xpg@info{Option: Russian, numerals=\xpg@val}% }{\xpg@warning{Unknown Russian numerals value `#1'}} \define@boolkey{russian}[russian@]{indentfirst}[true]{ diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf index 2e30cd953ed..ea62bc8b8f5 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf @@ -19,8 +19,8 @@ % TODO: Add other Sami varieties \def\sami@variant{northern} -%\define@choicekey*+{sami}{variant}[\val\nr]{northern}[nothern]{% -% \ifcase\nr\relax +%\define@choicekey*+{sami}{variant}[\xpg@val\xpg@nr]{northern}[nothern]{% +% \ifcase\xpg@nr\relax % % northern: % \def\sami@variant{samin}% % \SetLanguageKeys{sami}{language=Northern Sami,langtag=NSM}% @@ -31,7 +31,7 @@ % \SetLanguageKeys{sami}{language= Sami,langtag=}% % \xpg@fontsetup@latin{sami}% % \fi -% \xpg@info{Option: sami, variant=\val}% +% \xpg@info{Option: sami, variant=\xpg@val}% %}{\xpg@warning{Unknown sami variant `#1'}} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf index daa34b398d2..07f4c3e4689 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf @@ -62,15 +62,15 @@ and may look very wrong.} \newif\ifsanskrit@devanagari@numerals \sanskrit@devanagari@numeralstrue -\define@choicekey*+{sanskrit}{numerals}[\val\nr]{Devanagari,Western}[Devanagari]{% - \ifcase\nr\relax +\define@choicekey*+{sanskrit}{numerals}[\xpg@val\xpg@nr]{Devanagari,Western}[Devanagari]{% + \ifcase\xpg@nr\relax % Devanagari: \sanskrit@devanagari@numeralstrue% \or % Western: \sanskrit@devanagari@numeralsfalse% \fi - \xpg@info{Option: Sanskrit, numerals=\val}% + \xpg@info{Option: Sanskrit, numerals=\xpg@val}% }{\xpg@warning{Unknown Sanskrit numeral `#1'}} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf index 11c774e5fe1..afcfba36aa2 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf @@ -27,8 +27,8 @@ \setlanguagealias[script=Cyrillic]{serbian}{serbianc} \newif\if@serbian@cyr -\define@choicekey*+{serbian}{Script}[\val\nr]{cyrillic,latin}[cyrillic]{% - \ifcase\nr\relax +\define@choicekey*+{serbian}{Script}[\xpg@val\xpg@nr]{cyrillic,latin}[cyrillic]{% + \ifcase\xpg@nr\relax % cyrillic: \@serbian@cyrtrue \SetLanguageKeys{serbian}{scripttag=cyrl,script=Cyrillic,babelname=serbianc,bcp47=sr-Cyrl} @@ -41,15 +41,15 @@ %TODO \def\serbian@language{\language=\l@serbianlat}% % or should we use Croatian patterns as a fallback for the time being??? \fi - \xpg@info{Option: Serbian, script=\val}% + \xpg@info{Option: Serbian, script=\xpg@val}% }{\xpg@warning{Unknown Serbian script `#1'}} \define@key{serbian}{script}[Cyrillic]{\setkeys{serbian}{Script=#1}} \newif\ifcyrillic@numerals \newif\ifcyrillic@asbuk@numerals -\define@choicekey*+{serbian}{numerals}[\val\nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{% - \ifcase\nr\relax +\define@choicekey*+{serbian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{% + \ifcase\xpg@nr\relax % arabic: \cyrillic@numeralsfalse% \cyrillic@asbuk@numeralsfalse% @@ -66,7 +66,7 @@ \cyrillic@numeralstrue% \cyrillic@asbuk@numeralstrue% \fi - \xpg@info{Option: Serbian, numerals=\val}% + \xpg@info{Option: Serbian, numerals=\xpg@val}% }{\xpg@warning{Unknown Serbian numerals value `#1'}} \setkeys{serbian}{Script,numerals} @@ -187,7 +187,7 @@ \def\serbian@numbers{% \let\latin@alph\@alph \let\latin@Alph\@Alph - \ifserbian@numerals + \ifcyrillic@numerals \def\serbian@alph##1{\expandafter\serbiannumeral\expandafter{\the##1}}% \def\serbian@Alph##1{\expandafter\Serbiannumeral\expandafter{\the##1}}% \let\@alph\serbian@alph% @@ -201,11 +201,11 @@ } \def\blockextras@serbian{% - \ifserbian@numerals\serbian@numbers\fi + \ifcyrillic@numerals\serbian@numbers\fi } \def\noextras@serbian{% - \ifserbian@numerals\noserbian@numbers\fi + \ifcyrillic@numerals\noserbian@numbers\fi } \def\Asbuk#1{\expandafter\serbian@asbuk@Alph\csname c@#1\endcsname} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf index be24daa2bbf..53b1d3a6e15 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf @@ -22,8 +22,8 @@ \setlanguagealias[variant=upper]{sorbian}{uppersorbian} \def\sorbian@variant{usorbian} -\define@choicekey*+{sorbian}{variant}[\val\nr]{upper,lower}[upper]{% - \ifcase\nr\relax +\define@choicekey*+{sorbian}{variant}[\xpg@val\xpg@nr]{upper,lower}[upper]{% + \ifcase\xpg@nr\relax % upper: \def\sorbian@variant{usorbian}% \SetLanguageKeys{sorbian}{language=Upper Sorbian,langtag=USB,babelname=uppersorbian,bcp47=hsb}% @@ -64,7 +64,7 @@ } }% \fi - \xpg@info{Option: sorbian, variant=\val}% + \xpg@info{Option: sorbian, variant=\xpg@val}% }{\xpg@warning{Unknown sorbian variant `#1'}} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf index d11286be63a..3a4cb2f08ac 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf @@ -22,8 +22,8 @@ \newif\if@spanish@mexico \@spanish@mexicofalse -\define@choicekey*+{spanish}{variant}[\val\nr]{spanish,mexican}[spanish]{% - \ifcase\nr\relax +\define@choicekey*+{spanish}{variant}[\xpg@val\xpg@nr]{spanish,mexican}[spanish]{% + \ifcase\xpg@nr\relax % spanish: \@spanish@mexicofalse% \SetLanguageKeys{spanish}{babelname=spanish,bcp47=es-ES}% @@ -32,7 +32,7 @@ \@spanish@mexicotrue% \SetLanguageKeys{spanish}{babelname=spanishmx,bcp47=es-MX}% \fi - \xpg@info{Option: spanish, variant=\val}% + \xpg@info{Option: spanish, variant=\xpg@val}% }{\xpg@warning{Unknown spanish variant `#1'}} % Localized math operators à la babel @@ -40,8 +40,8 @@ \newif\ifspanish@spacedoperators \newif\ifspanish@locoperators -\define@choicekey*+{spanish}{spanishoperators}[\val\nr]{all,accented,spaced,none}[all]{% - \ifcase\nr\relax +\define@choicekey*+{spanish}{spanishoperators}[\xpg@val\xpg@nr]{all,accented,spaced,none}[all]{% + \ifcase\xpg@nr\relax % all: \spanish@locoperatorstrue% \spanish@accentedoperatorstrue% @@ -62,7 +62,7 @@ \spanish@accentedoperatorsfalse% \spanish@spacedoperatorsfalse% \fi - \xpg@info{Option: Spanish, spanishoperators=\val}% + \xpg@info{Option: Spanish, spanishoperators=\xpg@val}% }{\xpg@warning{Unknown spanishoperators value `#1'}} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf index d63569b3021..7b82a76c775 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf @@ -22,8 +22,8 @@ \newif\ifcyrillic@numerals \newif\ifcyrillic@asbuk@numerals -\define@choicekey*+{ukrainian}{numerals}[\val\nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{% - \ifcase\nr\relax +\define@choicekey*+{ukrainian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{% + \ifcase\xpg@nr\relax % arabic: \cyrillic@numeralsfalse% \cyrillic@asbuk@numeralsfalse% @@ -40,7 +40,7 @@ \cyrillic@numeralstrue% \cyrillic@asbuk@numeralstrue% \fi - \xpg@info{Option: Ukrainian, numerals=\val}% + \xpg@info{Option: Ukrainian, numerals=\xpg@val}% }{\xpg@warning{Unknown Ukrainian numerals value `#1'}} diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf index bb2c9e87cca..c2b23de0aa7 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf @@ -13,15 +13,15 @@ \providebool{welsh@formaldate} -\define@choicekey*+{welsh}{date}[\val\nr]{long,short}[short]{% - \ifcase\nr\relax +\define@choicekey*+{welsh}{date}[\xpg@val\xpg@nr]{long,short}[short]{% + \ifcase\xpg@nr\relax % long: \welsh@formaldatetrue \or % accented: \welsh@formaldatefalse \fi - \xpg@info{Option: Welsh, date=\val}% + \xpg@info{Option: Welsh, date=\xpg@val}% }{\xpg@warning{Unknown date value `#1'}} % Register default options diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty index 118017d1f4f..1e872abb2f6 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty +++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty @@ -1,5 +1,5 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{polyglossia}[2020/01/29 v1.47 +\ProvidesPackage{polyglossia}[2020/03/25 v1.48 Modern multilingual typesetting with XeLaTeX and LuaLaTeX] \RequirePackage{etoolbox} \RequirePackage{makecmds} @@ -301,7 +301,7 @@ \csdef{#1@language}{% \polyglossia@setup@language@patterns{#1}% }% - % setup hypenmins + % setup hyphenmins \exp_args:NNe \clist_set:Nn \l_tmpa_clist { \prop_item:Nn \polyglossia@langsetup {#1 / hyphenmins} } \cs_if_eq:cNF {l@#1} \l@nohyphenation @@ -959,34 +959,45 @@ %% ensure localization of \markright and \markboth commands %%% THIS IS NOW DISABLED BY DEFAULT -\newcommand{\local@marks}[1]{} -\def\enable@local@marks{ +\cs_new_nopar:Nn {\polyglossia@local@marks:n} {} +\cs_new_nopar:Nn {\polyglossia@enable@local@marks:} +{ \xpg@info{Option:~ localmarks}% - \def\local@marks##1{% - \def\markboth####1####2{% + \cs_gset_nopar:Nn \polyglossia@local@marks:n + {% + \def\xpg@tmp@lang{##1}% + \DeclareRobustCommand\markboth[2]{% \begingroup \let\label\relax \let\index\relax \let\glossary\relax \unrestored@protected@xdef\@themark - {{\foreignlanguage{##1}{% - \protect\@@ensure@maindir{####1}}}% - {\foreignlanguage{##1}{% - \protect\@@ensure@maindir{####2}}}}% + {% + {\lowercase{\foreignlanguage{\xpg@tmp@lang}}{\protect\@@ensure@maindir{####1}}}% + {\lowercase{\foreignlanguage{\xpg@tmp@lang}}{\protect\@@ensure@maindir{####2}}}% + }% \@temptokena \expandafter{\@themark}% \mark{\the\@temptokena}% \endgroup - \if@nobreak\ifvmode\nobreak\fi\fi}% - \def\markright####1{% - \begingroup - \let\label\relax \let\index\relax \let\glossary\relax - \expandafter\@markright\@themark - {\foreignlanguage{##1}{\protect\@@ensure@maindir{####1}}}% - \@temptokena \expandafter{\@themark}% - \mark{\the\@temptokena}% - \endgroup - \if@nobreak\ifvmode\nobreak\fi\fi}% - \def\@markright####1####2####3{\@temptokena{\protect\@@ensure@maindir{####1}}% - \unrestored@protected@xdef\@themark{{\the\@temptokena}% - {\protect\@@ensure@maindir{####3}}}}}% + \if@nobreak\ifvmode\nobreak\fi\fi% + }% + \DeclareRobustCommand\markright[1]{% + \begingroup + \let\label\relax \let\index\relax \let\glossary\relax + \expandafter\@markright\@themark + {\lowercase{\foreignlanguage{\xpg@tmp@lang}}{\protect\@@ensure@maindir{####1}}}% + \@temptokena \expandafter{\@themark}% + \mark{\the\@temptokena}% + \endgroup + \if@nobreak\ifvmode\nobreak\fi\fi% + }% +% This part seems wrong (see #396 for explanation). Remove after a while. +% \def\@markright####1####2####3{% +% \@temptokena{\protect\@@ensure@maindir{####1}}% +% \unrestored@protected@xdef\@themark{% +% {\the\@temptokena}% +% {\protect\@@ensure@maindir{####3}}% +% }% +% }% + }% } @@ -2021,7 +2032,7 @@ % via babelname (such as biblatex) \cs_if_exist_use:c{captions@bbl@\babelname}% \cs_if_exist_use:c{date@bbl@\babelname}% - \local@marks{#2}% + \polyglossia@local@marks:n{#2}% \csuse{init@extras@#2}% \polyglossia@lang@indentfirst:n{#2} \csuse{blockextras@#2}% @@ -2141,7 +2152,7 @@ localmarks .bool_set:N = \l_polyglossia_localmarks_bool, localmarks - .default:n = false, + .default:n = true, % compatibility nolocalmarks .meta:n = { localmarks = false }, @@ -2171,8 +2182,8 @@ \gdef\xpg@info#1{\relax}% no polyglossia info } -\bool_if:nTF \l_polyglossia_localmarks_bool {} { - \enable@local@marks{} +\bool_if:nTF \l_polyglossia_localmarks_bool { + \polyglossia@enable@local@marks: }{} % compatibility |