summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-03-28 03:02:13 +0000
committerNorbert Preining <norbert@preining.info>2022-03-28 03:02:13 +0000
commit5f80d92d8bebc775b30e2b212e33b08089517654 (patch)
treee1e56652895e1debfdeb684d33a53189e63dc776 /macros
parentcfc8605fb8316f9b12730374e205212fc07b49ff (diff)
CTAN sync 202203280302
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/cooking-units/cooking-units.dtx318
-rw-r--r--macros/latex/contrib/cooking-units/cooking-units.ins4
-rw-r--r--macros/latex/contrib/cooking-units/cooking-units.pdfbin748443 -> 738814 bytes
-rw-r--r--macros/unicodetex/latex/njuthesis/njuthesis.dtx514
-rw-r--r--macros/unicodetex/latex/njuthesis/njuthesis.ins12
-rw-r--r--macros/unicodetex/latex/njuthesis/njuthesis.pdfbin1146496 -> 1159001 bytes
-rw-r--r--macros/unicodetex/latex/polyglossia/README.md6
-rw-r--r--macros/unicodetex/latex/polyglossia/polyglossia.dtx2418
-rw-r--r--macros/unicodetex/latex/polyglossia/polyglossia.pdfbin341615 -> 348164 bytes
9 files changed, 2060 insertions, 1212 deletions
diff --git a/macros/latex/contrib/cooking-units/cooking-units.dtx b/macros/latex/contrib/cooking-units/cooking-units.dtx
index ee29c982c3..574f2b7fcd 100644
--- a/macros/latex/contrib/cooking-units/cooking-units.dtx
+++ b/macros/latex/contrib/cooking-units/cooking-units.dtx
@@ -82,7 +82,7 @@ for the details of that license.
%\keepsilent
\askforoverwritefalse
\preamble
-Copyright (C) 2016--2021 by Ben Vitecek (current Maintainer)
+Copyright (C) 2016--2022 by Ben Vitecek (current Maintainer)
This file may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
@@ -143,9 +143,9 @@ and the derived file cooking-units.sty.
\usepackage{nicefrac}
\usepackage{cleveref}
\usepackage{mathtools}
-\usepackage{siunitx}
+\usepackage{siunitx}[=v2]
\usepackage{totalcount}
-\usepackage{microtype}
+%\usepackage{microtype}
\usepackage{enumitem}
@@ -244,7 +244,7 @@ and the derived file cooking-units.sty.
\NewDocumentCommand \PrintUnit { o m }
{
\__cookingunits_culang_let:nnN { name } {#2} \l_tmpa_tl
- \tl_if_eq:NNF \l_tmpa_tl \q__cookingunits_no_translation
+ \tl_if_eq:NNF \l_tmpa_tl \c__cookingunits_no_translation_str
{ \l_tmpa_tl }
\IfNoValueF {#1} {#1}
&
@@ -307,7 +307,7 @@ and the derived file cooking-units.sty.
{
\cs_if_eq:NNTF ##1 \\
{ \textbackslash\textbackslash \\ }
- { \textbackslash \textcolor{blue}{\cs_to_str:N ##1} }
+ { \textbackslash \textcolor {blue} { \cs_to_str:N ##1 } }
}{
\token_if_letter:NTF ##1
{##1}
@@ -449,13 +449,13 @@ and the derived file cooking-units.sty.
{ \l_translation_does_not_exist_tl }
{
\__cu_use:n { culang_let_for:nnnN } {#1} { unit-symbol } {#2} \l_tmpa_tl
- \tl_if_in:NnTF \l_tmpa_tl \q__cookingunits_no_translation
+ \tl_if_in:NnTF \l_tmpa_tl \c__cookingunits_no_translation_str
{ \l_translation_does_not_exist_tl }
{ \l_tmpa_tl }
}
&
\__cu_use:n { culang_let_for:nnnN } {#1} { name } {#2} \l_tmpa_tl
- \tl_if_in:NnTF \l_tmpa_tl \q__cookingunits_no_translation
+ \tl_if_eq:NNTF \l_tmpa_tl \c__cookingunits_no_translation_str
{ \l_translation_does_not_exist_tl }
{ \l_tmpa_tl }
&
@@ -463,13 +463,13 @@ and the derived file cooking-units.sty.
\__cu_use:n { culang_let_for:nnnN } {#1} { name-pl } {#2} \l_tmpb_tl
\str_if_eq:NNF \l_tmpa_tl \l_tmpb_tl
{
- \tl_if_in:NnTF \l_tmpb_tl \q__cookingunits_no_translation
+ \tl_if_eq:NNTF \l_tmpb_tl \c__cookingunits_no_translation_str
{ \l_translation_does_not_exist_tl }
{ (\l_tmpb_tl) }
}
&
\__cu_use:n { culang_let_for:nnnN } {#1} { gender } {#2} \l_tmpa_tl
- \tl_if_in:NnTF \l_tmpa_tl \q__cookingunits_no_translation
+ \tl_if_eq:NNTF \l_tmpa_tl \c__cookingunits_no_translation_str
{ \l_translation_does_not_exist_tl }
{ \l_tmpa_tl }
}
@@ -477,14 +477,12 @@ and the derived file cooking-units.sty.
\NewDocumentCommand \CreateTableForPhrases { >{\TrimSpaces} m }
{
\seq_clear:N \l_tmpa_seq
- \__cu_use:n { culang_let_for:nnnN } {#1} { phrase } { phrase-prop } \l_tmpa_prop
+ \__cu_use:n { culang_get_phrase_prop_for:nN } {#1} \l_tmpa_prop
\prop_if_exist:NTF \l_tmpa_prop
{
- \tl_if_eq:NNTF \q__cooking_units_no_translation \l_tmpa_prop
+ \tl_if_eq:NNTF \c__cookingunits_no_translation_str \l_tmpa_prop
{ \ERRORCreateTablePhraseII }
- {
- \prop_get:NnN \l_tmpa_prop { seq } \l_tmpa_seq
- }
+ { \prop_get:NnN \l_tmpa_prop { seq } \l_tmpa_seq }
}
{ \ERRORCreateTablePhraseI }
\seq_gput_right:Nn \l_tmpa_seq { THEEND }
@@ -553,10 +551,10 @@ and the derived file cooking-units.sty.
\endlist
}
\makeatletter
-\newenvironment{mydescription}
- {\list{}{\labelwidth\z@ \itemindent-\leftmargin
- \let\makelabel\descriptionlabel}}
- {\endlist}
+%\newenvironment{mydescription}
+% {\list{}{\labelwidth\z@ \itemindent-\leftmargin
+% \let\makelabel\descriptionlabel}}
+% {\endlist}
\renewcommand*\descriptionlabel[1]{\hspace\labelsep
\normalfont\bfseries #1}
\makeatother
@@ -804,6 +802,9 @@ and the derived file cooking-units.sty.
% \changes {2021/03/21} {2.00} {New commands to define keys: \mycs{cudefinekeychain} and \mycs{cuaddtokeychain}.}
% \changes {2021/03/21} {2.00} {Using commands as unit-keys now works.}
%
+% \changes {2022/03/26} {2.00a} {Bugfix: Fixing property list retrival error (storing property lists via translations did not work too well).}
+% \changes {2022/03/26} {2.00a} {Bugfix: |\cuam| prints a unit in case of an error. This also happens with \opt{parse-number=false}.}
+% \changes {2022/03/26} {2.00a} {Bugfix: Remove \cs{peek_meaning_ignore_spaces:NTF}.}
%
%
%
@@ -849,7 +850,7 @@ and the derived file cooking-units.sty.
% not very \LaTeX-like, so I started writing some code to convert
% units. I expanded the code, rewrote it in \LaTeX3 (which is much
% more pleasant than \LaTeXe) and here it is.
-%
+%
%
%
%
@@ -3207,7 +3208,7 @@ and the derived file cooking-units.sty.
%
%
%
-%
+%
%
%
%
@@ -3367,7 +3368,7 @@ and the derived file cooking-units.sty.
%
%
%
-%
+%
%
%
%
@@ -3385,6 +3386,7 @@ and the derived file cooking-units.sty.
% shown.
%
% \small
+%
%
%\clearpage
% \subsection{English}
@@ -3449,7 +3451,7 @@ and the derived file cooking-units.sty.
%
%
%
-%
+% \normalsize
%
%
% \section{US, Imperial and Other units}
@@ -3559,108 +3561,6 @@ and the derived file cooking-units.sty.
%
%
%
-%
-% \begin{comment}
-%^^A \section{Notes and other stuff}
-%^^A This section contains stuff which might or might not be interesting.
-%^^A
-%^^A \subsection{More or less FAQ}
-%^^A
-%^^A \num{624150912.6 +- 3.9 e+10}
-%^^A \num{6.241509126 +- 0.000000039 e+18}
-%^^A
-%^^A \num{8.6173303 +- 00000.0000050 e-5}
-%^^A
-%^^A \subsection{Calculation}
-%^^A This subsection deals with some regarding the conversion to certain units.
-%^^A Mostly to (I like to call them) \enquote{electron volt units} (or natural units).
-%^^A Let's begin.
-%^^A
-%^^A We start with the easiest one: conversion of joule into electron volt.
-%^^A Easy because Wikipedia and nearly every physics book knows the answer.
-%^^A And according to Wikipedia
-%^^A \begin{align}
-%^^A \SI{1}{\eV} &= \SI{1.6021766208(98)e-19}{\joule} \\
-%^^A \SI{1}{\joule} &= \SI{6.241509126 +- 0.000000039 e+18}{\eV}
-%^^A \end{align}
-%^^A Adding this is no problem:
-%^^A \begin{lstlisting}
-%^^A \cuaddtokeys {J} {eV} { 1.6021766208e-19 }
-%^^A \end{lstlisting}
-%^^A
-%^^A
-%^^A Great, next Temperature (kelvin) to electron volt. Also no problem at all
-%^^A because joule and kelvin are related by the boltzmann constant $k_B$ with
-%^^A \begin{equation}
-%^^A energy (\si{\joule}) = k_B \cdot temperature (\si{\kelvin})
-%^^A \end{equation}
-%^^A as $[k_B]= \sfrac{\si{\joule}}{\si{\kelvin}}$ and
-%^^A $k_B= \SI{1.38064852(79)e-23}{\joule\per\kelvin}$. Now using the power
-%^^A of (more or less basic, but somehow annoying) mathematics we get:
-%^^A \begin{align}
-%^^A [k_B] &= \SI{1.38064852(79)e-23}{\joule\per\kelvin} = \\
-%^^A &= \num{1.38064852(79)e-23} \cdot \SI{6.241509126 +- 0.000000039 e+18 }{\eV\per\K} = \\
-%^^A &= \SI{8.6173303 +- 0.0000050 e-5 }{\eV\per\K}
-%^^A \end{align}
-%
-%
-%^^A \section{Notes and other stuff}
-%^^A \subsection{Some details to electron volts}
-%^^A This section explains how I calculated the values for conversion into electron volt
-%^^A or the respective derivative. Let's begin with some constants (from Wikipedia), note that
-%^^A \begin{equation*}
-%^^A \num{1.23456(78)e-9} = \num[separate-uncertainty = true]{1.23456(78)e-9}
-%^^A \end{equation*}
-%^^A just for info.
-%^^A
-%^^A \begin{align}
-%^^A \SI{1}{\eV} &= \SI{1.6021766208(98)e-19}{\J} \\
-%^^A \hbar &= \SI{1.054571800(13)e-34}{\J\s} \\
-%^^A k_B &= \SI{1.38064852(79)e-23}{\J\per\K} = \SI{8.6173303(50)e-5}{\eV\per\K}\\
-%^^A c &= \SI{299792458}{\m\per\s}
-%^^A \end{align}
-%^^A
-%^^A Note that all those and following values are rounded to the second relevant figure of the
-%^^A uncertainty of the value.
-%^^A
-%^^A Well then, next are temperatures.
-%^^A
-%^^A Temperatures are fairly easy. Just convert the temperature of your choice to kelvin
-%^^A and multiplicate it with $k_B$:
-%^^A \begin{align}
-%^^A \SI{1}{\K} * k_B &= \SI{8.6173303(50)e-5}{\eV}
-%^^A \end{align}
-%^^A
-%^^A Next is more complicated. To compute the resulting unceartanity I using
-%^^A \enquote{Gauß'sches Fehlerfortpflanzungsgesetz} (I don't know if this has
-%^^A a translation). Anyway. We know that
-%^^A \begin{align*}
-%^^A \frac{\SI{1}{\eV}}{c^2} &= \frac{\SI{1.6021766208e-19}{\J}}{(\SI{299792458}{\m\per\s})^2}
-%^^A = \frac{\SI{1.6021766208e-19}{\kg\m\squared\per\s\squared}}{\SI{8,98755178736818E16}{\m\squared\per\s\squared}} = \\
-%^^A &\frac{\SI{1.6021766208e-3}{\kg}}{\num{8,98755178736818}} =
-%^^A \SI{1782661906,94091624922088}{\kg}
-%^^A \end{align*}
-%^^A
-%^^A Great, now we have to calucalte the unceartinity:
-%^^A \begin{align}
-%^^A f(\si{\eV},c) &= \frac{\si{\eV}}{c^2} \\
-%^^A df(\si\eV,c) &= \sqrt{ (\frac{\partial f}{\partial \si\eV})^2 * (\Delta \si\eV)^2 + (\frac{\partial f}{\partial c})^2 * (\Delta c)^2 } = \\
-%^^A &= \sqrt{ (\frac{1}{c^2})^2 * (\Delta \si\eV)^2 + (-2\frac{eV}{c^{-3}})^2 * (\Delta c)^2 }
-%^^A \end{align}
-%^^A
-%^^A Now we know that $\Delta c = 0$:
-%^^A \begin{align}
-%^^A df(\si\eV,c) &= \sqrt{ (\frac{1}{c^2})^2 * (\Delta \si\eV)^2 } =
-%^^A \sqrt{ \frac{1}{(\SI{299792458}{\m\per\s} )^2} * (\SI{0.0000000098e-19}{\J})^2 } \\
-%^^A &=
-%^^A \end{align}
-% \end{comment}
-%
-%
-%
-%
-%
-%
%\end{documentation}
%
%
@@ -3703,14 +3603,14 @@ and the derived file cooking-units.sty.
% \begin{macrocode}
\ProvidesExplPackage
{cooking-units}
- {2021/05/16}
- {2.00}
+ {2022/03/26}
+ {2.00a}
{Ein Paket fuer Kocheinheiten}
% \end{macrocode}
%
% Checking if \pkg{expl3} is up-to-date, otherwise abort the loading of the package.
% \begin{macrocode}
-\@ifpackagelater { expl3 } { 2021/05/07 }
+\@ifpackagelater { expl3 } { 2022/02/24 }
{ }
{
\PackageError { cooking-units } { Support~package~expl3~too~old }
@@ -3731,7 +3631,7 @@ and the derived file cooking-units.sty.
%
% Checking if \pkg{translations} is up-to-date, otherwise abort the loading of the package.
% \begin{macrocode}
-\@ifpackagelater { translations } { 2021/01/17 }
+\@ifpackagelater { translations } { 2022/02/05 }
{ }
{
\PackageError { cooking-units } { Support~package~translations~too~old }
@@ -3761,6 +3661,7 @@ and the derived file cooking-units.sty.
% \end{macrocode}
% \begin{macrocode}
\bool_new:N \g_@@_opt_numeral_bool
+%\bool_new:N \g_@@_opt_debug_bool
\keys_define:nn { cooking-units }
{
use-numerals .code:n =
@@ -3771,6 +3672,8 @@ and the derived file cooking-units.sty.
use-numerals .default:n = { false },
use-fmtcount-numerals .bool_gset:N = \g_@@_opt_numeral_bool ,
use-fmtcount-numerals .default:n = { false },
+% debug .bool_set:N = \g_@@_opt_debug_bool ,
+% debug .default:n = { true } ,
unknown .code:n = { \msg_error:nnxx { cooking-units } { key-unknown }
{ \l_keys_path_str } { cooking-units }
}
@@ -3992,6 +3895,8 @@ and the derived file cooking-units.sty.
\tl_new:N \l_@@_stored_units_tl
\tl_new:N \l_@@_stored_formula_tl
\tl_new:N \l_@@_base_tl
+\tl_new:N \l_cookingunits_raw_amount_a_tl
+\tl_new:N \l_cookingunits_raw_amount_b_tl
% \end{macrocode}
% \begin{macrocode}
\tl_new:N \l_@@_cmd_hook_tl
@@ -4062,7 +3967,7 @@ and the derived file cooking-units.sty.
% The dimension between the fraction and the mixed fraction part is
% stored within this macro. There is no real reason why I have
% chosen this distance to be 0.1em, I just thought that it looks
-% best. But if someone has some ideas of how large this distance
+% best. But if someone has some ideas of how large this distancee
% should be I am happy to listen.
% \begin{macrocode}
\dim_new:N \l_@@_mixed_frac_dim
@@ -4303,11 +4208,12 @@ and the derived file cooking-units.sty.
% \end{macrocode}
%\end{macro}
%
-% \begin{macro}{ \q_@@_no_translation }
+% \begin{macro}{ \q_@@_no_translation_str }
% Checking value if a translation is avaiable.
% \begin{macrocode}
-\quark_new:N \q_@@_no_translation
-%\cs_new:Npn \q_@@_no_translation { asdasd\ewhkerhjkwejhk }
+\quark_new:N \q_@@_no_translation_str
+\str_const:Nn \c_@@_no_translation_str { no-translation-sady-found-@@ }
+%\cs_new:Npn \q_@@_no_translation_str { asdasd\ewhkerhjkwejhk }
% \end{macrocode}
%\end{macro}
%
@@ -6615,7 +6521,7 @@ and the derived file cooking-units.sty.
\prg_new_conditional:Npnn \@@_culang_unitname_let:Nn #1#2 { TF, F , T }
{
\@@_culang_let:nnN { name } {#2} #1
- \tl_if_eq:NNTF #1 \q_@@_no_translation
+ \tl_if_eq:NNTF #1 \c_@@_no_translation_str
{ \prg_return_false: }
{ \prg_return_true: }
}
@@ -6671,17 +6577,17 @@ and the derived file cooking-units.sty.
%
% \begin{macrocode}
\@@_culang_def_base:nnn { name } { decimal-mark } { . }
-\@@_culang_def_base:nnn { name-pl } { decimal-mark } { \q_@@_no_translation }
+\@@_culang_def_base:nnn { name-pl } { decimal-mark } { \c_@@_no_translation_str }
\@@_culang_def_for:nnnn { German } { name-pl } { decimal-mark } { , }
% \end{macrocode}
% Note that the plural versions just exist for completing the set.
% \begin{macrocode}
-\@@_culang_def_base:nnn { name } { one (m) } { \q_@@_no_translation }
-\@@_culang_def_base:nnn { name } { one (f) } { \q_@@_no_translation }
-\@@_culang_def_base:nnn { name } { one (n) } { \q_@@_no_translation }
-\@@_culang_def_base:nnn { name-pl } { one (m) } { \q_@@_no_translation }
-\@@_culang_def_base:nnn { name-pl } { one (f) } { \q_@@_no_translation }
-\@@_culang_def_base:nnn { name-pl } { one (n) } { \q_@@_no_translation }
+\@@_culang_def_base:nnn { name } { one (m) } { \c_@@_no_translation_str }
+\@@_culang_def_base:nnn { name } { one (f) } { \c_@@_no_translation_str }
+\@@_culang_def_base:nnn { name } { one (n) } { \c_@@_no_translation_str }
+\@@_culang_def_base:nnn { name-pl } { one (m) } { \c_@@_no_translation_str }
+\@@_culang_def_base:nnn { name-pl } { one (f) } { \c_@@_no_translation_str }
+\@@_culang_def_base:nnn { name-pl } { one (n) } { \c_@@_no_translation_str }
% \end{macrocode}
% \begin{macrocode}
\@@_culang_def_for:nnnn { English } { name } { one (m) } { one }
@@ -6696,7 +6602,7 @@ and the derived file cooking-units.sty.
%
% \begin{macrocode}
\@@_culang_def_base:nnn { name } { cutext-range-sign } { -- }
-\@@_culang_def_base:nnn { name-pl } { cutext-range-sign } { \q_@@_no_translation }
+\@@_culang_def_base:nnn { name-pl } { cutext-range-sign } { \c_@@_no_translation_str }
\@@_culang_def_for:nnnn { German } { name } { cutext-range-sign } { ~bis~ }
\@@_culang_def_for:nnnn { English } { name } { cutext-range-sign } { ~to~ }
% \end{macrocode}
@@ -6734,16 +6640,18 @@ and the derived file cooking-units.sty.
% \begin{macrocode}
\cs_new:Npn \@@_def_new_type_aux:Nnn #1#2#3
{
- \cs_new:cpn { @@_set_ #2 _to:n } ##1
+ \cs_new_nopar:cpn { @@_set_ #2 _to:n } ##1
{
- \tl_if_exist:cF { c_@@_#2_ ##1 _tl } { \tl_show:n { ERROR-set-#2-##1 } }
- \tl_set_eq:Nc #1 { c_@@_#2_ ##1 _tl }
+ \tl_if_exist:cF { c_@@_#2_ ##1 _tl }
+ { \msg_error:nnn {cooking-units } { internal-error } { Type } { ERROR-set-#2-##1 } }
+ \tl_set_eq:Nc #1 { c_@@_#2_ ##1 _tl }
}
\tl_if_empty:nF {#3}
{
\prg_new_conditional:cpnn { @@_if_ #2 _equal:n } ##1 {#3}
{
- \tl_if_exist:cF { c_@@_#2_ ##1 _tl } { \tl_show:n { ERROR-check-#2-##1 } }
+ \tl_if_exist:cF { c_@@_#2_ ##1 _tl }
+ { \msg_error:nnnn {cooking-units } { internal-error } { Type-2 } { ERROR-set-#2-##1 } }
\tl_if_eq:NcTF #1 { c_@@_#2_ ##1 _tl }
{ \prg_return_true: }
{ \prg_return_false: }
@@ -6798,7 +6706,6 @@ and the derived file cooking-units.sty.
% parses options and decides (depending on which command was used)
% what to do with the stuff and how to print it.
% \begin{macrocode}
-\bool_new:N \l_@@_skip_first_part_bool
\cs_new:Npn \@@_do_the_stuff:nnnnnn #1#2#3#4#5#6
{
% #1 -- label
@@ -7217,7 +7124,11 @@ and the derived file cooking-units.sty.
\cs_new:Npn \@@_new_print_unit_correctly:
{
\@@_if_state_equal:nTF { error }
- { \@@_print_unit_in_case_of_error: }
+ {
+ \tl_case:NnF \l_@@_cmd_type_tl
+ { \c_@@_cmd_type_cuam_tl { } }
+ { \@@_print_unit_in_case_of_error: }
+ }
{
\tl_case:NnF \l_@@_cmd_type_tl
{
@@ -7373,12 +7284,12 @@ and the derived file cooking-units.sty.
% \begin{macrocode}
\cs_new:Npn \@@_create_internal_error:nN #1#2
{
- \@@_set_case_to:n { error }
+ \@@_set_state_to:n { error }
\msg_error:nnnV { cooking-units } { internal-error } {#1} #2
}
\cs_new:Npn \@@_create_error:n #1
{
- \@@_set_case_to:n { error }
+ \@@_set_state_to:n { error }
\msg_error:nnV { cooking-units } {#1} \l_@@_original_amount_tl
}
\cs_new:Npn \@@_create_error_and_stop:n #1
@@ -7388,7 +7299,7 @@ and the derived file cooking-units.sty.
}
\cs_new:Npn \@@_create_error:nn #1#2
{
- \@@_set_case_to:n { error }
+ \@@_set_state_to:n { error }
\msg_error:nnnV { cooking-units } {#1} {#2} \l_@@_original_amount_tl
}
% \end{macrocode}
@@ -7473,7 +7384,7 @@ and the derived file cooking-units.sty.
% \end{macro}
%
%
-% \begin{macro}{ \@@_split_and_parse:}
+% \begin{macro}{ \@@_split_and_parse:N}
% Splits the input into fractions or ranges (or numbers).
% \begin{macrocode}
\cs_new:Npn \@@_split_and_parse:N #1
@@ -8247,8 +8158,8 @@ and the derived file cooking-units.sty.
% \begin{macrocode}
\cs_new:Npn \@@_cuam_post_process_input_phrases:NN #1#2
{
- \@@_culang_let:nnN { phrase } { phrase-prop } \l_@@_phrase_prop
- \tl_if_eq:NNT \q_@@_no_translation \l_@@_phrase_prop
+ \@@_culang_get_phrase_prop:N \l_@@_phrase_prop
+ \tl_if_eq:NNT \c_@@_no_translation_str \l_@@_phrase_prop
{ \use_none_delimit_by_q_stop:w }
\prop_get:NnN \l_@@_phrase_prop { seq } \l_@@_phrase_numbers_seq
%
@@ -9119,8 +9030,8 @@ and the derived file cooking-units.sty.
% \begin{macrocode}
\cs_new:Npn \@@_set_cooking_unit_base_translation:n #1
{
- \@@_culang_def_base:nnn { name } {#1} \q_@@_no_translation
- \@@_culang_def_base:nnn { name-pl } {#1} \q_@@_no_translation
+ \@@_culang_def_base:nnn { name } {#1} \c_@@_no_translation_str
+ \@@_culang_def_base:nnn { name-pl } {#1} \c_@@_no_translation_str
\@@_culang_def_base:nnn { gender } {#1} { m }
}
% \end{macrocode}
@@ -9222,11 +9133,11 @@ and the derived file cooking-units.sty.
{
\seq_pop:NN \g_@@_stored_derived_formula_seq \l_@@_tmpb_tl
\prop_put:NnV \l_@@_derived_units_prop {##1} \l_@@_tmpb_tl
- \seq_pop:NN \g_@@_stored_derived_unit_print_seq \l_@@_tmpa_tl
% \end{macrocode}
% First create the unit, \emph{then} set the reference to the base unit.
% (Else it is not yet defined)
% \begin{macrocode}
+ \seq_pop:NN \g_@@_stored_derived_unit_print_seq \l_@@_tmpa_tl
\exp_args:NNx \declarecookingunit [ {symbol={\l_@@_tmpa_tl}} ] {##1}
\tl_set_eq:cN { l_@@_base_key_unit_ ##1 _tl } \l_@@_curr_unit_tl
}
@@ -9494,9 +9405,12 @@ and the derived file cooking-units.sty.
\@@_error_if_unit_not_defined:nNT {#1} \l_@@_curr_unit_tl
{ \@@_set_state_to:n { error } }
}
- \peek_meaning_ignore_spaces:NTF [
- { \@@_parse_definename_optional_unitsymbol:w }
- { \@@_parse_definename_singular:n }
+ \peek_remove_spaces:n
+ {
+ \peek_meaning:NTF [
+ { \@@_parse_definename_optional_unitsymbol:w }
+ { \@@_parse_definename_singular:n }
+ }
}
% \end{macrocode}
% \end{macro}
@@ -9531,9 +9445,12 @@ and the derived file cooking-units.sty.
\quark_if_recursion_tail_stop_do:nn {#1}
{ \msg_error:nn { cooking-units } { missing-argument } }
\prop_put:Nnn \l_@@_tmpa_prop { name } {#1}
- \peek_meaning_ignore_spaces:NTF [
- { \@@_parse_definename_optional_plural:w }
- { \@@_parse_definename_optional_plural:w [#1] }
+ \peek_remove_spaces:n
+ {
+ \peek_meaning:NTF [
+ { \@@_parse_definename_optional_plural:w }
+ { \@@_parse_definename_optional_plural:w [#1] }
+ }
}
% \end{macrocode}
% \end{macro}
@@ -9545,9 +9462,12 @@ and the derived file cooking-units.sty.
\cs_new:Npn \@@_parse_definename_optional_plural:w [#1]
{
\prop_put:Nnn \l_@@_tmpa_prop { name-pl } {#1}
- \peek_meaning_ignore_spaces:NTF <
- { \@@_parse_definename_optional_gender:w }
- { \@@_parse_definename_optional_gender:w <m> }
+ \peek_remove_spaces:n
+ {
+ \peek_meaning:NTF <
+ { \@@_parse_definename_optional_gender:w }
+ { \@@_parse_definename_optional_gender:w <m> }
+ }
}
% \end{macrocode}
% \end{macro}
@@ -9635,14 +9555,35 @@ and the derived file cooking-units.sty.
%
%
%
-% \begin{macro}{ \@@_cuprint_define_printed_unit:nn }
+% \begin{macro}{ }
% Defining phrases. Phrases (sadly) depend on the language.
% The idea is going to be: Each language has its own property list
% which is going to be stored for each language. Later, the property
% list is recoverd for the language currently used. If no phrase is defined
-% the fallback |\q_@@_no_translation| is returned.
+% the fallback |\c_@@_no_translation_str| is returned.
% \begin{macrocode}
-\@@_culang_def_base:nnn { phrase } { phrase-prop } { \q_@@_no_translation }
+\@@_culang_def_base:nnn { phrase } { phrase-prop } { \c_@@_no_translation_str }
+\@@_culang_def_base:nnn { phrase } { phrase-lang } { Humphry-Drumphy }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{ }
+% \begin{macrocode}
+\cs_new:Npn \@@_culang_get_phrase_prop:N #1
+ {
+ \@@_culang_let:nnN { phrase } { phrase-lang } \l_@@_language_tl
+ \prop_if_exist:cTF { l_@@_ \l_@@_language_tl _phrase_prop }
+ {
+ \prop_set_eq:Nc #1 { l_@@_ \l_@@_language_tl _phrase_prop }
+ }
+ { \tl_set_eq:NN #1 \c_@@_no_translation_str }
+ }
+\cs_new:Npn \@@_culang_get_phrase_prop_for:nN #1#2
+ {
+ \prop_set_eq:Nc #2 { l_@@_ #1 _phrase_prop }
+% \prop_if_exist:cT { l_@@_ #1 _phrase_prop }
+% { \prop_set_eq:Nc \l_@@_phrase_prop { l_@@_ #1 _phrase_prop } }
+ }
% \end{macrocode}
% \end{macro}
%
@@ -9684,21 +9625,26 @@ and the derived file cooking-units.sty.
{
\tl_set:Nn \l_@@_language_tl {#1}
\@@_culang_if_translation_exists_for:VnnTF \l_@@_language_tl
- { phrase } { phrase-prop }
+ { phrase } { phrase-lang }
{
- \@@_culang_let_for:VnnN \l_@@_language_tl { phrase } { phrase-prop }
- \l_@@_phrase_prop
+% \@@_culang_let_for:VnnN \l_@@_language_tl { phrase } { phrase-prop }
+% \l_@@_phrase_prop
+ \prop_set_eq:Nc \l_@@_phrase_prop { l_@@_ \l_@@_language_tl _phrase_prop }
\prop_get:NnN \l_@@_phrase_prop { seq } \l_@@_phrase_numbers_seq
}{
+ \prop_new:c { l_@@_ \l_@@_language_tl _phrase_prop }
\prop_clear:N \l_@@_phrase_prop
\seq_clear:N \l_@@_phrase_numbers_seq
}
- \@@_sanitize_arrows:n {#2}
- \@@_parse_phrase:V \l_@@_sanitise_tl
- \@@_new_cuphrase_sort_sequence:N \l_@@_phrase_numbers_seq
- \prop_put:NnV \l_@@_phrase_prop { seq } \l_@@_phrase_numbers_seq
- \@@_culang_def_for:VnnV
- \l_@@_language_tl { phrase } { phrase-prop } \l_@@_phrase_prop
+ \@@_sanitize_arrows:n {#2}
+ \@@_parse_phrase:V \l_@@_sanitise_tl
+ \@@_new_cuphrase_sort_sequence:N \l_@@_phrase_numbers_seq
+ \prop_put:NnV \l_@@_phrase_prop { seq } \l_@@_phrase_numbers_seq
+ \prop_set_eq:cN { l_@@_ \l_@@_language_tl _phrase_prop } \l_@@_phrase_prop
+% \@@_culang_def_for:VnnV
+% \l_@@_language_tl { phrase } { phrase-prop } \l_@@_phrase_prop
+ \@@_culang_def_for:VnnV
+ \l_@@_language_tl { phrase } { phrase-lang } \l_@@_language_tl
}
% \end{macrocode}
% \end{macro}
@@ -9780,9 +9726,12 @@ and the derived file cooking-units.sty.
% \begin{macrocode}
\cs_new:Npn \@@_parse_phrase_optionals:n #1
{
- \peek_meaning_ignore_spaces:NTF [
- { \@@_parse_stuff_plural:w }
- { \@@_parse_stuff_plural:w [#1] }
+ \peek_remove_spaces:n
+ {
+ \peek_meaning:NTF [
+ { \@@_parse_stuff_plural:w }
+ { \@@_parse_stuff_plural:w [#1] }
+ }
}
% \end{macrocode}
% \end{macro}
@@ -9795,9 +9744,12 @@ and the derived file cooking-units.sty.
\cs_new:Npn \@@_parse_stuff_plural:w [#1]
{
\prop_put:Nnn \l_@@_tmpa_prop { -pl } {#1}
- \peek_meaning_ignore_spaces:NTF <
- { \@@_parse_stuff_gender:w }
- { \@@_parse_stuff_gender:w <m> }
+ \peek_remove_spaces:n
+ {
+ \peek_meaning:NTF <
+ { \@@_parse_stuff_gender:w }
+ { \@@_parse_stuff_gender:w <m> }
+ }
}
% \end{macrocode}
% \end{macro}
diff --git a/macros/latex/contrib/cooking-units/cooking-units.ins b/macros/latex/contrib/cooking-units/cooking-units.ins
index 7298eb0e53..1d58ebb3ae 100644
--- a/macros/latex/contrib/cooking-units/cooking-units.ins
+++ b/macros/latex/contrib/cooking-units/cooking-units.ins
@@ -5,7 +5,7 @@
%% The original source files were:
%%
%% cooking-units.dtx (with options: `install')
-%% Copyright (C) 2016--2021 by Ben Vitecek (current Maintainer)
+%% Copyright (C) 2016--2022 by Ben Vitecek (current Maintainer)
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -25,7 +25,7 @@
\input l3docstrip.tex
\askforoverwritefalse
\preamble
-Copyright (C) 2016--2021 by Ben Vitecek (current Maintainer)
+Copyright (C) 2016--2022 by Ben Vitecek (current Maintainer)
This file may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
diff --git a/macros/latex/contrib/cooking-units/cooking-units.pdf b/macros/latex/contrib/cooking-units/cooking-units.pdf
index e65da308d7..d4b06cbb01 100644
--- a/macros/latex/contrib/cooking-units/cooking-units.pdf
+++ b/macros/latex/contrib/cooking-units/cooking-units.pdf
Binary files differ
diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.dtx b/macros/unicodetex/latex/njuthesis/njuthesis.dtx
index ff8521dd9d..228b53a204 100644
--- a/macros/unicodetex/latex/njuthesis/njuthesis.dtx
+++ b/macros/unicodetex/latex/njuthesis/njuthesis.dtx
@@ -111,7 +111,7 @@ To produce the documentation run the original source files ending with
%
%<class>\NeedsTeXFormat{LaTeX2e}
%<*!(driver|install)>
-%<+!driver>\GetIdInfo $Id: njuthesis.dtx 0.16.0 2022-03-19 12:00:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
+%<+!driver>\GetIdInfo $Id: njuthesis.dtx 0.16.1 2022-03-27 13:00:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
%<class> {Thesis template for Nanjing University}
%<class>\ProvidesExplClass{njuthesis}
%<definition-ug> {Undergraduate definition file for njuthesis}
@@ -142,6 +142,7 @@ To produce the documentation run the original source files ending with
\UseTblrLibrary{booktabs,diagbox,siunitx}
\DefTblrTemplate{caption-tag}{default}{表\hspace{0.25em}\thetable}
\SetTblrStyle{caption-tag}{font=\bfseries}
+\SetTblrInner{row{1}={font=\bfseries}}
\DefTblrTemplate{caption-sep}{default}{\quad}
\lstdefinestyle{style@base}
{
@@ -191,13 +192,15 @@ To produce the documentation run the original source files ending with
%</driver>
% \fi
%
-% \title{\color{njuviolet}{The \cls{njuthesis} class\\ \textbf{南京大学学位论文模板}}}
+% \title{\color{njuviolet}{The \cls{njuthesis} class\\
+% \textbf{南京大学学位论文模板}}}
%
% \author{^^A
% 南京大学 Linux 用户组
-% \thanks{E-mail: \href{mailto:git+nju-lug-email-3104-issue-@yaoge123.cn}{git+nju-lug-email-3104-issue-@yaoge123.cn}}}
+% \thanks{E-mail: \href{mailto:git+nju-lug-email-3104-issue-@yaoge123.cn}
+% {git+nju-lug-email-3104-issue-@yaoge123.cn}}}
%
-% \date{v0.16.0 \quad 2022-03-19}
+% \date{v0.16.1 \quad 2022-03-27}
%
% \changes{v0.1}{2021/09/04}{开始开发。}
% \changes{v0.2}{2021/09/07}{初步搭建了可用的模板。}
@@ -245,12 +248,13 @@ To produce the documentation run the original source files ending with
% 在使用本模板时,我们默认您同意以下内容:
% \begin{enumerate}
% \item 本模板通过 LPPL 1.3c 协议开放源代码,您可以随意使用编译出的 PDF 文件。
-% \item 本模板与学校官方部门并不存在合作关系,作者不对使用本模板产生的格式审查问题负责。
+% \item 本模板与学校官方部门并不存在合作关系,
+% 作者不对使用本模板产生的格式审查问题负责。
% \item 遇到本文档没有覆盖的问题属于正常情况,欢迎提交反馈意见。
% \end{enumerate}
%
-% 我们的 \href{https://git.nju.edu.cn/nju-lug/lug-introduction}{Linux 用户组}始终欢迎
-% 您的加入!
+% 我们的 \href{https://git.nju.edu.cn/nju-lug/lug-introduction}
+% {Linux 用户组}始终欢迎您的加入!
% \end{abstract}
%
% \clearpage
@@ -266,9 +270,12 @@ To produce the documentation run the original source files ending with
%
% \section{模板介绍}
%
-% \cls{njuthesis},即南京大学学位论文模板,是一个由南京大学 Linux 用户组维护的,用于处理本校学生毕业论文排版需求的 \hologo{LaTeX} 模板。
+% \cls{njuthesis},即南京大学学位论文模板,是一个由南京大学 Linux
+% 用户组维护的,用于处理本校学生毕业论文排版需求的 \hologo{LaTeX} 模板。
%
-% 本模板使用的本科生毕业论文模板格式依据《关于启动南京大学2022届本科毕业论文(设计)工作的通知》\cite{nju2021},研究生学位论文格式依据研究生院提供的材料包。
+% 本模板使用的本科生毕业论文模板格式依据
+% 《关于启动南京大学2022届本科毕业论文(设计)工作的通知》\cite{nju2021},
+% 研究生学位论文格式依据研究生院提供的材料包。
%
%
% \subsection{开始之前}
@@ -280,51 +287,68 @@ To produce the documentation run the original source files ending with
% \fcolorbox{olgreen}{gray!5}{\parbox{\textwidth-5em}{%
% \hspace{2em}\begin{minipage}[c]{10cm}
% \begin{enumerate}
-% \item 访问 \url{https://tex.nju.edu.cn}
-% \item 点击右上角~\olbutton{注册}~按钮,用\href{https://itsc.nju.edu.cn/1b/ce/c21586a334798/page.htm}{南大邮箱}注册账号
-% \item 登录您的账号
-% \item 点击左上角~\olbutton{创建新项目}~按钮,选择~\olbutton{论文模板}
-% \item 随意取名,点击~\olbutton{创建}~按钮
+% \item 访问 \url{https://tex.nju.edu.cn}
+% \item 点击右上角~\olbutton{注册}~按钮,
+% 用\href{https://itsc.nju.edu.cn/1b/ce/c21586a334798/page.htm}
+% {南大邮箱}注册账号
+% \item 登录您的账号
+% \item 点击左上角~\olbutton{创建新项目}~按钮,选择~\olbutton{论文模板}
+% \item 随意取名,点击~\olbutton{创建}~按钮
% \end{enumerate}
% \end{minipage}}}
%
% \bigskip
-% 稍等片刻,您会在浏览器右侧发现一份新生成的空白论文。如果它的效果令您满意,不妨以此为基础开始写作。
+% 稍等片刻,您会在浏览器右侧发现一份新生成的空白论文。
+% 如果它的效果令您满意,不妨以此为基础开始写作。
%
% \subparagraph{我一定要体验上述流程吗?}
-% 是,但也不一定。有人坚持认为应该做一些\emph{直观、清晰、有手就行、一条路走到底}的教程,而不是
-% \emph{长篇累牍的精细介绍},其核心论据在于:现代人类总体上需要快速取得成就感,而且大部分可能用
-% 到本模板的同学不会具备必要的基础知识。反驳的观点在于过分简单的实验总是浪费时间的,尤其是在您
-% 可能早已掌握基本用法的情况下。但,不论如何,这番操作总会使您预览到 \cls{njuthesis} 论文模板的
-% 实际样式。
+% 是,但也不一定。有人坚持认为应该做一些\emph{直观、清晰、有手就行、一
+% 条路走到底}的教程,而不是\emph{长篇累牍的精细介绍},其核心论据在于:
+% 现代人类总体上需要快速取得成就感,而且大部分可能用到本模板的同学不
+% 会具备必要的基础知识。反驳的观点在于过分简单的实验总是浪费时间的,
+% 尤其是在您可能早已掌握基本用法的情况下。但,不论如何,这番操作总会
+% 使您预览到 \cls{njuthesis} 论文模板的实际样式。
%
% \subparagraph{我并没有见到理想的结果。}
-% 具体是哪里不满意?如果是\emph{样式存在偏差},请联系模板的作者;如果\emph{不能访问前文提到的在
-% 线编译网站},请考虑检查网络连接,依次咨询本校
-% \href{https://itsc.nju.edu.cn}{信息化管理建设服务中心} 和该网站的维护者
-% \href{mailto:my@yaoge123.cn}{姚舸老师};如果\emph{报错},请点击左上角的菜单按钮,查看编译器是
-% 否显示为 |XeLaTeX|;再如果\emph{还有其他原因},通过这几分钟的实验我们也可以得到一个相当有益的
-% 结论:\emph{也许 Word 模板更加适合您}。这可以节省下熟悉 \hologo{TeX} 排版软件使用方法所需的可
-% 观时间。
+% 具体是哪里不满意?如果是\emph{样式存在偏差},请联系模板的作者;如果
+% \emph{不能访问前文提到的在线编译网站},请考虑检查网络连接,依次咨询
+% 本校\href{https://itsc.nju.edu.cn}{信息化管理建设服务中心}和该网站
+% 的维护者\href{mailto:my@yaoge123.cn}{姚舸老师};如果\emph{报错},请
+% 点击左上角的菜单按钮,查看编译器是否显示为 |XeLaTeX|;
+% 再如果\emph{还有其他原因},通过这几分钟的实验我们也可以得到一个相当
+% 有益的结论:\emph{也许 Word 模板更加适合您}。这可以节省下熟悉
+% \hologo{TeX} 排版软件使用方法所需的可观时间。
%
% \subparagraph{但我依然对 \hologo{LaTeX} 一无所知!}
-% 这意味着您也许得花些时间在\emph{长篇累牍的精细介绍}上。请接着向后阅读,有需要时善用搜索。
+% 这意味着您也许得花些时间在\emph{长篇累牍的精细介绍}上。
+% 请接着向后阅读,有需要时善用搜索。
%
%
% \subsection{历史沿革}
%
% 十几年来,多位热心校友发布过自己编写的模板,在 GitHub 网站上可考的包括:
% \begin{enumerate}
-% \item 杨文博(\href{http://yangwenbo.com/}{@solrex})的 njuthesis(2010 - 2018) \cite{wenboyang2013}
-% \item \href{https://github.com/fireblue}{@fireblue} 基于杨文博模板的 NJUThesis(2013)\cite{fireblue2013}
-% \item \href{https://github.com/wenhai-zheng}{@wenhai-zheng} 的 NJUThesis(2013)\cite{wenhai-zheng2013}
-% \item 曹增乐(\href{https://github.com/ZLCao}{@ZLCao})的 NJUBachelor(2013 - 2016)\cite{zenglecao2013}
-% \item 胡海星(\href{http://haixing-hu.github.io/}{@Haixing-Hu})的 NJU-Thesis(2013 - 2018)\cite{haixinghu2013}
-% \item 张楚珩(\href{https://github.com/zhangchuheng123}{@zhangchuheng123})基于胡海星模板的 NJUThesis(2016)\cite{chuhengzhang2016}
-% \item 蒋炎岩(\href{http://ics.nju.edu.cn/~jyy/}{@jiangyy})的 njuthesis(2017 - 2019)\cite{yanyanjiang2017}
-% \item \href{https://github.com/njuHan}{@njuHan} 基于胡海星模板的 NJU-Thesis(2018 - 2021)
-% \item 饶安逸(\href{https://anyirao.com/}{@AnyiRao})基于张楚珩模板的 NJU Thesis 2018(2018)\cite{anyirao2018}
-% \item 赵懿晨(\href{https://fengchendian.github.io/about.html}{@FengChendian})基于饶安逸模板的 NJU Thesis 2021(2021)\cite{yichenzhao2021}
+% \item 杨文博(\href{http://yangwenbo.com/}{@solrex})的
+% njuthesis(2010 - 2018) \cite{wenboyang2013}
+% \item \href{https://github.com/fireblue}{@fireblue} 基于杨文博模板的
+% NJUThesis(2013)\cite{fireblue2013}
+% \item \href{https://github.com/wenhai-zheng}{@wenhai-zheng} 的
+% NJUThesis(2013)\cite{wenhai-zheng2013}
+% \item 曹增乐(\href{https://github.com/ZLCao}{@ZLCao})的
+% NJUBachelor(2013 - 2016)\cite{zenglecao2013}
+% \item 胡海星(\href{http://haixing-hu.github.io/}{@Haixing-Hu})的
+% NJU-Thesis(2013 - 2018)\cite{haixinghu2013}
+% \item 张楚珩(\href{https://github.com/zhangchuheng123}{@zhangchuheng123})
+% 基于胡海星模板的 NJUThesis(2016)\cite{chuhengzhang2016}
+% \item 蒋炎岩(\href{http://ics.nju.edu.cn/~jyy/}{@jiangyy})的
+% njuthesis(2017 - 2019)\cite{yanyanjiang2017}
+% \item \href{https://github.com/njuHan}{@njuHan} 基于胡海星模板的
+% NJU-Thesis(2018 - 2021)
+% \item 饶安逸(\href{https://anyirao.com/}{@AnyiRao})基于张楚珩模板的
+% NJU Thesis 2018(2018)\cite{anyirao2018}
+% \item 赵懿晨(\href{https://fengchendian.github.io/about.html}
+% {@FengChendian})基于饶安逸模板的
+% NJU Thesis 2021(2021)\cite{yichenzhao2021}
% \end{enumerate}
% 至于不幸而未进行代码版本管理的,甚至于说以压缩包形式流传于各人硬盘中的,就更不可计数了。
%
@@ -415,28 +439,37 @@ To produce the documentation run the original source files ending with
% \href{https://github.com/nju-lug/NJUThesis}{Github仓库}。仓库内仅包含源代码、
% 空白模板及测试文件,不可直接用于写作。这些文件对应的使用方法请参考
% \ref{subsubsec:on-the-fly-installation}。如果由于网络原因不便访问主仓库,也可
-% 以从\href{https://git.nju.edu.cn/nju-lug/nju-latex-templates/njuthesis}{NJU Git 同步镜像} 获取项目工程文件。
+% 以从 \href{https://git.nju.edu.cn/nju-lug/nju-latex-templates/njuthesis}
+% {NJU Git 同步镜像}获取项目工程文件。
%
% \subparagraph{GitHub Releases}
-% 本模板不定期将已有的新功能和问题修复打包为新的正式发行版,赋以更改后的版本号,发布在 \href{https://github.com/nju-lug/NJUThesis/releases/latest}{Github Releases 页面}。如果由于网络原因不便访问主仓库,也可以从\href{https://mirror.nju.edu.cn/github-release/nju-lug/NJUThesis/LatestRelease/}{南京大学镜像站下载页面}获取。可供下载的文件包括下列三种:
+% 本模板不定期将已有的新功能和问题修复打包为新的正式发行版,赋以更改后的版本号,
+% 发布在 \href{https://github.com/nju-lug/NJUThesis/releases/latest}{Github
+% Releases 页面}。如果由于网络原因不便访问主仓库,也可以从\ignorespaces
+% \href{https://mirror.nju.edu.cn/github-release/nju-lug/NJUThesis/LatestRelease/}
+% {南京大学镜像站下载页面}获取。可供下载的文件包括下列三种:
% \begin{description}
% \item[\file{njuthesis-v*.pdf}] 模板说明文档(本文档)。
-% \item[\file{njuthesis-user-v*.zip}] 交付给用户的完整模板包,包括格式文件和范本文档,可在解压后用于本地编译,也可直接上传至在线编译网站。
-% \item[\file{njuthesis-ctan-v*.zip}] 交付给 CTAN 的源代码包,普通用户请忽略。
+% \item[\file{njuthesis-user-v*.zip}] 交付给用户的完整模板包,
+% 包括格式文件和范本文档,可在解压后用于本地编译,
+% 也可直接上传至在线编译网站。
+% \item[\file{njuthesis-ctan-v*.zip}] 交付给 CTAN 的源代码包,
+% 普通用户请忽略。
% \end{description}
%
%
% \subsubsection{文件构成}
%
-% 本模板由数量众多的文件组成,\emph{所有可能遇到的}文件如表 \ref{tab:njuthesis-files} 所示。
+% 本模板由数量众多的文件组成,\emph{所有可能遇到的}文件如表
+% \ref{tab:njuthesis-files} 所示。
%
% \begin{table}[ht]
% \centering
% \begin{talltblr}[
-% caption = {\cls{njuthesis}文件构成},
-% label = {tab:njuthesis-files},
-% note{a} = {仅供开发使用,并不会在发布版本中出现。}
-% ] {ll}
+% caption = {\cls{njuthesis}文件构成},
+% label = {tab:njuthesis-files},
+% note{a} = {仅供开发使用,并不会在发布版本中出现。}
+% ] { row{1} = {font=\bfseries}, colspec = {ll} }
% \toprule
% 名称 & 说明 \\
% \midrule
@@ -513,8 +546,10 @@ To produce the documentation run the original source files ending with
%
% \subsubsection{安装\hologo{TeX}发行版}
%
-% 首先需要下载并安装 \hologo{TeX} 软件发行版,其中包括引擎、宏包、字体、文档等。各操作系统适用情况请参考表~\ref {tab:texdistribution}。第一次编译前请务必通过 MiKTeX Console、TeX Live
-% Manager 等图形化程序或 \pkg{tlmgr} \emph{手动更新全部宏包}以避免潜在的兼容性问题。
+% 首先需要下载并安装 \hologo{TeX} 软件发行版,其中包括引擎、宏包、字体、
+% 文档等。各操作系统适用情况请参考表~\ref {tab:texdistribution}。第一次
+% 编译前请务必通过 MiKTeX Console、TeX LiveManager 等图形化程序或
+% \pkg{tlmgr} \emph{手动更新全部宏包}以避免潜在的兼容性问题。
% \begin{table}[ht]
% \centering
% \caption{\hologo{TeX} 软件发行版一览}
@@ -533,11 +568,16 @@ To produce the documentation run the original source files ending with
% 以下是一些值得注意的要点:
% \begin{itemize}
% \item 可以参照这份\emph{手把手的教程}\cite{install-latex-guide-zh-cn}。
-% \item 校园网环境中访问\href{https://mirror.nju.edu.cn/download/TeX%20%E6%8E%92%E7%89%88%E7%B3%BB%E7%BB%9F}{南京大学开源软件镜像站}可以获得最佳的下载体验。
+% \item 校园网环境中访问\ignorespaces
+% \href{https://mirror.nju.edu.cn/download/TeX%20排版系统}
+% {南京大学开源软件镜像站}可以获得最佳的下载体验。
% \item 使用最新的发行版,即版本号为2021或者21。
% \item 对于 Windows 和 macOS 用户,更推荐轻量化的 \hologo{MiKTeX} 套件。
-% \item Linux 用户请尽可能下载 full 版本,如 |texlive-full|。换言之,下载最大的软件包。
-% \item 对于一部分用到新版本特性的宏包,\cls{njuthesis} 内置了版本检查\footnote{譬如遇到 l3 过时问题请运行 |tlmgr update l3packages|。},请确认各宏包已升级至最新版。
+% ^^A \item Linux 用户请尽可能下载 full 版本,如 |texlive-full|。
+% ^^A 换言之,下载最大的软件包。
+% \item 对于一部分用到新版本特性的宏包,\cls{njuthesis} 内置了版本检查
+% \footnote{譬如遇到 l3 过时问题请运行 |tlmgr update l3packages|。}
+% ,请确认各宏包已升级至最新版。
% \end{itemize}
%
%
@@ -546,22 +586,30 @@ To produce the documentation run the original source files ending with
%
% 配置完编译器后,还需要一个\emph{文本编辑器}来完成 \file{.tex} 文件内容的写作。
%
-% 关于具体使用哪一种,至今仍有相当一部分人认为Windows自带的\emph{记事本}是最好的
-% 文本编辑器。但对于本项目而言,在此诚心诚意地推荐您使用\emph{更现代更美观更多功
-% 能}的编辑器,譬如\emph{安装了 LaTeX Workshop 插件的 \href{https://code.visualstudio.com/}{Visual Studio Code}}。您也可以根据个人的喜好随意使用 TeXworks、TeXstudio 等编辑器,顺手就行。
+% 关于具体使用哪一种,至今仍有相当一部分人认为Windows自带的\emph{记事本}是
+% 最好的文本编辑器。但对于本项目而言,在此诚心诚意地推荐您使用\emph{更现代
+% 更美观更多功能}的编辑器,譬如\emph{安装了 \hologo{LaTeX} Workshop 插件的
+% \href{https://code.visualstudio.com/}{Visual Studio Code}}。您也可以根据
+% 个人的喜好随意使用 TeXworks、TeXstudio 等编辑器,顺手就行。
%
% \cls{njuthesis} 为一些常见编辑器提供了配置文件,如
% \begin{description}
-% \item[Visual Studio Code] 本模板在 \file{.vscode/} 中提供一份 \hologo{LaTeX} Workshop 插件的简易配置,在打开文件夹后将自动导入,可以省略初始配置步骤直接使用。
-% \item[TeXstudio] 本模板提供 \file{conf.txsprofile},可以使用快捷键 |alt+O+P| 导入配置文件。为了简化流程\footnote{当然,也可以设置为使用 \hologo{XeLaTeX} 编译,然后按照 \ref{subsubsec:compileseq} 内容使用快捷键 |F8| 手动编译参考文献。},该配置文件使用 \pkg{latexmk},第一次编译前请参考下一节内容安装 Perl。
+% \item[Visual Studio Code] 本模板在 \file{.vscode/} 中提供一份
+% \hologo{LaTeX} Workshop 插件的简易配置,在打开文件夹后将自动导入,
+% 可以省略初始配置步骤直接使用。
+% \item[TeXstudio] 本模板提供 \file{conf.txsprofile},可以使用快捷键
+% |alt+O+P| 导入配置文件。为了简化流程\footnote{当然,也可以设置
+% 为使用 \hologo{XeLaTeX} 编译,然后按照 \ref{subsubsec:compileseq}
+% 内容使用快捷键 |F8| 手动编译参考文献。},该配置文件使用
+% \pkg{latexmk},第一次编译前请参考下一节内容安装 Perl。
% \end{description}
%
%
% \subsubsection{编译顺序}
% \label{subsubsec:compileseq}
-% \hologo{TeX} 本身是命令行程序,通过不同的命令调用所需的编译引擎,编辑器提供的
-% 快捷按钮实际只是做了包装。为了便于排查运行错误,以下通过具体终端命令简要描述编
-% 译过程。
+% \hologo{TeX} 本身是命令行程序,通过不同的命令调用所需的编译引擎,
+% 编辑器提供的快捷按钮实际只是做了包装。为了便于排查运行错误,
+% 以下通过具体终端命令简要描述编译过程。
%
% 编译本模板的过程可以概括为下述步骤:
% \begin{enumerate}
@@ -570,8 +618,9 @@ To produce the documentation run the original source files ending with
% \item 生成页码、编号、目录
% \item 将参考文献列表页插入目录
% \end{enumerate}
-% 总计需要编译四次。\emph{假设即将使用的主文件名为 \file{njuthesis-sample.tex}},应采用以
-% 下命令顺序进行编译,以生成内容正确的 \file{njuthesis-sample.pdf}。输出的 PDF
+% 总计需要编译四次。\emph{假设即将使用的主文件名为
+% \file{njuthesis-sample.tex}},应采用以下命令顺序进行编译,
+% 以生成内容正确的 \file{njuthesis-sample.pdf}。输出的 PDF
% 文档位于同一目录下。该目录下同时会生成若干中间文件。
%
% 编译命令具体为引擎名称加主文件名,在编译 \file{.tex} 文件时,
@@ -604,10 +653,13 @@ To produce the documentation run the original source files ending with
%
%
% \subparagraph{使用 \pkg{latexmk}}
-% \pkg{latexmk}\cite{latexmk} 是一个基于 Perl 脚本的自动编译工具,宗旨是通过单一命令简化上述的多次编译流程。在使用该命令前,请确保安装了以下软件:
+% \pkg{latexmk}\cite{latexmk} 是一个基于 Perl 脚本的自动编译工具,
+% 宗旨是通过单一命令简化上述的多次编译流程。
+% 在使用该命令前,请确保安装了以下软件:
% \begin{description}
-% \item[Perl] 一般预装于 macOS 和 Linux,而 Windows 用户需要单独安装 \href{https://strawberryperl.com/}{Strawberry Perl}。
-% \item[\pkg{latexmk}] \hologo{MiKTeX} 已预装;如果终端找不到 |latexmk| 命令,\hologo{TeX}\,Live 用户需使用 \pkg{tlmgr} 单独安装。
+% \item[Perl] 一般预装于 macOS 和 Linux,而 Windows 用户需要单独安装
+% \href{https://strawberryperl.com/}{Strawberry Perl}。
+% \item[\pkg{latexmk}] 如果终端找不到 |latexmk| 命令,需使用包管理器单独安装。
% \end{description}
%
% 该命令的使用方法为
@@ -817,23 +869,26 @@ To produce the documentation run the original source files ending with
% \begin{table}[htbp]
% \centering
% \begin{talltblr}[
-% caption = {中文字体配置列表},
-% label = {tab:cjk-fontset},
-% note{a} = {请下载简繁扩展(即 GBK 编码)版本},
-% note{b} = {使用
-% \href{http://www.foundertype.com/index.php/FontInfo/index/id/164}{方正小标宋}
-% 作为方正书宋的粗体},
-% note{c} = {使用
-% \href{http://www.foundertype.com/index.php/FontInfo/index/id/131}{方正黑体}
-% 作为方正细黑一的粗体},
-% note{d} = {在部分操作系统中可能已经预装 Google Noto 字体。考虑到获取字体的难易程度,单独安装时请采用
+% caption = {中文字体配置列表},
+% label = {tab:cjk-fontset},
+% note{a} = {请下载简繁扩展(即 GBK 编码)版本},
+% note{b} = {使用\ignorespaces
+% \href{http://www.foundertype.com/index.php/FontInfo/index/id/164}
+% {方正小标宋}作为方正书宋的粗体},
+% note{c} = {使用\ignorespaces
+% \href{http://www.foundertype.com/index.php/FontInfo/index/id/131}
+% {方正黑体}作为方正细黑一的粗体},
+% note{d} = {在部分操作系统中可能已经预装 Google Noto 字体。
+% 考虑到获取字体的难易程度,单独安装时请采用
% \href{https://mirrors.nju.edu.cn/download/Adobe%20Source%20Han}{Adobe Source Han}
% 字体表示思源字体,请下载 Simplified Chinese(即后缀名为 SC)的版本},
% note{e} = {思源字体并不包含楷书和仿宋,而 Adobe 楷体和仿宋难以直接下载,
-% 因此使用方正字体代替},
-% ] { cell{2}{2,4} = {white!70!njuyellow}, cell{4}{4} = {white!70!njuyellow}, colspec = {ccccc} }
+% 因此使用方正字体代替} ]
+% { cell{2}{2,4} = {white!70!njuyellow},
+% cell{4}{4} = {white!70!njuyellow},
+% row{1} = {font=\bfseries}, colspec = {ccccc} }
% \toprule
-% \bf 配置名称 & \bf 宋体 & \bf 黑体 & \bf 楷书 & \bf 仿宋 \\
+% 配置名称 & 宋体 & 黑体 & 楷书 & 仿宋 \\
% \midrule
% Windows & 中易宋体 & 中易黑体 & 中易楷体 & 中易仿宋 \\
% macOS & 华文宋体 & 华文黑体 & 华文楷体 & 华文仿宋 \\
@@ -847,7 +902,7 @@ To produce the documentation run the original source files ending with
% \href{https://github.com/adobe-fonts}{思源}\TblrNote{d}
% & \href{https://mirrors.nju.edu.cn/adobe-fonts/source-han-serif/OTF/SimplifiedChinese/}{思源宋体}
% & \href{https://mirrors.nju.edu.cn/adobe-fonts/source-han-sans/OTF/SimplifiedChinese/}{思源黑体}
-% & 方正楷体\TblrNote{e} & 方正仿宋 \\
+% & 方正楷体\TblrNote{e} & 方正仿宋 \\
% \bottomrule
% \end{talltblr}
% \end{table}
@@ -903,9 +958,17 @@ To produce the documentation run the original source files ending with
% title = \Arg{标题}
% title* = \Arg{英文标题}
% \end{syntax}
-% 题目。由于封面上提供给中文题目的横线长度有限\footnote{单行最长为15个汉字,建议总长度不超过45字},本模板默认会自动对标题进行换行。如果需要手动制定换行位点,请使用换行控制符( |\\| ),最多两处。
+% 题目。由于封面上提供给中文题目的横线长度有限\footnote{单行最长为15个汉字,建议总长度不超过45字},本模板默认会自动对标题进行换行。如果需要手动指定换行位点,请使用换行控制符( |\\| ),最多两处。
% \end{function}
%
+% 绘制封面及摘要中的标题涉及断行处理,无法对空字符串产生正确结果。
+% 因而在手动将标题设置为空时,本模板将抛出如下错误:
+% \begin{shellexample}[deletekeywords={in}]
+% ! Package njuthesis Error: The title should not be left blank.
+% (njuthesis) Please check whether you have fill in both
+% (njuthesis) Chinese and English titles.
+% \end{shellexample}
+%
% \begin{function}[updated=2021-10-01]{info/keywords,info/keywords*}
% \begin{syntax}
% keywords = \Arg{关键词}
@@ -1434,7 +1497,8 @@ To produce the documentation run the original source files ending with
% \item[著者-出版年制] 正文引用的文献采用著者-出版年制时,各篇文献的标注内容由著者姓氏与出版年构成,并置于"()"内。参考文献表采用著者-出版年制组织时,各篇文献首先按文种集中,然后按著者字顺和出版年排列。
% \end{description}
%
-% 对于本科生而言,学校规定文件表明参考文献表应当“用数字加方括号表示”\cite{nju2021},符合顺序编码制的格式,保持默认设置即可。
+% 对于本科生而言,学校规定文件表明参考文献表应当“用数字加方括号
+% 表示”\cite{nju2021},符合顺序编码制的格式,保持默认设置即可。
%
% \begin{function}[added=2022-02-15]{bib/option}
% \begin{syntax}
@@ -1450,18 +1514,22 @@ To produce the documentation run the original source files ending with
% \begin{syntax}
% resource = \Arg{文件}
% \end{syntax}
-% 参考文献数据源。类似于 \tn{addbibresource} 命令,但可以使用逗号分隔的列表形式。必须使用带扩展名(\file{.bib})的完整文件名。
+% 参考文献数据源。类似于 \tn{addbibresource} 命令,但可以使用逗号分隔的
+% 列表形式。必须使用带扩展名(\file{.bib})的完整文件名。
% \end{function}
%
% \begin{function}{\addbibresource}
% \begin{syntax}
% \tn{addbibresource}\Arg{文件}
% \end{syntax}
-% 添加参考文献源文件。为了与 \pkg{biblatex} 进行兼容,也可使用本命令添加数据源。本命令不支持逗号分隔多个文件的形式,如果希望额外添加参考文献列表,需要在导言区中多次调用。
+% 添加参考文献源文件。为了与 \pkg{biblatex} 进行兼容,也可使用本命令
+% 添加数据源。本命令不支持逗号分隔多个文件的形式,如果希望额外添加参
+% 考文献列表,需要在导言区中多次调用。
% \end{function}
%
% 可以参考如下范例进行参考文献设置。
-% 其中 \opt{bib/option} 的内容旨在关闭部分不需显示的文献信息,可根据需要使用。
+% 其中 \opt{bib/option} 的内容旨在关闭部分不需显示的文献信息,
+% 并采取仅首字母大写的作者姓名格式,可根据需要使用。
% \begin{latexexample}[moretexcs={\njusetup},emph={[2]bib}]
% \njusetup {
% bib = {
@@ -1471,7 +1539,8 @@ To produce the documentation run the original source files ending with
% doi = false,
% isbn = false,
% url = false,
-% eprint = false
+% eprint = false,
+% gbnamefmt = lowercase
% }
% }
% }
@@ -1516,40 +1585,43 @@ To produce the documentation run the original source files ending with
% 引用命令 \tn{cite} 含有多个变体,以便使用文献条目中不同的信息域。在两种参考文献样式下,这些命令的行为具体存在一些差异,详见表 \ref{tab:numeric-style} 和表 \ref{tab:author-year-style}。
%
% \begin{table}[ht]
-% \caption{顺序编码制下的引用样式}
-% \label{tab:numeric-style}
% \centering
-% \begin{tblr}{cll}
+% \begin{talltblr} [
+% caption = {顺序编码制下的引用样式},
+% label = {tab:numeric-style} ]
+% { row{1} = {font=\bfseries}, colspec = {cll} }
% \toprule
-% \bf 引用方式 & \bf 命令 & \bf 排版效果 \\
+% 引用方式 & 命令 & 排版效果 \\
% \midrule
-% 单篇文献 & \tn{cite} & 上标可设置页码 \\
-% 单篇文献 & \tn{parencite} & 非上标可设置页码 \\
-% 多篇文献 & \tn{cite} & 上标,逗号隔开或短横线连接 \\
-% 标注页码 & \tn{pagescite} & 上标加自动页码 \\
-% 标注作者 & \tn{textcite} & 作者为主语加非上标编号 \\
-% 标注作者 & \tn{authornumcite} & 作者为主语加上标编号 \\
-% 完整脚注 & \tn{footfullcite} & 脚注方式 \\
+% 单篇文献 & \tn{cite} & 上标可设置页码 \\
+% 单篇文献 & \tn{parencite} & 非上标可设置页码 \\
+% 多篇文献 & \tn{cite} & 上标,逗号隔开或短横线连接 \\
+% 标注页码 & \tn{pagescite} & 上标加自动页码 \\
+% 标注作者 & \tn{textcite} & 作者为主语加非上标编号 \\
+% 标注作者 & \tn{authornumcite} & 作者为主语加上标编号 \\
+% 完整脚注 & \tn{footfullcite} & 脚注方式 \\
% \bottomrule
-% \end{tblr}
+% \end{talltblr}
% \end{table}
%
% \begin{table}[ht]
% \centering
-% \begin{talltblr}[
-% caption = {著者-出版年制下的引用样式},
-% label = {tab:author-year-style},
-% note{a} = {在此样式下 \tn{parencite} 效果等同于 \tn{cite}} ] {cll}
+% \begin{talltblr} [
+% caption = {著者-出版年制下的引用样式},
+% label = {tab:author-year-style},
+% note{a} = {在此样式下 \tn{parencite} 效果等同于 \tn{cite}。} ]
+% { row{1} = {font=\bfseries}, colspec = {cll} }
% \toprule
-% \bf 引用方式 & \bf 命令 & \bf 排版效果 \\
+% 引用方式 & 命令 & 排版效果 \\
% \midrule
-% 单篇文献 & \tn{cite}\TblrNote{a} & 作者加年份用括号包围可设置页码 \\
-% 多篇文献 & \tn{cite} & 分号隔开 \\
-% 标注页码 & \tn{pagescite} & 作者加年份用括号包围自动页码 \\
-% 标注年份 & \tn{yearcite} & 用括号包围的年份 \\
-% 标注年份、页码 & \tn{yearpagescite} & 提供年份用括号包围自动页码 \\
-% 标注作者 & \tn{textcite} & 作者为主语加加括号包围年份 \\
-% 完整脚注 & \tn{footfullcite} & 脚注方式 \\
+% 单篇文献 & \tn{cite}\TblrNote{a} &
+% 作者加年份用括号包围可设置页码 \\
+% 多篇文献 & \tn{cite} & 分号隔开 \\
+% 标注页码 & \tn{pagescite} & 作者加年份用括号包围自动页码 \\
+% 标注年份 & \tn{yearcite} & 用括号包围的年份 \\
+% 标注年份、页码 & \tn{yearpagescite} & 提供年份用括号包围自动页码 \\
+% 标注作者 & \tn{textcite} & 作者为主语加加括号包围年份 \\
+% 完整脚注 & \tn{footfullcite} & 脚注方式 \\
% \bottomrule
% \end{talltblr}
% \end{table}
@@ -1632,6 +1704,24 @@ To produce the documentation run the original source files ending with
% 关闭此选项后摘要页将不会出现在目录中,仅保留其 PDF 书签。
% \end{function}
%
+% \begin{function}[added=2022-03-26]{style/abstract-title}
+% \begin{syntax}
+% abstract-title = <(strict)|centered|natural>
+% \end{syntax}
+% 选择研究生摘要标题样式。
+% 默认为严格模式(\opt{strict}),即完全模仿材料包要求。
+% \end{function}
+%
+% 材料包中的 Word 空白模板仅有两行空白下划线。
+% 根据填写习惯的不同,模板预置了三种样式:
+% \begin{itemize}
+% \item \opt{strict},在两行空白下划线上左对齐填写标题。
+% 如果该标题不足一行,则第二行下划线留空;
+% 如果长度超出两行,则向后延伸并抛出一个警告信息。
+% \item \opt{centered},将严格模式的左对齐改为居中。
+% \item \opt{natural},仅居中标题,不做行数检查。
+% 本模式更适合较短的题目。
+% \end{itemize}
%
% \subsubsection{前言页}
%
@@ -1801,6 +1891,8 @@ To produce the documentation run the original source files ending with
% \begin{itemize}
% \item \pkg{natbib} 和 \pkg{gbt7714} 等 \hologo{BibTeX} 相关的参考文献宏包。
% \item \pkg{bm} 等使用传统数学字体配置方案的宏包。
+% \item \pkg{babel} 在直接使用时会覆盖默认的中文名称设置。
+% \item \pkg{microtype} 在 \hologo{XeTeX} 和 \hologo{LuaTeX} 下支持有限。
% \end{itemize}
%
%
@@ -2014,7 +2106,7 @@ To produce the documentation run the original source files ending with
%
%
% \end{documentation}
-%
+% \clearpage
%
% \begin{implementation}
%
@@ -2106,12 +2198,13 @@ To produce the documentation run the original source files ending with
% \end{variable}
%
% \begin{variable}{\l_@@_info_degree_tl,\l_@@_info_diploma_tl,
-% \l_@@_info_type_tl}
+% \l_@@_info_type_tl,\l_@@_info_type_en_tl}
% 用于存储学位名称的变量。
% \begin{macrocode}
\tl_new:N \l_@@_info_degree_tl
\tl_new:N \l_@@_info_diploma_tl
\tl_new:N \l_@@_info_type_tl
+\tl_new:N \l_@@_info_type_en_tl
% \end{macrocode}
% \end{variable}
%
@@ -2283,7 +2376,7 @@ To produce the documentation run the original source files ending with
\cs_new_protected:Npn \@@_ulined_center_box:nn #1#2
{
\mode_leave_vertical:
- \rule [ -0.5 ex ] { #1 } { 0.4 pt }
+ \rule [ -0.55 ex ] { #1 } { 0.4 pt }
\skip_horizontal:n { -#1 }
\hbox_to_wd:nn { #1 } { \hfil #2 \hfil }
}
@@ -2358,7 +2451,7 @@ To produce the documentation run the original source files ending with
\cs_new_protected:Npn \@@_uline:n #1
{
\mode_leave_vertical:
- \rule [ -0.5 ex ] { #1 } { 0.4 pt }
+ \rule [ -0.55 ex ] { #1 } { 0.4 pt }
\skip_horizontal:n { -#1 }
}
% \end{macrocode}
@@ -2469,6 +2562,16 @@ To produce the documentation run the original source files ending with
% \subsubsection{封面相关}
% \changes{v0.16}{2022/03/10}{将封面和摘要内部函数定义移动到前部。}
%
+% 定义关于标题的报错信息。
+% \begin{macrocode}
+\msg_new:nnn { njuthesis } { missing-title }
+ {
+ The~ title~ should~ not~ be~ left~ blank.\\
+ Please~ check~ whether~ you~ have~ fill~ in~
+ both~ Chinese~ and~ English~ titles.
+ }
+% \end{macrocode}
+%
% \begin{macro}{\@@_split_title:n,\@@_split_title:V}
% 分割标题。
% \begin{macrocode}
@@ -2505,6 +2608,8 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_multiline_title:nnn #1#2#3
{
+ \tl_if_empty:NT \l_@@_info_title_tl
+ { \msg_error:nn { njuthesis } { missing-title } }
\@@_split_title:V \l_@@_info_title_tl
\@@_spread_box:nnV { #2 } { \kaishu } \c_@@_name_title_tl
\@@_hskip:
@@ -2612,6 +2717,77 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@@_uline_box:}
+% 用于摘要标题的下划线盒子。
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_uline_box:
+ { \vtop{\box1\kern-\prevdepth\kern0.5ex\hrule} }
+% \end{macrocode}
+% \end{macro}
+%
+% 定义关于标题的报错信息。
+% \begin{macrocode}
+\msg_new:nnn { njuthesis } { abs-title-too-long }
+ {
+ Your~ title~ is~ too~ long~ to~ fit~ in~ two~ lines.\\
+ I~ have~ drawn~ additional~ lines~ to~ contain~ it,~
+ which~ will~ probably~ make~ your~ abstract~ page~
+ look~ slightly~ different~ from~ the~ standard.\\
+ You~ can~ use~ the~ "style/abstract-title"~ key~
+ to~ disable~ this~ message.
+ }
+% \end{macrocode}
+%
+% \begin{macro}{\@@_uline_list:nnn,\@@_uline_list:xnn}
+% \changes{v0.16}{2022/03/25}{使用原生断行算法处理摘要页标题。}
+% 用于研究生摘要页面的多行标题。
+% \begin{arguments}
+% \item 标签名
+% \item 内容
+% \item 左边距
+% \end{arguments}
+% 这里使用了 Primitive \TeX{} 语法以利用原生的断行算法\footnote{\url{https://tex.stackexchange.com/questions/637861/underline-list-item-to-page-width}}。
+% 对其语法的简要介绍可以参考 \href{http://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf}{\file{tex-nutshell.pdf}}。
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_uline_list:nnn #1#2#3
+ {
+ \hbox_set:Nn \l_@@_tmp_box {#1}
+ \setbox0=\vbox{\hangindent=\wd\l_@@_tmp_box \hangafter=-1
+ \leftskip=#3 \rightskip=\leftskip \parindent=\z@ #2\par
+ \global\setbox2=\hbox{}
+ \int_gzero:N \l_@@_tmp_int
+ \loop
+ \setbox1=\lastbox \unskip\unpenalty
+ \unless\ifvoid1
+ \global\setbox2=\hbox{\@@_uline_box:\penalty0\unhbox2}
+ \int_gincr:N \l_@@_tmp_int
+ \repeat
+ }
+ {
+ \noindent\copy\l_@@_tmp_box\unhbox2
+% \end{macrocode}
+% 在使用自然断行算法后,研究生的摘要标题可选择 \opt{strict}
+% 或者 \opt{natural} 模式。前者会为少于两行的标题补齐下划线,
+% 并对多于三行的标题生成警告信息。这里通过行数处理边界条件,
+% 包括标题未填写、标题只有一行,以及标题过长的情况。
+% \begin{macrocode}
+ \bool_if:NT \g_@@_strict_abs_title_bool
+ {
+ \int_case:nnF { \l_@@_tmp_int }
+ {
+ { 0 } { \msg_error:nn { njuthesis } { missing-title } }
+ { 1 } { \@@_uline:n { \textwidth } }
+ { 2 } { \prg_do_nothing: }
+ }
+ { \msg_warning:nn { njuthesis } { abs-title-too-long } }
+ \par
+ }
+ }
+ }
+\cs_generate_variant:Nn \@@_uline_list:nnn { xnn }
+% \end{macrocode}
+% \end{macro}
+%
%
% \subsection{页面对象}
% \changes{v0.15}{2022/01/24}{使用 \pkg{xtemplate} 重构封面。}
@@ -3035,10 +3211,10 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\msg_new:nnn { njuthesis } { load-config }
{ I~ am~ loading~ config~ file~ "#1". }
-\clist_if_empty:NF \g_@@_config_clist
+\clist_map_inline:Nn \g_@@_config_clist
{
- \msg_info:nnx { njuthesis } { load-config } { \g_@@_config_tl }
- \clist_map_inline:Nn \g_@@_config_clist { \file_input:n { #1 } }
+ \msg_info:nnn { njuthesis } { load-config } { #1 }
+ \file_input:n { #1 }
}
% \end{macrocode}
%
@@ -3060,6 +3236,7 @@ To produce the documentation run the original source files ending with
title .tl_set:N = \l_@@_info_title_tl,
title .initial:n = { 空 },
title* .tl_set:N = \l_@@_info_title_en_tl,
+ title* .initial:n = { Empty },
% \end{macrocode}
% \end{macro}
%
@@ -3166,7 +3343,9 @@ To produce the documentation run the original source files ending with
% 设置类型信息。
% \begin{macrocode}
\tl_set:Nx \l_@@_info_type_tl
- { \clist_item:Nn \c_@@_name_type_clist { \g_@@_info_type_int } }
+ { \clist_item:Nn \c_@@_name_type_clist { \g_@@_info_type_int } }
+\tl_set:Nx \l_@@_info_type_en_tl
+ { \clist_item:Nn \c_@@_name_type_en_clist { \g_@@_info_type_int } }
\tl_put_left:Nx \l_@@_info_type_tl
{ \tl_use:c { c_@@_name_ \l_@@_info_diploma_tl _tl } }
% \end{macrocode}
@@ -4539,7 +4718,7 @@ To produce the documentation run the original source files ending with
\@@_ulined_center_box:nn { 9 em } { \l_@@_info_clc_tl } \hfill
\@@_spread_box:nnV { 3.2 em } { } \c_@@_name_seclv_tl \@@_hskip:
\@@_ulined_center_box:nn { 9 em } { \l_@@_info_seclv_tl } \\
- V { 3.2 em } { } { \c_@@_name_udc_tl } \@@_hskip:
+ \@@_spread_box:nnV { 3.2 em } { } \c_@@_name_udc_tl \@@_hskip:
\@@_ulined_center_box:nn { 9 em } { \l_@@_info_udc_tl } \hfill \null
}
% \end{macrocode}
@@ -4853,8 +5032,9 @@ To produce the documentation run the original source files ending with
%<definition-g> content = \@@_abs_info_g:n { : },
%<definition-ug> format = \zihao { -4 } \kaishu,
%<definition-g> format = \zihao { 4 } \kaishu,
- align = l,
- bottom-skip = 1 cm
+%<definition-ug> bottom-skip = 1 cm,
+%<definition-g> bottom-skip = 2 cm,
+ align = l
}
% \end{macrocode}
% \end{macro}
@@ -4880,8 +5060,9 @@ To produce the documentation run the original source files ending with
%<definition-g> content = \@@_abs_info_en_g:n { :~ },
%<definition-ug> format = \zihao { -4 },
%<definition-g> format = \zihao { 4 },
- align = l,
- bottom-skip = 1 cm
+%<definition-ug> bottom-skip = 1 cm,
+%<definition-g> bottom-skip = 2 cm,
+ align = l
}
%</(definition-ug|definition-g)>
% \end{macrocode}
@@ -4926,6 +5107,30 @@ To produce the documentation run the original source files ending with
% \paragraph{研究生}
% \changes{v0.13}{2021/12/12}{使用 \hologo{LaTeX3} 语法重构研究生摘要。}
%
+% \begin{macro}{abstract/mark}
+% 英文摘要标题实例。
+% \begin{macrocode}
+\@@_declare_element:nn { abstract / mark }
+ {
+ content = \c_@@_name_abstract_b_tl,
+ format = \sffamily \zihao { -3 },
+ bottom-skip = 1 cm
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{abstract/en/mark}
+% 英文摘要标题实例。
+% \begin{macrocode}
+\@@_declare_element:nn { abstract / en / mark }
+ {
+ content = \c_@@_name_abstract_b_en_tl,
+ format = \sffamily \zihao { -3 },
+ bottom-skip = 1 cm
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\@@_abs_info_g:n}
% 绘制研究生中文摘要信息栏。
% \begin{arguments}
@@ -4936,15 +5141,12 @@ To produce the documentation run the original source files ending with
%<*definition-g>
\cs_new_protected:Npn \@@_abs_info_g:n #1
{
- \@@_full_uline:NV \l_@@_tmp_dim
+ \@@_uline_list:xnn
{
\clist_item:Nn \c_@@_name_type_clist { \g_@@_info_type_int }
\c_@@_name_title_a_tl #1
}
- \@@_ulined_center_box:nn { \l_@@_tmp_dim }
- { \tl_range:Nnn \l_@@_info_title_tl { 1 } { 20 } } \\
- \@@_uline:n { \textwidth } \@@_qquad:
- \tl_range:Nnn \l_@@_info_title_tl { 21 } { -1 } \\
+ { \l_@@_info_title_tl } { \g_@@_abs_title_left_skip }
% \end{macrocode}
% 专业、年级、姓名。
% \begin{macrocode}
@@ -4977,21 +5179,16 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_abs_info_en_g:n #1
{
- \@@_full_uline:NV \l_@@_tmp_dim
- { \clist_item:Nn \c_@@_name_type_en_clist
- { \g_@@_info_type_int } #1 }
- \@@_ulined_center_box:nn { \l_@@_tmp_dim }
- { \tl_range:Nnn \l_@@_info_title_en_tl { 1 } { 40 } } \\
- \@@_uline:n { \textwidth } \@@_qquad:
- \tl_range:Nnn \l_@@_info_title_en_tl { 41 } { -1 }
+ \@@_uline_list:xnn { \l_@@_info_type_en_tl #1 }
+ { \l_@@_info_title_en_tl } { \g_@@_abs_title_left_skip }
% \end{macrocode}
% 使用循环输出专业、姓名、导师。注意这里将 |\\| 放置在前部,
% 以避免末尾生成多余的换行符产生 |Underfull \vbox| 信息。
% \begin{macrocode}
\clist_map_inline:nn { major, author, supv_full }
- { \\
+ {
\@@_uline_entry:Nnnn \l_@@_tmp_dim
- { ##1 _en } { ##1 _en } { #1 }
+ { ##1 _en } { ##1 _en } { #1 } \par
}
}
%</definition-g>
@@ -5016,7 +5213,7 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% 关键词列表的悬挂缩进样式由 \tn{list} 环境产生。
% \begin{macrocode}
- \list { }
+ \list { \l_@@_tmp_tl }
{
\labelwidth \l_@@_tmp_dim
\labelsep \c_zero_dim
@@ -5028,8 +5225,7 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_set_eq:NN \makelabel \textbf
}
- \item [ \l_@@_tmp_tl ]
- \clist_use:cn { l_@@_info_keywords #1 _clist } { #2 }
+ \item \clist_use:cn { l_@@_info_keywords #1 _clist } { #2 }
\endlist
}
%</class>
@@ -5038,6 +5234,7 @@ To produce the documentation run the original source files ending with
%
%
% \subsubsection{绘制摘要}
+% \changes{v0.16}{2022/03/26}{补上研究生摘要页面的小标题。}
%
% \begin{macro}{\@@_make_abstract:,\@@_make_abstract_en:}
% 绘制摘要页面。
@@ -5047,11 +5244,13 @@ To produce the documentation run the original source files ending with
{
\UseInstance { nju } { abstract / title }
\UseInstance { nju } { abstract / info }
+%<definition-g> \UseInstance { nju } { abstract / mark }
}
\cs_new_protected:Npn \@@_make_abstract_en:
{
\UseInstance { nju } { abstract / en / title }
\UseInstance { nju } { abstract / en / info }
+%<definition-g> \UseInstance { nju } { abstract / en / mark }
}
%</(definition-ug|definition-g)>
% \end{macrocode}
@@ -5060,8 +5259,15 @@ To produce the documentation run the original source files ending with
%
% \subsubsection{用户接口}
%
+% \begin{macro}{\g_@@_abs_title_left_skip}
+% 研究生摘要标题左边距。
% \begin{macrocode}
%<*class>
+\skip_new:N \g_@@_abs_title_left_skip
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
\keys_define:nn { nju / style }
{
% \end{macrocode}
@@ -5069,8 +5275,32 @@ To produce the documentation run the original source files ending with
% \changes{v0.15}{2022/02/04}{可选择摘要是否出现在目录中。}
% 是否将摘要添加到目录。
% \begin{macrocode}
- abstract-in-toc .bool_gset:N = \g_@@_abs_in_toc_bool,
- abstract-in-toc .initial:n = true
+ abstract-in-toc .bool_gset:N = \g_@@_abs_in_toc_bool,
+ abstract-in-toc .initial:n = true,
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{style/abstract-title}
+% \changes{v0.16}{2022/03/26}{可选择研究生摘要标题样式。}
+% 选择摘要样式,默认为 \opt{strict}。
+% \begin{macrocode}
+ abstract-title .choice:,
+ abstract-title / strict .code:n =
+ {
+ \bool_gset_true:N \g_@@_strict_abs_title_bool
+ \skip_gset:Nn \g_@@_abs_title_left_skip { 1 em }
+ },
+ abstract-title / centered .code:n =
+ {
+ \bool_gset_true:N \g_@@_strict_abs_title_bool
+ \skip_gset:Nn \g_@@_abs_title_left_skip { 0 pt plus 1 fill }
+ },
+ abstract-title / natural .code:n =
+ {
+ \bool_gset_false:N \g_@@_strict_abs_title_bool
+ \skip_gset:Nn \g_@@_abs_title_left_skip { 0 pt plus 1 fill }
+ },
+ abstract-title .initial:n = strict
}
% \end{macrocode}
% \end{macro}
@@ -5262,6 +5492,8 @@ To produce the documentation run the original source files ending with
{ abstract } { 摘要 } { ABSTRACT },
% 用于书签的摘要名称字样
{ abstract_a } { 中文摘要 } { ABSTRACT },
+ % 用于小标题的摘要名称字样
+ { abstract_b } { 摘\qquad{}要 } { ABSTRACT },
{ appendix } { 附录 } { appendix },
{ dept } { 院系 } { DEPARTMENT },
{ figure } { 图 } { figure },
diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.ins b/macros/unicodetex/latex/njuthesis/njuthesis.ins
index 1d947d360e..5efc57a52f 100644
--- a/macros/unicodetex/latex/njuthesis/njuthesis.ins
+++ b/macros/unicodetex/latex/njuthesis/njuthesis.ins
@@ -76,6 +76,18 @@ To produce the documentation run the original source files ending with
\Msg{*************************************************************}
\endbatchfile
+\__nju_declare_element:nn { abstract / mark }
+ {
+ content = \c__nju_name_abstract_b_tl,
+ format = \sffamily \zihao { -3 },
+ bottom-skip = 1 cm
+ }
+\__nju_declare_element:nn { abstract / en / mark }
+ {
+ content = \c__nju_name_abstract_b_en_tl,
+ format = \sffamily \zihao { -3 },
+ bottom-skip = 1 cm
+ }
\endinput
%%
%% End of file `njuthesis.ins'.
diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.pdf b/macros/unicodetex/latex/njuthesis/njuthesis.pdf
index 1430d0d6ab..578bddd52d 100644
--- a/macros/unicodetex/latex/njuthesis/njuthesis.pdf
+++ b/macros/unicodetex/latex/njuthesis/njuthesis.pdf
Binary files differ
diff --git a/macros/unicodetex/latex/polyglossia/README.md b/macros/unicodetex/latex/polyglossia/README.md
index 33bbb1d2d7..df223991ec 100644
--- a/macros/unicodetex/latex/polyglossia/README.md
+++ b/macros/unicodetex/latex/polyglossia/README.md
@@ -1,4 +1,4 @@
-# THE POLYGLOSSIA PACKAGE v1.51
+# THE POLYGLOSSIA PACKAGE v1.54
## Multilingual typesetting with XeLaTeX and LuaLaTeX
This package provides an alternative to Babel for users of XeLaTeX and LuaLaTeX.
@@ -26,8 +26,8 @@ Polyglossia makes it possible to automate the following tasks:
# LICENCE
-Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2021 Arthur Reutenauer,
-Copyright (c) 2019-2021 Bastien Roucariès, 2019-2021 Jürgen Spitzmüller
+Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2022 Arthur Reutenauer,
+Copyright (c) 2019-2022 Bastien Roucariès, 2019-2022 Jürgen Spitzmüller
Except where otherwise noted, Polyglossia is placed under the terms of the MIT licence
(https://opensource.org/licenses/MIT).
diff --git a/macros/unicodetex/latex/polyglossia/polyglossia.dtx b/macros/unicodetex/latex/polyglossia/polyglossia.dtx
index fdcd7f32eb..d3f0abc589 100644
--- a/macros/unicodetex/latex/polyglossia/polyglossia.dtx
+++ b/macros/unicodetex/latex/polyglossia/polyglossia.dtx
@@ -8,7 +8,7 @@
\iffalse
%</internal>
%<*README>
-# THE POLYGLOSSIA PACKAGE v1.51
+# THE POLYGLOSSIA PACKAGE v1.54
## Multilingual typesetting with XeLaTeX and LuaLaTeX
This package provides an alternative to Babel for users of XeLaTeX and LuaLaTeX.
@@ -36,8 +36,8 @@ Polyglossia makes it possible to automate the following tasks:
# LICENCE
-Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2021 Arthur Reutenauer,
-Copyright (c) 2019-2021 Bastien Roucariès, 2019-2021 Jürgen Spitzmüller
+Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2022 Arthur Reutenauer,
+Copyright (c) 2019-2022 Bastien Roucariès, 2019-2022 Jürgen Spitzmüller
Except where otherwise noted, Polyglossia is placed under the terms of the MIT licence
(https://opensource.org/licenses/MIT).
@@ -66,17 +66,17 @@ to track the issues and follow progress.
The polyglossia package
(C) 2008–2010 François Charette
- (C) 2011–2021 Arthur Reutenauer
+ (C) 2011–2022 Arthur Reutenauer
(C) 2013 Elie Roux
(C) 2019 Bastien Roucariès
- (C) 2019–2021 Jürgen Spitzmüller
+ (C) 2019–2022 Jürgen Spitzmüller
License information appended
\endpreamble
\postamble
- Copyright (C) 2021 by Arthur Reutenauer <arthur 'dot' reutenauer 'at' normalesup 'dot' org>
+ Copyright (C) 2022 by Arthur Reutenauer <arthur 'dot' reutenauer 'at' normalesup 'dot' org>
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
@@ -273,7 +273,6 @@ to track the issues and follow progress.
\generate{\file{gloss-la-x-medieval.ldf}{\from{polyglossia.dtx}{gloss-la-x-medieval.ldf}}}
\generate{\file{gloss-la.ldf}{\from{polyglossia.dtx}{gloss-la.ldf}}}
\generate{\file{gloss-lao.ldf}{\from{polyglossia.dtx}{gloss-lao.ldf}}}
-\generate{\file{gloss-latex.ldf}{\from{polyglossia.dtx}{gloss-latex.ldf}}}
\generate{\file{gloss-latin.ldf}{\from{polyglossia.dtx}{gloss-latin.ldf}}}
\generate{\file{gloss-latinclassic.ldf}{\from{polyglossia.dtx}{gloss-latinclassic.ldf}}}
\generate{\file{gloss-latinecclesiastic.ldf}{\from{polyglossia.dtx}{gloss-latinecclesiastic.ldf}}}
@@ -373,7 +372,7 @@ to track the issues and follow progress.
% !TeX spellcheck = en_US
% !TeX TS-program = xelatex
\documentclass[11pt]{ltxdoc}
-\usepackage{color}
+\usepackage{xcolor}
\usepackage{xspace,fancyvrb,longtable,booktabs}
\usepackage[neverdecrease]{paralist}
\usepackage[format=hang,labelfont=bf,labelsep=period]{caption}
@@ -512,7 +511,7 @@ to track the issues and follow progress.
% \color{xpgblue}Polyglossia: Modern multilingual typesetting with \XeLaTeX\ and \LuaLaTeX}
% \author{\TA{François Charette} \and \TA{Arthur Reutenauer}\thanks{Current maintainer}
% \and \TA{Bastien Roucariès} \and \TA{Jürgen Spitzmüller}}
-% \date{\filedate \qquad \fileversion\\
+% \date{\filedate \qquad \fileversion\thanks{Please report bugs to \url{http://github.com/reutenauer/polyglossia/issues}}\\
% \footnotesize (\textsc{pdf} file generated on \today)}
%
% \maketitle
@@ -685,11 +684,9 @@ to track the issues and follow progress.
% british & english & variant=british \\
% canadian & english & variant=canadian \\
% canadien & french & variant=canadian \\
-% classiclatin\footnote{In \pkg{babel} currently only selectable via dot modifier (\emph{latin.classic}).}
-% & latin & variant=classic \\
+% classiclatin & latin & variant=classic \\
% farsi & persian & \\
-% ecclesiasticlatin\footnote{In \pkg{babel} currently only selectable via dot modifier (\emph{latin.ecclesiastic}).}
-% & latin & variant=ecclesiastic \\
+% ecclesiasticlatin & latin & variant=ecclesiastic \\
% friulan & friulian & \\
% german\footnote{Due to the name conflict only available in \pkg{polyglossia} as \emph{germanb} (which is a \pkg{babel} synonym).}
% & german & spelling=old \\
@@ -697,8 +694,7 @@ to track the issues and follow progress.
% kurmanji & kurdish & variant=kurmanji \\
% lowersorbian & sorbian & variant=lower \\
% magyar & hungarian & \\
-% medievallatin\footnote{In \pkg{babel} currently only selectable via dot modifier (\emph{latin.medieval}).}
-% & latin & variant=medieval \\
+% medievallatin & latin & variant=medieval \\
% naustrian & german & variant=austrian \\
% newzealand & english & variant=newzealand \\
% ngerman & german & variant=german [\emph{default}] \\
@@ -717,7 +713,7 @@ to track the issues and follow progress.
% \bottomrule
% \end{tabular}
% \end{minipage}
-%
+%
% \end{table}
%
% For convenience reasons, \pkg{polyglossia} also supports the use of babel names\new{1.46} (for the few justified
@@ -1214,7 +1210,7 @@ to track the issues and follow progress.
% \paragraph*{Commands:}
% \begin{itemize}
% \item \Cmd\abjad outputs Arabic \textit{abjad} numbers according to the Mashriq varieties.
-% Example: ¦\abjad{1863}¦ yields \textarabic{\abjad{1863}}.
+% Example: ¦\abjad{1863}¦ yields \textarabic{\abjad{1863}}.
% \item \Cmd\abjadmaghribi outputs Arabic \textit{abjad} numbers according to the Maghrib varieties.
% Example: ¦\abjadmaghribi{1863}¦ yields \textarabic{\abjadmaghribi{1863}}.
% \item \Cmd\abjadalph\new{1.50} steps through the Arabic alphabet, thus it can only be used up to 28.
@@ -1330,17 +1326,17 @@ to track the issues and follow progress.
% \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to \cmd\slash, hyphenation
% at the breakpoints preset in the hyphenation patterns is still allowed.
% \end{shorthands}
-% Furthermore, the following shorthands generate easy access to Croatian digraphs (ligatures):
+% Furthermore, the following shorthands generate easy access to Croatian digraphs:
% \begin{shorthands}
-% \item[¦"dz¦] Generates the ligature \charifavailable{01C6}{dž}\ if the font provides it. If not, the
-% two characters are output separately. Also available for ¦"Dz¦ (\charifavailable{01C5}{Dž})
-% and ¦"DZ¦ (\charifavailable{01C4}{DŽ}).
-% \item[¦"lj¦] Generates the ligature \charifavailable{01C9}{lj}\ if the font provides it. If not, the
-% two characters are output separately. Also available for ¦"Lj¦ (\charifavailable{01C8}{Lj})
-% and ¦"LJ¦ (\charifavailable{01C7}{LJ}).
-% \item[¦"nj¦] Generates the ligature \charifavailable{01CC}{nj}\ if the font provides it. If not, the
-% two characters are output separately. Also available for ¦"Nj¦ (\charifavailable{01CB}{Nj})
-% and ¦"NJ¦ (\charifavailable{01CA}{NJ}).
+% \item[¦"dz¦] Generates the digraph \charifavailable{01C6}{dž}\ if the font provides it. If not,
+% the two consecutive glyphs are output mimicking the digraph. Also available for
+% ¦"Dz¦ (\charifavailable{01C5}{Dž}) and ¦"DZ¦ (\charifavailable{01C4}{DŽ}).
+% \item[¦"lj¦] Generates the digraph \charifavailable{01C9}{lj}\ if the font provides it. If not,
+% the two consecutive glyphs are output mimicking the digraph. Also available for
+% ¦"Lj¦ (\charifavailable{01C8}{Lj}) and ¦"LJ¦ (\charifavailable{01C7}{LJ}).
+% \item[¦"nj¦] Generates the digraph \charifavailable{01CC}{nj}\ if the font provides it. If not,
+% the two consecutive glyphs are output mimicking the digraph. Also available for
+% ¦"Nj¦ (\charifavailable{01CB}{Nj}) and ¦"NJ¦ (\charifavailable{01CA}{NJ}).
% \end{shorthands}
%
% Finally, there are also four shorthands for quotation marks:
@@ -1350,19 +1346,21 @@ to track the issues and follow progress.
% \item[¦">¦] for Croatian left guillemets (»).
% \item[¦"<¦] for Croatian right guillemets («).
% \end{shorthands}
-% \item \xpgboolkeyfalse[1.47]{disableligatures}
-% If this is \xpgvalue{true}, all Croatian ligatures (for digraphs such as
-% \charifavailable{01C6}{dž}) will be replaced by single characters. This can
-% be useful if the ligatures on your font are broken (if the font does not
-% have them, they are automatically replaced).
+% \item \xpgboolkeyfalse[1.47]{disabledigraphs}[Up to version 1.53, the option was
+% called \xpgvalue{disableligatures}. The old option is kept for backwards compatibility,
+% but the use is discouraged.] If this is \xpgvalue{true}, all Croatian digraphs
+% (such as \charifavailable{01C6}{dž}) will be replaced by the two consecutive letters,
+% which is the most common way of typesetting them in Croatian. This can be useful if
+% the Unicode digraphs in your font are broken (if the font does not have them,
+% they are automatically mimicked by the two consecutive glyphs).
% \item \xpgboolkeytrue[1.53]{localalph}
% If \xpgvalue{true}, alphanumeric counters will use a locally established version which excludes
% the characters \meta{q}, \meta{w}, \meta{x} and \meta{y} from alphabetic counting.
% Obviously this limits the counting range to 22.
% \item \xpgboolkeytrue[1.51]{splithyphens}
-% According to Croatian typesetting conventions, if a word with a hard hyphen (such as \emph{je-li})
-% is hyphenated at this hyphen, a second hyphenation character is to be inserted at the beginning
-% of the line that follows the hyphenation (\emph{je-/-li}).
+% According to Croatian typesetting conventions, if a word with a hard hyphen (such as
+% \emph{hrvatsko-engleski}) is hyphenated at this hyphen, a second hyphenation character is to be
+% inserted at the beginning of the line that follows the hyphenation (\emph{hrvatsko-/-engleski}).
% By default, this is done automatically (if you are using \LuaTeX, the \pkg{luavlna} package is
% loaded to achieve this).
% Set this option to ¦false¦ to disable the feature.
@@ -1450,6 +1448,13 @@ to track the issues and follow progress.
% \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to \cmd\slash,
% hyphenation at the breakpoints preset in the hyphenation patterns is still allowed.
% \end{shorthands}
+% \item \xpgboolkeyfalse[1.54]{schoolhyphens}
+% If this is set to true, alternative (experimental) hyphenation patterns are used rather than the
+% default Finnish patterns. These patterns (called `School Hyphenation') are more basic in that
+% they do not contain hyphenation exceptions for compound words since these result in simple words
+% not being hyphenated at points where this would be valid. The backdrop of the `School' patterns
+% is that compound words might be hyphenated incorrectly.
+% See \url{https://github.com/hyphenation/basic-finnish} for details.
% \end{itemize}
%
% \subsection{french}\label{french}
@@ -1881,16 +1886,22 @@ to track the issues and follow progress.
% \item[¦=A¦] for Ā (A with macron), also available for Ē, Ī, Ō, Ū, V̄, and Ȳ.
% Note that a macron above the letter V is only displayed if your font
% supports the Unicode character ¦0304¦ (\emph{combining macron}).
-% \item[¦=ae¦] for a͞e (ae diphthong with macron), also available for a͞u, e͞u,
-% and o͞e. Note that macrons above diphthongs are only displayed if your font
-% supports the Unicode character ¦035E¦ (\emph{combining double
+% \item[¦=ae¦] for a͞e (ae diphthong with macron, for the ¦classic¦ and
+% the ¦modern¦ variant) or ǣ (ae ligature with macron, for the ¦medieval¦
+% and the ¦ecclesiastic¦ variant), respectively; also available for a͞u,
+% e͞u, and o͞e/œ̄. Note that macrons above diphthongs are only displayed if
+% your font supports the Unicode character ¦035E¦ (\emph{combining double
% macron}).
-% \item[¦=Ae¦] for A͞e (Ae diphthong with macron), also available for A͞u, E͞u,
-% and O͞e.
-% \item[¦=AE¦] for A͞E (AE diphthong with macron), also available for A͞U, E͞U,
-% and O͞E.
+% \item[¦=Ae¦] for A͞e (Ae diphthong with macron, for the ¦classic¦ and
+% the ¦modern¦ variant) or Ǣ (AE ligature with macron, for the ¦medieval¦
+% and the ¦ecclesiastic¦ variant), respectively; also available for A͞u,
+% E͞u, and O͞e/Œ̄.
+% \item[¦=AE¦] for A͞E (AE diphthong with macron, for the ¦classic¦ and
+% the ¦modern¦ variant) or Ǣ (AE ligature with macron, for the ¦medieval¦
+% and the ¦ecclesiastic¦ variant), respectively; also available for A͞U,
+% E͞U, and O͞E/Œ̄.
% \item[¦\textasciicircum a¦] for ă (a with breve), also available for ĕ, ĭ,
-% ŏ, ŭ, and y̆. Note that a breve above the letter y is only displayed if
+% ŏ, ŭ, and y̆. Note that a breve above the letter y is only displayed if
% your font supports the Unicode character ¦0306¦ (\emph{combining
% breve}).
% \item[¦\textasciicircum A¦] Ă (A with breve), also available for Ĕ, Ĭ, Ŏ,
@@ -1996,6 +2007,32 @@ to track the issues and follow progress.
% \paragraph*{Options:}
% \begin{itemize}
% \item \xpgchoicekey[1.45]{variant}{\xpgvalue{brazilian} or \xpgpresetvalue{portuguese}}
+% \item \xpgboolkeyfalse[1.54]{babelshorthands}
+% If this is turned on, the following shorthands for fine-tuning hyphenation and micro-typography
+% of Portuguese words are activated.
+% \begin{shorthands}
+% \item[¦"|¦] disables a ligature at this position.
+% \item[¦"=¦] for an explicit hyphen sign which is repeated at the beginning
+% of the next line when hyphenated, as common in Portuguese typesetting
+% (also if ¦splithyphens=false¦). Unlike plain ¦-¦, this also allows
+% for hyphenation at the other points preset in the hyphenation patterns.
+% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
+% cases where the hyphen should stick at the following syllable.
+% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
+% in the hyphenation patterns (as opposed to \cmd\-).
+% \item[¦""¦] allows for a line break at this position (without hyphenation sign).
+% \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to \cmd\slash, hyphenation
+% at the breakpoints preset in the hyphenation patterns is still allowed.
+% \item[¦"<¦] for French left guillemets («).
+% \item[¦">¦] for French right guillemets (»).
+% \end{shorthands}
+% \item \xpgboolkeytrue[1.54]{splithyphens}
+% According to Portuguese typesetting conventions, if a word with a hard hyphen (such as
+% \emph{pára-brisas}) is hyphenated at this hyphen, a second hyphenation character is to be
+% inserted at the beginning of the line that follows the hyphenation (\emph{pára-/-brisas}).
+% By default, this is done automatically (if you are using \LuaTeX, the \pkg{luavlna} package is
+% loaded to achieve this).
+% Set this option to ¦false¦ to disable the feature.
% \end{itemize}
%
% \subsection{russian}\label{russian}
@@ -2093,6 +2130,13 @@ to track the issues and follow progress.
% \paragraph*{Options:}
% \begin{itemize}
% \item \xpgchoicekey{script}{\xpgpresetvalue{Cyrillic} or \xpgvalue{Latin}}
+% \item \xpgboolkeytrue[1.54]{splithyphens}
+% According to Serbian typesetting conventions, if a word with a hard hyphen (such as
+% \emph{калцијум-карбонат}) is hyphenated at this hyphen, a second hyphenation character is to be
+% inserted at the beginning of the line that follows the hyphenation (\emph{калцијум-/-карбонат}).
+% By default, this is done automatically (if you are using \LuaTeX, the \pkg{luavlna} package is
+% loaded to achieve this).
+% Set this option to ¦false¦ to disable the feature.
% \item \xpgchoicekey{numerals}{\xpgpresetvalue{arabic}, \xpgvalue{cyrillic-alph} or \xpgvalue{cyrillic-trad}}
% Uses either Arabic numerals or Cyrillic alphanumerical numbering. The two Cyrillic variants differ as follows:
% \begin{itemize}
@@ -2125,7 +2169,8 @@ to track the issues and follow progress.
% \begin{shorthands}
% \item[¦"=¦] for an explicit hyphen sign which is repeated at the beginning
% of the next line when hyphenated, as common in Slovak typesetting
-% (only needed with ¦splithyphens=false¦).
+% (also if ¦splithyphens=false¦). Unlike plain ¦-¦, this also allows
+% for hyphenation at the other points preset in the hyphenation patterns.
% \item[¦"|¦] disables a ligature at this position.
% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
% cases where the hyphen should stick at the following syllable.
@@ -2365,11 +2410,11 @@ to track the issues and follow progress.
% (such as, in the case of English, ¦\def\chaptername{Chapter}¦)
% \item \Cmd{\date\meta{lang}} stores definitions of date formats (usually redefinitions
% of \cmd\today, in some cases also definitions of additional date commands)
-% \item \Cmd{\blockextras\meta{lang}} stores macros that are to be executed when the language
+% \item \Cmd{\blockextras@\meta{lang}} stores macros that are to be executed when the language
% \meta{lang} is activated via \cmd\selectlanguage\ command or the \meta{lang} environment
-% \item \Cmd{\inlineextras\meta{lang}} stores macros that are to be executed when the language
+% \item \Cmd{\inlineextras@\meta{lang}} stores macros that are to be executed when the language
% \meta{lang} is activated locally via \cmd\text\meta{lang} command
-% \item \Cmd{\noextras\meta{lang}} stores macros that are to be executed when the language
+% \item \Cmd{\noextras@\meta{lang}} stores macros that are to be executed when the language
% \meta{lang} is closed
% \end{itemize}
% ^^A
@@ -2720,6 +2765,48 @@ to track the issues and follow progress.
% \section{Revision history}
%
% \bgroup\footnotesize
+% \subsection*{1.54 (27-03-2022)}
+%
+% \subsubsection*{New features}
+% \begin{itemize}
+% \item New option \xpgoption{splithyphens} for Serbian (\TXI{496}) and Portuguese (\TXI{534}).
+% \item Add \xpgoption{babelshorthands} to Portuguese.
+% \item Add \xpgoption{schoolhyphens} option to Finnish (\TXI{525}).
+% \end{itemize}
+%
+% \subsubsection*{Interface and defaults changes}
+% \begin{itemize}
+% \item Rename \xpgoption{disableligatures} to \xpgoption{disabledigraphs} for Croatian (\TXI{497}, \TXP{500}).
+% \item Fix output with \xpgoption{numerals=cyrillic-alph} (part of \TXI{503}).
+% \item Standardize February and November in Indonesian according to the Great Dictionary of the Indonesian Language
+% of the Language Center (\emph{Kamus Besar Bahasa Indonesia}) (\TXP{526}).
+% \end{itemize}
+%
+% \subsubsection*{Bug fixes}
+% \begin{itemize}
+% \item Fix robustification of font family switches (\TXI{428}).
+% \item Preserve font family switches across languages (\TXI{519}).
+% \item Fix \TeX\ dash ligatures with \xpgoption{splithyphens} (\TXI{502}).
+% \item Prevent \emph{missing hyphenmins value} \LaTeX\ error with unknown languages (\TXI{513}).
+% \item Fix global \xpgoption{babelshorthands}, \xpgoption{localmarks} and \xpgoption{verbose}
+% options (\TXI{515}).
+% \item Fix Latin shorthands (\TXI{516}).
+% \item Remove spurious space in Bosnian date (\TXP{528}).
+% \item Fix \cmd\languagevariant\ and \cmd\mainlanguagevariant\ macros (\TXI{530}, \TXI{531}).
+% \item Make \cmd\iflanguageloaded\ and friends work in preamble (\TXI{532}).
+% \item Fix deactivation of shorthands (\TXI{320}).
+% \item Fix deactivation of numerals.
+% \item Update deprecated \LaTeX\ hooks (\TXI{523}).
+% \item Fix \xpgoption{luatexrenderer} option which was not considered appropriately (\TXI{533}).
+% \item Turn warning about \texttt{totalhyphenmin} to info, which is more appropriate (\TXI{111}).
+% \end{itemize}
+%
+% \subsubsection*{Documentation improvements}
+% \begin{itemize}
+% \item Document in this manual where to report bugs (\TXI{512}).
+% \end{itemize}
+%
+%
% \subsection*{1.53 (12-04-2021)}
%
% \subsubsection*{New features}
@@ -2952,12 +3039,13 @@ to track the issues and follow progress.
% change of behavior should you have used one of these options without value (\TXI{363}).
% Concerned are the following options:
% \begin{itemize}
-% \item ¦babelshorthands¦ in language Belarusian, Mongolian, Ukrainian, and Russian
-% (now ¦babelshorthands¦ equals ¦babelshorthand=true¦, no longer ¦babelshorthands=false¦).
-% \item ¦localalph¦ in language Slovenian (¦localalph¦ now equals ¦localalph=true¦).
-% \item ¦latesthyphen¦ in language German (¦latesthyphen¦ now equals ¦latesthyphen=true¦).
-% \item ¦fullyear¦ in package \pkg{hebrewcal} (¦fullyear¦ now equals ¦fullyear=true¦).
+% \item \xpgoption{babelshorthands} in language Belarusian, Mongolian, Ukrainian, and Russian
+% (now \xpgoption{babelshorthands} equals \xpgoption{babelshorthand=true}, no longer \xpgoption{babelshorthands=false}).
+% \item \xpgoption{localalph} in language Slovenian (\xpgoption{localalph} now equals \xpgoption{localalph=true}).
+% \item \xpgoption{fullyear} in package \pkg{hebrewcal} (\xpgoption{fullyear} now equals \xpgoption{fullyear=true}).
% \end{itemize}
+% \item The option \xpgoption{latesthyphen} in language German is deprecated. \XeTeX\ and \LuaTeX\ nowadays
+% always use the latest German hyphens.
% \item The command ¦\setlanguagealias*¦ (introduced in v1.46) does no longer define
% dedicated alias environments.
% \item The babelnames for Latin variants have been corrected to ¦classiclatin¦, ¦ecclesiasticlatin¦
@@ -3512,7 +3600,7 @@ to track the issues and follow progress.
% Many thanks to all the people who have contributed bugfixes and new features to \pkg{polyglossia}
% since we took over.
% In alphabetical order: \TA{Ignas Anikevicius}, \TA{Sina Ahmadi}, \TA{Wouter Bolsterlee}, \TA{Christian Buhtz},
-% \TA{Zgarbul Andrey}, \TA{Oleg Domanov}, \TA{Philipp Gesang}, \TA{Kevin Godby}, \TA{Enrico Gregorio},
+% \TA{Zgarbul Andrey}, \TA{Oleg Domanov}, user \TA{fakhriaunur}, \TA{Philipp Gesang}, \TA{Kevin Godby}, \TA{Enrico Gregorio},
% \TA{Khaled Hosny}, \TA{Najib Idrissi}, user \TA{julroy67}, \TA{Dohyun Kim}, \TA{Phil Kime}, \TA{Mike Kroutikov},
% \TA{Ivan Kokan}, \TA{Caleb Maclennan}, \TA{José Mancera}, \TA{Miquel Ortega}, \TA{Yevgen Pogribnyi}, \TA{Will Robertson},
% \TA{Maïeul Rouquette}, \TA{Elie Roux}, \TA{Hugo Roy}, \TA{Guy Rutenberg}, \TA{Philipp Stephani}, \TA{Niranjan Tambe},
@@ -3543,7 +3631,7 @@ to track the issues and follow progress.
% \subsection{polyglossia.sty}
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{polyglossia}[2021/04/12 v1.53
+\ProvidesPackage{polyglossia}[2022/03/27 v1.54
Modern multilingual typesetting with XeLaTeX and LuaLaTeX]
\RequirePackage{etoolbox}
\RequirePackage{makecmds}
@@ -3560,27 +3648,45 @@ to track the issues and follow progress.
% Execute code #3 if package #1 has been loaded already, else
% add to package hook #2
-\newcommand\xpg@at@package[3]{%
- \@ifpackageloaded{#1}{#3}{\AddToHook{#2}{#3}}%
-}
-
+\cs_new_nopar:Nn \__xpg_at_package_hook:nnn{
+ \@ifpackageloaded{#1}{#3}{\AddToHook{#2}{#3}}%
+}
+
+% safe according to expl3 bug #960
+\cs_generate_variant:Nn \prop_item:Nn { Ne, Nf, No, Nx }
+\cs_generate_variant:Nn \clist_set:Nn { Ne, Nf, No, Nx }
+\cs_generate_variant:Nn \clist_gput_right:Nn {Ne}
+\cs_generate_variant:Nn \prop_get:NnN {NeN}
+\cs_generate_variant:Nn \prop_gput:Nnn {Nne, Nee, Nen}
+\cs_generate_variant:Nn \cs_gset:Npn {Npe}
+\cs_generate_variant:Nn \cs_new:Nn {Ne}
+\cs_generate_variant:Nn \cs_new_nopar:Nn {Ne}
+\cs_generate_variant:Nn \cs_gset_nopar:Npn {Npe}
+\cs_generate_variant:Nn \cs_gset_nopar:Npn {cpe}
+\cs_generate_variant:Nn \tl_set:Nn {Ne}
+\cs_generate_variant:Nn \str_foldcase:n {e}
+\prg_generate_conditional_variant:Nnn \file_if_exist:n {e} {TF, T, F, p}
+\prg_generate_conditional_variant:Nnn \tl_if_blank:n {e} {TF, T, F, p}
+\prg_generate_conditional_variant:Nnn \clist_if_in:Nn {Ne} {TF, T, F, p}
+\prg_generate_conditional_variant:Nnn \prop_if_in:Nn {Ne} {TF, T, F, p}
% correct a bug in tracklang
-\xpg@at@package{tracklang}{file/after/tracklang.sty}{%
+\__xpg_at_package_hook:nnn{tracklang}{file/tracklang.sty/after}{%
\@ifpackagelater{tracklang}{2019/08/30}{}{\global\def\AddTrackedLangage{\AddTrackedLanguage}}
}
-
%% This is for compatibility with Babel-aware package:
\def\languageshorthands#1{\relax} %this is for scrlttr2 class
\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
+\AtEndPreamble{
+ \providecommand\texorpdfstring[2]{#1}% dummy command if hyperref is not loaded
+}
-\ifluatex
+\sys_if_engine_luatex:T{
\RequirePackage{luatexbase} % already included by fontspec, but needed here
\RequireLuaModule{polyglossia}
-\fi
+}
% Which version of XeTeX do we use? What is the boudary class? 4095 or 255
\@ifundefined{e@alloc@intercharclass@top}
@@ -3588,10 +3694,16 @@ to track the issues and follow progress.
{\let\xpg@boundaryclass=\e@alloc@intercharclass@top}
% Useful for getting list of loaded languages and variants. Like babel's bbl@loaded
-\let\xpg@loaded\@empty% list of loaded languages (polyglossia name)
-\let\xpg@vloaded\@empty% list of loaded variants
-\let\xpg@bloaded\@empty% list of loaded languages (babel name)
-\let\xpg@bcp@loaded\@empty% list of loaded languages (bcp-47 id)
+% all language loaded
+\seq_new:N \__xpg_langs_loaded
+% list of loaded languages (polyglossia name)
+\clist_new:N \xpg@loaded
+% list of loaded variants
+\clist_new:N \xpg@vloaded
+% list of loaded languages (babel name)
+\clist_new:N \xpg@bloaded
+% list of loaded languages (bcp-47 id)
+\clist_new:N \xpg@bcp@loaded
% counter in latin
\def\latinalph#1{\expandafter\latin@alph\csname c@#1\endcsname}
@@ -3661,25 +3773,37 @@ to track the issues and follow progress.
% error out if lang is not loaded
\cs_new_nopar:Nn \polyglossia@error@iflangnotloaded:n
{
- \cs_if_exist:cF{#1@loaded}
+ \seq_if_in:NxF \__xpg_langs_loaded {#1}
{
\xpg@error{language~ #1~ is~ not~ loaded.~ Please~ load~ it~ before~ using~ it.}
}
}
+\msg_new:nnn { polyglossia } { languagenotloaded }
+{
+ The~ language~ #1~ is~ not~ loaded.~ You~ should~ load~ it.
+}
+\msg_redirect_name:nnn { polyglossia } { languagenotloaded } { critical }
-% error do not use directly the gloss file
-\msg_new:nnn { polyglossia } { directloadgloss }
+\cs_new_nopar:Nn \__xpg_msg_if_lang_not_loaded:n
{
- You~ should~ not~ load~ directly~ the~ gloss~ file~ using~ `\string\usepackage'.
- You~ must~ use~ `\string\setotherlanguage\{#1\}' or `\string\setmainlanguage\{#1\}'.
+ \tl_if_blank:eT {\xpg_alias_base_lang:n{#1}}
+ {
+ \msg_show:nnn { polyglossia } { languagenotloaded } {#1}
+ }
}
-\msg_redirect_name:nnn { polyglossia } { directloadgloss } { critical }
+%
%% use macro if defined, else warn that it is not
-\def\csuse@warn#1{%
- \ifcsundef{#1}{\xpg@warning{ \expandafter\string\csname #1\endcsname\space is~ not~ defined}}%
- {\csname #1\endcsname}}
+\cs_new_nopar:Nn \__xpg_use_or_warn:N
+{
+ \cs_if_exist_use:NF {#1}
+ {
+ \xpg@warning { \tl_to_str:N {#1} ~ is~ not~ defined }
+ }
+}
+\cs_generate_variant:Nn \__xpg_use_or_warn:N {c}
+
%% ensure directionality if bidi is loaded, else ignore
\def\@@ensure@dir#1{\ifcsundef{@ensure@dir}{#1}{\@ensure@dir{#1}}}
@@ -3697,66 +3821,94 @@ to track the issues and follow progress.
}
}
+% if #1 is LR run #2 else #3
+\prg_set_conditional:Nnn \__xpg_if_LR_str:n {p, T, F, TF}
+{
+ \str_case_e:nnF{#1}{
+ {LR}{\prg_return_true:}
+ {RL}{\prg_return_false:}
+ }
+ {
+ \xpg@error{Unknown~ direction~#1}
+ \prg_return_false:
+ }
+}
+\prg_generate_conditional_variant:Nnn \__xpg_if_LR_str:n {e} {p, T, F, TF}
+
% (lua)bidi commands to change directionality for paragraphs
% and inline text.
% overwritten with correct package
\cs_new_nopar:Nn{\polyglossia@setpardirection:n}{%
- \str_case_e:nnTF{#1}{%
- {LR}{\relax}%
- {RL}{\xpg@error{right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}}%
- }%
- {}%
- {\xpg@error{Unknown~ language~ direction~ #1 ~(base~ wrapper)}}%
+ \__xpg_if_LR_str:nF {#1}
+ {
+ \xpg@error{right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
+ }
}
\cs_new_nopar:Nn{\polyglossia@settextdirection:n}{%
- \str_case_e:nnTF{#1}{%
- {LR}{\relax}%
- {RL}{\xpg@error{right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}}%
- }%
- {}%
- {\xpg@error{Unknown~ language~ direction~ #1 ~(base~ wrapper)}}%
+ \__xpg_if_LR_str:nF {#1}
+ {
+ \xpg@error{right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
+ }
}
-\xpg@at@package{bidi}{package/after/bidi}{%
+\__xpg_at_package_hook:nnn{bidi}{package/bidi/after}{%
\ExplSyntaxOn%
\cs_gset_nopar:Nn{\polyglossia@setpardirection:n}{%
- \str_case_e:nnTF{#1}{%
- {LR}{\setLR}%
- {RL}{\setRL}%
- }%
- {}%
- {\xpg@error{Unknown~ language~ direction~ #1 ~(bidi~ wrapper)}}%
+ \__xpg_if_LR_str:nTF{#1}%
+ {%
+ \setLR%
+ }%
+ {%
+ \setRL%
+ }%
}%
\cs_gset_nopar:Nn{\polyglossia@settextdirection:n}{%
- \str_case_e:nnTF{#1}{%
- {LR}{\LRE}%
- {RL}{\RLE}%
- }%
- {}%
- {\xpg@error{Unknown~ language~ direction~ #1 ~(bidi~ wrapper)}}%
+ \__xpg_if_LR_str:nTF{#1}%
+ {%
+ \LRE%
+ }%
+ {%
+ \RLE%
+ }%
}%
\ExplSyntaxOff%
}
-\xpg@at@package{luabidi}{package/after/luabidi}{%
+\__xpg_at_package_hook:nnn{luabidi}{package/luabidi/after}{%
\ExplSyntaxOn%
\cs_gset_nopar:Nn{\polyglossia@setpardirection:n}{%
- \str_case_e:nnTF{#1}{%
- {LR}{\setLR}%
- {RL}{\setRL}%
- }
- {}%
- {\xpg@error{Unknown~ language~ direction~ #1 ~(luabidi~ wrapper)}}%
+ \__xpg_if_LR_str:nTF{#1}%
+ {%
+ \setLR%
+ }%
+ {%
+ \setRL%
+ }%
}%
\cs_gset_nopar:Nn{\polyglossia@settextdirection:n}{%
- \str_case_e:nnTF{#1}{%
- {LR}{\LRE}%
- {RL}{\RLE}%
- }
- {}%
- {\xpg@error{Unknown~ language~ direction~ #1 ~(luabidi~ wrapper)}}%
+ \__xpg_if_LR_str:nTF{#1}%
+ {%
+ \LRE%
+ }%
+ {%
+ \RLE%
+ }%
}%
\ExplSyntaxOff%
}
+% emulate \RTLmain
+\cs_new_nopar:Nn \__xpg_setRTLmain: {}
+\str_case_e:nnF{\c_sys_engine_str}{%
+ {luatex}{\cs_gset:Nn \__xpg_setRTLmain: {\setRTLmain}}
+ {xetex}{\cs_gset:Nn \__xpg_setRTLmain: {\@RTLmaintrue\setnonlatin}}
+}
+{
+ \cs_gset:Nn \__xpg_setRTLmain:
+ {
+ \xpg@warning{You’re~ running a~ TeX~ engine~ that~ is~ not~ LuaTeX~ or~ XeTeX.\MessageBreak
+ That~ is~ almost~ guaranteed~ to~ cause~ problems.}
+ }
+}
+
%% compatibility with babel
\let\addto\gappto% gappto is defined in etoolbox
@@ -3792,6 +3944,8 @@ to track the issues and follow progress.
%% TODO? \toggletrue{#1@setup@done}%
% reinit \do
\def\do##1{\setotherlanguage{##1}}%
+ % register base alias
+ \xpg_language_alias { #1 } { #1 }
}
% Adjust language key setting after initial setup
@@ -3804,14 +3958,14 @@ to track the issues and follow progress.
% setup hyphennames from a str list of hyphen
\cs_new:Nn \polyglossia_setup_hyphen:n {
- \exp_args:Nne \clist_set:Nn{\l_tmpa_clist}{\prop_item:Nn \polyglossia@langsetup {#1 / hyphennames}}
+ \clist_set:Ne{\l_tmpa_clist}{\prop_item:Nn \polyglossia@langsetup {#1 / hyphennames}}
\providebool{havehyphen}
\boolfalse{havehyphen}
% for each hyphen in the set until we find one that works
\clist_map_inline:Nn \l_tmpa_clist {
\ifbool{havehyphen}{}{%
% check if language hyphenname is defined
- \polyglossia@check@ifdefined:NF{#1}{%
+ \__xpg_check_if_exist_l@:NF{#1}{%
% if not, first consider nohyphenation
\str_if_eq:nnTF{##1}{nohyphenation}
{%
@@ -3828,7 +3982,7 @@ to track the issues and follow progress.
\xpg@set@hyphenation@patterns{##1}
\global\booltrue{havehyphen}
}%
- }{}%
+ }{}%
}%
}%
}%
@@ -3847,7 +4001,7 @@ to track the issues and follow progress.
\polyglossia@setup@language@patterns{#1}%
}%
% setup hyphenmins
- \exp_args:NNe \clist_set:Nn \l_tmpa_clist
+ \clist_set:Ne \l_tmpa_clist
{ \prop_item:Nn \polyglossia@langsetup {#1 / hyphenmins} }
\cs_if_eq:cNF {l@#1} \l@nohyphenation
{
@@ -4053,7 +4207,14 @@ to track the issues and follow progress.
\prop_gput:Nnn{\polyglossia@langsetup}{#1/Localnumeral}{##1}
},
#1 / Localnumeral.value_required:n = true,
- #1 / Localnumeral.initial:n = {polyglossia@C@localnumeral}
+ #1 / Localnumeral.initial:n = {polyglossia@C@localnumeral},
+ % environment define command (by default create the environment)
+ #1 / DefineCommandsCmd
+ .code:n = {\prop_gput:Nnn{\polyglossia@langsetup}{#1/DefineCommandsCmd}{##1}},
+ #1 / DefineCommandsCmd
+ .value_required:n = true,
+ #1 / DefineCommandsCmd
+ .initial:n = {xpg_define_language_commands:e}
}
}
@@ -4297,7 +4458,10 @@ to track the issues and follow progress.
}
}
-\AtEndDocument{\prop_log:N{\polyglossia@langsetup}}
+\AtEndDocument{
+ \prop_log:N{\polyglossia@langsetup}
+ \prop_log:N{\__xpg_alias}
+}
\def\xpg@lastlanguage{0}%
\providebool{xpg@hyphenation@disabled}%
@@ -4454,7 +4618,9 @@ to track the issues and follow progress.
}%
\polyglossia@addfontfeature@language:xx{\prop_item:Nn{\polyglossia@langsetup}{#1/langtag}}
{\prop_item:Nn{\polyglossia@langsetup}{#1/language}}
- }}%
+ }%
+ \def\familytype{rm}%
+ }%
\csgdef{#1@font@sf}{%
\cs_if_exist_use:cF{#1fontsf}%
{
@@ -4475,7 +4641,9 @@ to track the issues and follow progress.
}%
\polyglossia@addfontfeature@language:xx{\prop_item:Nn{\polyglossia@langsetup}{#1/langtag}}
{\prop_item:Nn{\polyglossia@langsetup}{#1/language}}
- }}%
+ }%
+ \def\familytype{sf}%
+ }%
\csgdef{#1@font@tt}{%
\cs_if_exist_use:cF{#1fonttt}%
{
@@ -4496,7 +4664,9 @@ to track the issues and follow progress.
}%
\polyglossia@addfontfeature@language:xx{\prop_item:Nn{\polyglossia@langsetup}{#1/langtag}}
{\prop_item:Nn{\polyglossia@langsetup}{#1/language}}
- }}%
+ }%
+ \def\familytype{tt}%
+ }%
\endgroup
}
@@ -4552,21 +4722,29 @@ to track the issues and follow progress.
\newXeTeXintercharclass\xpg@normalclass %TODO
}{}
-\ifxetex
%% when no patterns are available, we use \l@nohyphenation, assigned to 255
%% (suggestion by Enrico Gregorio)
- \@ifundefined{l@nohyphenation}{\chardef\l@nohyphenation=255 }{}
-\else\ifluatex
- \@ifundefined{l@nohyphenation}{\chardef\l@nohyphenation=\directlua{
- tex.sprint(polyglossia.newloader_loaded_languages.nohyphenation)}\relax
- }{}
-\fi\fi
+\str_case_e:nn{\c_sys_engine_str}{
+ {luatex}
+ {
+ \@ifundefined{l@nohyphenation}
+ {\chardef\l@nohyphenation=\directlua{
+ tex.sprint(polyglossia.newloader_loaded_languages.nohyphenation)}\relax
+ }
+ {}
+ }
+ {xetex}
+ {
+ \@ifundefined{l@nohyphenation}{\chardef\l@nohyphenation=255 }{}
+ }
+}
+
%we call this macro when a gloss file is not found for a given language
\def\xpg@nogloss#1{%
\xpg@warning{File~ gloss-#1.ldf~ does~ not~ exist!\MessageBreak
I~ will~ nevertheless~ try~ to~ use~ hyphenation~ patterns~ for~ #1.}%
- \PolyglossiaSetup{#1}{hyphenmins,hyphennames={#1},fontsetup=true}%
+ \PolyglossiaSetup{#1}{hyphenmins={2,3},hyphennames={#1},fontsetup=true}%
% the above amounts to:
%\ifcsundef{l@#1}%
% {\expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax}%
@@ -4583,40 +4761,105 @@ to track the issues and follow progress.
\catcode`\@=\xpg@saved@at@catcode%
}
+%% Load a lde file
+\cs_new_nopar:Nn \__xpg_gloss_ext: {lde}
+\cs_new_nopar:Ne \__xpg_saved_@pkgextension: {\@pkgextension}
+
+\msg_new:nnn { polyglossia } { directloadgloss }
+{
+ You~ should~ not~ load~ directly~ the~ gloss~ file. ~
+ You~ must~ use~ `\string\setotherlanguage\{#1\}' or `\string\setmainlanguage\{#1\}'.
+}
+\msg_redirect_name:nnn { polyglossia } { directloadgloss } { critical }
+\NewDocumentCommand{\__xpg_ProvidesLanguageDefinitionExtension_error}{m m m m}
+{
+ \msg_critical:nn { polyglossia } { directloadgloss }
+}
+% ProvideExplPackage but for language file
+\cs_new_eq:NN \ProvidesLanguageDefinitionExtension \__xpg_ProvidesLanguageDefinitionExtension_error
+\cs_new_eq:NN \__xpg_saved_ProvidesExplPackage \ProvidesExplPackage
+\NewDocumentCommand{\__xpg_ProvidesLanguageDefinitionExtension}{m m m m}
+{
+ \__xpg_saved_ProvidesExplPackage{#1}{#2}{#3}{#4}
+ \cs_gset_eq:NN \@pkgextension \__xpg_saved_@pkgextension:
+ \cs_gset_eq:NN \ProvidesLanguageDefinitionExtension \__xpg_ProvidesLanguageDefinitionExtension_error
+}
+
+
+% wrapper for loading a gle file
+\NewDocumentCommand{\RequireLanguageDefinitionExtension}{O{} m}
+{
+ \cs_gset_eq:NN \__xpg_saved_@pkgextension: \@pkgextension
+ \cs_gset_eq:NN \__xpg_saved_ProvidesExplPackage \ProvidesExplPackage
+ \cs_gset_eq:NN \@pkgextension \__xpg_gloss_ext:
+ \cs_gset_eq:NN \ProvidesLanguageDefinitionExtension \__xpg_ProvidesLanguageDefinitionExtension
+ \RequirePackage[#1]{gloss-#2}
+ % be paranoiac restore
+ \cs_gset_eq:NN \@pkgextension \__xpg_saved_@pkgextension:
+ \cs_gset_eq:NN \__xpg_ProvidesLanguageDefinitionExtension_error \ProvideLanguageDefinitionExtension
+}
+
% try to load a language file
\cs_new:Nn \polyglossia_load_lang_definition:nn {
- \file_if_exist:nTF{gloss-#2.ldf}
+ \file_if_exist:eTF{gloss-#2.lde}
{
- % 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}
+ \RequireLanguageDefinitionExtension[#1]{#2}
\setkeys{#2}{#1}
- % restore former ~ catcode
- \xpg@restore@tilde@catcode
}
{
- \xpg@nogloss{#2}
+ \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}
+ }
}
}
+\cs_generate_variant:Nn \polyglossia_load_lang_definition:nn {
+ ee, ef, en, eo, ex,
+ fe, ff, fn, fo, fx,
+ ne, nf, no, nx,
+ oe, of, on, oo, ox,
+ xe, xf, xn, xo, xx
+}
% load a master language from an alias file
\newcommand*\xpg@load@master@language[1] {
- \xpg@input{gloss-#1.ldf}
- \ifcsundef{#1@loaded}%
- {
- \exp_args:Nx\polyglossia@define@language@cmd:n{#1}%
- }{}
- \polyglossia@register@language:nn{}{#1}%
- \csgdef{#1@loaded}{}%
+ \file_if_exist:eTF{gloss-#1.lde}
+ {
+ \RequireLanguageDefinitionExtension{#1}
+ }
+ {
+ \xpg@input{gloss-#1.ldf}
+ }
+ \seq_if_in:NxF \__xpg_langs_loaded {#1}
+ {
+ % define environment and command if not alias
+ \str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#1/target}} {#1} {
+ \use:c{\prop_item:Nn{\polyglossia@langsetup}
+ {#1/DefineCommandsCmd}}
+ {#1}
+ }
+ }
+ \polyglossia@register@language:nn{}{#1}%
+ \seq_gput_right:Nn \__xpg_langs_loaded {#1}
}
+\prop_new:N \__xpg_alias
-% define environment and command
-\cs_new:Nn \polyglossia@define@language@cmd:n {
- \ifcsundef{#1@alias@lang}{%
+% define environment and command if not alias
+\cs_new:Nn \xpg_define_language_commands:n {
+ \str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#1/target}} {#1}
+ {
\exp_args:Ne
\newenvironment {\prop_item:Nn{\polyglossia@langsetup}{#1/envname}} [1] []
{
@@ -4627,156 +4870,242 @@ to track the issues and follow progress.
}%
\exp_args:Nc \newcommand {text#1} [2][]
{%
- \xpg@textlanguage[##1]{#1}{##2}%
+ \__xpg_textlanguage:een{##1}{#1}{##2}%
}%
- }{}
+ }
+}
+\cs_generate_variant:Nn \xpg_define_language_commands:n {e}
+
+\AtBeginDocument{
+ \prop_log:N{\__xpg_alias}
}
+% resolve alias property #1 lang #2 item
+\cs_new:Nn \xpg_alias_prop_item:nn {
+ \prop_if_in:NeTF \__xpg_alias {#1/#2}
+ {
+ \prop_item:Ne \__xpg_alias {#1/#2}
+ }
+ {
+ \prop_if_in:NeTF \__xpg_alias {#1/target}
+ {
+ % target to self fall back to language table
+ \str_if_eq:eeTF { \prop_item:Ne \__xpg_alias {#1/target} } { #1 }
+ {
+ \prop_item:Nn{\polyglossia@langsetup} {#1/#2}
+ }
+ % load alias by recursion
+ {
+ \xpg_alias_prop_item:ee { \prop_item:Ne \__xpg_alias {#1/target} } {#2}
+ }
+ }
+ {
+ % empty
+ }
+ }
+}
+\cs_generate_variant:Nn \xpg_alias_prop_item:nn {en, ne, ee}
+
+% add option #2 to list of option of language #1
+\cs_new:Nn \xpg_alias_add_to_option_i:nn
+{
+ \tl_if_blank:eTF {#2}
+ {
+ \xpg_alias_prop_item:nn {#1}{options}
+ }
+ {
+ \tl_if_blank:eTF { \xpg_alias_prop_item:nn {#1}{options} }
+ {
+ #2
+ }
+ {
+ \xpg_alias_prop_item:nn {#1}{options},#2
+ }
+ }
+}
+
+
+% get base language
+\cs_new:Nn \xpg_alias_base_lang:n {
+ \str_if_eq:eeTF { \prop_item:Ne \__xpg_alias {#1/target} } { #1 }
+ {
+ #1
+ }
+ {
+ \xpg_alias_base_lang:n { \prop_item:Ne \__xpg_alias {#1/target} }
+ }
+}
+\cs_generate_variant:Nn \xpg_alias_base_lang:n {e}
+
+\keys_define:nn { polyglossia/alias }
+{
+ % babelname\l_tmpa_prop
+ babelname .prop_put:N = \__xpg_language_alias_prop,
+ % bcp47
+ bcp47 .prop_put:N = \__xpg_language_alias_prop,
+ % variant
+ variant .prop_put:N = \__xpg_language_alias_prop,
+}
+
+
+
+% provide way to define alias environment and command
+% #1 () variant
+% #2 [] option (not yet without variant and bcp47 name)
+% #3 language
+% #4 () babel name
+% #5 [] bcp47 name
+% #6 alias
+\DeclareDocumentCommand \xpg_language_alias { D(){} O{} m D(){} O{} m}
+{
+ \prop_gremove:Nn \__xpg_alias {#6/target}
+ \prop_gremove:Nn \__xpg_alias {#6/options}
+ \prop_gremove:Nn \__xpg_alias {#6/bcp47}
+ \prop_gremove:Nn \__xpg_alias {#6/babelname}
+ \prop_gremove:Nn \__xpg_alias {#6/variant}
+ \prop_gput:Nee \__xpg_alias {#6/target} {#3}
+ \tl_if_blank:eF {#1}
+ {
+ \prop_gput:Nee \__xpg_alias {#6/variant} {#1}
+ }
+ \tl_if_blank:eF {#5}
+ {
+ \prop_gput:Nee \__xpg_alias {#6/bcp47} {#5}
+ }
+ \tl_if_blank:eF {#4}
+ {
+ \prop_gput:Nee \__xpg_alias {#6/babelname} {#1}
+ }
+ \tl_if_blank:eF {#2}
+ {
+ \prop_gput:Nee \__xpg_alias {#6/options} {#2}
+ }
+}
+
+
% provide way to define alias environment and command
% \setlanguagealias[<options>]{<language>}{<alias>}
\DeclareDocumentCommand \setlanguagealias {s O{} m m}
{
% The starred version does not define commands and environments
\IfBooleanF {#1}
+ {
+ \exp_args:Nc \providecommand {text#4} [2][] {}
+ \exp_args:Nc \renewcommand {text#4} [2][]
{
- \ifcsundef{#4@alias@lang}{%
- \exp_args:Ne
- \newenvironment {#4}
- {
- \begin{otherlanguage}[#2]{#3}
- }%
- {
- \end{otherlanguage}
- }%
- \exp_args:Nc \newcommand {text#4} [2][]
- {%
- \xpg@textlanguage[#2,##1]{#3}{##2}%
- }%
- }{%
- \exp_args:Ne
- \renewenvironment {#4}
- {
- \begin{otherlanguage}[#2]{#3}
- }%
- {
- \end{otherlanguage}
- }%
- \exp_args:Nc \renewcommand {text#4} [2][]
- {%
- \xpg@textlanguage[#2,##1]{#3}{##2}%
- }%
- }%
+ \__xpg_textlanguage:een{##1}{#4}{##2}
+ }
+ \exp_args:Nc \providecommand {#4} {}
+ \exp_args:Ne \renewenvironment {#4}
+ {
+ \begin{otherlanguage}{#4}
+ }
+ {
+ \end{otherlanguage}
+ }
}%
- \csgdef{#4@alias@lang}{#3}%
- \tl_if_blank:nF {#2} {\csgdef{#4@alias@opts}{#2}}%
+ \tl_clear_new:N \__xpg_alias_option_tl
+ \prop_clear_new:N \__xpg_language_alias_prop
+ \keys_set_known:nnN{polyglossia/alias} {#2} \__xpg_alias_option_tl
+ \xpg_language_alias
+ (\prop_item:Nn \__xpg_language_alias_prop {variant})
+ % TODO not yet [\__xpg_alias_option_tl]
+ [#2]
+ {#3}
+ (\prop_item:Nn \__xpg_language_alias_prop {babelname})
+ [\prop_item:Nn \__xpg_language_alias_prop {bcp47}]
+ {#4}
}
\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}{}%
+ \clist_if_in:NeF \xpg@loaded {#2}{
+ \clist_gput_right:Ne \xpg@loaded {#2}
+ }
+ % Register the language options
+ \polyglossia@set@lang@options:nnn {#2} {#1} {@xpg@set@langvariant}
+ % register babelname
+ \prop_get:NeN \polyglossia@langsetup {#2/babelname} \l_tmpa_tl
+ \clist_if_in:NeF \xpg@bloaded {\l_tmpa_tl}{
+ \clist_gput_right:Ne \xpg@bloaded {\l_tmpa_tl}
+ }
+ % register BCP-47 ID
+ \prop_get:NeN \polyglossia@langsetup {#2/bcp47} \l_tmpa_tl
+ \clist_if_in:NeF \xpg@bcp@loaded {\l_tmpa_tl}{
+ \clist_gput_right:Ne \xpg@bcp@loaded {\l_tmpa_tl}
+ }
}
-
\newcommand{\setdefaultlanguage}[2][]{%
% latex is an internal language, so do not record
- \ifstrequal{#2}{latex}{}{%
- % register polyglossia language name
- \ifcsundef{#2@registered}{%
- \global\edef\xpg@loaded{%
- \ifx\xpg@loaded\@empty\else\xpg@loaded,\fi #2%
- }%
- }{}%
- \csgdef{#2@registered}{}%
- }%
- \ifcsundef{#2@loaded}%
+ \str_if_eq:eeF{#2}{latex}
{
- \polyglossia_load_lang_definition:nn{#1}{#2}
- % define environment and command (except for internal latex language)
- \ifstrequal{#2}{latex}{}{%
- \exp_args:Nx\polyglossia@define@language@cmd:n{#2}
- }%
- \csgdef{#2@loaded}{}%
+ \clist_if_in:NeF \xpg@loaded {\xpg_alias_base_lang:n{##2}}{
+ \clist_gput_right:Ne \xpg@loaded {\xpg_alias_base_lang:n{##2}}
+ }
}
+ \seq_if_in:NxF \__xpg_langs_loaded {#2}
{
- \relax
+ \polyglossia_load_lang_definition:nn{#1}{#2}
+ % define environment and command if not alias
+ \str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#2/target}} {#2} {
+ \use:c{\prop_item:Nn{\polyglossia@langsetup}
+ {#2/DefineCommandsCmd}}
+ {#2}
+ }
+ \seq_gput_right:Nn \__xpg_langs_loaded {#2}
}
- \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}}%
- \exp_args:Nxx \polyglossia@set@default@language:nn {\csuse{#2@alias@opts},#1} {\csuse{#2@alias@lang}}%
- }{%
- \polyglossia@set@default@language:nn {#1} {\csuse{#2@alias@lang}}%
- }%
- }{%
- \polyglossia@set@default@language:nn {#1} {#2}%
- }%
+ \polyglossia@set@default@language:ee {\xpg_alias_add_to_option_i:nn{#2}{#1}}
+ {\xpg_alias_base_lang:n{#2}}%
}
+
\cs_new:Nn \polyglossia@set@default@language:nn
{
\gdef\xpg@main@language{#2}%
- \tl_if_blank:nTF {#1}{\gdef\mainlanguagevariant{}}{%
+ \tl_if_blank:nTF {#1}
+ {
+ \cs_gset_nopar:Npn \mainlanguagevariant {}
+ }
+ {%
% Register the language options
- \polyglossia@set@lang@options:nn {#2} {#1}%
+ \polyglossia@set@lang@options:nnn {#2} {#1} {@xpg@main@langvariant}%
}%
\csgdef{#2@gvar}{\mainlanguagevariant}%
%% The following settings are for the default language and script
% this tells bidi.sty or luabidi.sty that the document is RTL
- \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#2/direction}}{RL}{%
- \str_case_e:nnF{\c_sys_engine_str}{%
- {luatex}{\setRTLmain}
- {xetex}{\@RTLmaintrue\setnonlatin}
- }{}%
- }{}%
+ \__xpg_if_LR_str:eF{\prop_item:Nn{\polyglossia@langsetup}{#2/direction}}
+ {
+ \__xpg_setRTLmain:
+ }
\cs_gset_nopar:Nn \polyglossia@AtBeginDocument@selectlanguage: {
\selectbackgroundlanguage{#2}
\selectlanguage[#1]{#2}%
}
\xpg@info{Default~ language~ is~ #2}%
\polyglossia@set@language@name[#1]{#2}%
- \def\mainlanguagename{#2}
+
+ \cs_gset_nopar:Npn \mainlanguagename {#2}
% Store babelname of main language (for external packages such as biblatex)
- \prop_get:NxNT \polyglossia@langsetup {#2/babelname} \l_tmpa_tl
- { \edef\mainbabelname{\l_tmpa_tl} }
+ \cs_gset_nopar:Npe \mainbabelname { \prop_item:Nn \polyglossia@langsetup {#2/babelname} }
% Store babelname of current language (for external packages such as biblatex)
- \prop_get:NxNT \polyglossia@langsetup {#2/babelname} \l_tmpa_tl
- { \edef\babelname{\l_tmpa_tl}%
- \cs_gset_eq:cc{#2@gbabelname}{babelname}%
- }
+ \cs_gset_eq:NN \babelname \mainbabelname
+ \cs_gset_eq:cc{#2@gbabelname}{babelname}%
% Store BCP-47 id of main language
- \prop_get:NxNT \polyglossia@langsetup {#2/bcp47} \l_tmpa_tl
- { \csedef{mainbcp47id}{\l_tmpa_tl} }
- % Store BCP-47 id of current language
- \prop_get:NxNT \polyglossia@langsetup {#2/bcp47} \l_tmpa_tl
- { \csedef{bcp47id}{\l_tmpa_tl}%
- \cs_gset_eq:cc{#2@gbcp47id}{bcp47id}%
- }
- \ifluatex %
- \directlua{polyglossia.set_default_language('\luatexluaescapestring{\string#2}')}%
- \fi %
+ \cs_gset_nopar:cpe {mainbcp47id} { \prop_item:Nn \polyglossia@langsetup {#2/bcp47} }
+ \cs_gset_eq:cc {bcp47id} {mainbcp47id}
+ \cs_gset_eq:cc{#2@gbcp47id}{bcp47id}
+
+ \sys_if_engine_luatex:T
+ {
+ \directlua{polyglossia.set_default_language('\luatexluaescapestring{\string#2}')}%
+ }
+}
+\cs_generate_variant:Nn\polyglossia@set@default@language:nn {
+ ee, ef, en, eo, ex,
+ fe, ff, fn, fo, fx,
+ ne, nf, no, nx,
+ oe, of, on, oo, ox,
+ xe, xf, xn, xo, xx
}
\let\setmainlanguage=\setdefaultlanguage
@@ -4785,12 +5114,11 @@ to track the issues and follow progress.
% Currently supported: bcp-47
\DeclareDocumentCommand \languageid {m}
{
- \str_case:nnTF {#1}
+ \str_case:nnF {#1}
{
{bcp-47} { \csuse{bcp47id} }
{bcp47} { \csuse{bcp47id} }
}
- {}
{
\xpg@error{Invalid~ \string\languageid\space argument:~ #1}
}
@@ -4800,25 +5128,26 @@ to track the issues and follow progress.
% Currently supported: bcp-47
\DeclareDocumentCommand \mainlanguageid {m}
{
- \str_case:nnTF {#1}
+ \str_case:nnF {#1}
{
{bcp-47} { \csuse{mainbcp47id} }
{bcp47} { \csuse{mainbcp47id} }
}
- {}
{
\xpg@error{Invalid~ \string\mainlanguageid\space argument:~ #1}
}
}
-
-\def\mainbabelname{}%
-\def\mainlanguagevariant{}%
+% main babel name
+\cs_new_nopar:Npn \mainlanguagename {}
+\cs_new_nopar:Npn \mainbabelname {}
+\cs_new_nopar:cpn {mainbcp47id} {}
+\cs_new_nopar:Npn \mainlanguagevariant {}%
% Store main language variant for external packages
\define@key{xpg@main@langvariant}{variant}{%
- \gdef\mainlanguagevariant{#1}%
+ \cs_gset_nopar:Npn \mainlanguagevariant {#1}%
}
-\def\babelname{}%
+\cs_new_nopar:Npn \babelname {}
\def\languagevariant{}%
% Store current language variant for external packages
\define@key{xpg@set@langvariant}{variant}{%
@@ -4831,21 +5160,16 @@ to track the issues and follow progress.
\ifcsundef{#2@gvar}{\def\languagevariant{}}{\def\languagevariant{\csuse{#2@gvar}}}
}{%
% Register the language options
- \polyglossia@set@lang@options:nn {#2} {#1}%
+ \polyglossia@set@lang@options:nnn {#2} {#1} {@xpg@set@langvariant}%
+ \cs_set_eq:cc{#2@gvar}{languagevariant}%
}%
}
\newcommand*{\resetdefaultlanguage}[2][]{%
- \ifcsdef{#2@alias@lang}{%
- \ifcsdef{#2@alias@opts}{%
- \exp_args:Nxx \polyglossia@reset@default@language:nn {\csuse{#2@alias@opts},#1} {\csuse{#2@alias@lang}}%
- }{%
- polyglossia@reset@default@language:nn {#1} {\csuse{#2@alias@lang}}%
- }%
- }{%
- polyglossia@reset@default@language:nn {#1} {#2}%
- }%
+ \polyglossia@reset@default@language:nn
+ {\xpg_alias_add_to_option_i:nn{#2}{#1}}
+ {\xpg_alias_base_lang:n{#2}}%
}
\cs_new:Nn \polyglossia@reset@default@language:nn
@@ -4859,7 +5183,10 @@ to track the issues and follow progress.
\cs_if_exist_use:c{noextras@bbl@\mainbabelname}%
\csuse{init@noextras@\xpg@main@language}%
\polyglossia@set@language@name[#1]{#2}%
- \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#2/direction}}{RL}{\@rlmaintrue\@rl@footnotetrue}{}%
+ \__xpg_if_LR_str:eF{\prop_item:Ne{\polyglossia@langsetup}{#2/direction}}
+ {
+ \@rlmaintrue\@rl@footnotetrue
+ }
\selectlanguage[#1]{#2}%
\selectbackgroundlanguage{#2}%
% Store babelname of current language (for external packages such as biblatex)
@@ -4883,6 +5210,13 @@ to track the issues and follow progress.
\csedef{bcp47id}{\prop_item:Nn{\polyglossia@langsetup}{#2/bcp47}}%
}%
}
+\cs_generate_variant:Nn \polyglossia@reset@default@language:nn {
+ ee, ef, en, eo, ex,
+ fe, ff, fn, fo, fx,
+ ne, nf, no, nx,
+ oe, of, on, oo, ox,
+ xe, xf, xn, xo, xx
+}
% This saves the normalfont for the latin script since we may change normalfont in other scripts
\let\normalfontlatin=\normalfont%
@@ -4964,15 +5298,18 @@ to track the issues and follow progress.
\def\xpg@select@fontfamily#1{%
\def\tmp@tt{tt}\def\tmp@sf{sf}%
\ifx\familytype\tmp@tt
- \csuse@warn{#1@font@tt}%
+ \__xpg_use_or_warn:c{#1@font@tt}%
\else\ifx\familytype\tmp@sf
- \csuse@warn{#1@font@sf}%
- \else\csuse@warn{#1@font@rm}\fi\fi}
+ \__xpg_use_or_warn:c{#1@font@sf}%
+ \else\__xpg_use_or_warn:c{#1@font@rm}\fi\fi}
\def\xpg@set@normalfont#1{%
- \DeclareRobustCommand\rmfamily{\csuse{#1@font@rm}}%
- \DeclareRobustCommand\sffamily{\csuse{#1@font@sf}}%
- \DeclareRobustCommand\ttfamily{\csuse{#1@font@tt}}%
+ \letcs{\rmfamily}{#1@font@rm}%
+ \letcs{\sffamily}{#1@font@sf}%
+ \letcs{\ttfamily}{#1@font@tt}%
+ \robustify\rmfamily%
+ \robustify\sffamily%
+ \robustify\ttfamily%
\gdef\normalfont{\protect\xpg@select@fontfamily{#1}%
\fontseries{\seriesdefault}\selectfont%
\fontshape{\shapedefault}
@@ -4991,14 +5328,10 @@ to track the issues and follow progress.
\@afterindentfalse%
}
-\newcommand*{\selectbackgroundlanguage}[1]{%
- \ifcsdef{#1@alias@lang}{%
- \polyglossia@select@background@language:n {\csuse{#1@alias@lang}}%
- }{%
- \polyglossia@select@background@language:n {#1}%
- }%
+\cs_new_nopar:Npn \selectbackgroundlanguage #1
+{%
+ \polyglossia@select@background@language:n {\xpg_alias_base_lang:n{#1}}
}
-
\cs_new:Nn \polyglossia@select@background@language:n
{
\str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#1/lcscript}}{latin}
@@ -5006,26 +5339,23 @@ to track the issues and follow progress.
{\xpg@set@normalfont{#1}}%
\csuse{#1@globalnumbers}%
}
-
-\newcommand{\setotherlanguage}[2][]{%
- \ifcsundef{#2@loaded}
+\cs_generate_variant:Nn \polyglossia@select@background@language:n {e}
+% Declare secondary language #2 with language options #1
+\DeclareDocumentCommand \setotherlanguage { O{} m }
+{
+ \seq_if_in:NxF \__xpg_langs_loaded {#2}
{
- \polyglossia_load_lang_definition:nn{#1}{#2}
- % define environment and command
- \exp_args:Nx\polyglossia@define@language@cmd:n{#2}
- \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}}%
- \exp_args:Nxx \polyglossia@set@other@language:nn {\csuse{#2@alias@opts},#1} {\csuse{#2@alias@lang}}%
- }{%
- \polyglossia@set@other@language:nn {#1} {\csuse{#2@alias@lang}}%
- }%
- }{%
- \polyglossia@set@other@language:nn {#1} {#2}%
- }%
- \csgdef{#2@loaded}{}%
+ \polyglossia_load_lang_definition:ee {#1} {#2}%
+ % define environment and command if not alias
+ \str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#2/target}} {#2} {
+ \use:c{\prop_item:Nn{\polyglossia@langsetup}
+ {#2/DefineCommandsCmd}}
+ {#2}
+ }
+ \polyglossia@set@other@language:ee {\xpg_alias_add_to_option_i:nn{#2}{#1}}
+ {\xpg_alias_base_lang:n{#2}}%
+ \seq_gput_right:Nn \__xpg_langs_loaded {#2}
}
- {}
}
\cs_new:Nn \polyglossia@set@other@language:nn
@@ -5033,15 +5363,22 @@ to track the issues and follow progress.
\polyglossia@register@language:nn{#1}{#2}%
% If a variant is set, store it.
\gdef\otherlanguagevariant{}
- \tl_if_blank:nTF {#1}{}{%
- % Register the language options
- \polyglossia@set@lang@options:nn {#2} {#1}%
- }%
+ % Register the language options
+ \polyglossia@set@lang@options:nnn {#2} {#1} {@xpg@other@langvariant}%
+
\csgdef{#2@gvar}{\otherlanguagevariant}%
\prop_get:NxNT \polyglossia@langsetup {#2/babelname} \l_tmpa_tl
{ \xdef\otherlanguagebabelname{\l_tmpa_tl} }
\cs_gset_eq:cc{#2@gbabelname}{otherlanguagebabelname}%
}
+\cs_generate_variant:Nn \polyglossia@set@other@language:nn {
+ ee, ef, en, eo, ex,
+ fe, ff, fn, fo, fx,
+ ne, nf, no, nx,
+ oe, of, on, oo, ox,
+ xe, xf, xn, xo, xx
+}
+
% Store main language variant for external packages
\define@key{xpg@other@langvariant}{variant}{%
@@ -5071,15 +5408,7 @@ to track the issues and follow progress.
% where \text<alias> would cause clashes
% (e.g., \textit)
\newcommand\textlang[3][]{%
- \ifcsdef{#2@alias@lang}{%
- \ifcsdef{#2@alias@opts}{%
- \exp_args:Nxx \xpg@textlanguage[\csuse{#2@alias@opts},#1]{\csuse{#2@alias@lang}}{#3}%
- }{%
- \xpg@textlanguage[#1]{\csuse{#2@alias@lang}}{#3}%
- }%
- }{%
- \xpg@textlanguage[#1]{#2}{#3}%
- }%
+ \__xpg_textlanguage:een {#1} {#2} {#3}
}%
% Alias to {<lang>}, but more suitable
@@ -5122,6 +5451,8 @@ to track the issues and follow progress.
% joint code of \foreignlanguage, otherlanguage*
% and \text<lang>
+% #1 option
+% #2 language
\newcommand{\xpg@otherlanguage}[2][]
{%
\polyglossia@error@iflangnotloaded:n{#2}
@@ -5137,66 +5468,90 @@ to track the issues and follow progress.
}
\renewcommand{\foreignlanguage}[3][]
-{%
- \ifcsdef{#2@alias@lang}{%
- \ifcsdef{#2@alias@opts}{%
- \exp_args:Nxx \polyglossia@foreignlanguage:nnn {\csuse{#2@alias@opts},#1} {\csuse{#2@alias@lang}} {#3}%
- }{%
- \polyglossia@foreignlanguage:nnn {#1} {\csuse{#2@alias@lang}} {#3}%
- }%
- }{%
- \polyglossia@foreignlanguage:nnn {#1} {#2} {#3}%
- }%
+{
+ \__xpg_foreignlanguage:eeen {#1} {#2} {\xpg_alias_base_lang:n{#2}} {#3}
}
-\cs_new:Nn \polyglossia@foreignlanguage:nnn
+% internal wrapper for foreing language
+% #1 option
+% #2 alias
+% #3 base lang
+% #3 text
+\cs_new:Nn \__xpg_foreignlanguage:nnnn
{
- \polyglossia@error@iflangnotloaded:n{#2}
- \bgroup
- \xpg@otherlanguage[#1]{#2}%
- \polyglossia@lang@settextdirection:nn{#2}{#3}%
- \egroup
+ \tl_if_blank:nT {#3}
+ {
+ \msg_show:nnn { polyglossia } { languagenotloaded } {#2}
+ }
+ \group_begin:
+ \xpg@otherlanguage[\xpg_alias_add_to_option_i:nn{#2}{#1}]{#4}%
+ \polyglossia@lang@settextdirection:nn{#3}{#4}%
+ \group_end:
}
+\cs_generate_variant:Nn \__xpg_foreignlanguage:nnn {een}
+
% otherlanguage* is the environment equivalent of \foreignlanguage
\expandafter\providecommand\csname otherlanguage*\endcsname{}
\renewenvironment{otherlanguage*}[2][]
{%
- \ifcsdef{#2@alias@lang}{%
- \ifcsdef{#2@alias@opts}{%
- \exp_args:Nxx \polyglossia@otherlanguage:nn {\csuse{#2@alias@opts},#1} {\csuse{#2@alias@lang}}%
- }{%
- \polyglossia@otherlanguage:nn {#1} {\csuse{#2@alias@lang}}%
- }%
- }{%
- \polyglossia@otherlanguage:nn {#1} {#2}%
- }%
+ \__xpg_otherlanguage:eee {#1} {#2} {\xpg_alias_base_lang:n{#2}}
}
-{\egroup}
+{\group_end:}
-\cs_new:Nn \polyglossia@otherlanguage:nn
+% internal wrapper
+% #1 option
+% #2 alias
+% #3 base lang
+\cs_new:Nn \__xpg_otherlanguage:nnn
{
- \xpg@otherlanguage[#1]{#2}%
- \polyglossia@lang@settextdirection:nn{#2}\bgroup%
+ \tl_if_blank:nT {#3}
+ {
+ \msg_show:nnn { polyglossia } { languagenotloaded } {#2}
+ }
+ \xpg@otherlanguage[\xpg_alias_add_to_option_i:nn{#2}{#1}]{#3}%
+ \polyglossia@lang@settextdirection:nn{#3}\group_begin:%
+}
+\cs_generate_variant:Nn \__xpg_otherlanguage:nnn {
+ eee
}
% use by \text<lang> and \textlang. Equivalent to \foreignlanguage,
% except that dates are localized.
-\newcommand\xpg@textlanguage[3][]{%
- \polyglossia@error@iflangnotloaded:n{#2}
- \bgroup
- \xpg@otherlanguage[#1]{#2}%
- \csuse{date#2}%
- % This is a hook for external packages which want to access variants
- % via babelname (such as biblatex)
- \cs_if_exist_use:c{date@bbl@\babelname}%
- \polyglossia@lang@settextdirection:nn{#2}{#3}%
- \egroup
- % Reset the language's/script's font families
- \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#2/lcscript}}{latin}{}{\resetfontlatin}%
+% #1: option
+% #2: alias
+% #3: text
+\cs_new:Nn \__xpg_textlanguage:nnn
+{
+ \__xpg_textlanguage:nnen {#1} {#2} {\xpg_alias_base_lang:n{#2}} {#3}
}
+\cs_generate_variant:Nn \__xpg_textlanguage:nnn {een}
+% use by \text<lang> and \textlang. Equivalent to \foreignlanguage,
+% except that dates are localized.
+% #1: option
+% #2: alias
+% #3: base language
+% #4: text
+\cs_new:Nn \__xpg_textlanguage:nnnn
+{
+ \tl_if_blank:nT {#3}
+ {
+ \msg_show:nnn { polyglossia } { languagenotloaded } {#2}
+ }
+ \group_begin:
+ \xpg@otherlanguage[#1]{#3}%
+ \csuse{date#3}%
+ % This is a hook for external packages which want to access variants
+ % via babelname (such as biblatex)
+ \cs_if_exist_use:c{date@bbl@\babelname}%
+ \polyglossia@lang@settextdirection:nn{#3}{#4}%
+ \group_end:
+ % Reset the language's/script's font families
+ \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#3/lcscript}}{latin}{}{\resetfontlatin}%
+}
+\cs_generate_variant:Nn \__xpg_textlanguage:nnnn {nnen}
% Define language-specific hyphenation exceptions
\newcommand\pghyphenation[3][]{
@@ -5219,58 +5574,59 @@ to track the issues and follow progress.
\let\emp@langname\@undefined}
\DeclareDocumentCommand \selectlanguage {s O{} m}
-{%
- \ifcsdef{#3@alias@lang}{%
- \ifcsdef{#3@alias@opts}{%
- \exp_args:Nxx \polyglossia@select@language:nnn {#1} {\csuse{#3@alias@opts},#2} {\csuse{#3@alias@lang}}%
- }{%
- \polyglossia@select@language:nnn {#1} {#2} {\csuse{#3@alias@lang}}%
- }%
- }{%
- \polyglossia@error@iflangnotloaded:n{#3}%
- \polyglossia@select@language:nnn {#1} {#2} {#3}%
- }
+{
+ \__xpg_msg_if_lang_not_loaded:n {#3}
+ \polyglossia@select@language:nee {#1}
+ {\xpg_alias_add_to_option_i:nn{#3}{#2}}
+ {\xpg_alias_base_lang:n{#3}}
}
\cs_new:Nn \polyglossia@select@language:nnn
{
\IfBooleanF {#1}
- {
- \cs_set_nopar:Npx \xpg@pop@language { \exp_not:N \xpg@pop@language@i {#2} {#3} }
- \group_insert_after:N \xpg@pop@language
- }
- \tl_if_blank:nTF {#2}{}{%
- % Register the language options
- \polyglossia@set@lang@options:nn {#3} {#2}%
- }%
- % The starred variant does not write to the aux
- \IfBooleanTF#1{%
- \xpg@set@language@nonaux[#2]{#3}%
- }{%
- \xpg@set@language@aux[#2]{#3}%
- }%
- \ifluatex%
- \directlua{polyglossia.select_language('\luatexluaescapestring{\string#3}',
- \the\csname l@#3\endcsname)}%
- \fi%
+ {
+ \cs_set_nopar:Npx \xpg@pop@language { \exp_not:N \xpg@pop@language@i {#2} {#3} }
+ \group_insert_after:N \xpg@pop@language
+ }
+ % Register the language options
+ \polyglossia@set@lang@options:nnn {#3} {#2} {@xpg@set@langvariant}%
+ % The starred variant does not write to the aux
+ \IfBooleanTF#1{%
+ \xpg@set@language@nonaux[#2]{#3}%
+ }
+ {%
+ \xpg@set@language@aux[#2]{#3}%
+ }%
+ \sys_if_engine_luatex:T
+ {
+ \directlua{polyglossia.select_language('\luatexluaescapestring{\string#3}',
+ \the\csname l@#3\endcsname)}%
+ }
\polyglossia@register@language:nn{#2}{#3}%
}
+\cs_generate_variant:Nn \polyglossia@select@language:nnn {
+ nee, nne
+}
-\cs_new:Nn \polyglossia@set@lang@options:nn
-{
+% set lang option #2 for lang #1
+\cs_new:Nn \polyglossia@set@lang@options:nnn
+{
+ \tl_if_blank:nF {#2}
+ {
% If the optional argument sets a value for the key “variant”, copy it to xpg@langvariant
\clist_map_inline:nn { #2 } {%
- \xpg@parsevariantkeyvalue##1=@xpg@langvariant:#1\relax
+ \xpg@parsevariantkeyvalue##1=#3:#1\relax
}%
\exp_args:Nne \setkeys{#1}{#2}%
+ }
}
% Initialize default language options, so that
% \iflanguageoption has the info it needs also
% for default settings
\newcommand*\xpg@initialize@gloss@options[2]{%
- \polyglossia@set@lang@options:nn {#1} {#2}%
+ \polyglossia@set@lang@options:nnn {#1} {#2} {@xpg@set@langvariant}%
}
% Record synonymous keyvals such as variant=us and variant=american
@@ -5320,16 +5676,16 @@ to track the issues and follow progress.
{
\prop_get:cnNTF {xpg@current@options@#1} {#2} \l_tmpa_tl
{
- \exp_args:Nee \str_if_eq:NNTF{\l_tmpa_tl}{#3}
+ \str_if_eq:eeTF{\l_tmpa_tl}{#3}
{\prg_return_true:}
{
\prop_get:cnNTF {xpg@alias@keyvals@#1@#3} {#2} \l_tmpb_tl
{
- \exp_args:Nne \clist_set:Nn{\l_tmpa_clist}{\l_tmpb_tl}
+ \clist_set:Ne{\l_tmpa_clist}{\l_tmpb_tl}
\providetoggle{xpgvalfound}
\togglefalse{xpgvalfound}
\clist_map_inline:Nn \l_tmpa_clist {
- \exp_args:Nee \str_if_eq:NNT{##1}{\l_tmpa_tl}
+ \str_if_eq:eeT{##1}{\l_tmpa_tl}
{ \toggletrue{xpgvalfound} }
}
\iftoggle{xpgvalfound}{\prg_return_true:}{\prg_return_false:}
@@ -5352,39 +5708,39 @@ to track the issues and follow progress.
% Append any variant to csv list of variants
\define@key{xpg@langvariant}{variant}{%
- \edef\xpg@vloaded{#1\ifx\xpg@vloaded\@empty\else,\xpg@vloaded\fi}%
-}
-
-\prg_set_conditional:Npnn \polyglossia@check@if@lang@loaded:N #1 { p , T , F , TF }{
- \cs_if_exist:cTF{#1}{
- \prg_return_true:
- }{
- \prg_return_false:
+ \clist_if_in:NeF \xpg@vloaded {#1}{
+ \clist_gput_right:Ne \xpg@vloaded {#1}
}
}
% Test if language is loaded
\newcommand*\iflanguageloaded[3]{%
- \polyglossia@check@if@lang@loaded:NTF{#1@loaded}{#2}{#3}%
+ \AddToHook{begindocument/end}{%
+ \clist_if_in:NeTF \xpg@loaded{#1}{#2}{#3}%
+ }%
}
% Same for babellanguage is loaded
\newcommand*\ifbabellanguageloaded[3]{%
- \polyglossia@check@if@lang@loaded:NTF{#1@bbl@loaded}{#2}{#3}%
+ \AddToHook{begindocument/end}{%
+ \clist_if_in:NeTF \xpg@bloaded{#1}{#2}{#3}%
+ }%
}
% Same for languageid
\DeclareDocumentCommand \iflanguageidloaded {mmmm}
{
+ \AddToHook{begindocument/end}{%
\str_case:nnTF {#1}
{
- {bcp-47} { \polyglossia@check@if@lang@loaded:NTF{#2@bcp@loaded}{#3}{#4} }
- {bcp47} { \polyglossia@check@if@lang@loaded:NTF{#2@bcp@loaded}{#3}{#4} }
+ {bcp-47} { \clist_if_in:NeTF \xpg@bcp@loaded{#2}{#3}{#4} }
+ {bcp47} { \clist_if_in:NeTF \xpg@bcp@loaded{#2}{#3}{#4} }
}
{}
{
\xpg@error{Invalid~ \string\iflanguageidloaded\space argument:~ #1}
}
+ }%
}
% Check if the current font has a given glyph
@@ -5403,8 +5759,10 @@ to track the issues and follow progress.
}
}
{
- \xpg@warning{You’re running a TeX engine that is not LuaTeX or XeTeX.\MessageBreak
- That is almost guaranteed to cause problems.}
+ \xpg@warning{You’re ~ running ~ a ~ TeX engine ~ that ~ is ~
+ not ~ LuaTeX ~ or ~ XeTeX.\MessageBreak
+ That~ is~ almost~ guaranteed~ to~ cause~ problems.}
+ \prg_return_false:
}
}
@@ -5446,6 +5804,11 @@ to track the issues and follow progress.
}%
\@select@language[#1]{#2}%
% Write to the aux
+ \xpg@set@language@only@aux[#1]{#2}%
+}
+
+\newcommand*{\xpg@set@language@only@aux}[2][]{%
+ % Write to the aux
\if@filesw%
\ifx#1\\\\%
\protected@write\@auxout{}{\protect\selectlanguage*{#2}}%
@@ -5477,45 +5840,8 @@ to track the issues and follow progress.
}{}%
}
-% Open a group in the aux file. This is to keep
-% nested language options local (see #320).
-% In bidi tables, the opening/closing needs to be swapped (see #354)
-\newcommand*{\xpg@set@group@aux}{%
- \if@filesw%
- \ifbool{xpg@inbiditable}{%
- \protected@write\@auxout{}{\egroup}%
- \addtocontents{toc}{\egroup}%
- \addtocontents{lof}{\egroup}%
- \addtocontents{lot}{\egroup}%
- }{%
- \protected@write\@auxout{}{\bgroup}%
- \addtocontents{toc}{\bgroup}%
- \addtocontents{lof}{\bgroup}%
- \addtocontents{lot}{\bgroup}%
- }%
- \fi
-}
-
-% Close the group in the aux file.
-% In bidi RTL tables, the opening/closing needs
-% to be swapped (see #354).
-\newcommand*{\xpg@unset@group@aux}{%
- \if@filesw%
- \ifbool{xpg@inbiditable}{%
- \protected@write\@auxout{}{\bgroup}%
- \addtocontents{toc}{\bgroup}%
- \addtocontents{lof}{\bgroup}%
- \addtocontents{lot}{\bgroup}%
- }{%
- \protected@write\@auxout{}{\egroup}%
- \addtocontents{toc}{\egroup}%
- \addtocontents{lof}{\egroup}%
- \addtocontents{lot}{\egroup}%
- }%
- \fi
-}
-
-\prg_set_conditional:Npnn \polyglossia@check@ifdefined:N #1 { p , T , F , TF }{
+% check if language is defined
+\prg_set_conditional:Npnn \__xpg_check_if_exist_l@:N #1 { p , T , F , TF }{
\cs_if_exist:cTF {l@#1}
{
\cs_if_eq:cNTF {l@#1} \l@nohyphenation
@@ -5537,48 +5863,54 @@ to track the issues and follow progress.
\def\polyglossia@luatex@load@lang#1{%
% if \l@#1 is not properly defined, call lua function newloader(#1),
% and assign the returned number to \l@#1
- \polyglossia@check@ifdefined:NF {#1}
- {
- \expandafter\chardef\csname l@#1\endcsname=
- \directlua{ tex.sprint(polyglossia.newloader'#1') }\relax
- }
+ \__xpg_check_if_exist_l@:NF {#1}
+ {
+ \expandafter\chardef\csname l@#1\endcsname=
+ \directlua{ tex.sprint(polyglossia.newloader'#1') }\relax
+ }
}
% This check is also used by biblatex, so don't
% rename silently.
\newcommand\xpg@ifdefined[3]{%
- % With luatex, we first need to define \l@#1.
- \ifluatex
- \polyglossia@luatex@load@lang{#1}%
- \fi
- \polyglossia@check@ifdefined:NTF{#1}{#2}{#3}%
+ % With luatex, we first need to define \l@#1.
+ \sys_if_engine_luatex:T
+ {
+ \polyglossia@luatex@load@lang{#1}%
+ }
+ \__xpg_check_if_exist_l@:NTF{#1}{#2}{#3}%
}%
% Set \bbl@hyphendata@\the\language, which is (lua)babel's
% hyphenation pattern hook
% FIXME Clarifiy why/when this is needed.
\newcommand*\xpg@set@bbl@hyphendata[1]{%
- \ifluatex%
- \ifcsdef{bbl@hyphendata@#1}{}{%
- \global\@namedef{bbl@hyphendata@\the\language}{}%
- }%
- \fi%
+ \sys_if_engine_luatex:T
+ {
+ \ifcsdef{bbl@hyphendata@#1}{}{%
+ \global\@namedef{bbl@hyphendata@\the\language}{}%
+ }%
+ }
}
% Set hyphenation patterns for a given language. This does the right
% thing both for XeTeX and LuaTeX
\newcommand*\xpg@set@hyphenation@patterns[1]{%
- \ifluatex
- \polyglossia@luatex@load@lang{#1}%
- \language=\csname l@#1\endcsname
- \else
- \ifxetex
- \language=\csname l@#1\endcsname
- \else
+ \str_case_e:nnF{\c_sys_engine_str}{
+ {luatex}
+ {
+ \polyglossia@luatex@load@lang{#1}%
+ \language=\csname l@#1\endcsname
+ }
+ {xetex}
+ {
+ \language=\csname l@#1\endcsname
+ }
+ }
+ {
\xpg@warning{You’re~running~a~TeX~engine~that~is~not~LuaTeX~or~XeTeX.\MessageBreak
That~is~almost~guaranteed~to~cause~problems.}%
- \fi
- \fi
+ }
}
@@ -5615,38 +5947,46 @@ to track the issues and follow progress.
% Hook for external packages such as biblatex
\def\polyglossia@language@switched{}
-\def\noextrascurrent#1{%
- \csuse{noextras@#1}%
- % This is a hook for external packages which want to access variants
- % via babelname (such as biblatex)
- \cs_if_exist_use:c{noextras@bbl@\babelname}
+% remove all custumization for language #1
+\cs_new:Npn \noextrascurrent #1
+{%
+ \cs_if_exist_use:c{noextras@#1}%
+ % This is a hook for external packages which want to access variants
+ % via babelname (such as biblatex)
+ \cs_if_exist_use:c{noextras@bbl@\babelname}
}
% Common code for `\select@language' and `\foreignlanguage'.
\newcommand{\select@@language}[2][]{%
% disable the extras and number settings of the previous language
- \ifcsundef{languagename}{}{%
- \noextrascurrent{\languagename}%
- \csuse{no\languagename @numbers}%
- \ifxetex
- \str_if_eq:eeTF{\exp_args:Nne\prop_item:Nn{\polyglossia@langsetup}{\languagename/direction}}{RL}%
- {%
- \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#2/direction}}{RL}%
- {}% RTL -> RTL
- {\setlatin}% RTL -> LTR
- }{%
- \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#2/direction}}{RL}%
- {\setnonlatin}% LTR -> RTL
- {}% LTR -> LTR
- }%
- \fi
+ \cs_if_exist:cT{languagename}
+ {%
+ \noextrascurrent{\languagename}%
+ \cs_if_exist_use:c{no\languagename @numbers}%
+ \sys_if_engine_xetex:T{
+ \__xpg_if_LR_str:eTF{\prop_item:Ne{\polyglossia@langsetup}{\languagename/direction}}
+ {
+ \__xpg_if_LR_str:eF{\prop_item:Nn{\polyglossia@langsetup}{#2/direction}}
+ {\setnonlatin}% LTR -> RTL
+ }%
+ {%
+ \__xpg_if_LR_str:eT{\prop_item:Nn{\polyglossia@langsetup}{#2/direction}}
+ {\setlatin}% RTL -> LTR
+ }
+ }
}%
\polyglossia@set@language@name[#1]{#2}%
% Set the language's/script's font families
- \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#2/lcscript}}{latin}{\resetfontlatin}{\xpg@set@normalfont{#2}}%
+ \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#2/lcscript}} {latin}
+ {
+ \resetfontlatin
+ }
+ {
+ \xpg@set@normalfont{#2}
+ }%
\xpg@select@fontfamily{#2}%
- \csuse@warn{#2@language}%
- \csuse{#2@numbers}%
+ \__xpg_use_or_warn:c{#2@language}%
+ \cs_if_exist_use:c{#2@numbers}%
\use@localhyphenmins[#1]{#2}%
\polyglossia@lang@frenchspacing:n{#2}
}
@@ -5656,24 +5996,48 @@ to track the issues and follow progress.
\provideenvironment{otherlanguage}{}{}
-\newbool{xpg@noset@groups}
+%
+% Keep track of the active (nested) languages and options
+%
+\clist_new:N \l_xpg_lang_stack
+
+\cs_new:Nn \polyglossia@stack@language:nn
+{
+ \clist_push:Nn \l_xpg_lang_stack {#1:#2}
+}
+
+\cs_generate_variant:Nn \seq_set_split:Nnn {Nnx}
+
+\cs_new:Nn \polyglossia@unstack@language:n
+{
+ \clist_gpop:NNTF \l_xpg_lang_stack \l_tmpa_tl {
+ % Stored format = options:language => split:
+ \seq_set_split:Nnx \l_tmpa_seq {:} \l_tmpa_tl
+ \seq_get_left:NN \l_tmpa_seq \l_tmpb_tl
+ \seq_get_right:NN \l_tmpa_seq \l_tmpc_tl
+ % Execute passed command with language and maybe options
+ \tl_if_empty:NTF \l_tmpb_tl {\cs_if_exist_use:c{#1}{\l_tmpc_tl}}
+ {\cs_if_exist_use:c{#1}[\l_tmpb_tl]{\l_tmpc_tl}}
+ }
+ {}
+}
+
\renewenvironment{otherlanguage}[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}%
+ % Get real current options (incl. defaults)
+ \clist_clear_new:N \l_xpg_current_options
+ \prop_map_inline:cn {xpg@current@options@#2}
+ {
+ \clist_put_right:Nn \l_xpg_current_options {##1=##2}
+ }
+ % Store current options and language on stack
+ \polyglossia@stack@language:nn{\clist_use:Nn \l_xpg_current_options {,}}{#2}%
\selectlanguage[#1]{#2}%
}
-{\ifbool{xpg@noset@groups}{}{\xpg@unset@group@aux}}
+{%
+ % restore previous language in aux file and remove closed one from stack
+ \polyglossia@unstack@language:n{xpg@set@language@only@aux}%
+}
\newcommand{\setlocalhyphenmins}[3]{%
\xpg@ifdefined{#1}{%
@@ -5690,26 +6054,20 @@ to track the issues and follow progress.
% \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}%
- }{}%
- }{}%
+ \edef\xpg@tmp@opts{\xpg_alias_add_to_option_i:nn{#2}{#1}}
+ \edef\xpg@tmp@lang{\xpg_alias_base_lang:n{#2}}
\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}{\prop_item:Ne{\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}}%
+ \csedef{tmp@bcp47id}{\prop_item:Ne{\polyglossia@langsetup}{\xpg@tmp@lang /bcp47}}%
}%
\xpg@warning{id: \csuse{tmp@bcp47id}}%
\csgdef{\csname tmp@bcp47id\endcsname @hyphenmins}{{#3}{#4}}%
@@ -5741,15 +6099,15 @@ to track the issues and follow progress.
\edef\tmpa{\csuse{\csname tmp@bcp47id\endcsname @hyphenmins}}%
\expandafter\expandafter\expandafter\set@hyphenmins\tmpa\relax%
}
- \ifluatex
+ \sys_if_engine_luatex:T{
% Set \totalhyphenmin if specified
\prop_get:NxNTF \polyglossia@langsetup {#2/totalhyphenmin} \l_tmpa_tl
{
- \xpg@warning{totalhyphenmin: '\l_tmpa_tl'}
+ \xpg@info{totalhyphenmin: '\l_tmpa_tl'}
\expandafter\hyphenationmin \l_tmpa_tl%
}%
{}%
- \fi
+ }
}
% Babel previously compiled in hyphenrules into the kernel (via hyphen.cfg)
@@ -5761,37 +6119,17 @@ to track the issues and follow progress.
% 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}%
- }%
+ \edef\xpg@tmp@opts{\xpg_alias_add_to_option_i:nn{#2}{#1}}
+ \edef\xpg@tmp@lang{\xpg_alias_base_lang:n{#2}}
+ % Register the language options
+ \polyglossia@set@lang@options:nnn {\xpg@tmp@lang} {\xpg@tmp@opts} {@xpg@set@langvariant}%
% Now switch patterns
- \csuse@warn{\csuse{xpg@tmp@lang}@language}%
+ \__xpg_use_or_warn:c{\use:c{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}{%
@@ -5846,15 +6184,15 @@ to track the issues and follow progress.
% 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
+\sys_if_engine_luatex:T{
+ \str_if_eq:eeF{\l_polyglossia_luatex_renderer}{none}
+ {
+ \xpg@info{Setting~ LuaTeX~ font~ renderer~ to~ \l_polyglossia_luatex_renderer}
+ \exp_args:Ne \defaultfontfeatures{Renderer=\l_polyglossia_luatex_renderer}
+ }
+}
-\bool_if:nTF \l_polyglossia_verbose_bool {} {
+\bool_if:nF \l_polyglossia_verbose_bool {
\gdef\@latex@info#1{\relax}% no latex info
\gdef\@font@info#1{\relax}% no latex font info
\gdef\@font@warning#1{\relax}% no latex font warnings
@@ -5862,9 +6200,9 @@ to track the issues and follow progress.
\gdef\xpg@info#1{\relax}% no polyglossia info
}
-\bool_if:nTF \l_polyglossia_localmarks_bool {
+\bool_if:nT \l_polyglossia_localmarks_bool {
\polyglossia@enable@local@marks:
-}{}
+}
% compatibility
\newif\ifsystem@babelshorthands
@@ -9247,11 +9585,11 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\blockextras@afrikaans{%
- \ifafrikaans@babelshorthands\afrikaans@shorthands\fi%
+ \ifafrikaans@babelshorthands\afrikaans@shorthands\else\noafrikaans@shorthands\fi%
}
\def\inlineextras@afrikaans{%
- \ifafrikaans@babelshorthands\afrikaans@shorthands\fi%
+ \ifafrikaans@babelshorthands\afrikaans@shorthands\else\noafrikaans@shorthands\fi%
}
% \end{macrocode}
@@ -9855,8 +10193,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi%
\fi}}
-
-\newcommand{\arabicnumerals}[2]{\arabicnumber{#2}}
+% Use \providecommand here as the ldf file might
+% be reloaded via aeb (BCP).
+\providecommand{\arabicnumerals}[2]{\arabicnumber{#2}}
\def\arabicnumber#1{%
\ifeastern@numerals
@@ -10666,8 +11005,10 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\csuse{datebelarusian@\belarusian@spelling}%
}
-\newcommand{\belarusiannumerals}[2]{\belarusiannumber{#2}}
-\newcommand{\Belarusiannumerals}[2]{\Belarusiannumber{#2}}
+% Use \providecommand here as the ldf file might
+% be reloaded via be-tarask (BCP).
+\providecommand{\belarusiannumerals}[2]{\belarusiannumber{#2}}
+\providecommand{\Belarusiannumerals}[2]{\Belarusiannumber{#2}}
\def\belarusiannumber#1{%
\ifcyrillic@numerals
@@ -10743,12 +11084,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\blockextras@belarusian{%
- \ifcyrillic@numerals\belarusian@numbers\fi%
- \ifbelarusian@babelshorthands\belarusian@shorthands\fi%
+ \ifcyrillic@numerals\belarusian@numbers\else\nobelarusian@numbers\fi%
+ \ifbelarusian@babelshorthands\belarusian@shorthands\else\nobelarusian@shorthands\fi%
}
\def\inlineextras@belarusian{%
- \ifbelarusian@babelshorthands\belarusian@shorthands\fi%
+ \ifbelarusian@babelshorthands\belarusian@shorthands\else\nobelarusian@shorthands\fi%
}
% \end{macrocode}
@@ -10988,7 +11329,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\today{\number\day.~\ifcase\month\or
januar\or februar\or mart\or april\or maj\or
juni\or juli\or august\or septembar\or oktobar\or novembar\or
- decembar\fi \space \number\year.~}%
+ decembar\fi \space \number\year.}%
}
% \end{macrocode}
@@ -11457,11 +11798,11 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\blockextras@catalan{%
- \ifcatalan@babelshorthands\catalan@shorthands\fi%
+ \ifcatalan@babelshorthands\catalan@shorthands\else\nocatalan@shorthands\fi%
}
\def\inlineextras@catalan{%
- \ifcatalan@babelshorthands\catalan@shorthands\fi%
+ \ifcatalan@babelshorthands\catalan@shorthands\else\nocatalan@shorthands\fi%
}
% \end{macrocode}
% \iffalse
@@ -11603,14 +11944,25 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\define@boolkey{croatian}[croatian@]{babelshorthands}[true]{}
-\define@boolkey{croatian}[croatian@]{disableligatures}[true]{}
+\define@boolkey{croatian}[croatian@]{disabledigraphs}[true]{}
+
+% Alias kept for backwards compatibility. Please do not remove
+\define@boolkey{croatian}[croatian@]{disableligatures}[true]{%
+ \xpg@warning{The option disableligatures is deprected.\MessageBreak
+ Please use disabledigraphs instead}%
+ \ifcroatian@disableligatures
+ \croatian@disabledigraphstrue
+ \else
+ \croatian@disabledigraphsfalse
+ \fi
+}
\define@boolkey{croatian}[croatian@]{splithyphens}[true]{}
\define@boolkey{croatian}[croatian@]{localalph}[true]{}
% Register default options
-\xpg@initialize@gloss@options{croatian}{babelshorthands=false,disableligatures=false,
+\xpg@initialize@gloss@options{croatian}{babelshorthands=false,disabledigraphs=false,
splithyphens=true,localalph=true}
\ifsystem@babelshorthands
@@ -11626,6 +11978,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}{}
\def\croatian@@splhyphen#1{%
+ \def\croatian@sh@tmp{%
+ \if\croatian@sh@next-#1%
+ \else\expandafter\croatian@@@splhyphen{#1}\fi%
+ }%
+ \futurelet\croatian@sh@next\croatian@sh@tmp%
+}
+
+\def\croatian@@@splhyphen#1{%
\ifnum\hyphenchar \font>0%
\kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
\nobreak\hskip\z@%
@@ -11655,12 +12015,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\declare@shorthand{croatian}{"'}{”}%
\declare@shorthand{croatian}{"<}{«}%
\declare@shorthand{croatian}{">}{»}%
- \declare@shorthand{croatian}{"D}{\xpg@hr@lig{D}}%
- \declare@shorthand{croatian}{"d}{\xpg@hr@lig{d}}%
- \declare@shorthand{croatian}{"L}{\xpg@hr@lig{L}}%
- \declare@shorthand{croatian}{"l}{\xpg@hr@lig{l}}%
- \declare@shorthand{croatian}{"N}{\xpg@hr@lig{N}}%
- \declare@shorthand{croatian}{"n}{\xpg@hr@lig{n}}%
+ \declare@shorthand{croatian}{"D}{\xpg@hr@digraph{D}}%
+ \declare@shorthand{croatian}{"d}{\xpg@hr@digraph{d}}%
+ \declare@shorthand{croatian}{"L}{\xpg@hr@digraph{L}}%
+ \declare@shorthand{croatian}{"l}{\xpg@hr@digraph{l}}%
+ \declare@shorthand{croatian}{"N}{\xpg@hr@digraph{N}}%
+ \declare@shorthand{croatian}{"n}{\xpg@hr@digraph{n}}%
}
\def\nocroatian@shorthands{%
@@ -11693,24 +12053,24 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi%
}
-\newcommand*\hr@charifavailable[2]{%
- \ifcroatian@disableligatures
- \bgroup#2\egroup%
- \else
- \charifavailable{#1}{#2}%
+\newcommand*\hr@charifavailable[3]{%
+ \ifcroatian@disabledigraphs% no notion of digraphs at all
+ \bgroup#3\egroup%
+ \else% digraph...
+ \charifavailable{#1}{#2}% ... either a Unicode original or a mimic of one
\fi%
}
-% Provide croatian ligatures if available in current font
-\def\xpg@hr@lig#1#2{%
+% Provide croatian digraphs if available in current font
+\def\xpg@hr@digraph#1#2{%
\bgroup%
% 1. DŽ, Dž and dž
\ifx#1D%
\ifx#2Z\relax%
- \hr@charifavailable{01C4}{DŽ}%
+ \hr@charifavailable{01C4}{D\nobreak Ž}{DŽ}%
\else%
\ifx#2z\relax
- \hr@charifavailable{01C5}{Dž}%
+ \hr@charifavailable{01C5}{D\nobreak ž}{Dž}%
\else
D#2%
\fi%
@@ -11718,7 +12078,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi%
\ifx#1d%
\ifx#2z\relax
- \hr@charifavailable{01C6}{dž}%
+ \hr@charifavailable{01C6}{d\nobreak ž}{dž}%
\else
d#2%
\fi%
@@ -11726,10 +12086,10 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% 2. LJ, Lj and lj
\ifx#1L%
\ifx#2J\relax%
- \hr@charifavailable{01C7}{LJ}%
+ \hr@charifavailable{01C7}{L\nobreak J}{LJ}%
\else%
\ifx#2j\relax
- \hr@charifavailable{01C8}{Lj}%
+ \hr@charifavailable{01C8}{L\nobreak j}{Lj}%
\else
L#2%
\fi%
@@ -11737,7 +12097,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi%
\ifx#1l%
\ifx#2j\relax
- \hr@charifavailable{01C9}{lj}%
+ \hr@charifavailable{01C9}{l\nobreak j}{lj}%
\else
l#2%
\fi%
@@ -11745,10 +12105,10 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% 2. NJ, Nj and nj
\ifx#1N%
\ifx#2J\relax%
- \hr@charifavailable{01CA}{NJ}%
+ \hr@charifavailable{01CA}{N\nobreak J}{NJ}%
\else%
\ifx#2j\relax
- \hr@charifavailable{01CB}{Nj}%
+ \hr@charifavailable{01CB}{N\nobreak j}{Nj}%
\else
N#2%
\fi%
@@ -11756,7 +12116,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi%
\ifx#1n%
\ifx#2j\relax
- \hr@charifavailable{01CC}{nj}%
+ \hr@charifavailable{01CC}{n\nobreak j}{nj}%
\else
n#2%
\fi%
@@ -11769,7 +12129,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\refname{Literatura}%
\def\abstractname{Sažetak}%
\def\bibname{Bibliografija}%
- \def\chaptername{Poglav\hr@charifavailable{01C9}{lj}e}%
+ \def\chaptername{Poglav\xpg@hr@digraph{l}{j}e}%
\def\appendixname{Dodatak}%
\def\contentsname{Sadržaj}%
\def\listfigurename{Popis slika}%
@@ -11790,9 +12150,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\datecroatian{%
\def\today{\number\day.~\ifcase\month\or
- siječ\hr@charifavailable{01CC}{nj}a\or ve\hr@charifavailable{01C9}{lj}ače\or
- ožujka\or trav\hr@charifavailable{01CC}{nj}a\or svib\hr@charifavailable{01CC}{nj}a\or
- lip\hr@charifavailable{01CC}{nj}a\or srp\hr@charifavailable{01CC}{nj}a\or
+ siječ\xpg@hr@digraph{n}{j}a\or ve\xpg@hr@digraph{l}{j}ače\or
+ ožujka\or trav\xpg@hr@digraph{n}{j}a\or svib\xpg@hr@digraph{n}{j}a\or
+ lip\xpg@hr@digraph{n}{j}a\or srp\xpg@hr@digraph{n}{j}a\or
kolovoza\or rujna\or listopada\or studenoga\or prosinca\fi \space \number\year.}%
}
@@ -11815,13 +12175,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\blockextras@croatian{%
- \ifcroatian@babelshorthands\croatian@shorthands\fi%
+ \ifcroatian@babelshorthands\croatian@shorthands\else\nocroatian@shorthands\fi%
\ifcroatian@splithyphens\croatian@hyphens\else\nocroatian@hyphens\fi%
\ifcroatian@localalph\let\alph\croatian@alph\let\Alph\croatian@Alph\fi%
}
\def\inlineextras@croatian{%
- \ifcroatian@babelshorthands\croatian@shorthands\fi%
+ \ifcroatian@babelshorthands\croatian@shorthands\else\nocroatian@shorthands\fi%
\ifcroatian@splithyphens\croatian@hyphens\else\nocroatian@hyphens\fi%
\ifcroatian@localalph\let\alph\croatian@alph\let\Alph\croatian@Alph\fi%
}
@@ -11904,7 +12264,15 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\shorthandoff{"}%
}{}
-\def\cs@@splithyphen#1{%
+\def\czech@@splithyphen#1{%
+ \def\czech@sh@tmp{%
+ \if\czech@sh@next-#1%
+ \else\expandafter\czech@@@splithyphen{#1}\fi%
+ }%
+ \futurelet\czech@sh@next\czech@sh@tmp%
+}
+
+\def\czech@@@splithyphen#1{%
\ifnum\hyphenchar \font>0%
\kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
\nobreak\hskip\z@%
@@ -11913,14 +12281,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi%
}
-\def\cs@splithyphen{%
- \cs@@splithyphen{-}%
+\def\czech@splithyphen{%
+ \czech@@splithyphen{-}%
}
\def\czech@shorthands{%
\bbl@activate{"}%
\def\language@group{czech}%
- \declare@shorthand{czech}{"=}{\cs@splithyphen}%
+ \declare@shorthand{czech}{"=}{\czech@splithyphen}%
\declare@shorthand{czech}{"`}{„}%
\declare@shorthand{czech}{"'}{“}%
\declare@shorthand{czech}{"<}{«}%
@@ -11957,9 +12325,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\else
\XeTeXinterchartokenstate=1
\XeTeXcharclass `\- \czech@hyphen
- \XeTeXinterchartoks \z@ \czech@hyphen = {\cs@@splithyphen}% "-" -> "\cs@@splithyphen-"
+ \XeTeXinterchartoks \z@ \czech@hyphen = {\czech@@splithyphen}% "-" -> "\czech@@splithyphen-"
% necessary if used together with vlna:
- \XeTeXinterchartoks \czech@nonsyllabicpreposition \czech@hyphen = {\cs@@splithyphen}% "-" -> "\cs@@splithyphen-"
+ \XeTeXinterchartoks \czech@nonsyllabicpreposition \czech@hyphen = {\czech@@splithyphen}% "-" -> "\czech@@splithyphen-"
\fi%
}
@@ -12091,13 +12459,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\blockextras@czech{%
- \ifczech@babelshorthands\czech@shorthands\fi%
+ \ifczech@babelshorthands\czech@shorthands\else\noczech@shorthands\fi%
\ifczech@vlna\czech@vlna\else\noczech@vlna\fi%
\ifczech@splithyphens\czech@hyphens\else\noczech@hyphens\fi%
}
\def\inlineextras@czech{%
- \ifczech@babelshorthands\czech@shorthands\fi%
+ \ifczech@babelshorthands\czech@shorthands\else\noczech@shorthands\fi%
\ifczech@vlna\czech@vlna\else\noczech@vlna\fi%
\ifczech@splithyphens\czech@hyphens\else\noczech@hyphens\fi%
}
@@ -12642,11 +13010,11 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\blockextras@dutch{%
- \ifdutch@babelshorthands\dutch@shorthands\fi%
+ \ifdutch@babelshorthands\dutch@shorthands\else\nodutch@shorthands\fi%
}
\def\inlineextras@dutch{%
- \ifdutch@babelshorthands\dutch@shorthands\fi%
+ \ifdutch@babelshorthands\dutch@shorthands\else\nodutch@shorthands\fi%
}
% \end{macrocode}
@@ -12819,19 +13187,20 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
% BCP-47 compliant aliases
-\setlanguagealias*{english}{en}
-\setlanguagealias*[variant=australian]{english}{en-AU}
-\setlanguagealias*[variant=newzealand]{english}{en-NZ}
-\setlanguagealias*[variant=us]{english}{en-US}
-\setlanguagealias*[variant=british]{english}{en-GB}
-\setlanguagealias*[variant=canadian]{english}{en-CA}
+\setlanguagealias*[bcp47=en]{english}{en}
+\setlanguagealias*[variant=australian,babelname=autralian,bcp47=en-AU]{en}{en-AU}
+\setlanguagealias*[variant=canadian,babelname=canadian,bcp47=en-CA]{en}{en-CA}
+\setlanguagealias*[variant=british,babelname=british,bcp47=en-NZ]{en}{en-GB}
+\setlanguagealias*[variant=newzealand,babelname=newzealand,bcp47=en-NZ]{en}{en-NZ}
+\setlanguagealias*[variant=us,babelname=american,bcp47=en-US]{en}{en-US}
+
% Babel aliases
-\setlanguagealias[variant=us]{english}{american}
-\setlanguagealias[variant=australian]{english}{australian}
-\setlanguagealias[variant=british]{english}{british}
-\setlanguagealias[variant=canadian]{english}{canadian}
-\setlanguagealias[variant=newzealand]{english}{newzealand}
+\setlanguagealias[variant=us]{en-US}{american}
+\setlanguagealias[variant=australian]{en-AU}{australian}
+\setlanguagealias[variant=british]{en-GB}{british}
+\setlanguagealias[variant=canadian]{en-CA}{canadian}
+\setlanguagealias[variant=newzealand]{en-NZ}{newzealand}
\providebool{british@hyphen}
\providebool{english@ordinalmonthday}
@@ -12979,6 +13348,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\alsoname{see also}%
\def\proofname{Proof}%
}
+
\def\dateenglish{%
\def\english@day{%
\ifenglish@ordinalmonthday
@@ -13290,8 +13660,10 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\define@boolkey{finnish}[finnish@]{babelshorthands}[true]{}
+\define@boolkey{finnish}[finnish@]{schoolhyphens}[true]{}
+
% Register default options
-\xpg@initialize@gloss@options{finnish}{babelshorthands=false}
+\xpg@initialize@gloss@options{finnish}{babelshorthands=false,schoolhyphens=false}
\ifsystem@babelshorthands
\setkeys{finnish}{babelshorthands=true}
@@ -13345,6 +13717,21 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\proofname{Todistus}%
\def\glossaryname{Sanasto}%
}
+
+\def\finnish@language{%
+ \iffinnish@schoolhyphens
+ \xpg@ifdefined{schoolfinnish}{%
+ \polyglossia@setup@language@patterns{schoolfinnish}%
+ }{%
+ \xpg@warning{Finnish 'School' hyphenation patterns (schoolfinnish) not available.\MessageBreak
+ I will use the standard patterns for Finnish instead}%
+ \polyglossia@setup@language@patterns{finnish}%
+ }%
+ \else
+ \polyglossia@setup@language@patterns{finnish}%
+ \fi
+}
+
\def\datefinnish{%
\def\today{\number\day.~\ifcase\month\or
tammikuuta\or helmikuuta\or maaliskuuta\or huhtikuuta\or
@@ -13357,11 +13744,11 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\blockextras@finnish{%
- \iffinnish@babelshorthands\finnish@shorthands\fi%
+ \iffinnish@babelshorthands\finnish@shorthands\else\nofinnish@shorthands\fi%
}
\def\inlineextras@finnish{%
- \iffinnish@babelshorthands\finnish@shorthands\fi%
+ \iffinnish@babelshorthands\finnish@shorthands\else\nofinnish@shorthands\fi%
}
% \end{macrocode}
@@ -14496,12 +14883,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\blockextras@georgian{%
- \ifgeorgian@numerals\georgian@numbers\fi%
- \ifgeorgian@babelshorthands\georgian@shorthands\fi%
+ \ifgeorgian@numerals\georgian@numbers\else\nogeorgian@numbers\fi%
+ \ifgeorgian@babelshorthands\georgian@shorthands\else\nogeorgian@shorthands\fi%
}
\def\inlineextras@georgian{%
- \ifgeorgian@babelshorthands\georgian@shorthands\fi%
+ \ifgeorgian@babelshorthands\georgian@shorthands\else\nogeorgian@shorthands\fi%
}
% \end{macrocode}
@@ -14664,7 +15051,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\xpg@info{Option: German, script=\xpg@val}%
}{\xpg@warning{Unknown German script `#1'}}
-% Option defunc'ed, as bot XeTeX and LuaTeX meanwhile
+% Option defunc'ed, as both XeTeX and LuaTeX meanwhile
% use the experimental German hyphenation patterns by default.
\define@boolkey{german}[german@]{latesthyphen}[true]{}
@@ -14673,7 +15060,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setkeys{german}{spelling,script,variant}
% Register default options
-\xpg@initialize@gloss@options{german}{variant=german,spelling=new,script=latin,latesthyphen=false,babelshorthands=false}
+\xpg@initialize@gloss@options{german}{variant=german,spelling=new,script=latin,babelshorthands=false}
% Register alias options
\xpg@set@alias@values{german}{spelling}{new}{1996}
\xpg@set@alias@values{german}{spelling}{old}{1901}
@@ -14829,11 +15216,11 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\blockextras@german{%
- \ifgerman@babelshorthands\german@shorthands\fi%
+ \ifgerman@babelshorthands\german@shorthands\else\nogerman@shorthands\fi%
}
\def\inlineextras@german{%
- \ifgerman@babelshorthands\german@shorthands\fi%
+ \ifgerman@babelshorthands\german@shorthands\else\nogerman@shorthands\fi%
}
% \end{macrocode}
@@ -15144,8 +15531,10 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\renewrobustcmd\anw@print{ʹ}}
\anw@true
-\newcommand{\greeknumerals}[2]{\greeknumber{#2}}
-\newcommand{\Greeknumerals}[2]{\Greeknumber{#2}}
+% Use \providecommand here as the ldf file might
+% be reloaded via politunikogreek.
+\providecommand{\greeknumerals}[2]{\greeknumber{#2}}
+\providecommand{\Greeknumerals}[2]{\Greeknumber{#2}}
\protected\def\greeknumber#1{\expandafter\@greeknumber\expandafter{\number#1}}
\def\@greeknumber#1{%
@@ -16353,12 +16742,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\lccode\string"2019=\string"2019%
\clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000%
\finalhyphendemerits=50000000%
- \ifitalian@babelshorthands\italian@shorthands\fi%
+ \ifitalian@babelshorthands\italian@shorthands\else\noitalian@shorthands\fi%
}
\def\inlineextras@italian{%
\lccode\string"2019=\string"2019%
- \ifitalian@babelshorthands\italian@shorthands\fi%
+ \ifitalian@babelshorthands\italian@shorthands\else\noitalian@shorthands\fi%
}
%%% CHANGES END %%%
% \end{macrocode}
@@ -17120,16 +17509,25 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% change chapter and part headings
\if@korean@swapheadings
% With titlesec
- \ifdefined\titleformat
- \ifdefined\@part
- \let\xpg@save@part@format\@part
- \patchcmd{\@part}%
+ \ifcsdef{titleformat}{%
+ \ifcsdef{H@old@part}{% Hyperref
+ \let\xpg@save@part@format\H@old@part
+ \patchcmd{\H@old@part}%
{\partname\nobreakspace\thepart}%
{\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
{}%
{\xpg@warning{Failed to patch part for Korean}}%
- \fi
- \ifdefined\chapter
+ }{% not hyperref
+ \ifcsdef{@part}{%
+ \let\xpg@save@part@format\@part
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Korean}}%
+ }{}%
+ }
+ \ifcsdef{chapter}{%
\titleformat\chapter[display]%
{\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}%
{%
@@ -17139,15 +17537,15 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\koreanTHEname\space \thechapter\space \@chapapp
\fi
}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}%
- \fi
- \else % (not \ifdefined\titleformat)
+ }{}%
+ }{% (not \ifdefined\titleformat)
% With KOMA
- \ifdefined\sectionformat
- \ifdefined\partformat
+ \ifcsdef{sectionformat}{%
+ \ifcsdef{partformat}{%
\let\xpg@save@part@format\partformat
\renewcommand*{\partformat}{\koreanTHEname~\thepart~\partname}%
- \fi
- \ifdefined\chapterformat
+ }{}%
+ \ifcsdef{chapterformat}{%
\let\xpg@save@chap@format\chapterformat
\renewcommand*{\chapterformat}{\mbox{%
\IfChapterUsesPrefixLine
@@ -17160,11 +17558,11 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}%
{\thechapter\autodot\enskip}%
}}%
- \fi
- \else % (not \ifdefined\sectionformat)
+ }{}%
+ }{% (not \ifdefined\sectionformat)
% With memoir
- \ifdefined\@memptsize
- \ifdefined\@makechapterhead
+ \ifcsdef{@memptsize}{%
+ \ifcsdef{@makechapterhead}{%
\let\xpg@save@chap@format\@makechapterhead
\patchcmd{\@makechapterhead}%
{\printchaptername \chapternamenum \printchapternum}%
@@ -17182,10 +17580,10 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\ifpatchable\printchaptername\@chapapp
{\chapnamefont\koreanTHEname\chapternamenum}{}}%
\fi
- \fi
- \ifdefined\@part
- \let\xpg@save@part@format\@part
- \patchcmd{\@part}%
+ }{}%
+ \ifcsdef{H@old@part}{% Hyperref
+ \let\xpg@save@part@format\H@old@part
+ \patchcmd{\H@old@part}%
{\printpartname \partnamenum \printpartnum}%
{\printkoreanpartthe \printpartnum\partnamenum \printpartname}%
{}%
@@ -17193,10 +17591,22 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\ifdefined\printkoreanpartthe\else
\def\printkoreanpartthe{\partnamefont\koreanTHEname\partnamenum}%
\fi
- \fi
- \else % (not \ifdefined\@memptsize)
+ }{% not hyperref
+ \ifcsdef{@part}{%
+ \let\xpg@save@part@format\@part
+ \patchcmd{\@part}%
+ {\printpartname \partnamenum \printpartnum}%
+ {\printkoreanpartthe \printpartnum\partnamenum \printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Korean}}%
+ \ifdefined\printkoreanpartthe\else
+ \def\printkoreanpartthe{\partnamefont\koreanTHEname\partnamenum}%
+ \fi
+ }{}%
+ }%
+ }{% (not \ifdefined\@memptsize)
% With standard classes
- \ifdefined\@makechapterhead
+ \ifcsdef{@makechapterhead}{%
\let\xpg@save@chap@format\@makechapterhead
\patchcmd{\@makechapterhead}%
{\@chapapp\space \thechapter}%
@@ -17209,23 +17619,35 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}%
{}%
{\xpg@warning{Failed to patch chapter for Korean}}%
- \fi
- \ifdefined\@part
- \let\xpg@save@part@format\@part
- \patchcmd{\@part}%
+ }{}%
+ \ifcsdef{H@old@part}{% Hyperref
+ \let\xpg@save@part@format\H@old@part
+ \patchcmd{\H@old@part}%
{\partname\nobreakspace\thepart}%
{\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
{}%
{\xpg@warning{Failed to patch part for Korean}}%
- \fi % (end \ifdefined\@part)
- \fi % (end \ifdefined\@memptsize)
- \fi % (end \ifdefined\sectionformat)
- \fi % (end \ifdefined\titleformat)
+ }{% not hyperref
+ \ifcsdef{@part}{%
+ \ifpatchable{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\let\xpg@save@part@format\@part
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
+ {}%
+ {\ifcsdef{part}{\xpg@warning{Failed to patch part for Korean}}{}}}%
+ {}%
+ }{}% (end \ifdefined\@part)
+ }% (end not hyperref)
+ }% (end \ifdefined\@memptsize)
+ }% (end \ifdefined\sectionformat)
+ }% (end \ifdefined\titleformat)
\fi % (end \if@korean@swapheadings)
%
% Change running headers
\if@korean@swapheaders
- \ifdefined\chapterformat
+ \ifcsdef{chapterformat}{%
% With KOMA
\let\xpg@save@chaptermark@format\chaptermarkformat
\renewcommand*\chaptermarkformat{%
@@ -17240,8 +17662,8 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{\thechapter\autodot}%
\enskip
}%
- \else % (not \ifdefined\chapterformat)
- \ifdefined\@memptsize
+ }{% (not \ifdefined\chapterformat)
+ \ifcsdef{@memptsize}{%
% With memoir
\let\xpg@save@chaptermark@format\chaptermark
\patchcmd{\chaptermark}%
@@ -17254,74 +17676,85 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi
}%
{}%
- {}%
- \else % (not \ifdefined\@memptsize)
+ {\xpg@warning{Failed to patch chaptermark for Korean}}%
+ }{% (not \ifdefined\@memptsize)
% With standard classes
- \ifdefined\chaptermark
- \let\xpg@save@chaptermark@format\chaptermark
- \patchcmd{\chaptermark}%
- {\@chapapp\ \thechapter}%
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \appendixname\ \thechapter
- \else
- \koreanTHEname\ \thechapter\ \@chapapp
- \fi
- }%
- {}%
- {}%
- \fi % (end \ifdefined\chaptermark)
- \fi % (end \ifdefined\@memptsize)
- \fi % (end \ifdefined\chapterformat)
+ \ifcsdef{chaptermark}{%
+ \ifpatchable{\chaptermark}%
+ {\@chapapp\ \thechapter}%
+ {\let\xpg@save@chaptermark@format\chaptermark
+ \patchcmd{\chaptermark}%
+ {\@chapapp\ \thechapter}%
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \appendixname\ \thechapter
+ \else
+ \koreanTHEname\ \thechapter\ \@chapapp
+ \fi
+ }%
+ {}%
+ {\xpg@warning{Failed to patch chaptermark for Korean}}}%
+ {}%
+ }{}% (end \ifdefined\chaptermark)
+ }% (end \ifdefined\@memptsize)
+ }% (end \ifdefined\chapterformat)
\fi % (end \if@korean@swapheaders)
}
\def\nokorean@headingsformat{%
% Reset chapter and part heading
- \ifdefined\titleformat
+ \ifcsdef{titleformat}{%
% With titlesec
- \ifdefined\xpg@save@part@format
- \let\@part\xpg@save@part@format
- \fi
- \ifdefined\chapter
+ \ifcsdef{xpg@save@part@format}{%
+ \ifcsdef{H@old@part}{%
+ \let\H@old@part\xpg@save@part@format
+ }{%
+ \let\@part\xpg@save@part@format
+ }%
+ }{}%
+ \ifcsdef{chapter}{%
\titleformat\chapter[display]%
{\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}%
{\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}%
- \fi
- \else % (not \ifdefined\titleformat)
- \ifdefined\sectionformat
+ }{}%
+ }{% (not \ifdefined\titleformat)
+ \ifcsdef{sectionformat}{%
% With KOMA
- \ifdefined\xpg@save@part@format
+ \ifcsdef{xpg@save@part@format}{%
\let\partformat\xpg@save@part@format
- \fi
- \ifdefined\xpg@save@chap@format
+ }{}%
+ \ifcsdef{xpg@save@chap@format}{%
\let\chapterformat\xpg@save@chap@format
- \fi
- \else
+ }{}%
+ }{%
% With memoir and standard classes
- \ifdefined\xpg@save@part@format
- \let\@part\xpg@save@part@format
- \fi
- \ifdefined\xpg@save@chap@format
+ \ifcsdef{xpg@save@part@format}{%
+ \ifcsdef{H@old@part}{%
+ \let\H@old@part\xpg@save@part@format
+ }{%
+ \let\@part\xpg@save@part@format
+ }%
+ }{}%
+ \ifcsdef{xpg@save@chap@format}{%
\let\@makechapterhead\xpg@save@chap@format
- \fi
- \fi % (end \ifdefined\sectionformat)
- \fi % (end \ifdefined\titleformat)
+ }{}%
+ }% (end \ifdefined\sectionformat)
+ }% (end \ifdefined\titleformat)
%
% Reset headers
- \ifdefined\chaptermarkformat
+ \ifcsdef{chaptermarkformat}{%
% With KOMA
- \ifdefined\xpg@save@chaptermark@format
+ \ifcsdef{xpg@save@chaptermark@format}{%
\let\chaptermarkformat\xpg@save@chaptermark@format
- \fi
- \else
- \ifdefined\chaptermark
+ }{}%
+ }{%
+ \ifcsdef{chaptermark}{%
% With memoir and standard classes
- \ifdefined\xpg@save@chaptermark@format
+ \ifcsdef{xpg@save@chaptermark@format}{%
\let\chaptermark\xpg@save@chaptermark@format
- \fi
- \fi % (end \ifdefined\chaptermark)
- \fi % (end \ifdefined\chapterformat)
+ }{}%
+ }{}% (end \ifdefined\chaptermark)
+ }% (end \ifdefined\chapterformat)
}
\def\datekorean{%
@@ -17824,7 +18257,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\csname datekurdish@\kurdish@variant @\kurdish@script\endcsname%
}
-\newcommand{\kurdishnumerals}[2]{\kurdishnumber{#2}}
+% Use \providecommand here as the ldf file might
+% be reloaded via BCP.
+\providecommand{\kurdishnumerals}[2]{\kurdishnumber{#2}}
\def\kurdishnumber#1{%
\if@western@numerals
@@ -18064,54 +18499,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% \end{macrocode}
% \iffalse
%</gloss-lao.ldf>
-%<*gloss-latex.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-latex.ldf}
-% \begin{macrocode}
-\ProvidesFile{gloss-latex.ldf}[polyglossia: module for default language]
-
-\PolyglossiaSetup{latex}{
- hyphennames={english},
- hyphenmins={2,3},
- langtag=ENG,
- fontsetup=true,
-}
-
-\def\captionslatex{%
- \def\prefacename{Preface}%
- \def\refname{References}%
- \def\abstractname{Abstract}%
- \def\bibname{Bibliography}%
- \def\chaptername{Chapter}%
- \def\appendixname{Appendix}%
- \def\contentsname{Contents}%
- \def\listfigurename{List of Figures}%
- \def\listtablename{List of Tables}%
- \def\indexname{Index}%
- \def\figurename{Figure}%
- \def\tablename{Table}%
- \def\partname{Part}%
- \def\enclname{encl}%
- \def\ccname{cc}%
- \def\headtoname{To}%
- \def\pagename{Page}%
- \def\seename{see}%
- \def\alsoname{see also}%
- \def\proofname{Proof}%
-}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-latex.ldf>
%<*gloss-latin.ldf>
% \fi
% \clearpage
%
% \subsection{gloss-latin.ldf}
% \begin{macrocode}
-\ProvidesFile{gloss-latin.ldf}[polyglossia: module for Latin v.2.3 2020-03-08]
+\ProvidesFile{gloss-latin.ldf}[polyglossia: module for Latin v.2.4 2021-10-25]
\ExplSyntaxOn
@@ -18140,7 +18534,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\bool_new:N \l_polyglossia_latin_use_j_bool
\bool_new:N \l_polyglossia_latin_use_v_bool
-\bool_new:N \l_polyglossia_latin_use_digraphs_bool
+\bool_new:N \l_polyglossia_latin_use_ligatures_bool
\bool_new:N \l_polyglossia_latin_capitalize_month_bool
\cs_new:Npn \polyglossia_latin_classical_character_codes:
@@ -18501,7 +18895,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{
\bool_set_false:N \l_polyglossia_latin_use_j_bool
\bool_set_false:N \l_polyglossia_latin_use_v_bool
- \bool_set_false:N \l_polyglossia_latin_use_digraphs_bool
+ \bool_set_false:N \l_polyglossia_latin_use_ligatures_bool
\bool_set_true:N \l_polyglossia_latin_capitalize_month_bool
\bool_set_false:N \l_polyglossia_latin_punctuation_spacing_bool
\str_set:Nn \l_polyglossia_latin_variant_str {classic}
@@ -18513,7 +18907,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{
\bool_set_false:N \l_polyglossia_latin_use_j_bool
\bool_set_false:N \l_polyglossia_latin_use_v_bool
- \bool_set_true:N \l_polyglossia_latin_use_digraphs_bool
+ \bool_set_true:N \l_polyglossia_latin_use_ligatures_bool
\bool_set_true:N \l_polyglossia_latin_capitalize_month_bool
\bool_set_false:N \l_polyglossia_latin_punctuation_spacing_bool
\str_set:Nn \l_polyglossia_latin_variant_str {medieval}
@@ -18525,7 +18919,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{
\bool_set_false:N \l_polyglossia_latin_use_j_bool
\bool_set_true:N \l_polyglossia_latin_use_v_bool
- \bool_set_false:N \l_polyglossia_latin_use_digraphs_bool
+ \bool_set_false:N \l_polyglossia_latin_use_ligatures_bool
\bool_set_true:N \l_polyglossia_latin_capitalize_month_bool
\bool_set_false:N \l_polyglossia_latin_punctuation_spacing_bool
\str_set:Nn \l_polyglossia_latin_variant_str {modern}
@@ -18537,7 +18931,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{
\bool_set_false:N \l_polyglossia_latin_use_j_bool
\bool_set_true:N \l_polyglossia_latin_use_v_bool
- \bool_set_true:N \l_polyglossia_latin_use_digraphs_bool
+ \bool_set_true:N \l_polyglossia_latin_use_ligatures_bool
\bool_set_false:N \l_polyglossia_latin_capitalize_month_bool
\bool_set_true:N \l_polyglossia_latin_punctuation_spacing_bool
\str_set:Nn \l_polyglossia_latin_variant_str {ecclesiastic}
@@ -18632,7 +19026,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{
\def \prefacename
{
- \bool_if:NTF \l_polyglossia_latin_use_digraphs_bool {Præfatio} {Praefatio}
+ \bool_if:NTF \l_polyglossia_latin_use_ligatures_bool {Præfatio} {Praefatio}
}
\def \refname {Conspectus~librorum}
\def \abstractname {Summarium}
@@ -18658,7 +19052,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\cs_new:Npn \polyglossia_latin_month_name:
{
- \str_set:Nx \l_tmpa_str
+ \tl_set:Nx \l_tmpa_tl
{
\int_case:nn { \month }
{
@@ -18678,10 +19072,10 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\bool_if:NTF \l_polyglossia_latin_capitalize_month_bool
{
- \tl_mixed_case:n { \l_tmpa_str }
+ \text_titlecase:n { \l_tmpa_tl }
}
{
- \str_use:N \l_tmpa_str
+ \l_tmpa_tl
}
}
@@ -18830,28 +19224,28 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{
\str_case:nnF {#1}
{
- {A} { \polyglossia_latin_digraph_shorthand:Nnn E { Æ }
+ {A} { \polyglossia_latin_ligature_shorthand:Nnn E { Æ }
{
- \polyglossia_latin_digraph_shorthand:Nnn e { Æ }
+ \polyglossia_latin_ligature_shorthand:Nnn e { Æ }
{
\polyglossia_latin_allow_hyphens: A
}
}
}
- {a} { \polyglossia_latin_digraph_shorthand:Nnn e { æ }
+ {a} { \polyglossia_latin_ligature_shorthand:Nnn e { æ }
{
\polyglossia_latin_allow_hyphens: a
}
}
- {O} { \polyglossia_latin_digraph_shorthand:Nnn E { Π}
+ {O} { \polyglossia_latin_ligature_shorthand:Nnn E { Π}
{
- \polyglossia_latin_digraph_shorthand:Nnn e { Π}
+ \polyglossia_latin_ligature_shorthand:Nnn e { Π}
{
\polyglossia_latin_allow_hyphens: O
}
}
}
- {o} { \polyglossia_latin_digraph_shorthand:Nnn e { œ }
+ {o} { \polyglossia_latin_ligature_shorthand:Nnn e { œ }
{
\polyglossia_latin_allow_hyphens: o
}
@@ -18861,23 +19255,20 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{>} { » }
}
{
- \token_if_letter:NTF #1 { \polyglossia_latin_allow_hyphens: #1 }
+ \tl_if_single_token:nTF {#1}
{
- \token_if_eq_meaning:NNTF #1 \AE { \polyglossia_latin_allow_hyphens: #1 }
+ \token_if_letter:NTF #1 { \polyglossia_latin_allow_hyphens: }
{
- \token_if_eq_meaning:NNTF #1 \ae { \polyglossia_latin_allow_hyphens: #1 }
+ \polyglossia_latin_if_ligature_command:NTF #1 { \polyglossia_latin_allow_hyphens: }
{
- \token_if_eq_meaning:NNTF #1 \OE { \polyglossia_latin_allow_hyphens: #1 }
- {
- \token_if_eq_meaning:NNTF #1 \oe { \polyglossia_latin_allow_hyphens: #1 }
- {
- \token_to_str:N "
- #1
- }
- }
+ \token_to_str:N "
}
}
}
+ {
+ \token_to_str:N "
+ }
+ #1
}
}
@@ -18885,22 +19276,22 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{
\str_case:nnF {#1}
{
- {A} { \polyglossia_latin_digraph_shorthand:Nnn E { Ǽ }
+ {A} { \polyglossia_latin_ligature_shorthand:Nnn E { Ǽ }
{
- \polyglossia_latin_digraph_shorthand:Nnn e { Ǽ } { Á }
+ \polyglossia_latin_ligature_shorthand:Nnn e { Ǽ } { Á }
}
}
- {a} { \polyglossia_latin_digraph_shorthand:Nnn e { ǽ } { á } }
+ {a} { \polyglossia_latin_ligature_shorthand:Nnn e { ǽ } { á } }
{E} { É }
{e} { é }
{I} { Í }
{i} { í }
- {O} { \polyglossia_latin_digraph_shorthand:Nnn E { \'Π}
+ {O} { \polyglossia_latin_ligature_shorthand:Nnn E { \'Π}
{
- \polyglossia_latin_digraph_shorthand:Nnn e { \'Œ } { Ó }
+ \polyglossia_latin_ligature_shorthand:Nnn e { \'Œ } { Ó }
}
}
- {o} { \polyglossia_latin_digraph_shorthand:Nnn e { \'œ } { ó } }
+ {o} { \polyglossia_latin_ligature_shorthand:Nnn e { \'œ } { ó } }
{U} { Ú }
{u} { ú }
{V} { \' V } % V may be a vowel, but lowercase v is never used as a vowel.
@@ -18912,20 +19303,17 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{œ} { \'œ }
}
{
- \token_if_eq_meaning:NNTF #1 \AE { Ǽ }
+ \tl_if_single_token:nTF {#1}
{
- \token_if_eq_meaning:NNTF #1 \ae { ǽ }
+ \polyglossia_latin_if_ligature_command:NTF #1 { \' }
{
- \token_if_eq_meaning:NNTF #1 \OE { \'Π}
- {
- \token_if_eq_meaning:NNTF #1 \oe { \'œ }
- {
- \token_to_str:N '
- #1
- }
- }
+ \token_to_str:N '
}
}
+ {
+ \token_to_str:N '
+ }
+ #1
}
}
@@ -18933,9 +19321,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{
\str_case:nnF {#1}
{
- {A} { \polyglossia_latin_diphthong_macron:NNn AE
+ {A} { \polyglossia_latin_ligature_macron:NNnn AE { Ǣ }
{
- \polyglossia_latin_diphthong_macron:NNn Ae
+ \polyglossia_latin_ligature_macron:NNnn Ae { Ǣ }
{
\polyglossia_latin_diphthong_macron:NNn AU
{
@@ -18944,7 +19332,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
}
}
- {a} { \polyglossia_latin_diphthong_macron:NNn ae
+ {a} { \polyglossia_latin_ligature_macron:NNnn ae { ǣ }
{
\polyglossia_latin_diphthong_macron:NNn au { ā }
}
@@ -18957,12 +19345,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{e} { \polyglossia_latin_diphthong_macron:NNn eu { ē } }
{I} { Ī }
{i} { ī }
- {O} { \polyglossia_latin_diphthong_macron:NNn OE
+ {O} { \polyglossia_latin_ligature_macron:NNnn OE { \=Π}
{
- \polyglossia_latin_diphthong_macron:NNn Oe { Ō }
+ \polyglossia_latin_ligature_macron:NNnn Oe { \=Œ } { Ō }
}
}
- {o} { \polyglossia_latin_diphthong_macron:NNn oe { ō } }
+ {o} { \polyglossia_latin_ligature_macron:NNnn oe { \=œ } { ō } }
{U} { Ū }
{u} { ū }
{V} { \= V } % V may be a vowel, but lowercase v is never used as a vowel.
@@ -18970,7 +19358,16 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{y} { ȳ }
}
{
- \token_to_str:N =
+ \tl_if_single_token:nTF {#1}
+ {
+ \polyglossia_latin_if_ligature_command:NTF #1 { \= }
+ {
+ \token_to_str:N =
+ }
+ }
+ {
+ \token_to_str:N =
+ }
#1
}
}
@@ -19007,12 +19404,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\bbl@allowhyphens
}
-\cs_new:Npn \polyglossia_latin_digraph_shorthand:Nnn #1#2#3
-% #1: second letter of digraph (E or e)
-% #2: digraph character
-% #3: non-digraph code
+\cs_new:Npn \polyglossia_latin_ligature_shorthand:Nnn #1#2#3
+% #1: second letter of ligature (E or e)
+% #2: ligature character
+% #3: non-ligature code
{
- \bool_if:NTF \l_polyglossia_latin_use_digraphs_bool
+ \bool_if:NTF \l_polyglossia_latin_use_ligatures_bool
{
\peek_meaning_remove:NTF #1 {#2} {#3}
}
@@ -19021,12 +19418,60 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
}
+\msg_new:nnn {polyglossia} {latin / no-double-macron-font}
+ {
+ The~combining~double~macron~(U+035E)~is~not~available~in~the~current~
+ font.~The~diphthong~is~typeset~without~macron~ \msg_line_context: .
+ }
+
\cs_new:Npn \polyglossia_latin_diphthong_macron:NNn #1#2#3
% #1: first character of diphthong
% #2: second character of diphthong
% #3: non-diphthong code
{
- \peek_meaning:NTF #2 { #1 \char "35E \relax } {#3} % U+35E: combining double macron
+ \peek_meaning:NTF #2
+ {
+ #1
+ \iffontchar \font "35E \relax % U+35E: combining double macron
+ \char "35E \relax
+ \else
+ \msg_warning:nn {polyglossia} {latin / no-double-macron-font}
+ \fi
+ }
+ {
+ #3
+ }
+ }
+
+\cs_new:Npn \polyglossia_latin_ligature_macron:NNnn #1#2#3#4
+% #1: first character of diphthong
+% #2: second character of diphthong
+% #3: ligature code
+% #4: false code
+ {
+ \polyglossia_latin_ligature_shorthand:Nnn #2 {#3}
+ {
+ \polyglossia_latin_diphthong_macron:NNn #1 #2 {#4}
+ }
+ }
+
+% The following conditional tests if the argument is a ligature command (\AE,
+% \ae, \OE, or \oe).
+\prg_new_conditional:Npnn \polyglossia_latin_if_ligature_command:N #1 {TF}
+ {
+ \token_if_eq_meaning:NNTF #1 \AE { \prg_return_true: }
+ {
+ \token_if_eq_meaning:NNTF #1 \ae { \prg_return_true: }
+ {
+ \token_if_eq_meaning:NNTF #1 \OE { \prg_return_true: }
+ {
+ \token_if_eq_meaning:NNTF #1 \oe { \prg_return_true: }
+ {
+ \prg_return_false:
+ }
+ }
+ }
+ }
}
\cs_new:Npn \polyglossia_latin_no_shorthands:
@@ -19644,8 +20089,8 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\datemalay@indonesian{%
\def\today{\number\day~\ifcase\month\or
- Januari\or Pebruari\or Maret\or April\or Mei\or Juni\or
- Juli\or Agustus\or September\or Oktober\or Nopember\or Desember\fi
+ Januari\or Februari\or Maret\or April\or Mei\or Juni\or
+ Juli\or Agustus\or September\or Oktober\or November\or Desember\fi
\space \number\year}}
\def\datemalay@malay{%
@@ -20170,12 +20615,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\blockextras@mongolian{%
- \ifcyrillic@numerals\mongolian@numbers\fi%
- \ifmongolian@babelshorthands\mongolian@shorthands\fi%
+ \ifcyrillic@numerals\mongolian@numbers\else\nomongolian@numbers\fi%
+ \ifmongolian@babelshorthands\mongolian@shorthands\else\nomongolian@shorthands\fi%
}
\def\inlineextras@mongolian{%
- \ifmongolian@babelshorthands\mongolian@shorthands\fi%
+ \ifmongolian@babelshorthands\mongolian@shorthands\else\nomongolian@shorthands\fi%
}
% \end{macrocode}
@@ -20676,12 +21121,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\lccode\string"2019=\string"2019%
\clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000%
\finalhyphendemerits=50000000%
- \ifoccitan@babelshorthands\occitan@shorthands\fi%
+ \ifoccitan@babelshorthands\occitan@shorthands\else\nooccitan@shorthands\fi%
}
\def\inlineextras@occitan{%
\lccode\string"2019=\string"2019%
- \ifoccitan@babelshorthands\occitan@shorthands\fi%
+ \ifoccitan@babelshorthands\occitan@shorthands\else\nooccitan@shorthands\fi%
}
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
@@ -20958,12 +21403,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\lccode\string"2019=\string"2019%
\clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000%
\finalhyphendemerits=50000000%
- \ifpiedmontese@babelshorthands\piedmontese@shorthands\fi%
+ \ifpiedmontese@babelshorthands\piedmontese@shorthands\else\nopiedmontese@shorthands\fi%
}
\def\inlineextras@piedmontese{%
\lccode\string"2019=\string"2019%
- \ifpiedmontese@babelshorthands\piedmontese@shorthands\fi%
+ \ifpiedmontese@babelshorthands\piedmontese@shorthands\else\nopiedmontese@shorthands\fi%
}
%%% CHANGES END %%%
% \end{macrocode}
@@ -21082,6 +21527,10 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias[variant=portuguese]{portuguese}{portuges}
\setlanguagealias[variant=brazilian]{portuguese}{brazil}
+\ifluatex
+ \RequirePackage{luavlna}
+\fi
+
\def\portuguese@variant{portuges}
\define@choicekey*+{portuguese}{variant}[\xpg@val\xpg@nr]{portuguese,brazilian}[portuguese]{%
\ifcase\xpg@nr\relax
@@ -21098,10 +21547,91 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\xpg@info{Option: portuguese, variant=\xpg@val}%
}{\xpg@warning{Unknown portuguese variant `#1'}}
+\define@boolkey{portuguese}[portuguese@]{babelshorthands}[true]{}
+
+\define@boolkey{portuguese}[portuguese@]{splithyphens}[true]{}
% Register default options
-\xpg@initialize@gloss@options{portuguese}{variant=portuguese}
+\xpg@initialize@gloss@options{portuguese}{variant=portuguese,
+ babelshorthands=false,
+ splithyphens=true}
+
+\ifsystem@babelshorthands
+ \setkeys{portuguese}{babelshorthands=true}
+\else
+ \setkeys{portuguese}{babelshorthands=false}
+\fi
+
+\ifcsundef{initiate@active@char}{%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
+}{}
+
+\def\portuguese@@splhyphen#1{%
+ \def\portuguese@sh@tmp{%
+ \if\portuguese@sh@next-#1%
+ \else\expandafter\portuguese@@@splhyphen{#1}\fi%
+ }%
+ \futurelet\portuguese@sh@next\portuguese@sh@tmp%
+}
+\def\portuguese@@@splhyphen#1{%
+ \ifnum\hyphenchar \font>0%
+ \kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
+ \nobreak\hskip\z@%
+ \else%
+ #1%
+ \fi%
+}
+
+\def\portuguese@splhyphen{%
+ \portuguese@@splhyphen{-}%
+}
+
+\def\portuguese@shorthands{%
+ \bbl@activate{"}%
+ \def\language@group{portuguese}%
+ \declare@shorthand{portuguese}{"=}{\portuguese@splhyphen}%
+ \declare@shorthand{portuguese}{""}{\hskip\z@skip}%
+ \declare@shorthand{portuguese}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
+ \declare@shorthand{portuguese}{"-}{\nobreak\-\bbl@allowhyphens}%
+ \declare@shorthand{portuguese}{"|}{%
+ \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
+ \bbl@allowhyphens}{}%
+ }%
+ \declare@shorthand{portuguese}{"/}{\textormath
+ {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}%
+ \declare@shorthand{portuguese}{"<}{«}%
+ \declare@shorthand{portuguese}{">}{»}%
+}
+
+\def\noportuguese@shorthands{%
+ \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}%
+}
+
+\ifxetex
+ % splithyphens
+ \newXeTeXintercharclass\portuguese@hyphen % -
+\fi
+
+\def\portuguese@hyphens{%
+ \ifluatex
+ \AfterPreamble{\enablesplithyphens{portuguese}}%
+ \else
+ \XeTeXinterchartokenstate=1
+ \XeTeXcharclass `\- \portuguese@hyphen
+ \XeTeXinterchartoks \z@ \portuguese@hyphen = {\portuguese@@splhyphen}% "-" -> "\portuguese@@splhyphen-"
+ \fi%
+}
+
+\def\noportuguese@hyphens{%
+ \ifluatex
+ \AfterPreamble{\disablesplithyphens{portuguese}}%
+ \else
+ \XeTeXcharclass `\- \z@
+ \fi%
+}
\def\portuguese@language{%
\polyglossia@setup@language@patterns{\portuguese@variant}%
@@ -21177,6 +21707,21 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\dateportuguese{%
\csname dateportuguese@\portuguese@variant\endcsname%
}
+
+\def\noextras@portuguese{%
+ \ifportuguese@babelshorthands\noportuguese@shorthands\fi%
+ \noportuguese@hyphens%
+}
+
+\def\blockextras@portuguese{%
+ \ifportuguese@babelshorthands\portuguese@shorthands\else\noportuguese@shorthands\fi%
+ \ifportuguese@splithyphens\portuguese@hyphens\else\noportuguese@hyphens\fi%
+}
+
+\def\inlineextras@portuguese{%
+ \ifportuguese@babelshorthands\portuguese@shorthands\else\noportuguese@shorthands\fi%
+ \ifportuguese@splithyphens\portuguese@hyphens\else\noportuguese@hyphens\fi%
+}
% \end{macrocode}
% \iffalse
@@ -21646,12 +22191,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\blockextras@russian{%
\russian@capsformat%
- \ifcyrillic@numerals\russian@numbers\fi%
- \ifrussian@babelshorthands\russian@shorthands\fi%
+ \ifcyrillic@numerals\russian@numbers\else\norussian@numbers\fi%
+ \ifrussian@babelshorthands\russian@shorthands\else\norussian@shorthands\fi%
}
\def\inlineextras@russian{%
- \ifrussian@babelshorthands\russian@shorthands\fi%
+ \ifrussian@babelshorthands\russian@shorthands\else\norussian@shorthands\fi%
}
%%% These lines taken from russianb.ldf, part of babel package.
@@ -21875,8 +22420,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% Register default options
\xpg@initialize@gloss@options{sanskrit}{script=Devanagari,numerals=Devanagari}
-
-\newcommand{\sanskritnumerals}[2]{\sanskritnumber{#2}}
+% Use \providecommand here as the ldf file might
+% be reloaded via BCP.
+\providecommand{\sanskritnumerals}[2]{\sanskritnumber{#2}}
\def\sanskritnumber#1{%
\ifsanskrit@devanagari@numerals
@@ -21982,7 +22528,8 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
langtag=SRB,
hyphennames={serbian},
hyphenmins={2,2},
- indentfirst=true,
+ frenchspacing=true, % Правопис српскога језика, Матица српска, 2010. (измењено и допуњено, четврто издање): т. 188, под Обликовање ступца и пасуса
+ indentfirst=true, % Правопис српскога језика, Матица српска, 2010. (измењено и допуњено, четврто издање): т. 188, под Обликовање ступца и пасуса
fontsetup=false,
localnumeral=serbiannumerals,
Localnumeral=Serbiannumerals,
@@ -21998,6 +22545,10 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% Babel aliases
\setlanguagealias[script=Cyrillic]{serbian}{serbianc}
+\ifluatex
+ \RequirePackage{luavlna}
+\fi
+
\newif\if@serbian@cyr
\define@choicekey*+{serbian}{Script}[\xpg@val\xpg@nr]{cyrillic,latin}[cyrillic]{%
\ifcase\xpg@nr\relax
@@ -22041,10 +22592,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\xpg@info{Option: Serbian, numerals=\xpg@val}%
}{\xpg@warning{Unknown Serbian numerals value `#1'}}
+\define@boolkey{serbian}[serbian@]{splithyphens}[true]{}
+
\setkeys{serbian}{Script,numerals}
% Register default options
-\xpg@initialize@gloss@options{serbian}{script=Cyrillic,numerals=arabic}
+\xpg@initialize@gloss@options{serbian}{script=Cyrillic,numerals=arabic,splithyphens=true}
\def\captionsserbian{%
\if@serbian@cyr\captionsserbian@cyr\else\captionsserbian@lat\fi
@@ -22125,9 +22678,10 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
децембар\fi \space \number\year.}%
}
-
-\newcommand{\serbiannumerals}[2]{\serbiannumber{#2}}
-\newcommand{\Serbiannumerals}[2]{\Serbiannumber{#2}}
+% Use \providecommand here as the ldf file might
+% be reloaded via serbianc.
+\providecommand{\serbiannumerals}[2]{\serbiannumber{#2}}
+\providecommand{\Serbiannumerals}[2]{\Serbiannumber{#2}}
\def\serbiannumber#1{%
\ifcyrillic@numerals
@@ -22172,12 +22726,65 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\@Alph\latin@Alph
}
+\def\serbian@@splhyphen#1{%
+ \def\serbian@sh@tmp{%
+ \if\serbian@sh@next-#1%
+ \else\expandafter\serbian@@@splhyphen{#1}\fi%
+ }%
+ \futurelet\serbian@sh@next\serbian@sh@tmp%
+}
+
+\def\serbian@@@splhyphen#1{%
+ \ifnum\hyphenchar \font>0%
+ \kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
+ \nobreak\hskip\z@%
+ \else%
+ #1%
+ \fi%
+}
+
+\def\serbian@splhyphen{%
+ \serbian@@splhyphen{-}%
+}
+
+\ifxetex
+ % splithyphens
+ \newXeTeXintercharclass\serbian@hyphen % -
+ \newXeTeXintercharclass\serbian@nonsyllabicpreposition%
+\fi
+
+\def\serbian@hyphens{%
+ \ifluatex
+ \AfterPreamble{\enablesplithyphens{serbian}}%
+ \else
+ \XeTeXinterchartokenstate=1
+ \XeTeXcharclass `\- \serbian@hyphen
+ \XeTeXinterchartoks \z@ \serbian@hyphen = {\serbian@@splhyphen}% "-" -> "\serbian@@splhyphen-"
+ % necessary if used together with vlna:
+ \XeTeXinterchartoks \serbian@nonsyllabicpreposition \serbian@hyphen = {\serbian@@splhyphen}% "-" -> "\serbian@@splhyphen-"
+ \fi%
+}
+
+\def\noserbian@hyphens{%
+ \ifluatex
+ \AfterPreamble{\disablesplithyphens{serbian}}%
+ \else
+ \XeTeXcharclass `\- \z@
+ \fi%
+}
+
\def\blockextras@serbian{%
- \ifcyrillic@numerals\serbian@numbers\fi
+ \ifcyrillic@numerals\serbian@numbers\else\noserbian@numbers\fi%
+ \ifserbian@splithyphens\serbian@hyphens\else\noserbian@hyphens\fi%
+}
+
+\def\inlineextras@serbian{%
+ \ifserbian@splithyphens\serbian@hyphens\else\noserbian@hyphens\fi%
}
\def\noextras@serbian{%
- \ifcyrillic@numerals\noserbian@numbers\fi
+ \ifcyrillic@numerals\noserbian@numbers\fi%
+ \noserbian@hyphens%
}
\def\Asbuk#1{\expandafter\serbian@asbuk@Alph\csname c@#1\endcsname}
@@ -22186,21 +22793,21 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\AsbukTrad#1{\expandafter\cyr@Alph\csname c@#1\endcsname}
\def\asbukTrad#1{\expandafter\cyr@alph\csname c@#1\endcsname}
-% This is a poor man's cyrillic alphanumeric. It just uses the alphabet and
-% thus ends at 30.
+% This is a poor man's cyrillic alphanumeric.
+% It just uses the alphabet and thus ends at 30.
\def\serbian@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 Я%
+ А\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\xpg@ill@value{#1}{serbian@asbuk@Alph}\fi%
}
\def\serbian@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 я%
+ а\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\xpg@ill@value{#1}{serbian@asbuk@alph}\fi%
}
@@ -22268,6 +22875,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}{}
\def\slovak@@splhyphen#1{%
+ \def\slovak@sh@tmp{%
+ \if\slovak@sh@next-#1%
+ \else\expandafter\slovak@@@splhyphen{#1}\fi%
+ }%
+ \futurelet\slovak@sh@next\slovak@sh@tmp%
+}
+
+\def\slovak@@@splhyphen#1{%
\ifnum\hyphenchar \font>0%
\kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
\nobreak\hskip\z@%
@@ -22463,13 +23078,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\blockextras@slovak{%
- \ifslovak@babelshorthands\slovak@shorthands\fi%
+ \ifslovak@babelshorthands\slovak@shorthands\else\noslovak@shorthands\fi%
\ifslovak@vlna\slovak@vlna\else\noslovak@vlna\fi%
\ifslovak@splithyphens\slovak@hyphens\else\noslovak@hyphens\fi%
}
\def\inlineextras@slovak{%
- \ifslovak@babelshorthands\slovak@shorthands\fi%
+ \ifslovak@babelshorthands\slovak@shorthands\else\noslovak@shorthands\fi%
\ifslovak@vlna\slovak@vlna\else\noslovak@vlna\fi%
\ifslovak@splithyphens\slovak@hyphens\else\noslovak@hyphens\fi%
}
@@ -22933,7 +23548,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\tgh\relax%
}
-\newcommand*\spanishoperator[2][]{%
+% Use \providecommand here as the ldf file might
+% be reloaded via babel aliases.
+\providecommand*\spanishoperator[2][]{%
\ifx#1\\\\
\protected@csxdef{#2}{\mathop{\operator@font #2}\nolimits}%
\else
@@ -23590,8 +24207,10 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\tmp@tibetan{tibetan}
\define@key{tibetan}{numerals}[tibetan]{%
\def\@tmpa{#1}%
- \ifx\@tmpa\tmp@tibetan\@tibetan@numeralstrue\else
- \@tibetan@numeralsfalse\fi
+ \ifx\@tmpa\tmp@tibetan\@tibetan@numeralstrue%
+ \else
+ \@tibetan@numeralsfalse%
+ \fi%
}
\ifluatex
@@ -23600,23 +24219,23 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi
\def\tibetan@eol{%
- \ifluatex %
- \xpg@tibteol=1\relax %
+ \ifluatex%
+ \xpg@tibteol=1\relax%
\directlua{polyglossia.activate_tibt_eol()}%
- \else %
+ \else%
\XeTeXlinebreaklocale "bo"%
\XeTeXlinebreakskip=0pt plus 0.1em% doesn't do much, but doesn't harm I guess...
- \fi %
+ \fi%
}
\def\notibetan@eol{%
- \ifluatex %
- \xpg@tibteol=0\relax %
+ \ifluatex%
+ \xpg@tibteol=0\relax%
%\directlua{polyglossia.activate_tibt_eol()}%
- \else %
+ \else%
\XeTeXlinebreaklocale "en"% en? really?
\XeTeXlinebreakskip=0pt plus 0pt%
- \fi %
+ \fi%
}
% Register default options
@@ -23649,6 +24268,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\proofname{བདེན་དཔང་།}% not sure about this one...
\def\glossaryname{མིང་ཚིག་རེའུ་མིག།}%
}
+
\def\datetibetan{%
\def\tibetan@month{%
\ifcase\month\or
@@ -23673,6 +24293,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\tibetandigits#1{\expandafter\@tibetan@digits #1@}
+
\def\@tibetan@digits#1{%
\ifx @#1% then terminate
\else
@@ -23691,14 +24312,28 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi}
\def\@tibetanalph#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 ཨ
- \else\xpg@ill@value{#1}{@tibetanalph}\fi}
-\def\tibetanAlph#1{\expandafter\@tibetanAlph\csname c@#1\endcsname}
+ \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 ཨ
+ \else%
+ \xpg@ill@value{#1}{@tibetanalph}%
+ \fi%
+}
+
+\def\tibetanAlph#1{%
+ \expandafter\@tibetanAlph\csname c@#1\endcsname%
+}
+
\def\@tibetanAlph#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 ཨ
- \else\xpg@ill@value{#1}{@tibetanalph}\fi}
+ \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 ཨ%
+ \else%
+ \xpg@ill@value{#1}{@tibetanalph}%
+ \fi%
+}
\newcommand{\tibetanumerals}[2]{\tibetannumber{#2}}
@@ -23708,13 +24343,16 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\@Alph\@tibetanAlph%
\fi
}
+
\def\notibetan@numbers{%
\let\@alph\latin@alph%
\let\@Alph\latin@Alph%
}
+% Store original definition
+\let\xpg@orig@arabic\@arabic
+
\def\tibetan@globalnumbers{%
- \let\xpg@orig@arabic\@arabic%
\let\@arabic\tibetannumber%
\renewcommand{\thefootnote}{\localnumeral*{footnote}}%
}
@@ -23725,17 +24363,31 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\noextras@tibetan{%
\notibetan@eol%
- \ifcsname xpg@orig@baselinestretch\endcsname\renewcommand{\baselinestretch}{\xpg@orig@baselinestretch}\fi %
- }
+ \ifcsname xpg@orig@baselinestretch\endcsname%
+ \renewcommand{\baselinestretch}{\xpg@orig@baselinestretch}%
+ \fi%
+}
\def\inlineextras@tibetan{%
- \xdef\xpg@orig@baselinestretch{\ifcsname baselinestretch\endcsname \baselinestretch \else 1\fi}%
+ \xdef\xpg@orig@baselinestretch{%
+ \ifcsname baselinestretch\endcsname
+ \baselinestretch
+ \else
+ 1%
+ \fi%
+ }%
\renewcommand{\baselinestretch}{1.2}%
\tibetan@eol%
- }
+}
\def\blockextras@tibetan{%
- \xdef\xpg@orig@baselinestretch{\ifcsname baselinestretch\endcsname \baselinestretch \else 1\fi}%
+ \xdef\xpg@orig@baselinestretch{%
+ \ifcsname baselinestretch\endcsname
+ \baselinestretch
+ \else
+ 1%
+ \fi%
+ }%
\renewcommand{\baselinestretch}{1.2}%
\tibetan@eol%
}
@@ -24134,8 +24786,8 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\ukrainiannumeral=\ukrainiannumber
\let\Ukrainiannumeral=\Ukrainiannumber
-\def\Asbuk#1{\expandafter\ukranian@asbuk@Alph\csname c@#1\endcsname}
-\def\asbuk#1{\expandafter\ukranian@asbuk@alph\csname c@#1\endcsname}
+\def\Asbuk#1{\expandafter\ukrainian@asbuk@Alph\csname c@#1\endcsname}
+\def\asbuk#1{\expandafter\ukrainian@asbuk@alph\csname c@#1\endcsname}
\def\AsbukTrad#1{\expandafter\cyr@Alph\csname c@#1\endcsname}
\def\asbukTrad#1{\expandafter\cyr@alph\csname c@#1\endcsname}
@@ -24180,12 +24832,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\blockextras@ukrainian{%
\ukrainian@capsformat%
- \ifcyrillic@numerals\ukrainian@numbers\fi%
- \ifukrainian@babelshorthands\ukrainian@shorthands\fi%
+ \ifcyrillic@numerals\ukrainian@numbers\else\noukrainian@numbers\fi%
+ \ifukrainian@babelshorthands\ukrainian@shorthands\else\noukrainian@shorthands\fi%
}
\def\inlineextras@ukrainian{%
- \ifukrainian@babelshorthands\ukrainian@shorthands\fi%
+ \ifukrainian@babelshorthands\ukrainian@shorthands\else\noukrainian@shorthands\fi%
}
%%% stuff from Babel
diff --git a/macros/unicodetex/latex/polyglossia/polyglossia.pdf b/macros/unicodetex/latex/polyglossia/polyglossia.pdf
index efbcbab0cb..74e64410ad 100644
--- a/macros/unicodetex/latex/polyglossia/polyglossia.pdf
+++ b/macros/unicodetex/latex/polyglossia/polyglossia.pdf
Binary files differ