summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/changes/changes.drv4
-rw-r--r--macros/latex/contrib/changes/changes.dtx5
-rw-r--r--macros/latex/contrib/changes/changes.english.pdfbin182297 -> 184162 bytes
-rw-r--r--macros/latex/contrib/changes/changes.english.withcode.pdfbin263736 -> 265996 bytes
-rw-r--r--macros/latex/contrib/changes/changes.ins2
-rw-r--r--macros/latex/contrib/changes/changes.ngerman.pdfbin194643 -> 195579 bytes
-rw-r--r--macros/latex/contrib/changes/examples.dtx2
-rw-r--r--macros/latex/contrib/changes/pyMergeChanges.py34
-rw-r--r--macros/latex/contrib/changes/userdoc/changes.de.tex48
-rw-r--r--macros/latex/contrib/changes/userdoc/changes.en.tex50
-rw-r--r--macros/latex/contrib/datetime2-contrib/datetime2-welsh/datetime2-welsh.dtx35
-rw-r--r--macros/latex/contrib/datetime2-contrib/datetime2-welsh/datetime2-welsh.ins2
-rw-r--r--macros/latex/contrib/datetime2-contrib/datetime2-welsh/datetime2-welsh.pdfbin285782 -> 285605 bytes
-rw-r--r--macros/latex/contrib/l3kernel/CHANGELOG.md9
-rw-r--r--macros/latex/contrib/l3kernel/README.md2
-rw-r--r--macros/latex/contrib/l3kernel/expl3.dtx4
-rw-r--r--macros/latex/contrib/l3kernel/expl3.pdfbin585032 -> 585147 bytes
-rw-r--r--macros/latex/contrib/l3kernel/interface3.pdfbin1534901 -> 1534753 bytes
-rw-r--r--macros/latex/contrib/l3kernel/interface3.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3alloc.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3basics.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3bootstrap.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3box.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3candidates.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3clist.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3coffins.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3color-base.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3debug.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3deprecation.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3doc.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3docstrip.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3docstrip.pdfbin263405 -> 263471 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3expan.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3file.dtx4
-rw-r--r--macros/latex/contrib/l3kernel/l3final.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3flag.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-assign.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-aux.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-basics.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-convert.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-expo.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-extended.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-logic.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-parse.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-random.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-round.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-traps.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-trig.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fparray.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3int.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3intarray.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3kernel-functions.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3keys.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3legacy.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3luatex.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3msg.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3names.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3prefixes.pdfbin59064 -> 59064 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3prg.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3prop.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3quark.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3regex.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3seq.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3skip.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3sort.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3str-convert.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3str.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3styleguide.pdfbin280163 -> 280271 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3styleguide.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3syntax-changes.pdfbin227889 -> 227998 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3syntax-changes.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3sys.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3term-glossary.pdfbin186678 -> 186787 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3term-glossary.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3tl-analysis.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3tl.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3token.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3unicode.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/source3.pdfbin5693916 -> 5693995 bytes
-rw-r--r--macros/latex/contrib/l3kernel/source3.tex2
-rw-r--r--macros/latex/contrib/polyglossia/README16
-rw-r--r--macros/latex/contrib/polyglossia/polyglossia.dtx6933
-rw-r--r--macros/latex/contrib/polyglossia/polyglossia.ins15
-rw-r--r--macros/latex/contrib/polyglossia/polyglossia.pdfbin133958 -> 184844 bytes
-rw-r--r--macros/latex/contrib/scontents/README.md4
-rw-r--r--macros/latex/contrib/scontents/scontents.dtx352
-rw-r--r--macros/latex/contrib/scontents/scontents.ins4
-rw-r--r--macros/latex/contrib/scontents/scontents.pdfbin338561 -> 336246 bytes
-rw-r--r--macros/luatex/latex/luabidi/doc/luabidi-test-arabmaths.tex (renamed from macros/luatex/latex/luabidi/doc/test.tex)0
-rw-r--r--macros/luatex/latex/luabidi/doc/luabidi.pdfbin0 -> 91872 bytes
-rw-r--r--macros/luatex/latex/luabidi/doc/luabidi.tex237
-rw-r--r--macros/luatex/latex/luabidi/tex/arabmaths.tex2
-rw-r--r--macros/luatex/latex/luabidi/tex/autofootnoterule.tex116
-rw-r--r--macros/luatex/latex/luabidi/tex/luabidi-arabmaths.def11
-rw-r--r--macros/luatex/latex/luabidi/tex/luabidi-autofootnoterule.def72
-rw-r--r--macros/luatex/latex/luabidi/tex/luabidi-footnotes.def76
-rw-r--r--macros/luatex/latex/luabidi/tex/luabidi.sty52
-rw-r--r--macros/luatex/latex/luabidi/tex/textwidthfootnoterule.tex2
99 files changed, 5644 insertions, 2561 deletions
diff --git a/macros/latex/contrib/changes/changes.drv b/macros/latex/contrib/changes/changes.drv
index 13ee48a492..f10e708732 100644
--- a/macros/latex/contrib/changes/changes.drv
+++ b/macros/latex/contrib/changes/changes.drv
@@ -260,11 +260,11 @@
% document title
\ifENGLISH
\title{The \chpackage{changes}-package}
- \subtitle{Manual change markup --- version 3.1.3}
+ \subtitle{Manual change markup --- version 3.2.0}
\fi
\ifGERMAN
\title{Das \chpackage{changes}-Paket}
- \subtitle{Manuelle Änderungsmarkierung -- Version 3.1.3}
+ \subtitle{Manuelle Änderungsmarkierung -- Version 3.2.0}
\fi
\author{Ekkart Kleinod}
diff --git a/macros/latex/contrib/changes/changes.dtx b/macros/latex/contrib/changes/changes.dtx
index 1ca69d8a93..8d6fa6e251 100644
--- a/macros/latex/contrib/changes/changes.dtx
+++ b/macros/latex/contrib/changes/changes.dtx
@@ -59,6 +59,7 @@
% \changes{v3.1.1}{2018/12/18}{bugfix: uneven dot fills in summaries}
% \changes{v3.1.2}{2019/01/26}{bugfix: problems with amsart class}
% \changes{v3.1.3}{2019/07/21}{bugfix: option clash for ulem and truncate; documentation of known problems and solutions}
+% \changes{v3.2.0}{2019/10/28}{Merge changes script (pyMergeChanges): Support nested brackets}
% \GetFileInfo{changes.dtx}
% \RecordChanges
%
@@ -99,8 +100,8 @@
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{changes}
-[2019/07/21 v3.1.3 changes package]
-\typeout{*** changes package 2019/07/21 v3.1.3 ***}
+[2019/10/28 v3.2.0 changes package]
+\typeout{*** changes package 2019/10/28 v3.2.0 ***}
% \end{macrocode}
%
% Package \chpackage{xkeyval} provides options with key-value-pairs.
diff --git a/macros/latex/contrib/changes/changes.english.pdf b/macros/latex/contrib/changes/changes.english.pdf
index 9c82f24bef..12ca7fa7ca 100644
--- a/macros/latex/contrib/changes/changes.english.pdf
+++ b/macros/latex/contrib/changes/changes.english.pdf
Binary files differ
diff --git a/macros/latex/contrib/changes/changes.english.withcode.pdf b/macros/latex/contrib/changes/changes.english.withcode.pdf
index 9a7fd6423d..d8bfff1dfc 100644
--- a/macros/latex/contrib/changes/changes.english.withcode.pdf
+++ b/macros/latex/contrib/changes/changes.english.withcode.pdf
Binary files differ
diff --git a/macros/latex/contrib/changes/changes.ins b/macros/latex/contrib/changes/changes.ins
index 46e9854344..06da2e778c 100644
--- a/macros/latex/contrib/changes/changes.ins
+++ b/macros/latex/contrib/changes/changes.ins
@@ -1,6 +1,6 @@
%% This file creates the needed files from changes.dtx
%%
-\def\filedate{2019/01/26}
+\def\filedate{2019/10/28}
\def\batchfile{changes.ins}
\input docstrip
diff --git a/macros/latex/contrib/changes/changes.ngerman.pdf b/macros/latex/contrib/changes/changes.ngerman.pdf
index 638fea2946..497dad2b47 100644
--- a/macros/latex/contrib/changes/changes.ngerman.pdf
+++ b/macros/latex/contrib/changes/changes.ngerman.pdf
Binary files differ
diff --git a/macros/latex/contrib/changes/examples.dtx b/macros/latex/contrib/changes/examples.dtx
index 4b617a95c9..78eaf393c1 100644
--- a/macros/latex/contrib/changes/examples.dtx
+++ b/macros/latex/contrib/changes/examples.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2007-2018
+% Copyright (C) 2007-2019
% Ekkart Kleinod (ekleinod@edgesoft.de)
% --------------------------------------------------------------------------
%
diff --git a/macros/latex/contrib/changes/pyMergeChanges.py b/macros/latex/contrib/changes/pyMergeChanges.py
index 37209bdc64..39c8b22007 100644
--- a/macros/latex/contrib/changes/pyMergeChanges.py
+++ b/macros/latex/contrib/changes/pyMergeChanges.py
@@ -30,6 +30,7 @@ Options:
If no option is given, runs interactively.
Created on Wed Dec 5 20:28:40 2018
+Revised on Tue Aug 27 17:51:58 2019
"""
@@ -131,11 +132,11 @@ if INPUTFILE == OUTPUTFILE:
print('Input File and Output File must be different.')
sys.exit(1)
-RE_ADDED = re.compile(r'\\added(\[[^\]]*\]){0,1}\{([^\}]*)\}')
-RE_DELETED = re.compile(r'\\deleted(\[[^\]]*\]){0,1}\{([^\}]*)\}')
-RE_REPLACED = re.compile(r'\\replaced(\[[^\]]*\]){0,1}\{([^\}]*)\}\{([^\}]*)\}')
-RE_HIGHLIGHT = re.compile(r'\\highlight(\[[^\]]*\]){0,1}\{([^\}]*)\}')
-RE_COMMENT = re.compile(r'\\comment(\[[^\]]*\]){0,1}\{([^\}]*)\}')
+RE_ADDED = re.compile(r'(\\added)(\[[^\]]*\])?\{(([^\}]?(\{[^\}]*\})?)*)\}')
+RE_DELETED = re.compile(r'(\\deleted)(\[[^\]]*\])?\{(([^\}]?(\{[^\}]*\})?)*)\}')
+RE_REPLACED = re.compile(r'(\\replaced)(\[[^\]]*\])?\{(([^\}]?(\{[^\}]*\})?)*)\}\{(([^\}]?(\{[^\}]*\})?)*)\}')
+RE_HIGHLIGHT = re.compile(r'(\\highlight)(\[[^\]]*\])?\{(([^\}]?(\{[^\}]*\})?)*)\}')
+RE_COMMENT = re.compile(r'(\\comment)(\[[^\]]*\])?\{(([^\}]?(\{[^\}]*\})?)*)\}')
codecs.open(OUTPUTFILE, mode='w', encoding='utf8').close()
with codecs.open(INPUTFILE, mode='r', encoding='utf8') as fin, \
@@ -164,9 +165,9 @@ codecs.open(OUTPUTFILE, mode='a', encoding='utf8') as fout:
answer = ask1()
if answer == 'a':
lineout = (lineout[:matchAdded.start(0)]
- + matchAdded.group(2) + lineout[matchAdded.end(0):])
+ + matchAdded.group(3) + lineout[matchAdded.end(0):])
lineout = trim_space(lineout, matchAdded.start(0)
- + len(matchAdded.group(2)))
+ + len(matchAdded.group(3)))
lineout = trim_space(lineout, matchAdded.start(0))
elif answer == 'r':
lineout = (lineout[:matchAdded.start(0)] + lineout[matchAdded.end(0):])
@@ -189,7 +190,7 @@ codecs.open(OUTPUTFILE, mode='a', encoding='utf8') as fout:
lineout = (lineout[:matchDeleted.start(0)] + lineout[matchDeleted.end(0):])
lineout = trim_space(lineout, matchDeleted.start(0))
elif answer == 'r':
- lineout = (lineout[:matchDeleted.start(0)] + matchDeleted.group(2)
+ lineout = (lineout[:matchDeleted.start(0)] + matchDeleted.group(3)
+ lineout[matchDeleted.end(0):])
elif answer == 'k':
lineout = lineout
@@ -207,15 +208,15 @@ codecs.open(OUTPUTFILE, mode='a', encoding='utf8') as fout:
answer = ask1()
if answer == 'a':
lineout = (lineout[:matchReplaced.start(0)]
- + matchReplaced.group(2) + lineout[matchReplaced.end(0):])
+ + matchReplaced.group(3) + lineout[matchReplaced.end(0):])
lineout = trim_space(lineout, matchReplaced.start(0)
- + len(matchReplaced.group(2)))
+ + len(matchReplaced.group(3)))
lineout = trim_space(lineout, matchReplaced.start(0))
elif answer == 'r':
lineout = (lineout[:matchReplaced.start(0)]
- + matchReplaced.group(3) + lineout[matchReplaced.end(0):])
+ + matchReplaced.group(6) + lineout[matchReplaced.end(0):])
lineout = trim_space(lineout, matchReplaced.start(0)
- + len(matchReplaced.group(3)))
+ + len(matchReplaced.group(6)))
lineout = trim_space(lineout, matchReplaced.start(0))
elif answer == 'k':
lineout = lineout
@@ -233,9 +234,9 @@ codecs.open(OUTPUTFILE, mode='a', encoding='utf8') as fout:
answer = ask2()
if answer == 'r':
lineout = (lineout[:matchHighlight.start(0)]
- + matchHighlight.group(2) + lineout[matchHighlight.end(0):])
+ + matchHighlight.group(3) + lineout[matchHighlight.end(0):])
lineout = trim_space(lineout, matchHighlight.start(0)
- + len(matchHighlight.group(2)))
+ + len(matchHighlight.group(3)))
lineout = trim_space(lineout, matchHighlight.start(0))
elif answer == 'k':
lineout = lineout
@@ -252,10 +253,7 @@ codecs.open(OUTPUTFILE, mode='a', encoding='utf8') as fout:
print('\n** comment commit ** \n' + matchComment.group())
answer = ask2()
if answer == 'r':
- lineout = (lineout[:matchComment.start(0)]
- + matchComment.group(2) + lineout[matchComment.end(0):])
- lineout = trim_space(lineout, matchComment.start(0)
- + len(matchComment.group(2)))
+ lineout = (lineout[:matchComment.start(0)] + lineout[matchComment.end(0):])
lineout = trim_space(lineout, matchComment.start(0))
elif answer == 'k':
lineout = lineout
diff --git a/macros/latex/contrib/changes/userdoc/changes.de.tex b/macros/latex/contrib/changes/userdoc/changes.de.tex
index f63ad7309d..e9c9dd7690 100644
--- a/macros/latex/contrib/changes/userdoc/changes.de.tex
+++ b/macros/latex/contrib/changes/userdoc/changes.de.tex
@@ -167,22 +167,7 @@ Das Script liegt im Verzeichnis:
Das Script entfernt alle Markierungen, indem die Änderungen angenommen oder abgelehnt werden.
Sie können die zu entfernenden Markierungen individuell im interaktiven Modus selektieren bzw.\ selektieren, indem Sie das Skript ohne Optionen starten.
-Das Skript benötigt \emph{python3}.
-
-Nutzen Sie das Skript wie folgt:
-
-\chinputlisting{, language=bash}{userdoc/script_pymergechanges}
-
-Starten Sie das Skript ohne Optionen und Dateien für eine kurze Hilfe:
-
-\chinputlisting{, language=bash}{userdoc/script_pymergechanges_empty}
-
-Bekannte Probleme:
-
-\begin{itemize}
- \item entfernt nur Markierungen, die in einer Zeile stehen, Markierungen, die mehrere Zeilen umfassen, werden ignoriert
- \item Probleme mit vernesteten Kommandos
-\end{itemize}
+Für Details lesen Sie bitte \autoref{sec:remove-markup}.
@@ -862,6 +847,37 @@ Die folgenden Pakete sind manchmal notwendig und müssen installiert sein, wenn
\end{description}
+%^^A ---- Remove markup from file
+\cleardoublepage
+\section{Markierungen aus den Dateien entfernen}
+\label{sec:remove-markup}
+
+Die Entfernung der Markierungen aus dem Quelltext müssen Sie von Hand vornehmen, dafür steht auch ein Script von Yvon Cui zur Verfügung.
+Das Script liegt im Verzeichnis:
+
+\chinline[, language=bash]{path_script}
+
+Das Script entfernt alle Markierungen, indem die Änderungen angenommen oder abgelehnt werden.
+Sie können die zu entfernenden Markierungen individuell im interaktiven Modus selektieren bzw.\ selektieren, indem Sie das Skript ohne Optionen starten.
+
+Das Skript benötigt \emph{python3}.
+
+Nutzen Sie das Skript wie folgt:
+
+\chinputlisting{, language=bash}{userdoc/script_pymergechanges}
+
+Starten Sie das Skript ohne Optionen und Dateien für eine kurze Hilfe:
+
+\chinputlisting{, language=bash}{userdoc/script_pymergechanges_empty}
+
+Bekannte Probleme:
+
+\begin{itemize}
+ \item entfernt nur Markierungen, die in einer Zeile stehen, Markierungen, die mehrere Zeilen umfassen, werden ignoriert
+\end{itemize}
+
+
+
%^^A ---- Known problems and solutions
\cleardoublepage
\section{Bekannte Probleme und Lösungen}
diff --git a/macros/latex/contrib/changes/userdoc/changes.en.tex b/macros/latex/contrib/changes/userdoc/changes.en.tex
index 2a6fb3964a..2e721a02dc 100644
--- a/macros/latex/contrib/changes/userdoc/changes.en.tex
+++ b/macros/latex/contrib/changes/userdoc/changes.en.tex
@@ -161,30 +161,14 @@ You can suppress the output of changes with:
\chinline{usepackage_final_changes}
In order to remove the markup from the \hologo{LaTeX} files, you have to remove the commands by hand or use the script by Yvon Cui.
-You find the script in the directory:
+You find the script \texttt{pyMergeChanges.py} in the directory:
\chinline[, language=bash]{path_script}
The script removes all markups either keeping or rejecting the change.
You can select or deselect markup from removal using the interactive mode by starting the script without options.
-The script requires \emph{python3}.
-
-Use the script as follows:
-
-\chinputlisting{, language=bash}{userdoc/script_pymergechanges}
-
-Run the script with no options and files for a short help text:
-
-\chinputlisting{, language=bash}{userdoc/script_pymergechanges_empty}
-
-Known issues:
-
-\begin{itemize}
- \item removes only markup that is used in one line, not markup that spans multiple lines
- \item problems with nested commands
-\end{itemize}
-
+For detailed information please refer to \autoref{sec:remove-markup}.
@@ -867,6 +851,36 @@ The following packages are sometimes required and have to be installed if used b
\end{description}
+%^^A ---- Remove markup from file
+\cleardoublepage
+\section{Remove markup from file}
+\label{sec:remove-markup}
+
+In order to remove the markup from the \hologo{LaTeX} files, you have to remove the commands by hand or use the script by Yvon Cui.
+You find the script in the directory:
+
+\chinline[, language=bash]{path_script}
+
+The script removes all markups either keeping or rejecting the change.
+You can select or deselect markup from removal using the interactive mode by starting the script without options.
+
+The script requires \emph{python3}.
+
+Use the script as follows:
+
+\chinputlisting{, language=bash}{userdoc/script_pymergechanges}
+
+Run the script with no options and files for a short help text:
+
+\chinputlisting{, language=bash}{userdoc/script_pymergechanges_empty}
+
+Known issues:
+
+\begin{itemize}
+ \item removes only markup that is used in one line, not markup that spans multiple lines
+\end{itemize}
+
+
%^^A ---- Known problems and solutions
\cleardoublepage
\section{Known problems and solutions}
diff --git a/macros/latex/contrib/datetime2-contrib/datetime2-welsh/datetime2-welsh.dtx b/macros/latex/contrib/datetime2-contrib/datetime2-welsh/datetime2-welsh.dtx
index 3ee74c95af..42c17a863e 100644
--- a/macros/latex/contrib/datetime2-contrib/datetime2-welsh/datetime2-welsh.dtx
+++ b/macros/latex/contrib/datetime2-contrib/datetime2-welsh/datetime2-welsh.dtx
@@ -19,7 +19,7 @@
%\fi
% \iffalse
% Doc-Source file to use with LaTeX2e
-% Copyright (C) 2015 Nicola Talbot, all rights reserved.
+% Copyright (C) 2015-2019 Nicola Talbot, all rights reserved.
% (New maintainer add relevant lines here.)
% \fi
% \iffalse
@@ -61,11 +61,11 @@
%
%\title{Welsh Module for datetime2 Package}
%\author{Nicola L. C. Talbot (inactive)}
-%\date{2015-03-26 (v1.0)}
+%\date{2019-10-28 (v1.1)}
%\maketitle
%
%This module is currently unmaintained and may be subject to change.
-%If you want to volunteer to take over maintanance, contact me at
+%If you want to volunteer to take over maintenance, contact me at
%\url{http://www.dickimaw-books.com/contact.html}
%
%\begin{abstract}
@@ -99,8 +99,7 @@
%
%Currently there is only a regionless style. New maintainers may
%want to add regional variants "cy-GB"\slash"cy-GB-numeric" and
-%"cy-AR"\slash"cy-AR-numeric" once "cy-GB" and "cy-AR" have been added
-%to \sty{tracklang}. This style currently doesn't check the
+%"cy-AR"\slash"cy-AR-numeric". This style currently doesn't check the
%\opt{showdow} setting.
%
%\StopEventually{%
@@ -123,13 +122,13 @@
%\changes{1.0}{2015-03-26}{Initial release}
% Identify module
% \begin{macrocode}
-\ProvidesDateTimeModule{welsh-utf8}[2015/03/26 v1.0]
+\ProvidesDateTimeModule{welsh-utf8}[2019/10/28 v1.1]
% \end{macrocode}
%\begin{macro}{\DTMwelshordinal}
% \begin{macrocode}
\newcommand*{\DTMwelshordinal}[1]{%
- \number#1
- \ifnum#1=1
+ \number#1 % space intended
+ \ifnum#1=1 % space intended
\DTMwelshfmtordinal{añ}%
\fi
}
@@ -202,7 +201,7 @@
%\changes{1.0}{2015-03-26}{Initial release}
% Identify module
% \begin{macrocode}
-\ProvidesDateTimeModule{welsh-ascii}[2015/03/26 v1.0]
+\ProvidesDateTimeModule{welsh-ascii}[2019/10/28 v1.1]
% \end{macrocode}
%
%If abbreviated dates are supported, short month names should be
@@ -210,8 +209,8 @@
%\begin{macro}{\DTMwelshordinal}
% \begin{macrocode}
\newcommand*{\DTMwelshordinal}[1]{%
- \number#1
- \ifnum#1=1
+ \number#1 % space intended
+ \ifnum#1=1 % space intended
\DTMwelshfmtordsuffix{a\protect\~{n}}%
\fi
}
@@ -277,7 +276,7 @@
%
% Identify Module
% \begin{macrocode}
-\ProvidesDateTimeModule{welsh}[2015/03/26 v1.0]
+\ProvidesDateTimeModule{welsh}[2019/10/28 v1.1]
% \end{macrocode}
% Need to find out if XeTeX or LuaTeX are being used.
% \begin{macrocode}
@@ -364,9 +363,10 @@
% \end{macrocode}
%
% Define a setting to change the ordinal suffix style.
+%\changes{1.1}{2019-10-28}{renamed scratch variables}
% \begin{macrocode}
-\DTMdefchoicekey{welsh}{ord}[\val\nr]{level,raise,omit,sc}{%
- \ifcase\nr\relax
+\DTMdefchoicekey{welsh}{ord}[\@dtm@val\@dtm@nr]{level,raise,omit,sc}{%
+ \ifcase\@dtm@nr\relax
\renewcommand*{\DTMwelshfmtordsuffix}[1]{##1}%
\or
\renewcommand*{\DTMwelshfmtordsuffix}[1]{%
@@ -456,7 +456,7 @@
\DTMifbool{welsh}{mapzone}%
{\DTMusezonemapordefault{##1}{##2}}%
{%
- \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
+ \ifnum##1<0 \else+\fi\DTMtwodigits{##1}%
\ifDTMshowzoneminutes\DTMwelshtimesep\DTMtwodigits{##2}\fi
}%
}%
@@ -523,7 +523,7 @@
\DTMifbool{welsh}{mapzone}%
{\DTMusezonemapordefault{##1}{##2}}%
{%
- \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
+ \ifnum##1<0 \else+\fi\DTMtwodigits{##1}%
\ifDTMshowzoneminutes\DTMwelshtimesep\DTMtwodigits{##2}\fi
}%
}%
@@ -567,6 +567,7 @@
% Redefine \cs{datewelsh} (or \cs{date}\meta{dialect}) to prevent
% \sty{babel} from resetting \cs{today}. (For this to work,
% \sty{babel} must already have been loaded if it's required.)
+%\changes{1.1}{2019-10-28}{removed unwanted space}
% \begin{macrocode}
\ifcsundef{date\CurrentTrackedDialect}
{%
@@ -587,7 +588,7 @@
\DTMifcaseregional
{}% do nothing
{\DTMsetstyle{welsh}}%
- {\DTMsetstyle{welsh-numeric}}
+ {\DTMsetstyle{welsh-numeric}}%
}%
}%
% \end{macrocode}
diff --git a/macros/latex/contrib/datetime2-contrib/datetime2-welsh/datetime2-welsh.ins b/macros/latex/contrib/datetime2-contrib/datetime2-welsh/datetime2-welsh.ins
index c014c97b9f..7ed201f81b 100644
--- a/macros/latex/contrib/datetime2-contrib/datetime2-welsh/datetime2-welsh.ins
+++ b/macros/latex/contrib/datetime2-contrib/datetime2-welsh/datetime2-welsh.ins
@@ -3,7 +3,7 @@
\preamble
datetime2-welsh.dtx
- Copyright 2015 Nicola Talbot
+ Copyright 2015-2019 Nicola Talbot
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
diff --git a/macros/latex/contrib/datetime2-contrib/datetime2-welsh/datetime2-welsh.pdf b/macros/latex/contrib/datetime2-contrib/datetime2-welsh/datetime2-welsh.pdf
index 9fd3f409f0..c172eaf10e 100644
--- a/macros/latex/contrib/datetime2-contrib/datetime2-welsh/datetime2-welsh.pdf
+++ b/macros/latex/contrib/datetime2-contrib/datetime2-welsh/datetime2-welsh.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/CHANGELOG.md b/macros/latex/contrib/l3kernel/CHANGELOG.md
index a19fe12ee0..c8c1a1a24a 100644
--- a/macros/latex/contrib/l3kernel/CHANGELOG.md
+++ b/macros/latex/contrib/l3kernel/CHANGELOG.md
@@ -7,6 +7,12 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+## [2019-10-28]
+
+### Fixed
+
+- File searching when `\(pdf)filesize` is not available (fixes #644)
+
## [2019-10-27]
### Changed
@@ -596,7 +602,8 @@ this project uses date-based 'snapshot' version identifiers.
- Step func­tions have been added for dim vari­ables,
e.g. `\dim_step_in­line:nnnn`
-[Unreleased]: https://github.com/latex3/latex3/compare/2019-10-27...HEAD
+[Unreleased]: https://github.com/latex3/latex3/compare/2019-10-28...HEAD
+[2019-10-28]: https://github.com/latex3/latex3/compare/2019-10-27...2019-10-28
[2019-10-27]: https://github.com/latex3/latex3/compare/2019-10-24...2019-10-27
[2019-10-24]: https://github.com/latex3/latex3/compare/2019-10-21...2019-10-24
[2019-10-21]: https://github.com/latex3/latex3/compare/2019-10-14...2019-10-21
diff --git a/macros/latex/contrib/l3kernel/README.md b/macros/latex/contrib/l3kernel/README.md
index e8c2e77024..7871bbad26 100644
--- a/macros/latex/contrib/l3kernel/README.md
+++ b/macros/latex/contrib/l3kernel/README.md
@@ -1,7 +1,7 @@
LaTeX3 Programming Conventions
==============================
-Release 2019-10-27
+Release 2019-10-28
Overview
--------
diff --git a/macros/latex/contrib/l3kernel/expl3.dtx b/macros/latex/contrib/l3kernel/expl3.dtx
index f6d779cfea..b2b0464bc9 100644
--- a/macros/latex/contrib/l3kernel/expl3.dtx
+++ b/macros/latex/contrib/l3kernel/expl3.dtx
@@ -24,7 +24,7 @@
%
%<*driver|generic|package|2ekernel>
%</driver|generic|package|2ekernel>
-\def\ExplFileDate{2019-10-27}%
+\def\ExplFileDate{2019-10-28}%
%<*driver>
\documentclass[full]{l3doc}
\usepackage{graphicx}
@@ -51,7 +51,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/expl3.pdf b/macros/latex/contrib/l3kernel/expl3.pdf
index bdb7a2e5bc..5be11cc518 100644
--- a/macros/latex/contrib/l3kernel/expl3.pdf
+++ b/macros/latex/contrib/l3kernel/expl3.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/interface3.pdf b/macros/latex/contrib/l3kernel/interface3.pdf
index 3308fd4efb..72c1d2a0e4 100644
--- a/macros/latex/contrib/l3kernel/interface3.pdf
+++ b/macros/latex/contrib/l3kernel/interface3.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/interface3.tex b/macros/latex/contrib/l3kernel/interface3.tex
index fdacf71475..5f0eb7d06f 100644
--- a/macros/latex/contrib/l3kernel/interface3.tex
+++ b/macros/latex/contrib/l3kernel/interface3.tex
@@ -54,7 +54,7 @@ for those people who are interested.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2019-10-27}
+\date{Released 2019-10-28}
\pagenumbering{roman}
\maketitle
diff --git a/macros/latex/contrib/l3kernel/l3alloc.dtx b/macros/latex/contrib/l3kernel/l3alloc.dtx
index cd32f72ba1..5815374fdb 100644
--- a/macros/latex/contrib/l3kernel/l3alloc.dtx
+++ b/macros/latex/contrib/l3kernel/l3alloc.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3basics.dtx b/macros/latex/contrib/l3kernel/l3basics.dtx
index c6fd14d112..373850f666 100644
--- a/macros/latex/contrib/l3kernel/l3basics.dtx
+++ b/macros/latex/contrib/l3kernel/l3basics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3bootstrap.dtx b/macros/latex/contrib/l3kernel/l3bootstrap.dtx
index 1f5eed64aa..c5253ae252 100644
--- a/macros/latex/contrib/l3kernel/l3bootstrap.dtx
+++ b/macros/latex/contrib/l3kernel/l3bootstrap.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3box.dtx b/macros/latex/contrib/l3kernel/l3box.dtx
index 72332114b4..2f72616abf 100644
--- a/macros/latex/contrib/l3kernel/l3box.dtx
+++ b/macros/latex/contrib/l3kernel/l3box.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3candidates.dtx b/macros/latex/contrib/l3kernel/l3candidates.dtx
index 2136016a09..05b899a0aa 100644
--- a/macros/latex/contrib/l3kernel/l3candidates.dtx
+++ b/macros/latex/contrib/l3kernel/l3candidates.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3clist.dtx b/macros/latex/contrib/l3kernel/l3clist.dtx
index 0890b5584c..9c4ca821de 100644
--- a/macros/latex/contrib/l3kernel/l3clist.dtx
+++ b/macros/latex/contrib/l3kernel/l3clist.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3coffins.dtx b/macros/latex/contrib/l3kernel/l3coffins.dtx
index 306da7aaf0..fa15c3491d 100644
--- a/macros/latex/contrib/l3kernel/l3coffins.dtx
+++ b/macros/latex/contrib/l3kernel/l3coffins.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3color-base.dtx b/macros/latex/contrib/l3kernel/l3color-base.dtx
index 9224a7dbe4..eed072790e 100644
--- a/macros/latex/contrib/l3kernel/l3color-base.dtx
+++ b/macros/latex/contrib/l3kernel/l3color-base.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3debug.dtx b/macros/latex/contrib/l3kernel/l3debug.dtx
index 860d892b94..4c5cd8ac61 100644
--- a/macros/latex/contrib/l3kernel/l3debug.dtx
+++ b/macros/latex/contrib/l3kernel/l3debug.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3deprecation.dtx b/macros/latex/contrib/l3kernel/l3deprecation.dtx
index 1de67a694d..f3da727225 100644
--- a/macros/latex/contrib/l3kernel/l3deprecation.dtx
+++ b/macros/latex/contrib/l3kernel/l3deprecation.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3doc.dtx b/macros/latex/contrib/l3kernel/l3doc.dtx
index 3713fcfa91..e2cbc4fd5e 100644
--- a/macros/latex/contrib/l3kernel/l3doc.dtx
+++ b/macros/latex/contrib/l3kernel/l3doc.dtx
@@ -79,7 +79,7 @@ and all files in that bundle must be distributed together.
%
% \title{The \cls{l3doc} class}
% \author{\Team}
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
% \maketitle
% \tableofcontents
%
diff --git a/macros/latex/contrib/l3kernel/l3docstrip.dtx b/macros/latex/contrib/l3kernel/l3docstrip.dtx
index d060c196f9..7ab137b18f 100644
--- a/macros/latex/contrib/l3kernel/l3docstrip.dtx
+++ b/macros/latex/contrib/l3kernel/l3docstrip.dtx
@@ -63,7 +63,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3docstrip.pdf b/macros/latex/contrib/l3kernel/l3docstrip.pdf
index 3a8310a332..b28d21fb56 100644
--- a/macros/latex/contrib/l3kernel/l3docstrip.pdf
+++ b/macros/latex/contrib/l3kernel/l3docstrip.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3expan.dtx b/macros/latex/contrib/l3kernel/l3expan.dtx
index 290070d41d..513ca5f205 100644
--- a/macros/latex/contrib/l3kernel/l3expan.dtx
+++ b/macros/latex/contrib/l3kernel/l3expan.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3file.dtx b/macros/latex/contrib/l3kernel/l3file.dtx
index 3e81384e8a..f83f7e62bb 100644
--- a/macros/latex/contrib/l3kernel/l3file.dtx
+++ b/macros/latex/contrib/l3kernel/l3file.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
@@ -2760,6 +2760,8 @@
{
\prg_set_protected_conditional:Npnn \file_get_full_name:nN #1#2 { T , F , TF }
{
+ \tl_set:Nx \l_@@_base_name_tl
+ { \__kernel_file_name_sanitize:n {#1} }
\@@_get_full_name_search:nN { } \use:n
\seq_map_inline:Nn \l_file_search_path_seq
{ \@@_get_full_name_search:nN { ##1 / } \seq_map_break:n }
diff --git a/macros/latex/contrib/l3kernel/l3final.dtx b/macros/latex/contrib/l3kernel/l3final.dtx
index f4ff7ab610..dd41ed167e 100644
--- a/macros/latex/contrib/l3kernel/l3final.dtx
+++ b/macros/latex/contrib/l3kernel/l3final.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3flag.dtx b/macros/latex/contrib/l3kernel/l3flag.dtx
index 47eda9b640..919bb1e5de 100644
--- a/macros/latex/contrib/l3kernel/l3flag.dtx
+++ b/macros/latex/contrib/l3kernel/l3flag.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-assign.dtx b/macros/latex/contrib/l3kernel/l3fp-assign.dtx
index f8b7d4dd19..66b82bfad2 100644
--- a/macros/latex/contrib/l3kernel/l3fp-assign.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-assign.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
% \maketitle
%
% \begin{documentation}
diff --git a/macros/latex/contrib/l3kernel/l3fp-aux.dtx b/macros/latex/contrib/l3kernel/l3fp-aux.dtx
index 823648f03b..50673f8c2c 100644
--- a/macros/latex/contrib/l3kernel/l3fp-aux.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-aux.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-basics.dtx b/macros/latex/contrib/l3kernel/l3fp-basics.dtx
index 4855c6bf9f..44a627a477 100644
--- a/macros/latex/contrib/l3kernel/l3fp-basics.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-basics.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-convert.dtx b/macros/latex/contrib/l3kernel/l3fp-convert.dtx
index b01a1d61fa..54fb6a1516 100644
--- a/macros/latex/contrib/l3kernel/l3fp-convert.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-convert.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-expo.dtx b/macros/latex/contrib/l3kernel/l3fp-expo.dtx
index c9f4504951..1685725262 100644
--- a/macros/latex/contrib/l3kernel/l3fp-expo.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-expo.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-extended.dtx b/macros/latex/contrib/l3kernel/l3fp-extended.dtx
index 40c6a2619f..5f8dee809d 100644
--- a/macros/latex/contrib/l3kernel/l3fp-extended.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-extended.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-logic.dtx b/macros/latex/contrib/l3kernel/l3fp-logic.dtx
index d5e934d014..2ec0ea3d58 100644
--- a/macros/latex/contrib/l3kernel/l3fp-logic.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-logic.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-parse.dtx b/macros/latex/contrib/l3kernel/l3fp-parse.dtx
index 7d01fa95e7..354dc38f19 100644
--- a/macros/latex/contrib/l3kernel/l3fp-parse.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-parse.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-random.dtx b/macros/latex/contrib/l3kernel/l3fp-random.dtx
index 0f953161d8..96efa6f5bf 100644
--- a/macros/latex/contrib/l3kernel/l3fp-random.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-random.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-round.dtx b/macros/latex/contrib/l3kernel/l3fp-round.dtx
index 71044a5ec7..d3555ec9fc 100644
--- a/macros/latex/contrib/l3kernel/l3fp-round.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-round.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-traps.dtx b/macros/latex/contrib/l3kernel/l3fp-traps.dtx
index 394b173afc..a9f09c994e 100644
--- a/macros/latex/contrib/l3kernel/l3fp-traps.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-traps.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
% \maketitle
%
% \begin{documentation}
diff --git a/macros/latex/contrib/l3kernel/l3fp-trig.dtx b/macros/latex/contrib/l3kernel/l3fp-trig.dtx
index bd1a6916ef..b1bbc3e744 100644
--- a/macros/latex/contrib/l3kernel/l3fp-trig.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-trig.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp.dtx b/macros/latex/contrib/l3kernel/l3fp.dtx
index b1bacee80f..6540d13883 100644
--- a/macros/latex/contrib/l3kernel/l3fp.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp.dtx
@@ -49,7 +49,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fparray.dtx b/macros/latex/contrib/l3kernel/l3fparray.dtx
index 1f30b2fa6a..cdbe450f3c 100644
--- a/macros/latex/contrib/l3kernel/l3fparray.dtx
+++ b/macros/latex/contrib/l3kernel/l3fparray.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3int.dtx b/macros/latex/contrib/l3kernel/l3int.dtx
index 5658a55e60..cc333941d9 100644
--- a/macros/latex/contrib/l3kernel/l3int.dtx
+++ b/macros/latex/contrib/l3kernel/l3int.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3intarray.dtx b/macros/latex/contrib/l3kernel/l3intarray.dtx
index fbb18a2d56..a258b3d10b 100644
--- a/macros/latex/contrib/l3kernel/l3intarray.dtx
+++ b/macros/latex/contrib/l3kernel/l3intarray.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx
index 32312970f1..1c8ad30396 100644
--- a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx
+++ b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3keys.dtx b/macros/latex/contrib/l3kernel/l3keys.dtx
index d6b43e39e5..666f268846 100644
--- a/macros/latex/contrib/l3kernel/l3keys.dtx
+++ b/macros/latex/contrib/l3kernel/l3keys.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3legacy.dtx b/macros/latex/contrib/l3kernel/l3legacy.dtx
index 77da137dc0..10a2bd814a 100644
--- a/macros/latex/contrib/l3kernel/l3legacy.dtx
+++ b/macros/latex/contrib/l3kernel/l3legacy.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3luatex.dtx b/macros/latex/contrib/l3kernel/l3luatex.dtx
index 85f0ee6f47..0c6cc6c953 100644
--- a/macros/latex/contrib/l3kernel/l3luatex.dtx
+++ b/macros/latex/contrib/l3kernel/l3luatex.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3msg.dtx b/macros/latex/contrib/l3kernel/l3msg.dtx
index 23e94336b2..c847e0ebb4 100644
--- a/macros/latex/contrib/l3kernel/l3msg.dtx
+++ b/macros/latex/contrib/l3kernel/l3msg.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3names.dtx b/macros/latex/contrib/l3kernel/l3names.dtx
index efdbcb05ae..d662d0e080 100644
--- a/macros/latex/contrib/l3kernel/l3names.dtx
+++ b/macros/latex/contrib/l3kernel/l3names.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3prefixes.pdf b/macros/latex/contrib/l3kernel/l3prefixes.pdf
index 6006b4a821..64d82ca02a 100644
--- a/macros/latex/contrib/l3kernel/l3prefixes.pdf
+++ b/macros/latex/contrib/l3kernel/l3prefixes.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3prg.dtx b/macros/latex/contrib/l3kernel/l3prg.dtx
index b8b54e5cc5..83614a933a 100644
--- a/macros/latex/contrib/l3kernel/l3prg.dtx
+++ b/macros/latex/contrib/l3kernel/l3prg.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3prop.dtx b/macros/latex/contrib/l3kernel/l3prop.dtx
index fc128080a7..0b46bb09f9 100644
--- a/macros/latex/contrib/l3kernel/l3prop.dtx
+++ b/macros/latex/contrib/l3kernel/l3prop.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3quark.dtx b/macros/latex/contrib/l3kernel/l3quark.dtx
index 4c448eb5e3..207b61002b 100644
--- a/macros/latex/contrib/l3kernel/l3quark.dtx
+++ b/macros/latex/contrib/l3kernel/l3quark.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3regex.dtx b/macros/latex/contrib/l3kernel/l3regex.dtx
index f86921aa79..7282e03b6d 100644
--- a/macros/latex/contrib/l3kernel/l3regex.dtx
+++ b/macros/latex/contrib/l3kernel/l3regex.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3seq.dtx b/macros/latex/contrib/l3kernel/l3seq.dtx
index ef6229745f..ec5efa274e 100644
--- a/macros/latex/contrib/l3kernel/l3seq.dtx
+++ b/macros/latex/contrib/l3kernel/l3seq.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3skip.dtx b/macros/latex/contrib/l3kernel/l3skip.dtx
index 3aad86c4e0..0193b11227 100644
--- a/macros/latex/contrib/l3kernel/l3skip.dtx
+++ b/macros/latex/contrib/l3kernel/l3skip.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3sort.dtx b/macros/latex/contrib/l3kernel/l3sort.dtx
index 938cb1f6c5..ddc9be8c75 100644
--- a/macros/latex/contrib/l3kernel/l3sort.dtx
+++ b/macros/latex/contrib/l3kernel/l3sort.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3str-convert.dtx b/macros/latex/contrib/l3kernel/l3str-convert.dtx
index 3f720167ed..ff6c75db5c 100644
--- a/macros/latex/contrib/l3kernel/l3str-convert.dtx
+++ b/macros/latex/contrib/l3kernel/l3str-convert.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3str.dtx b/macros/latex/contrib/l3kernel/l3str.dtx
index 1446518fa3..bc8b8de16a 100644
--- a/macros/latex/contrib/l3kernel/l3str.dtx
+++ b/macros/latex/contrib/l3kernel/l3str.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3styleguide.pdf b/macros/latex/contrib/l3kernel/l3styleguide.pdf
index 9be9b6a4ae..335fc4188c 100644
--- a/macros/latex/contrib/l3kernel/l3styleguide.pdf
+++ b/macros/latex/contrib/l3kernel/l3styleguide.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3styleguide.tex b/macros/latex/contrib/l3kernel/l3styleguide.tex
index 32ec91cc03..ba82487262 100644
--- a/macros/latex/contrib/l3kernel/l3styleguide.tex
+++ b/macros/latex/contrib/l3kernel/l3styleguide.tex
@@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2019-10-27}
+\date{Released 2019-10-28}
\begin{document}
diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf
index 7a16a6ecfe..483f259c70 100644
--- a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf
+++ b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.tex b/macros/latex/contrib/l3kernel/l3syntax-changes.tex
index 13e71bd9d8..521a6e1e45 100644
--- a/macros/latex/contrib/l3kernel/l3syntax-changes.tex
+++ b/macros/latex/contrib/l3kernel/l3syntax-changes.tex
@@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2019-10-27}
+\date{Released 2019-10-28}
\newcommand{\TF}{\textit{(TF)}}
diff --git a/macros/latex/contrib/l3kernel/l3sys.dtx b/macros/latex/contrib/l3kernel/l3sys.dtx
index 6a00e95889..af09373f25 100644
--- a/macros/latex/contrib/l3kernel/l3sys.dtx
+++ b/macros/latex/contrib/l3kernel/l3sys.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.pdf b/macros/latex/contrib/l3kernel/l3term-glossary.pdf
index c4d5bb53fe..398b476956 100644
--- a/macros/latex/contrib/l3kernel/l3term-glossary.pdf
+++ b/macros/latex/contrib/l3kernel/l3term-glossary.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.tex b/macros/latex/contrib/l3kernel/l3term-glossary.tex
index 36ef02855d..cc0ba73953 100644
--- a/macros/latex/contrib/l3kernel/l3term-glossary.tex
+++ b/macros/latex/contrib/l3kernel/l3term-glossary.tex
@@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2019-10-27}
+\date{Released 2019-10-28}
\newcommand{\TF}{\textit{(TF)}}
diff --git a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx
index 39026440d1..7836f222d1 100644
--- a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx
+++ b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3tl.dtx b/macros/latex/contrib/l3kernel/l3tl.dtx
index de9b53ffcd..531259c8f7 100644
--- a/macros/latex/contrib/l3kernel/l3tl.dtx
+++ b/macros/latex/contrib/l3kernel/l3tl.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3token.dtx b/macros/latex/contrib/l3kernel/l3token.dtx
index 408f65c239..1133adeef4 100644
--- a/macros/latex/contrib/l3kernel/l3token.dtx
+++ b/macros/latex/contrib/l3kernel/l3token.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3unicode.dtx b/macros/latex/contrib/l3kernel/l3unicode.dtx
index d8f8eecd25..ebef490729 100644
--- a/macros/latex/contrib/l3kernel/l3unicode.dtx
+++ b/macros/latex/contrib/l3kernel/l3unicode.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-10-27}
+% \date{Released 2019-10-28}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/source3.pdf b/macros/latex/contrib/l3kernel/source3.pdf
index 84c007ddaf..9ca33a657d 100644
--- a/macros/latex/contrib/l3kernel/source3.pdf
+++ b/macros/latex/contrib/l3kernel/source3.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/source3.tex b/macros/latex/contrib/l3kernel/source3.tex
index 7395cc9fe4..1aa4428c4b 100644
--- a/macros/latex/contrib/l3kernel/source3.tex
+++ b/macros/latex/contrib/l3kernel/source3.tex
@@ -53,7 +53,7 @@ for those people who are interested.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2019-10-27}
+\date{Released 2019-10-28}
\pagenumbering{roman}
\maketitle
diff --git a/macros/latex/contrib/polyglossia/README b/macros/latex/contrib/polyglossia/README
index bd15b9aa5d..531780f8cb 100644
--- a/macros/latex/contrib/polyglossia/README
+++ b/macros/latex/contrib/polyglossia/README
@@ -1,7 +1,7 @@
¦----------------------------------------------¦
¦ ¦
- ¦ THE POLYGLOSSIA PACKAGE v1.44 ¦
+ ¦ THE POLYGLOSSIA PACKAGE v1.45 ¦
¦ ¦
¦ Modern multilingual typesetting ¦
¦ with XeLaTeX and LuaLaTeX ¦
@@ -10,7 +10,8 @@
This package provides an alternative to Babel for users of XeLaTeX and LuaLaTeX
(with a few languages incompletely supported for the latter). This version
-includes support for 78 different languages.
+includes support for 75 different languages, some of which in different regional,
+national or scriptal varieties.
Polyglossia makes it possible to automate the following tasks:
@@ -28,7 +29,8 @@ Polyglossia makes it possible to automate the following tasks:
* For languages that have their own numeration system, modifying the formatting
of numbers appropriately.
* Ensuring the proper directionality if the document contains languages
- written from right to left (via the package bidi, available separately).
+ written from right to left (via the packages bidi and luabidi, available
+ separately).
LICENSE
@@ -39,13 +41,13 @@ Polyglossia is placed under the terms of the LaTeX Project Public Licence
LICENCE.txt for the text of the LPPL v1.3c, or
http://www.latex-project.org/lppl.txt for the latest version.
-This work has the LPPL maintenance status ‘maintained’. The current maintainer is Arthur Reutenauer.
+This work has the LPPL maintenance status ‘maintained’. The current maintainer is
+Arthur Reutenauer.
BUGS
-Polyglossia is full of bugs. If you run into one, or suspect you do, or you
-have a request or comment, please use the GitHub issue tracker:
-http://github.com/reutenauer/polyglossia/issues
+If you run into a bug, or suspect you do, or you have a request or comment, please
+use the GitHub issue tracker: http://github.com/reutenauer/polyglossia/issues
This is more efficient than contacting me by email as it allows me to track the
issues and follow progress.
diff --git a/macros/latex/contrib/polyglossia/polyglossia.dtx b/macros/latex/contrib/polyglossia/polyglossia.dtx
index f86b06f6d5..d9a4151831 100644
--- a/macros/latex/contrib/polyglossia/polyglossia.dtx
+++ b/macros/latex/contrib/polyglossia/polyglossia.dtx
@@ -11,7 +11,7 @@
¦----------------------------------------------¦
¦ ¦
- ¦ THE POLYGLOSSIA PACKAGE v1.44 ¦
+ ¦ THE POLYGLOSSIA PACKAGE v1.45 ¦
¦ ¦
¦ Modern multilingual typesetting ¦
¦ with XeLaTeX and LuaLaTeX ¦
@@ -20,7 +20,8 @@
This package provides an alternative to Babel for users of XeLaTeX and LuaLaTeX
(with a few languages incompletely supported for the latter). This version
-includes support for 78 different languages.
+includes support for 75 different languages, some of which in different regional,
+national or scriptal varieties.
Polyglossia makes it possible to automate the following tasks:
@@ -38,7 +39,8 @@ Polyglossia makes it possible to automate the following tasks:
* For languages that have their own numeration system, modifying the formatting
of numbers appropriately.
* Ensuring the proper directionality if the document contains languages
- written from right to left (via the package bidi, available separately).
+ written from right to left (via the packages bidi and luabidi, available
+ separately).
LICENSE
@@ -49,13 +51,13 @@ Polyglossia is placed under the terms of the LaTeX Project Public Licence
LICENCE.txt for the text of the LPPL v1.3c, or
http://www.latex-project.org/lppl.txt for the latest version.
-This work has the LPPL maintenance status ‘maintained’. The current maintainer is Arthur Reutenauer.
+This work has the LPPL maintenance status ‘maintained’. The current maintainer is
+Arthur Reutenauer.
BUGS
-Polyglossia is full of bugs. If you run into one, or suspect you do, or you
-have a request or comment, please use the GitHub issue tracker:
-http://github.com/reutenauer/polyglossia/issues
+If you run into a bug, or suspect you do, or you have a request or comment, please
+use the GitHub issue tracker: http://github.com/reutenauer/polyglossia/issues
This is more efficient than contacting me by email as it allows me to track the
issues and follow progress.
@@ -115,7 +117,6 @@ issues and follow progress.
\generate{\file{gloss-breton.ldf}{\from{polyglossia.dtx}{gloss-breton.ldf}}}
\generate{\file{gloss-bulgarian.ldf}{\from{polyglossia.dtx}{gloss-bulgarian.ldf}}}
\generate{\file{gloss-catalan.ldf}{\from{polyglossia.dtx}{gloss-catalan.ldf}}}
-\generate{\file{gloss-classiclatin.ldf}{\from{polyglossia.dtx}{gloss-classiclatin.ldf}}}
\generate{\file{gloss-coptic.ldf}{\from{polyglossia.dtx}{gloss-coptic.ldf}}}
\generate{\file{gloss-croatian.ldf}{\from{polyglossia.dtx}{gloss-croatian.ldf}}}
\generate{\file{gloss-czech.ldf}{\from{polyglossia.dtx}{gloss-czech.ldf}}}
@@ -129,11 +130,14 @@ issues and follow progress.
\generate{\file{gloss-finnish.ldf}{\from{polyglossia.dtx}{gloss-finnish.ldf}}}
\generate{\file{gloss-french.ldf}{\from{polyglossia.dtx}{gloss-french.ldf}}}
\generate{\file{gloss-friulan.ldf}{\from{polyglossia.dtx}{gloss-friulan.ldf}}}
+\generate{\file{gloss-friulian.ldf}{\from{polyglossia.dtx}{gloss-friulian.ldf}}}
+\generate{\file{gloss-gaelic.ldf}{\from{polyglossia.dtx}{gloss-gaelic.ldf}}}
\generate{\file{gloss-galician.ldf}{\from{polyglossia.dtx}{gloss-galician.ldf}}}
\generate{\file{gloss-german.ldf}{\from{polyglossia.dtx}{gloss-german.ldf}}}
\generate{\file{gloss-greek.ldf}{\from{polyglossia.dtx}{gloss-greek.ldf}}}
\generate{\file{gloss-hebrew.ldf}{\from{polyglossia.dtx}{gloss-hebrew.ldf}}}
\generate{\file{gloss-hindi.ldf}{\from{polyglossia.dtx}{gloss-hindi.ldf}}}
+\generate{\file{gloss-hungarian.ldf}{\from{polyglossia.dtx}{gloss-hungarian.ldf}}}
\generate{\file{gloss-icelandic.ldf}{\from{polyglossia.dtx}{gloss-icelandic.ldf}}}
\generate{\file{gloss-interlingua.ldf}{\from{polyglossia.dtx}{gloss-interlingua.ldf}}}
\generate{\file{gloss-irish.ldf}{\from{polyglossia.dtx}{gloss-irish.ldf}}}
@@ -142,32 +146,40 @@ issues and follow progress.
\generate{\file{gloss-kannada.ldf}{\from{polyglossia.dtx}{gloss-kannada.ldf}}}
\generate{\file{gloss-khmer.ldf}{\from{polyglossia.dtx}{gloss-khmer.ldf}}}
\generate{\file{gloss-korean.ldf}{\from{polyglossia.dtx}{gloss-korean.ldf}}}
+\generate{\file{gloss-kurdish.ldf}{\from{polyglossia.dtx}{gloss-kurdish.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-latvian.ldf}{\from{polyglossia.dtx}{gloss-latvian.ldf}}}
\generate{\file{gloss-lithuanian.ldf}{\from{polyglossia.dtx}{gloss-lithuanian.ldf}}}
-\generate{\file{gloss-liturgicallatin.ldf}{\from{polyglossia.dtx}{gloss-liturgicallatin.ldf}}}
\generate{\file{gloss-lsorbian.ldf}{\from{polyglossia.dtx}{gloss-lsorbian.ldf}}}
\generate{\file{gloss-macedonian.ldf}{\from{polyglossia.dtx}{gloss-macedonian.ldf}}}
\generate{\file{gloss-magyar.ldf}{\from{polyglossia.dtx}{gloss-magyar.ldf}}}
+\generate{\file{gloss-malay.ldf}{\from{polyglossia.dtx}{gloss-malay.ldf}}}
\generate{\file{gloss-malayalam.ldf}{\from{polyglossia.dtx}{gloss-malayalam.ldf}}}
\generate{\file{gloss-marathi.ldf}{\from{polyglossia.dtx}{gloss-marathi.ldf}}}
+\generate{\file{gloss-mongolian.ldf}{\from{polyglossia.dtx}{gloss-mongolian.ldf}}}
\generate{\file{gloss-nko.ldf}{\from{polyglossia.dtx}{gloss-nko.ldf}}}
\generate{\file{gloss-norsk.ldf}{\from{polyglossia.dtx}{gloss-norsk.ldf}}}
+\generate{\file{gloss-norwegian.ldf}{\from{polyglossia.dtx}{gloss-norwegian.ldf}}}
\generate{\file{gloss-nynorsk.ldf}{\from{polyglossia.dtx}{gloss-nynorsk.ldf}}}
\generate{\file{gloss-occitan.ldf}{\from{polyglossia.dtx}{gloss-occitan.ldf}}}
+\generate{\file{gloss-persian.ldf}{\from{polyglossia.dtx}{gloss-persian.ldf}}}
\generate{\file{gloss-piedmontese.ldf}{\from{polyglossia.dtx}{gloss-piedmontese.ldf}}}
\generate{\file{gloss-polish.ldf}{\from{polyglossia.dtx}{gloss-polish.ldf}}}
\generate{\file{gloss-portuges.ldf}{\from{polyglossia.dtx}{gloss-portuges.ldf}}}
+\generate{\file{gloss-portuguese.ldf}{\from{polyglossia.dtx}{gloss-portuguese.ldf}}}
\generate{\file{gloss-romanian.ldf}{\from{polyglossia.dtx}{gloss-romanian.ldf}}}
\generate{\file{gloss-romansh.ldf}{\from{polyglossia.dtx}{gloss-romansh.ldf}}}
\generate{\file{gloss-russian.ldf}{\from{polyglossia.dtx}{gloss-russian.ldf}}}
+\generate{\file{gloss-sami.ldf}{\from{polyglossia.dtx}{gloss-sami.ldf}}}
\generate{\file{gloss-samin.ldf}{\from{polyglossia.dtx}{gloss-samin.ldf}}}
\generate{\file{gloss-sanskrit.ldf}{\from{polyglossia.dtx}{gloss-sanskrit.ldf}}}
\generate{\file{gloss-scottish.ldf}{\from{polyglossia.dtx}{gloss-scottish.ldf}}}
\generate{\file{gloss-serbian.ldf}{\from{polyglossia.dtx}{gloss-serbian.ldf}}}
\generate{\file{gloss-slovak.ldf}{\from{polyglossia.dtx}{gloss-slovak.ldf}}}
\generate{\file{gloss-slovenian.ldf}{\from{polyglossia.dtx}{gloss-slovenian.ldf}}}
+\generate{\file{gloss-sorbian.ldf}{\from{polyglossia.dtx}{gloss-sorbian.ldf}}}
\generate{\file{gloss-spanish.ldf}{\from{polyglossia.dtx}{gloss-spanish.ldf}}}
\generate{\file{gloss-swedish.ldf}{\from{polyglossia.dtx}{gloss-swedish.ldf}}}
\generate{\file{gloss-syriac.ldf}{\from{polyglossia.dtx}{gloss-syriac.ldf}}}
@@ -189,6 +201,7 @@ issues and follow progress.
\generate{\file{thaidigits.map}{\from{polyglossia.dtx}{thaidigits.map}}}
\def\MetaPrefix{-- }
\generate{\file{polyglossia-frpt.lua}{\from{polyglossia.dtx}{polyglossia-frpt.lua}}}
+\generate{\file{polyglossia-korean.lua}{\from{polyglossia.dtx}{polyglossia-korean.lua}}}
\generate{\file{polyglossia-tibt.lua}{\from{polyglossia.dtx}{polyglossia-tibt.lua}}}
\generate{\file{polyglossia.lua}{\from{polyglossia.dtx}{polyglossia.lua}}}
\let\MetaPrefix\DoubleperCent
@@ -206,14 +219,17 @@ issues and follow progress.
%</internal>
%
%<*driver>
+% !TeX spellcheck = en_US
+% !TeX TS-program = xelatex
\documentclass[11pt]{ltxdoc}
\usepackage{color}
-\usepackage{xspace,fancyvrb}
+\usepackage{xspace,fancyvrb,booktabs}
\usepackage[neverdecrease]{paralist}
\definecolor{myblue}{rgb}{0.02,0.04,0.48}
\definecolor{lightblue}{rgb}{0.61,.8,.8}
\definecolor{myred}{rgb}{0.65,0.04,0.07}
\usepackage[
+ unicode=true,
bookmarks=true,
colorlinks=true,
linkcolor=myblue,
@@ -221,8 +237,8 @@ issues and follow progress.
citecolor=myblue,
hyperindex=false,
hyperfootnotes=false,
- pdftitle={Polyglossia: An alternative to Babel for XeLaTeX and LuaLaTeX},
- pdfauthor={F Charette, A Reutenauer},
+ pdftitle={Polyglossia: Modern multilingual typesetting with XeLaTeX and LuaLaTeX},
+ pdfauthor={F Charette, A Reutenauer, B Roucariès, J Spitzmüller},
pdfkeywords={xetex, xelatex, luatex, lualatex, multilingual, babel, hyphenation}
]{hyperref}
\usepackage{metalogo}
@@ -231,7 +247,7 @@ issues and follow progress.
\usepackage[babelshorthands]{polyglossia}
\usepackage{farsical}
\setmainlanguage[variant=british,ordinalmonthday=false]{english}
-\setotherlanguages{arabic,hebrew,syriac,greek,russian,catalan}
+\setotherlanguages{arabic,armenian,hebrew,syriac,greek,russian,serbian,catalan}
\usepackage[protrusion]{microtype}
\newcommand*\Cmd[1]{\cmd{#1}\DescribeMacro{#1}\xspace}
\newcommand*\pkg[1]{\textsf{\color{myblue}#1}}
@@ -239,6 +255,7 @@ issues and follow progress.
\newcommand*\TR[1]{\textcolor{myred}{#1}}
\newcommand*\TX[1]{\hyperref[#1]{\textcolor{myred}{#1}}}
\newcommand*\TB[1]{\textcolor{myblue}{\bf #1}}
+\newcommand*\TA[1]{\textsc{\color{myblue}#1}}
\newcommand*\link[1]{\href{#1}{#1}}
\def\eg{\textit{e.g.,}\xspace}
\def\ie{\textit{i.e.,}\xspace}
@@ -260,12 +277,25 @@ issues and follow progress.
\renewenvironment{itemize}{\begin{compactitem}[\char"2023]}%[{\fontspec{DejaVu Sans}\char"25BB}]}%
{\end{compactitem}}
\renewenvironment{enumerate}{\begin{compactenum}}{\end{compactenum}}
+\newenvironment{shorthands}{%
+ \begin{list}{}%
+ {\settowidth{\labelwidth}{MM}%
+ \setlength{\leftmargin}{\labelwidth}%
+ \addtolength{\leftmargin}{\labelsep}%
+ \renewcommand{\makelabel}[1]{##1\hfil}}}%
+ {\end{list}}
+
+% This is to prevent page breaks too short after subsections
+\def\condbreak#1{%
+ \vskip 0pt plus #1\pagebreak[3]\vskip 0pt plus -#1\relax}
+\pretocmd{\subsection}{\condbreak{2\baselineskip}}{}{}
%% fontspec declarations:
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}
\setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono}
\newfontfamily\arabicfont[Script=Arabic]{Amiri}
+\newfontfamily\armenianfont[Script=Armenian]{DejaVu Sans}
\newfontfamily\syriacfont[Script=Syriac]{Serto Jerusalem}
\newfontfamily\hebrewfont[Script=Hebrew]{Ezra SIL}
@@ -276,6 +306,8 @@ issues and follow progress.
\RecordChanges
% COMMENT THE NEXT LINE TO INCLUDE THE CODE
\AtBeginDocument{\OnlyDescription}
+
+
\begin{document}
\ifxetex
\DocInput{polyglossia.dtx}
@@ -288,13 +320,14 @@ issues and follow progress.
% \errorcontextlines=999
% \makeatletter
%
-% \hyphenation{Kha-li-ghi}
+% \hyphenation{Kha-li-ghi Reu-ten-auer}
% \GetFileInfo{polyglossia.sty}
%
% \title{\textcolor{lightblue}{\Huge\fontspec[LetterSpace=40]{GFS Ambrosia} Πολυγλωσσια}
% \\[16pt]
-% \color{myblue}Polyglossia: An Alternative to Babel for \XeLaTeX\ and \LuaLaTeX}
-% \author{\scshape\color{myblue}François Charette\\\color{myblue}Current maintainer: \scshape Arthur Reutenauer}
+% \color{myblue}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\\
% \footnotesize (\textsc{pdf} file generated on \today)}
%
@@ -312,8 +345,8 @@ issues and follow progress.
%
% \section{Introduction}
%
-% Polyglossia is a package for facilitating multilingual typesetting with
-% \XeLaTeX\ and (at an early stage) \LuaLaTeX. Basically, it
+% \pkg{Polyglossia} is a package for facilitating multilingual typesetting with
+% \XeLaTeX\ and (with some exceptions) \LuaLaTeX. Basically, it
% can be used as an alternative to \pkg{babel} for performing the following
% tasks automatically:
%
@@ -345,42 +378,38 @@ issues and follow progress.
% and modern. The package \pkg{antomega} has been very beneficial in our attempt to
% reach this objective.
%
-% \paragraph{Requirements:} The current version of \pkg{polyglossia} makes use of some convenient
-% macros defined in the \pkg{etoolbox} package by Philipp Lehmann. Being designed
-% for \XeLaTeX\ and \LuaLaTeX, it obviously also relies on \pkg{fontspec} by Will
-% Robertson. For languages written from right to left, it needs the package \pkg{bidi}
-% by Vafa Khalighi (\textarabic{وفا خليقي}). Polyglossia also bundles three packages for calendaric
-% computations (\pkg{hebrewcal}, \pkg{hijrical}, and \pkg{farsical}).
-%
-% \section{Loading language definition files}
-%
-% \subsection{The recommended way}
-% You can determine the default language by means of the command:
-% \displaycmd{\setdefaultlanguage[⟨options⟩]\{lang\}}{\setdefaultlanguage}
-% (or equivalently \Cmd\setmainlanguage).
-% Secondary languages can be loaded with
-% \displaycmd{\setotherlanguage[⟨options⟩]\{lang\}.}{\setotherlanguage}
-% These commands have the advantage of being explicit and of allowing you to set
-% language-specific options.\footnote{ %
-% More on language-specific options below.}
-% It is also possible to load a series of secondary languages at once using
-% \displaycmd{\setotherlanguages\{lang1,lang2,lang3,…\}.}{\setotherlanguages}
-% Language-specific options can be set or changed at any time by means of
-% \displaycmd{\setkeys\{⟨lang⟩\}\{opt1=value1,opt2=value2,…\}.}{\setkeys}
-%
-%
-% \subsection{The “Babel way” – obsolete}
-% \new{v1.2.0}
-% {\color{red}\bfseries Warning}: \pkg{polyglossia} no longer supports loading
-% language definition files as package options!
-% ^^AAs with \pkg{babel}, \pkg{polyglossia} also allows you to load language definition files
-% ^^Aas package options. In most cases, option \texttt{⟨lang⟩} will load the file
-% ^^A\file{gloss-⟨lang⟩.ldf}. Note however that the \textit{first} language listed in \\
-% ^^A\centerline{\cmd{\usepackage[lang1,lang2,…]{polyglossia}}}
-% ^^Awill be the default language for the document, which
-% ^^Ais the opposite convention of \pkg{babel}.
-% ^^ANote also that this method may not work in some cases, and should be
-% ^^Aconsidered deprecated.
+% \paragraph{Requirements} The current version of \pkg{polyglossia} makes use of some convenient
+% macros defined in the \pkg{etoolbox} package by \TA{Philipp Lehmann} and \TA{Joseph Wright}.
+% Being designed for \XeLaTeX\ and \LuaLaTeX, it obviously also relies on \pkg{fontspec} by
+% \TA{Will Robertson}. For languages written from right to left, it needs the package \pkg{bidi}
+% (for \XeTeX) or \pkg{luabidi} (for \LuaTeX) by \TA{Vafa Khalighi} (\textarabic{وفا خليقي}) and
+% the \pkg{bidi-tex GitHub Organisation}.
+% Polyglossia also bundles three packages for calendaric computations (\pkg{hebrewcal},
+% \pkg{hijrical}, and \pkg{farsical}).
+%
+%
+% \section{Setting up multilingual documents}
+%
+% \subsection{Activating languages}
+%
+% The default language of a document is specified by means of the command
+% \displaycmd{\setdefaultlanguage[⟨options⟩]\{⟨lang⟩\}}{\setdefaultlanguage}
+% (or, equivalently, \Cmd\setmainlanguage).
+% Secondary languages are specified with
+% \displaycmd{\setotherlanguage[⟨options⟩]\{⟨lang⟩\}.}{\setotherlanguage}
+% All these commands allow you to set language-specific options.\footnote{%
+% Section~\ref{specific} documents these options for the respective languages.}
+% It is also possible to load a series of secondary languages at once (but without options)
+% using
+% \displaycmd{\setotherlanguages\{⟨lang1⟩,⟨lang2⟩,⟨lang3⟩,…\}.}{\setotherlanguages}
+%
+% All language-specific options can be modified locally by means of the
+% language-switching commands described in section \ref{languageswitching}.
+%
+% \paragraph{Note} In general, it is advisable to activate the languages \emph{after} all
+% packages have been loaded. This is particularly important if you use right-to-left scripts
+% or languages with babel shorthands.
+%
%
% \subsection{Supported languages}
%
@@ -388,69 +417,156 @@ issues and follow progress.
% Those in red have specific options and/or commands
% that are explained in section \ref{specific} below.
%
-% \begin{table}[h]\centering
+% \begin{table}[ht]\centering
% \label{tab:lang}
-% ^^A Produced with tools/insert-language-list.rb -- AR, 2015-07-14
-% ^^A Edited by hand -- AR 2019-04-04
+% ^^A Produced with tools/insert-language-list.rb -- JS, 2019-10-18
+% ^^A Edited by hand -- JS, 2019-10-18
% \begin{tabular}{lllll}
-% \hline
-% albanian & danish & interlingua & nko & \TX{slovenian}\\
-% amharic & divehi & irish & norsk & spanish \\
-% \TX{arabic} & \TX{dutch} & \TX{italian} & nynorsk & swedish \\
-% armenian & \TX{english} & kannada & occitan & \TX{syriac} \\
-% asturian & \TX{esperanto} & khmer & piedmontese & tamil \\
-% bahasai & estonian & \TX{korean} & polish & telugu \\
-% bahasam & \TX{farsi} & \TX{lao} & portuges & \TX{thai} \\
-% basque & finnish & \TX{latin} & romanian & tibetan \\
-% \TX{bengali} & french & latvian & romansh & turkish \\
-% brazil[ian] & friulan & lithuanian & \TX{russian} & turkmen \\
-% breton & galician & \TX{lsorbian} & samin & \TX{ukrainian}\\
-% bulgarian & \TX{german} & \TX{magyar} & \TX{sanskrit} & urdu \\
-% \TX{catalan} & \TX{greek} & macedonian & scottish & \TX{usorbian} \\
-% coptic & \TX{hebrew} & malayalam & \TX{serbian} & vietnamese \\
-% croatian & \TX{hindi} & marathi & slovak & \TX{welsh} \\
-% czech & icelandic \\
-% \hline
+% \toprule
+% albanian & \TX{dutch} & interlingua & \TX{mongolian} & \TX{slovenian}\\
+% amharic & \TX{english} & \TX{italian} & nko & \TX{sorbian}\\
+% \TX{arabic} & \TX{esperanto} & japanese & \TX{norwegian} & spanish\\
+% \TX{armenian}& estonian & kannada & occitan & swedish\\
+% asturian & \TX{finnish} & khmer & \TX{persian} & \TX{syriac}\\
+% basque & \TX{french} & \TX{korean} & piedmontese & tamil\\
+% \TX{bengali} & friulian & \TX{kurdish} & polish & telugu\\
+% breton & \TX{gaelic} & \TX{lao} & \TX{portuguese} & \TX{thai}\\
+% bulgarian & galician & \TX{latin} & romanian & \TX{tibetan}\\
+% \TX{catalan} & \TX{german} & latvian & romansh & turkish\\
+% coptic & \TX{greek} & lithuanian & \TX{russian} & turkmen\\
+% croatian & \TX{hebrew} & macedonian & \TX{sami} & \TX{ukrainian}\\
+% \TX{czech} & \TX{hindi} & \TX{malay} & \TX{sanskrit} & urdu\\
+% danish & \TX{hungarian} & malayalam & \TX{serbian} & vietnamese\\
+% divehi & icelandic & marathi & slovak & \TX{welsh}\\
+% \bottomrule
% \end{tabular}
+%
+%
% \caption{Languages currently supported in \pkg{polyglossia}}
% \end{table}
%
-% \textit{NB:} The support for Amharic\new{v1.0.1} should be considered an experimental attempt to
-% port the package \pkg{ethiop}.\footnote{ Feedback is welcome.}
+% \paragraph{Version Notes} The support for Amharic\new{v1.0.1} should be considered an experimental attempt to
+% port the package \pkg{ethiop}.\footnote{Feedback is welcome.}
% Version 1.1.1\new{v1.1.1} added support for Asturian, %\footnote{ Provided by Kevin Godby and Xuacu Saturio.},
% Lithuanian, %\footnote{ Provided by Kevin Godby and Paulius Sladkevičius.},
% and Urdu. %\footnote{ Provided by Kamal Abdali.}
% ^^A
% Version 1.2\new{v1.2.0} adds support for Armenian, Occitan, Bengali,
-% Lao, Malayalam, Marathi, Tamil, Telugu, and Turkmen.\footnote{ %
+% Lao, Malayalam, Marathi, Tamil, Telugu, and Turkmen.\footnote{%
% See acknowledgements at the end for due credit to the various contributors.}
+% Version 1.43\new{v1.43} silently introduced basic support for Japanese. This
+% is considered experimental, and feedback is appreciated.
+% In version 1.45\new{v1.45}, support for Kurdish and Mongolian as well as some new
+% variants (Canadian French and English) have been added. Furthermore, for consistency reasons, some language have
+% been renamed (\emph{farsi}\textrightarrow\emph{persian}, \emph{friulan}\textrightarrow\emph{friulian},
+% \emph{magyar}\textrightarrow\emph{hungarian}, \emph{portuges}\textrightarrow\emph{portuguese},
+% \emph{samin}\textrightarrow\emph{sami}) or merged (\emph{bahasai}\slash\emph{bahasam}\textrightarrow\emph{malay},
+% \emph{brazil}\slash\emph{portuges}\textrightarrow\emph{portuguese},
+% \emph{lsorbian}\slash\emph{usorbian}\textrightarrow\emph{sorbian},
+% \emph{irish}\slash\emph{scottish}\textrightarrow\emph{gaelic},
+% \emph{norsk}\slash\emph{nynorsk}\textrightarrow\emph{norwegian}). The old names are still supported for backwards
+% compatibility reasons, but they might not give access to newer language features.
+%
+%
+% \subsection{Relation to Babel languages}
+%
+% If you are familiar with the \pkg{babel} package, you will note that \pkg{polyglossia}'s language naming
+% slightly differs. Whereas \pkg{babel} has a unique name for each language variety (\eg\emph{american} and \emph{british}),
+% \pkg{polyglossia} differentiates language varieties via language options.
+%
+% Furthermore, \pkg{babel} uses sometimes abbreviations for language names (\eg\emph{bahasam} for Bahasa Malayu) as well
+% as endonyms, \ie language names coming from the designated languages (such as \emph{bahasa}, \emph{canadien} or \emph{magyar}).
+% As opposed to this, \pkg{polyglossia} always uses spelled-out (lower-cased) English language names.
+%
+% Table~\ref{tab:bbllang} lists the language names that differ in both packages. \pkg{Babel} names marked in red can also be used
+% in \pkg{polyglossia} as an alias.\footnote{This is for historical reasons, since earlier versions of \pkg{polyglossia} used
+% those names as well. Note, however, that you need to use the matching language switching commands, then, as
+% well, \eg \cmd\textportuges\ with \emph{portuges} (rather than \cmd\textportuguese).}
+%
+% \begin{table}
+% \label{tab:bbllang}
+% \begin{tabular}{lll}
+% \toprule
+% \textbf{Babel name} & \textbf{Polyglossia name} & \textbf{Polyglossia options}\tabularnewline
+% \midrule
+% acadien & french & variant=acadian \\
+% american & english & \emph{(default)} \\
+% australian & english & variant=australian \\
+% austrian & german & variant=austrian, spelling=old \\
+% bahasa & malay & \emph{(default)} \\
+% \TR{bahasam} & malay & variant=malaysian \\
+% \TR{brazil} & portuguese & variant=brazilian \\
+% british & english & variant=british \\
+% canadian & english & variant=canadian \\
+% canadien & french & variant=canadian \\
+% \TR{farsi} & persian & \\
+% \TR{friulan} & friulian & \\
+% german & german & spelling=old \\
+% \TR{irish} & gaelic & variant=irish \\
+% kurmanji & kurdish & variant=kurmanji \\
+% lowersorbian & sorbian & variant=lower \\
+% \TR{magyar} & hungarian & \\
+% naustrian & german & variant=austrian \\
+% newzealand & english & variant=newzealand \\
+% ngerman & german & \emph{(default)} \\
+% \TR{norsk} & norwegian & variant=bokmal \\
+% nswissgerman & german & variant=swiss \\
+% \TR{nynorsk} & norwegian & \emph{(default)} \\
+% polutonikogreek & greek & variant=polytonic \\
+% \TR{portuges} & portuguese & \emph{(default)} \\
+% \TR{samin} & sami & \\
+% \TR{scottish} & gaelic & variant=scottish \\
+% serbianc & serbian & script=Cyrillic \\
+% slovene & slovenian & \\
+% swissgerman & german & variant=swiss, spelling=old \\
+% uppersorbian & sorbian & variant=upper \\
+% \bottomrule
+% \end{tabular}
+%
+% \caption{Babel-polyglossia language name matching}
+% \end{table}
%
%
+% \subsection{Global options}
%
-% Polyglossia can also be loaded with the option
-% ‘babelshorthands’\new{v1.1.1}, which globally activates \pkg{babel}
-% shorthands whenever available. Currently shorthands are implemented for
-% Catalan, Dutch, German, Italian, and Russian: see these respective
-% languages for details.
-%
-% Another option (turned off by default) is ‘localmarks’, which
-% redefines the internal \LaTeX\ macros \cmd\markboth\ and \cmd\markright.
-% \new{v1.2.0}Note that this was formerly turned on by default, but we
-% now realize that it causes more problems than otherwise. For backwards-compatibility
-% the opposite option ‘nolocalmarks’ is still available.
+% \pkg{Polyglossia} can be loaded with the following global package options:
%
-% There is also the option ‘quiet’ which turns off most info messages and some of the warnings
-% issued by \LaTeX, \pkg{fontspec} and \pkg{polyglossia}.
+% \begin{itemize}
+% \item \TB{babelshorthands}\new{v1.1.1} globally activates \pkg{babel}
+% shorthands whenever available. Currently shorthands are implemented for
+% Catalan, Czech, Dutch, Finnish, German, Italian, Mongolian, and Russian.
+% Please refer to the respective language descriptions (sec.~\ref{specific}) for details.
+%
+% \item \TB{localmarks} redefines the internal \LaTeX\ macros \cmd\markboth\ and \cmd\markright.
+% In earlier versions of \pkg{polyglossia},\new{v1.2.0} this option was set by default, but we
+% now realize that it causes more problems than it helps, so it is now off by default.
+% For backwards-compatibility, the option \TB{nolocalmarks} which used to switch off the previous
+% default, and now does nothing, is still available.
+%
+% \item \TB{quiet} turns off most info messages and some of the warnings issued by \LaTeX,
+% \pkg{fontspec} and \pkg{polyglossia}.
+% \end{itemize}
%
-% \section{Language-switching commands}
+% \section{Language-switching commands}\label{languageswitching}
%
-% Whenever a language definition file \file{gloss-⟨lang⟩.ldf} is loaded,
-% the command \cmd{\text⟨lang⟩[⟨options⟩]\{…\}} \DescribeMacro{\text⟨lang⟩}
+% \subsection{Recommended commands}
+% For each activated language the command
+% \cmd{\text⟨lang⟩[⟨options⟩]\{…\}} \DescribeMacro{\text⟨lang⟩}
% becomes available for short insertions of text in that language.
% For example ¦\textrussian{\today}¦ yields \textrussian{\today}
-% Longer passages are better put between the environment ¦⟨lang⟩¦
-% (again with the possibility of setting language options locally.
-% \DescribeEnv{⟨lang⟩}
+% This command switches to the correct hyphenation patterns, it activates
+% some extra features for the selected language (such as extra spacing before
+% punctuation in French), and it translates the date when using ¦\today¦.
+% It does not, however, translate so-called \textit{caption strings}, i.\,e.
+% ``chapter'', ``figure'' etc., to the local language (these remain in the main
+% language).
+%
+% The\DescribeEnv{⟨lang⟩}\ environment ¦⟨lang⟩¦, which is also available for any activated language,
+% is meant for longer passages of text. It behaves slightly different than the \cmd{\text⟨lang⟩\{…\}}
+% command: It does everything the latter does, but additionally, the caption strings are translated
+% as well, and the language is also passed to auxiliary files, the table of contents and the lists of
+% figures/tables.
+% Like the command, the environment provides the possibility of setting language options locally.
% For instance the following allows us to quote the beginning
% of Homer’s \textit{Iliad}:
%
@@ -471,9 +587,30 @@ issues and follow progress.
% \end{greek}
% \bigskip
%
-% Note that for Arabic one cannot use the environment ¦arabic¦,
+% \noindent\DescribeEnv{Arabic} Note that for Arabic one cannot use the environment ¦arabic¦,
% as \cmd\arabic\ is defined internally by \LaTeX. In this case
-% we need to use the environment ¦Arabic¦ instead\DescribeEnv{Arabic}.
+% we need to use the environment ¦Arabic¦ instead.
+%
+% \subsection{Babel commands}
+% Some macros defined in \pkg{babel}’s \file{hyphen.cfg} (and thus usually
+% compiled into the \XeLaTeX\ and \LuaLaTeX\ format) are redefined, but keep a
+% similar behaviour.
+% \begin{itemize}
+% \item \DescribeMacro{\selectlanguage}\cmd{\selectlanguage[⟨options⟩]\{⟨lang⟩\}}
+% \item \DescribeMacro{\foreignlanguage}\cmd{\foreignlanguage[⟨options⟩]\{⟨lang⟩\}\{…\}}
+% \item \DescribeEnv{otherlanguage}\cmd{\begin\{otherlanguage\}[⟨options⟩]\{⟨lang⟩\}} \dots{} \cmd{\end\{otherlanguage\}}
+% \item \DescribeEnv{otherlanguage*}\cmd{\begin\{otherlanguage*\}[⟨options⟩]\{⟨lang⟩\}} \dots{} \cmd{\end\{otherlanguage*\}}
+% \end{itemize}
+% ^^A
+% ¦\selectlanguage{⟨lang⟩}¦ and the ¦otherlanguage¦ environment are identical to the
+% the ¦⟨lang⟩¦ environment, except that ¦\selectlanguage{⟨lang⟩}¦
+% does not need to be explicitly closed. The command ¦\foreinlanguage{⟨lang⟩}{…}¦ and the ¦otherlanguage*¦
+% environment are identical with the use of the ¦\text⟨lang⟩¦ command, with the one
+% notable exception that they do not translate the date with ¦\today¦.
+%
+% Since the \XeLaTeX\ and \LuaLaTeX\ format incorporate \pkg{babel}’s \file{hyphen.cfg},
+% the low-level commands for hyphenation and language switching
+% defined there are also accessible.
%
% \subsection{Other commands}
% The following commands are probably of lesser interest to the end user, but
@@ -487,19 +624,14 @@ issues and follow progress.
% to another one in the middle of a document: \textit{this may have adverse effects}!
%
% \item \Cmd\normalfontlatin: in an environment where \cmd\normalfont\ has been redefined
-% to a non-latin script, this will call the font defined with \cmd\setmainfont\ etc.
-% Likewise it is possible to use \Cmd\rmfamilylatin, \Cmd\sffamilylatin,
+% to a non-latin script, this will reset to the font defined with \cmd\setmainfont\ etc.
+% In a similar vein, it is possible to use \Cmd\rmfamilylatin, \Cmd\sffamilylatin,
% and \Cmd\ttfamilylatin.
%
-% \item Some macros defined in \pkg{babel}’s \file{hyphen.cfg} (and thus usually
-% compiled into the \XeLaTeX\ and \LuaLaTeX\ format) are redefined, but keep a similar
-% behaviour, namely \Cmd\selectlanguage, \Cmd\foreignlanguage,
-% and the environment ¦otherlanguage¦\DescribeEnv{otherlanguage}.
+% \item \Cmd\latinalph: Representation of counter as a lower-case letter: 1 = a, 2 = b, etc.
+%
+% \item \Cmd\latinAlph: Representation of counter as a uper-case letter: 1 = A, 2 = B, etc.
% \end{itemize}
-% ^^A
-% Since the \XeLaTeX\ and \LuaLaTeX\ format incorporate \pkg{babel}’s \file{hyphen.cfg},
-% the low-level commands for hyphenation and language switching
-% defined there are also accessible.
%
% \section{Font setup}
%
@@ -526,14 +658,35 @@ issues and follow progress.
% does not appear to support the script of that language, an error message is
% displayed.
%
-% \section{Hyphenation disabling}
+% \section{Adapting hyphenation}
+%
+% \subsection{Hyphenation exceptions}
+%
+% \TeX\ provides the command ¦\hyphenation{⟨exceptions⟩}¦ to globally define hyphenation exceptions
+% which override the hyphenation patterns for specified words. The command takes as argument a space-separated
+% list of words where hyphenation points are marked by a dash (if no dash is used, the respective word is not
+% hyphenated at all):
+% \begin{Verbatim}
+% \hyphenation{%
+% po-ly-glos-sia
+% LaTeX
+% }
+% \end{Verbatim}
+% ^^A
+% These exceptions, however, apply to all languages. In addition to this, \pkg{polyglossia} provides
+% the command\new{v.1.45}
+% \displaycmd{\pghyphenation[⟨options⟩]\{⟨lang⟩\}\{⟨exceptions⟩\}}{\pghyphenation}
+% which can be used to define exceptions that only apply to a specific language or language variant,
+% respectively.
+%
+% \subsection{Hyphenation disabling}
%
% In some very specific contexts (such as music score creation), \TeX{} hyphenation
% is something to avoid as it may cause troubles. \pkg{polyglossia} provides two
-% functions: \cmd\disablehyphenation{} and \cmd\enablehyphenation . Note that when
-% you select a new language, hyphenation will be in the same state (enabled or
-% disabled) as before. When you reenable it, it will take the last selected
-% language.
+% functions: \Cmd\disablehyphenation\ and \Cmd\enablehyphenation. Note that if
+% you select a new language while hyphenation is disabled, it will remain disabled.
+% If you re-enable it, the hyphenation patterns of the currently selected language
+% will be activated.
%
% \section{Language-specific options and commands}\label{specific}
%
@@ -543,7 +696,7 @@ issues and follow progress.
% ^^A\subsection{amharic}\label{amharic}
%
% \subsection{arabic}\label{arabic}
-% \textbf{Options}:
+% \paragraph*{Options:}
% \begin{itemize}
% \item \TB{calendar} = \textit{gregorian} or islamic (= hijri)
% \item \TB{locale} = \textit{default},\footnote{ %
@@ -558,7 +711,7 @@ issues and follow progress.
% \item \TB{abjadjimnotail} = \textit{false} or true. \new{v1.0.3}
% Set this to true if you want the \textit{abjad} form of the number three to be \textarabic{ج‍} – as in the manuscript tradition – instead of the modern usage \textarabic{ج}.
% \end{itemize}
-% \textbf{Commands}:
+% \paragraph*{Commands:}
% \begin{itemize}
% \item \Cmd\abjad and \Cmd\abjadmaghribi (see section \ref{abjad})
% \item \Cmd\aemph to emphasize text with ¦\overline¦.\new{v1.2.0}
@@ -566,8 +719,15 @@ issues and follow progress.
% This command is also available for Farsi, Urdu, etc.
% \end{itemize}
%
-% \subsection{bengali}\label{bengali}\new{v1.2.0}
-% \textbf{Options}:
+% \subsection{armenian}\label{armenian}
+% \paragraph*{Options:}
+% \begin{itemize}
+% \item \TB{variant}\new{v1.45} = eastern or \textit{western}
+% \item \TB{numerals}\new{v1.45} = armenian or \textit{arabic}
+% \end{itemize}
+%
+% \subsection[bengali]{bengali\new{v1.2.0}}\label{bengali}
+% \paragraph*{Options:}
% \begin{itemize}
% \item \TB{numerals} = Western, Bengali or \textit{Devanagari}
% \item \TB{changecounternumbering} = true or \textit{false} (use specified
@@ -575,70 +735,129 @@ issues and follow progress.
% \end{itemize}
%
% \subsection{catalan}\label{catalan}
-% \textbf{Options:}
+% \paragraph*{Options:}
% \begin{itemize}
% \item \TB{babelshorthands} = \textit{false} or true. \new{v1.1.1}
% Activates the shorthands \texttt{"l} and \texttt{"L} to type geminated l’s.
% \end{itemize}
-% \textbf{Commands}:
+%
+% \paragraph*{Commands:}
+% \begin{itemize}
+% \item \Cmd{\l.l} and \Cmd{\L.L}\new{v1.1.1} can be used to type a geminated l, as in \textit{co\l.laborar},
+% similar to \pkg{babel} (the glyph U+00B7 MIDDLE DOT is used as a geminating sign).
+% \end{itemize}
+%
+% \subsection{czech}\label{czech}
+%
+% \paragraph*{Options:}
% \begin{itemize}
-% \item \Cmd{\l.l} and \Cmd{\L.L} behave as in \pkg{babel} to type a geminated l, as in \textit{co\l.laborar}. \new{v1.1.1}
-% In polyglossia the same can also be achieved with \Cmd{\l·l} and \Cmd{\L·L}.\footnote{ %
-% NB: · is the glyph U+00B7 MIDDLE DOT.}
+% \item \TB{babelshorthands} = \textit{false} or true. \new{v1.45}
+% if this is turned on, the following shorthands for Czech are activated:
+% \begin{shorthands}
+% \item[¦"=¦] for an explicit hyphen sign which is repeated at the beginning
+% of the next line when hyphenated, as common in Czech typesetting
+% (also see option ¦splithyphens¦).
+% \item[¦"‘¦] for Czech left double quotes (looks like ,,).
+% \item[¦"’¦] for Czech right double quotes (looks like “).
+% \item[¦">¦] for Czech left double guillemets (looks like >>).
+% \item[¦"<¦] for Czech right double guillemets (looks like <<).
+% \end{shorthands}
+% \item \TB{splithyphens} = \textit{false} or true. \new{v1.45}
+% According to Czech 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}).\\
+% If this option is true, this is done automatically (so the shorthand ¦"=¦ is not needed).
+% Note, however, that the option is only available for \XeTeX. If you are using \LuaTeX,
+% load the \pkg{luavlna} package to the same effect.
+% \item \TB{vlna} = \textit{false} or true. \new{v1.45}
+% According to Czech typesetting conventions, single-letter words (non-syllable prepositions)
+% must not occur at line ends.\\
+% If this option is true, this is taken care of. Note, however, that the option
+% is only available for \XeTeX. If you are using \LuaTeX, load the \pkg{luavlna} package
+% to the same effect.
% \end{itemize}
%
% \subsection{dutch}\label{dutch}
-% \textbf{Options:}
+% \paragraph*{Options:}
% \begin{itemize}
% \item \TB{babelshorthands} = \textit{false} or true. \new{v1.1.1}
-% if this is turned on, all shorthands defined in \pkg{babel}
-% for fine-tuning the hyphenation of Dutch words are activated.
-% \begin{itemize}
-% \item ¦"-¦ for an explicit hyphen sign, allowing hyphenation in the rest of the word
-% \item ¦"~¦ for a compound word mark without a breakpoint
-% \item ¦"|¦ disables the ligature at this position
-% \item ¦""¦ is like ¦"-¦, but produces no hyphen sign
-% (for compound words with a hyphen, e.g., ¦foo-""bar¦)
-% \item ¦"/¦ to enable hyphenation in two words written together but separated by a slash.
-% \item In addition, the macro \Cmd\- is redefined to allow hyphens in the rest of the word.
-% \end{itemize}
+% if this is turned on, the following shorthands defined for fine-tuning hyphenation and
+% micro-typography of Dutch words are activated:
+% \begin{shorthands}
+% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
+% in the hyphenation patterns (as opposed to ¦\-¦ in default \TeX).
+% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
+% cases where the hyphen should stick at the following syllable.
+% \item[¦"|¦] disables a ligature at this position.
+% \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 ¦\slash¦,
+% hyphenation at the breakpoints preset in the hyphenation patterns is still allowed.
+% \end{shorthands}
+% In addition, the macro \Cmd\- is redefined to allow hyphens in the rest of the word (equivalent to ¦"-¦).
% \end{itemize}
%
% \subsection{english}\label{english}
-% \textbf{Options}:
+% \paragraph*{Options:}
% \begin{itemize}
-% \item \TB{variant} = \textit{american} (= us), usmax (same as ‘american’ but with additional hyphenation patterns), british (= uk), australian or newzealand
+% \item \TB{variant} = \textit{american} (= us), usmax (same as ‘american’ but with additional hyphenation patterns),
+% british (= uk), australian, canadian\new{v1.45} or newzealand
% \item \TB{ordinalmonthday} = true/\textit{false} (true by default only when variant = british)
% \end{itemize}
%
% \subsection{esperanto}\label{esperanto}
-% \textbf{Commands}:
+% \paragraph*{Commands:}
% \begin{itemize}
-% \item \Cmd\hodiau\ and \Cmd\hodiaun are special forms of \cmd\today\ (see the \pkg{babel} documentation)
+% \item \Cmd\hodiau\ and \Cmd\hodiaun are special forms of \cmd\today. The former produces the date in Esperanto
+% preceded by the article (\emph{la}), which is the most common date format.
+% The latter produces the same date format in accusative case.
% \end{itemize}
%
-% \subsection{farsi}\label{farsi}
-% \textbf{Options}:
-% \begin{itemize}
-% \item \TB{numerals} = western or \textit{eastern}
-% \item \TB{locale} (not yet implemented)
-% \item \TB{calendar} (not yet implemented)
-% \end{itemize}
-% \textbf{Commands}:
-% \begin{itemize}
-% \item \Cmd\abjad (see section \ref{abjad})
-% \item \Cmd\aemph (see section \ref{arabic}).
-% \end{itemize}
+% \subsection{finnish}\label{finnish}
+% \paragraph*{Options:}
+% \begin{itemize}
+% \item \TB{babelshorthands} = \textit{false} or true. \new{v1.45}
+% if this is turned on, the following shorthands for fine-tuning hyphenation and micro-typography
+% of Finnish words are activated:
+% \begin{shorthands}
+% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
+% in the hyphenation patterns (as opposed to ¦\-¦).
+% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
+% cases where the hyphen should stick at the following syllable.
+% \item[¦"|¦] disables a ligature at this position.
+% \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 ¦\slash¦,
+% hyphenation at the breakpoints preset in the hyphenation patterns is still allowed.
+% \end{shorthands}
+% \end{itemize}
%
-% \subsection{french}\label{french}\new{v1.5.0}
-% \textbf{Options}:
+% \subsection{french}\label{french}
+% \paragraph*{Options:}
% \begin{itemize}
-% \item \TB{automaticspacesaroundguillemets} = true or \textit{false} (default value = true. Adds space after the opening guillemets and before the closing guillemets. Such space is usually not typed in source code, and you should let polyglossia add it. However, if your source code contains such space, you can set this option to false.)
-% \item \TB{frenchfootnote} = true or \textit{false} (default value = true. Determines whether the footnote mark starting the footnote is normal script followed by a dot (default) or superscript without a dot.)
+% \item\TB{variant} = \textit{french} or canadian (=~acadian).\new{v1.45}
+% Currently, the three variants do not differ; they are supported for compatibility with \pkg{babel} (where they do not differ either).
+% \item \TB{autospacing} = true or \textit{false} (default value = true). One of the most distinct features of French typography is the addition
+% of extra spacing around punctuation and quotation marks (guillemets). By default, polyglossia adds these spaces automatically, so you don't need
+% to enter them. This options allows you to switch this feature off globally.
+% \item \TB{autospaceguillemets}\footnote{Up to version 1.44, the option was called \textit{automaticspacesaroundguillemets}. For backards compatibility reasons, the more verbose old option is still supported.} = true or \textit{false} (default value = true). If you only want to disable the automatic addition of spacing after opening and before closing guillemets (and not at punctuation), set this to \textit{false}. Note
+% that the more general option \textit{autospacing} overrides this.
+% \item \TB{autospacetypewriter}\footnote{Babel's syntax \textit{OriginalTypewriter} is also supported.}\new{1.45} = true or \textit{false} (default value = true). By default, automatic spacing is disabled in typewriter font. If this is enabled, spacing in typewriter context is the same as with roman and sans serif font, depending on the \textit{autospacing} and \textit{autospaceguillemets} settings (note that this was the default up to v.~1.44).
+% \item \TB{frenchfootnote} = true or \textit{false} (default value = true). If \textit{true}, footnotes start with a non-superscripted number followed by a dot, as common in French typography. Note that this might interfere with the specific footnote handling of classes or packages.
+% Also note that this option is only functional (by design) if French is the main language.
% \end{itemize}
+% \paragraph*{Commands:}
+% \begin{itemize}
+% \item \Cmd\NoAutoSpacing\new{v1.45} disables automatic spacing around punctuation and quotation marks in all following text. The command can also be used locally if braces are used for grouping: ¦{\NoAutoSpacing foo:bar}¦
+% \item \Cmd\AutoSpacing\new{v1.45} enables automatic spacing around punctuation and quotation marks in all following text. The command can also be used locally if braces are used for grouping: ¦{\AutoSpacing regarde!}¦
+% \end{itemize}
+%
+% \subsection[gaelic]{gaelic\new{v1.45}}\label{gaelic}
+% \paragraph*{Options:}
+% \begin{itemize}
+% \item \TB{variant} = \textit{irish} or scottish
+% \end{itemize}
%
% \subsection{german}\label{german}
-% \textbf{Options}:
+% \paragraph*{Options:}
% \begin{itemize}
% \item\TB{variant} = \textit{german}, austrian or swiss.\new{v1.33.4}
% Setting variant=austrian or variant=swiss uses some lexical variants.
@@ -653,39 +872,43 @@ issues and follow progress.
% the file \texttt{language.dat} that comes with \TeX Live 2008 and later.
% \item\TB{babelshorthands} = \textit{false} or true: \new{v1.0.3}
% if this is turned on, all shorthands defined in \pkg{babel}
-% for fine-tuning the hyphenation of German words are activated.
-% \begin{itemize}
-% \item ¦"ck¦ for ¦ck¦ to be hyphenated as ¦k-k¦
-% \item ¦"ff¦ for ¦ff¦ to be hyphenated as ¦ff-f¦; this is also available for the letters l, m, n, p, r and t
-% \item ¦"|¦ disables the ligature at this position
-% \item ¦"-¦ for an explicit hyphen sign, allowing hyphenation in the rest of the word
-% \item ¦""¦ is like ¦"-¦, but produces no hyphen sign
-% (for compound words with a hyphen, e.g., ¦foo-""bar¦)
-% \item ¦"~¦ for a compound word mark without a breakpoint
-% \item ¦"=¦ for a compound word mark with a breakpoint,
-% allowing hyphenation in the composing words.
-% \item ¦"/¦ a slash that allows for a line break and maintains hyphenation points.
-% \end{itemize}
+% for fine-tuning hyphenation and micro-typography of German words are activated.
+% \begin{shorthands}
+% \item[¦"ck¦] for ¦ck¦ to be hyphenated as ¦k-k¦ (1901 spelling).
+% \item[¦"ff¦] for ¦ff¦ to be hyphenated as ¦ff-f¦ (1901 spelling); this is also available
+% for the letters l, m, n, p, r and t.
+% \item[¦"|¦] disables a ligature at this position (\eg ¦Auf"|lage¦).
+% \item[¦"=¦] for an explicit hyphen with a breakpoint, allowing for hyphenation at the
+% other points preset in the hyphenation patterns (as opposed to plain ¦-¦).
+% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
+% cases where the hyphen should stick at the following syllable,\eg ¦bergauf und "~ab¦.
+% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
+% in the hyphenation patterns (as opposed to ¦\-¦).
+% \item[¦""¦] allows for a line break at this position (without hyphenation sign);
+% \eg ¦(pseudo"~)""wissenschaftlich¦.
+% \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to ¦\slash¦, hyphenation at the breakpoints
+% preset in the hyphenation patterns is still allowed.
+% \end{shorthands}
%
% There are also four shorthands for quotation signs:
-% \begin{itemize}
-% \item ¦"`¦ for German left double quotes („)
-% \item ¦"'¦ for German right double quotes (“)
-% \item ¦"<¦ for French left double quotes («)
-% \item ¦">¦ for French right double quotes (»).
-% \end{itemize}
+% \begin{shorthands}
+% \item[¦"`¦] for German left double quotes („)
+% \item[¦"'¦] for German right double quotes (“)
+% \item[¦"<¦] for French left double quotes («)
+% \item[¦">¦] for French right double quotes (»).
+% \end{shorthands}
% \item\TB{script} = \textit{latin} or fraktur.\new{v1.2.0}
% Setting script=fraktur modifies the captions for typesetting German in Fraktur.
% \end{itemize}
%
% \subsection{greek}\label{greek}
-% \textbf{Options}:
+% \paragraph*{Options:}
% \begin{itemize}
% \item \TB{variant} = \textit{monotonic} (= mono), polytonic (= poly), or ancient
% \item \TB{numerals} = \textit{greek} or arabic
% \item \TB{attic} = \textit{false}/true
% \end{itemize}
-% \textbf{Commands}:
+% \paragraph*{Commands:}
% \begin{itemize}
% \item \Cmd\Greeknumber and \Cmd\greeknumber \ (see section \ref{abjad}).
% \item The command \Cmd\atticnumeral (= \Cmd\atticnum) (activated with
@@ -696,133 +919,274 @@ issues and follow progress.
% \end{itemize}
%
% \subsection{hebrew}\label{hebrew}
-% \textbf{Options}:
+% \paragraph*{Options:}
% \begin{itemize}
% \item \TB{numerals} = hebrew or \textit{arabic}
% \item \TB{calendar} = hebrew or \textit{gregorian}
+% \item \TB{marcheshvan} = true or \textit{false} (default value = true). If true, the second month of the civil year will be output as \texthebrew{מרחשון} (Marcheshvan)
+% rather than \texthebrew{חשון} (Heshvan), which is the default.
% \end{itemize}
-% \textbf{Commands}:
+% \paragraph*{Commands:}
% \begin{itemize}
% \item \Cmd\hebrewnumeral\ (= \Cmd\hebrewalph) (see section \ref{abjad}).
% \item \Cmd\aemph (see section \ref{arabic}).
% \end{itemize}
%
-% \subsection{hindi}\label{hindi}\new{v1.2.0}
-% \textbf{Options}:
+% \subsection[hindi]{hindi\new{v1.2.0}}\label{hindi}
+% \paragraph*{Options:}
% \begin{itemize}
% \item \TB{numerals} = Western or \textit{Devanagari}
% \end{itemize}
%
+% \subsection{hungarian}\label{hungarian}
+% \paragraph*{Commands:}
+% \begin{itemize}
+% \item \Cmd\ontoday\ (= \Cmd\ondatehungarian): special form of \cmd\today\ which produces a slightly different
+% date format as used in prepositional phrases (such as ‘on February 10th’) in Hungarian.
+% \end{itemize}
+%
% \subsection{italian}\label{italian}
-% \textbf{Option:}
+% \paragraph*{Options:}
% \begin{itemize}
% \item \TB{babelshorthands} = \textit{false} or true. \new{v1.2.0cc}% TODO: check version
-% Activates the ¦"¦ character as a switch to perform etymological
-% hyphenation when followed by a letter, or other tasks when followed by
-% certain analphabetic characters; in particular ¦""¦ is used to enter
-% double raised open quotes (the Italian keyboard misses the backtick),
-% and ¦"<¦ and ¦">¦ to insert open and closed guillemets without any
-% spacing after the open or before the closed sign. ¦"/¦ is made
-% equivalent to \slash allowing a linebreak after the slash without any
-% hyphen sign; ¦"-¦ produces a short rule/hyphen and a discretional line
-% break alowing line breaks in the second compound word fragment.
+% Activates the ¦"¦ character as a switch to perform etymological
+% hyphenation when followed by a letter. Furthermore, the following shorthands are activated:
+% \begin{shorthands}
+% \item[¦""¦] double raised open quotes (the Italian keyboard misses the backtick).
+% \item[¦"<¦] open guillemet (looks like <<).
+% \item[¦">¦] closing guillemet (looks like >>).
+% \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to ¦\slash¦,
+% hyphenation at the breakpoints preset in the hyphenation patterns is still allowed.
+% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
+% in the hyphenation patterns (as opposed to ¦\-¦).
+% \end{shorthands}
% \end{itemize}
%
-% \subsection{korean}\label{korean}\new{v1.40.0}
-% The language definition file includes U. S. hyphenation patterns in order to
-% enable hyphenation when writing English within Korean text.
+% \subsection[korean]{korean\new{v1.40.0}}\label{korean}
+% \paragraph*{Options:}
+% \begin{itemize}
+% \item \TB{variant} = \textit{plain}, classic or modern:
+% for spacing before/after CJK punctuations.
+% `classic' is suitable for text with no interword spaces,
+% `modern' for text with interword spaces.
+% \item \TB{captions} = \textit{hangul} or hanja
+% \end{itemize}
+%
+% \subsection[kurdish]{kurdish\new{v1.45}}\label{kurdish}
+% Kurdish support includes Sorani Kurdish and Kurmanji Kurdish, both in either Arabic or Latin script.
+%
+% \paragraph*{Options:}
+% \begin{itemize}
+% \item \TB{variant} = kurmanji or \textit{sorani}
+% \item \TB{script} = Arabic or Latin. Defaults are ¦Arabic¦ for Sorani and ¦Latin¦ for Kurmanji.
+% \item \TB{numerals} = western or eastern. Defaults are ¦western¦ for Latin and ¦eastern¦ for Arabic script, depending on the selection above.
+% \item \TB{abjadjimnotail} = \textit{false} or true.
+% Set this to true if you want the \textit{abjad} form of the number three to be \textarabic{ج‍} – as in the manuscript tradition – instead of the modern usage \textarabic{ج}.
+% \item \TB{locale} (not yet implemented)
+% \item \TB{calendar} (not yet implemented)
+% \end{itemize}
+% \paragraph*{Commands:}
+% \begin{itemize}
+% \item \Cmd\ontoday: special form of \cmd\today\ which produces a slightly different
+% date format as used in prepositional phrases (as in ‘on February 10th’). Only available for Latin script.
+% \item \Cmd\abjad (see section \ref{abjad})
+% \item \Cmd\aemph (see section \ref{arabic})
+% \end{itemize}
%
-% \subsection{lao}\label{lao}\new{v1.2.0}
-% \textbf{Options}:
+% \subsection[lao]{lao\new{v1.2.0}}\label{lao}
+% \paragraph*{Options:}
% \begin{itemize}
% \item \TB{numerals} = lao or \textit{arabic}
% \end{itemize}
%
% \subsection{latin}\label{latin}
-% \textbf{Options}:
+% \paragraph*{Options:}
% \begin{itemize}
% \item \TB{variant} = classic, medieval or \textit{modern}
% \end{itemize}
%
-% \subsection{lsorbian and usorbian}\label{lsorbian}\label{usorbian}
-% \textbf{Commands}:
-% \begin{itemize}
-% \item \Cmd\oldtoday : see the \pkg{babel} documentation.
-% \end{itemize}
+% \subsection{malay}\label{malay}
+% \paragraph*{Options:}
+% \begin{itemize}
+% \item \TB{variant}\new{v1.45} = \textit{indonesian} (=~bahasai in \pkg{babel}) or
+% malaysian (=~bahasam in \pkg{babel})
+% \end{itemize}
%
-% \subsection{magyar}\label{magyar}
-% \textbf{Commands}:
-% \begin{itemize}
-% \item \Cmd\ontoday\ (= \Cmd\ondatemagyar): special forms of \cmd\today\
-% (see the \pkg{babel} documentation).
-% \end{itemize}
+% \subsection[mongolian]{mongolian\new{v1.45}}\label{mongolian}
+% Currently, only the Khalkha variety in Cyrillic script is supported.
%
+% \paragraph*{Options:}
+% \begin{itemize}
+% \item \TB{babelshorthands} = \textit{false} or true.
+% If this is turned on, the following shorthands are activated:
+% \begin{shorthands}
+% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
+% in the hyphenation patterns (as opposed to ¦\-¦).
+% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
+% cases where the hyphen should stick at the following syllable.
+% \item[¦"|¦] disables a ligature at this position.
+% \item[¦""¦] allows for a line break at this position (without hyphenation sign).
+% \item[¦"---¦] Cyrillic emdash in plain text.
+% \item[¦"--~¦] Cyrillic emdash in compound names (surnames).
+% \item[¦"--*¦] Cyrillic emdash for denoting direct speech.
+% \item[¦",¦] thinspace for initials with a breakpoint in following surname.
+% \item[¦"‘¦] for German left double quotes (looks like ,,).
+% \item[¦"’¦] for German right double quotes (looks like “).
+% \item[¦"<¦] for French left double quotes (looks like <<).
+% \item[¦">¦] for French right double quotes (looks like >>).
+% \end{shorthands}
+% \item \TB{numerals} = \textit{arabic} or cyrillic. Uses either Arabic numerals or Cyrillic
+% alphanumerical numbering.
+% \end{itemize}
+% ^^A
+% \paragraph*{Commands:}
+% \begin{itemize}
+% \item \Cmd\Asbuk: produces uppercased Cyrillic alphanumerals, for
+% environments such as ¦enumerate¦. The command takes a counter as argument,
+% \eg ¦\textrussian{\Asbuk{page}}¦ produces \textrussian{\Asbuk{page}}.
+% \item \Cmd\asbuk: same in lowercase
+% \end{itemize}
+%
+% \subsection{norwegian}\label{norwegian}
+% \paragraph*{Options:}
+% \begin{itemize}
+% \item \TB{variant}\new{v1.45} = bokmal (=~`norsk' in \pkg{babel}) or \textit{nynorsk}
+% \end{itemize}
+%
+% \subsection{persian}\label{persian}
+% \paragraph*{Options:}
+% \begin{itemize}
+% \item \TB{numerals} = western or \textit{eastern}
+% \item \TB{abjadjimnotail} = \textit{false} or true. \new{v1.0.3}
+% Set this to true if you want the \textit{abjad} form of the number three to be \textarabic{ج‍} – as in the manuscript tradition – instead of the modern usage \textarabic{ج}.
+% \item \TB{locale} (not yet implemented)
+% \item \TB{calendar} (not yet implemented)
+% \end{itemize}
+% \paragraph*{Commands:}
+% \begin{itemize}
+% \item \Cmd\abjad (see section \ref{abjad})
+% \item \Cmd\aemph (see section \ref{arabic}).
+% \end{itemize}
+%
+% \subsection{portuguese}\label{portuguese}
+% \paragraph*{Options:}
+% \begin{itemize}
+% \item \TB{variant}\new{v1.45} = brazilian or \textit{portuguese}
+% \end{itemize}
%
% \subsection{russian}\label{russian}
-% \textbf{Options}:
+% \paragraph*{Options:}
% \begin{itemize}
-% \item \TB{babelshorthands} = \textit{false} or true. % TODO check and document!
+% \item \TB{babelshorthands} = \textit{false} or true.
+% If this is turned on, the following shorthands are activated:
+% \begin{shorthands}
+% \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
+% in the hyphenation patterns (as opposed to ¦\-¦).
+% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
+% cases where the hyphen should stick at the following syllable.
+% \item[¦"|¦] disables a ligature at this position.
+% \item[¦""¦] allows for a line break at this position (without hyphenation sign).
+% \item[¦"---¦] Cyrillic emdash in plain text.
+% \item[¦"--~¦] Cyrillic emdash in compound names (surnames).
+% \item[¦"--*¦] Cyrillic emdash for denoting direct speech.
+% ^^A These are commented out in gloss-russian
+% ^^A \item[¦",¦] thinspace for initials with a breakpoint in following surname.
+% ^^A \item[¦"‘¦] for German left double quotes (looks like ,,).
+% ^^A \item[¦"’¦] for German right double quotes (looks like “).
+% ^^A \item[¦"<¦] for French left double quotes (looks like <<).
+% ^^A \item[¦">¦] for French right double quotes (looks like >>).
+% \end{shorthands}
% \item \TB{spelling} = \textit{modern} or old (for captions and date only, not for hyphenation)
+% \item \TB{numerals} = \textit{arabic} or cyrillic. Uses either Arabic numerals or Cyrillic
+% alphanumerical numbering.
% \end{itemize}
-%
-% \textbf{Commands}:
+% ^^A
+% \paragraph*{Commands:}
% \begin{itemize}
-% \item \Cmd\Asbuk: produces the uppercase Russian alphabet, for
-% environments such as ¦enumerate¦
+% \item \Cmd\Asbuk: produces uppercased Cyrillic alphanumerals, for
+% environments such as ¦enumerate¦. The command takes a counter as argument,
+% \eg ¦\textrussian{\Asbuk{page}}¦ produces \textrussian{\Asbuk{page}}.
% \item \Cmd\asbuk: same in lowercase
% \end{itemize}
%
+% \subsection[sami]{sami\new{v1.45}}\label{sami}
+% Currently support for Sami is limited to Northern Sami.
+%
% \subsection{sanskrit}\label{sanskrit}
-% \textbf{Options}:
+% \paragraph*{Options:}
% \begin{itemize}
-% \item \TB{Script} (default = Devanagari). \new{v1.0.2}
-% The value is passed to \pkg{fontspec} in cases where ¦\sanskritfont¦ or
-% ¦\devanagarifont¦ are not defined. This can be useful if you typeset
-% Sanskrit texts in scripts other than Devanagari.
-% ^^ATODO \item Numerals <<<<
+% \item \TB{Script} = \textit{Devanagari}\new{v1.0.2}, Gujarati, Malayalam, Bengali, Kannada,
+% Telugu or Latin.
+% The value is passed to \pkg{fontspec} in cases where the respective ¦\<script>font¦ is not defined.
+% This can be useful if you typeset Sanskrit texts in scripts other than Devanagari.
+% \item \TB{Numerals} = \textit{Devanagari}\new{v1.45} or Western
% \end{itemize}
-% \pkg{polyglossia} currently supports the typesetting of Sanskrit in the
-% following writing systems: Devanagari, Gujarati, Malayalam, Bengali, Kannada,
-% Telugu, and Latin. Use the ¦Script=¦ option to select the writing system
-% you want, and enter your input in that script.
%
% \subsection{serbian}\label{serbian}
-% \textbf{Options}:
+% \paragraph*{Options:}
% \begin{itemize}
-% \item \TB{script} = \textit{cyrillic} or latin
+% \item \TB{Script} = \textit{Cyrillic} or Latin. Will likely go to a variant.
+% \item \TB{numerals} = \textit{arabic} or cyrillic. Uses either Arabic numerals or Cyrillic
+% alphanumerical numbering.
% \end{itemize}
+% \paragraph*{Commands:}
+% \begin{itemize}
+% \item \Cmd\Asbuk: produces uppercased Cyrillic alphanumerals, for
+% environments such as ¦enumerate¦. The command takes a counter as argument,\\
+% Example: ¦\textserbian[numerals=cyrillic]{\Asbuk{page}}¦ produces \textserbian[numerals=cyrillic]{\Asbuk{page}}.
+% \item \Cmd\asbuk: same in lowercase
+% \end{itemize}
+%
%
% \subsection{slovenian}\label{slovenian}
-% \textbf{Options}:
+% \paragraph*{Options:}
% \begin{itemize}
-% \item \TB{localaph} = true \textit{false}
+% \item \TB{localalph} = true or \textit{false}
% \end{itemize}
%
+% \subsection{sorbian}\label{sorbian}
+% \paragraph*{Options:}
+% \begin{itemize}
+% \item \TB{variant}\new{v1.45} = lower or \textit{upper}
+% \item \TB{olddate}\new{v1.45} = true or \textit{false} (default value = true). If true, ¦\today¦
+% will use traditional Sorbian month names (\ie it will be synonymous to ¦\oldtoday¦ below)
+% \end{itemize}
+% \paragraph*{Commands:}
+% \begin{itemize}
+% \item \Cmd\oldtoday: outputs the current date using traditional Sorbian month names, even if \TB{olddate} is false.
+% \end{itemize}
+%
% \subsection{syriac}\label{syriac}
-% \textbf{Options}:
+% \paragraph*{Options:}
% \begin{itemize}
% \item \TB{numerals} = \textit{western} (i.e., 1234567890), eastern
% (for which the Oriental Arabic numerals are used: \textarabic{١٢٣٤٥٦٧٨٩٠}),
% or abjad. \new{v1.0.1}.
% \end{itemize}
-% \textbf{Commands}:
+% \paragraph*{Commands:}
% \begin{itemize}
% \item \Cmd\abjadsyriac (see section \ref{abjad})
% \item \Cmd\aemph (see section \ref{arabic}).
% \end{itemize}
%
% \subsection{thai}\label{thai}
-% \textbf{Options}:
+% \paragraph*{Options:}
% \begin{itemize}
% \item \TB{numerals} = thai or \textit{arabic}
% \end{itemize}
-%
-% To insert the word breaks, you need to use an external processor.
+% ^^A
+% To insert word breaks, you need to use an external processor.
% See the documentation to \pkg{thai-latex} and the file \file{testthai.tex}
% that comes with this package.
%
-% \subsection{ukrainian}\label{russian}
-% \textbf{Commands}:
+% \subsection{tibetan}\label{tibetan}
+% \paragraph*{Options:}
+% \begin{itemize}
+% \item \TB{numerals} = tibetan or \textit{arabic}
+% \end{itemize}
+%
+% \subsection{ukrainian}\label{ukrainian}
+% \paragraph*{Commands:}
% \begin{itemize}
% \item \Cmd\Asbuk: produces the uppercase Ukrainian alphabet, for
% environments such as ¦enumerate¦
@@ -830,79 +1194,228 @@ issues and follow progress.
% \end{itemize}
%
% \subsection{welsh}\label{welsh}
-% \textbf{Options}:
+% \paragraph*{Options:}
% \begin{itemize}
% \item \TB{date} = long or \textit{short}
% \end{itemize}
%
-% \section{Modifying or extending captions and date formats}
%
-% To redefine internal macros, you can use the command ¦\gappto¦ from the package
-% \pkg{etoolbox}. For compatibility with \pkg{babel} the command ¦\addto¦ is also available
-% with the same effect. For instance, to change the ¦\chaptername¦ for language ¦lingua¦,
+% \section{Modifying or extending captions, date formats and language settings}
+%
+% \pkg{Polyglossia} uses the following macros to define language-specific captions
+% (\ie strings such as ``chapter''), date formats and additional language settings
+% (¦⟨lang⟩¦ is to be replaces with the respective language name):
+%
+% \begin{itemize}
+% \item \Cmd{\captions⟨lang⟩} stores definitions of caption strings
+% (such as, in the case of English, ¦\def\chaptername{Chapter}¦)
+% \item \Cmd{\date⟨lang⟩} stores definitions of date formats (usually redefinitions
+% of ¦\today¦, in some cases also definitions of additional date commands)
+% \item \Cmd{\blockextras⟨lang⟩} stores macros that are to be executed when the language
+% ⟨lang⟩ is activated via ¦\selectlanguage¦ command or the ¦⟨lang⟩¦ environment
+% \item \Cmd{\inlineextras⟨lang⟩} stores macros that are to be executed when the language
+% ⟨lang⟩ is activated locally via ¦\text⟨lang⟩¦ command
+% \item \Cmd{\noextras⟨lang⟩} stores macros that are to be executed when the language
+% ¦⟨lang⟩¦ is closed
+% \end{itemize}
+% ^^A
+% In order to redefine internal macros, we recommend to use the command ¦\gappto¦.
+% For compatibility with \pkg{babel} the command ¦\addto¦ is also available
+% to the same effect. For instance, to change the ¦\chaptername¦ for language ¦lingua¦,
% you can do this:
% \begin{verbatim}
-% \gappto\captionslingua{\renewcommand{\chaptername}{Caput}}
+% \gappto\captionslingua{\def\chaptername{Caput}}
% \end{verbatim}
+% ^^A
+% Note that this needs to be done after the respective language has been loaded with
+% ¦\setmainlanguage¦ or ¦\setotherlanguage¦.
+%
+% Specifically for package authors, analogous commands are provided which are only executed
+% if a specific language \emph{variety} is used. As opposed to the macros above, these refer
+% to babel names. Other than that, the function is identical:
+%
+% \begin{itemize}
+% \item \Cmd{\captions@bbl@⟨babelname⟩}
+% \item \Cmd{\date@bbl@⟨babelname⟩}
+% \item \Cmd{\blockextras@bbl@⟨babelname⟩}
+% \item \Cmd{\inlineextras@bbl@⟨babelname⟩}
+% \item \Cmd{\noextras@bbl@⟨babelname⟩}
+% \end{itemize}
+% ^^A
+% By default, these macros are undefined. If they are defined (\eg by an external package),
+% they will be executed after their respective ¦⟨lang⟩¦ counterpart and thus can be used to
+% overwrite definitions of the former. Again, use ¦\gappto¦ to define\slash modify these macros.
+% For instance, to add a new caption ¦\footnotename¦ to the Swiss variety of German (babel name
+% ¦nswissgerman¦), you can do this:
+% \begin{verbatim}
+% \gappto\captions@bbl@nswissgerman{\def\footnotename{Fussnote}}
+% \end{verbatim}
+% ^^A
+% If you do this in a document preamble rather than in a package, you need to embrace the redefinition
+% by ¦\makeatletter¦ and ¦\makeatother¦ due to the ¦@¦ in the macro names.
%
-% \section{Non-Western decimal digits}
+% \section{Script-specific numbering}
%
-% Several scripts have their own versions of the decimal digits commonly called
-% ‘Arabic numerals’. With the appropriate language option set, \pkg{polyglossia}
+% Languages and scripts have specific numbering conventions. Some use decimal digits
+% (\eg Arabic numerals), some use alphabetic or alphanumerical notation (\eg Roman numbering).
+% In some cases, different conventions are available (\eg Mashriq or Maghrib numbering
+% in Arabic script, Arabic or Hebrew [=~alphanumeric] numbering in Hebrew).
+%
+% If the latter is the case, \pkg{polyglossia} provides language options which allow you to select
+% or switch to the suitable convention. With the appropriate language option set, \pkg{polyglossia}
% will automatically convert the output of internal \LaTeX\ counters to their
% localized forms, for instance to display page, chapter and section numbers.
%
-% In previous versions this conversion was achieved my means of TECKit fontmappings.
-% If needed they can be activated with the fontspec ¦Mapping¦ option,
+% For manual input of numbers, macros are provided. These convert Arabic numeric input to the respective
+% local decimal digit (see sec.~\ref{sec:decdigit}), alphanumeric representation (see sec.~\ref{abjad})
+% or whatever is appropriate (see sec.~\ref{sec:localnumber}). The possibilities are described in turn.
+%
+% \subsection{General localization of numbering}\label{sec:localnumber}
+%
+% As of 1.45,\new{1.45} \pkg{polyglossia} provides a generic macro \Cmd\localnumeral\ which converts numbers
+% to the current local form (which might be script-specific decimal digit, an alphabetic numbering or something else).
+% For instance in an Arabic environment
+% ¦\localnumeral{42}¦ yields \textarabic{\localnumeral{42}}, whereas in an Hebrew environment, it
+% results in \texthebrew[numerals=hebrew]{\localnumeral{42}} with ¦numerals=hebrew¦, and \texthebrew{\localnumeral{42}}
+% with ¦numerals=arabic¦. Note that, as opposed to the various ¦digits¦ macros (described in sec.~\ref{sec:decdigit}),
+% the argument of ¦\localnumeral¦ must consist of numbers only.
+%
+% For\new{1.45} the conversion of counters, the starred version \Cmd{\localnumeral*} is provided. This takes a counter as argument.
+% For instance in an Arabic environment ¦\localnumeral*{page}¦ yields \textarabic{\localnumeral*{page}}.
+%
+% For scripts with alphanumeric numbering, the variants \Cmd{\Localnumeral} and \Cmd{\Localnumeral*} provide the uppercased
+% versions.\medskip
+%
+% \noindent All these macros provide the following options:
+%
+% \begin{itemize}
+% \item \TB{lang} =\DescribeMacro{[lang=]}\ \textit{local}, main, or <language>.\\
+% Output number in the local form of the currently active language for ¦local¦, the main language of the document for ¦main¦,
+% and any (loaded) language for ¦<language>¦ (\eg ¦\localnumeral[lang=arabic]{42}}¦).
+% \end{itemize}
+%
+% \subsection{Non-Western decimal digits}\label{sec:decdigit}
+%
+% In addition\new{v1.1.1} to the generic macros described above, \pkg{polyglossia} provides language-specific conversion macros
+% which can be used if the generic ones do not suit the need.\footnote{%
+% A third method are so-called TECKit fontmappings.
+% Those can be activated with the \pkg{fontspec} ¦Mapping¦ option,
% using ¦arabicdigits¦, ¦farsidigits¦ or ¦thaidigits¦.
% For instance if \cmd\arabicfont\ is defined with the option ¦Mapping=arabicdigits¦,
-% then by typing ¦\textarabic{2010}¦ one will obtain \textarabic{٢٠١٠}.
-%
-% With version v1.1.1\new{v1.1.1} the same conversion is achieved directly by
-% simple \TeX\ macros. This prevents some problems that occur when the value of a
-% counter has to be written and read from auxiliary files.\footnote{ %
-% For instance the package \pkg{lastpage} did not work with \pkg{polyglossia} in situations
-% where the display of counters was redefined to include a font-switching command.}
-% These macros (currently \Cmd\arabicdigits, \Cmd\farsidigits\ and \Cmd\thaidigits\ are provided)
-% are also available to the users. For instance in an Arabic environment
-% ¦\arabicdigits{9182/738543-X}¦ yields
-% \textarabic{\arabicdigits{9182/738543-X}}.
-%
-% \section{Alphabetic numbering in Greek, Arabic, Hebrew, Syriac and Farsi}\label{abjad}
-%
-% In certain languages, numbers can be represented
-% by a special alphanumerical notation.\footnote{ %
-% See, e.g., \url{http://en.wikipedia.org/wiki/Greek_numerals},
+% typing \cmd{\textarabic\{2010\}} results in \textarabic{٢٠١٠}. Note that this method has some drawbacks, though,
+% for instance when the value of a counter has to be written and read from auxiliary files.
+% So please use this with care.}
+% The macros have the form ¦\<script>digits¦. They convert Arabic numerical input and leave every other input untouched.
+% In an Arabic context, for instance, ¦\arabicdigits{9182/738543-X}¦ yields \textarabic{\arabicdigits{9182/738543-X}}.
+%
+% Currently, the following macros are provided:
+%
+% \begin{itemize}
+% \item \Cmd\arabicdigits
+% \item \Cmd\bengalidigits
+% \item \Cmd\devanagaridigits
+% \item \Cmd\farsidigits
+% \item \Cmd\kannadadigits
+% \item \Cmd\khmerdigits
+% \item \Cmd\laodigits
+% \item \Cmd\nkodigits
+% \item \Cmd\thaidigits
+% \item \Cmd\tibetandigits
+% \end{itemize}
+%
+%
+% \subsection{Non-Latin alphabetic numbering}\label{abjad}
+%
+% For languages which use special (non-Latin) alphanumerical notation\footnote{%
+% For instance, see \url{http://en.wikipedia.org/wiki/Greek_numerals},
% \url{http://en.wikipedia.org/wiki/Abjad_numerals},
-% and \url{http://en.wikipedia.org/wiki/Hebrew_numerals}.}
-% ^^A \url{http://en.wikipedia.org/wiki/Syriac_alphabet}
+% \url{http://en.wikipedia.org/wiki/Hebrew_numerals},
+% and \url{http://en.wikipedia.org/wiki/Syriac_alphabet}.}, dedicated macros are provided.
%
-% The Greek numerals are obtained with \Cmd\greeknumeral (or \Cmd\Greeknumeral\ in uppercase).
-% Example: ¦\greeknumeral{1863}¦ yields \textgreek{\greeknumeral{1863}}.
+% They work in a similar way than the ¦\<script>digits¦ macros described above: They take Arabic numerical input
+% and output the respective value in the local alphabetic numbering scheme (most of these macros are equivalent
+% to ¦\localnumeral¦ and ¦\Localnumeral¦ in the respective context).
%
-% The Arabic \textit{abjad} numbers can be generated with the command \Cmd\abjad.
-% Example: ¦\abjad{1863}¦ yields \textarabic{\abjad{1863}}.
-% In the Maghrib the conventions are somewhat different, and the maghribi forms
-% of the \textit{abjad} numerals are obtained with the \Cmd\abjadmaghribi\ command.
-% Example: ¦\abjadmaghribi{1863}¦ yields \textarabic{\abjadmaghribi{1863}}.
+% The following macros are provided:
%
-% The code for Hebrew numerals, which was incorrect in previous versions, was
-% ported from the implementation in \pkg{babel} with v1.1.1\new{v1.1.1}, and the
-% user interface is identical to the one in \pkg{babel}.
-% The commands \Cmd\hebrewnumeral, \Cmd\Hebrewnumeral and \Cmd\Hebrewnumeralfinal\ behave exactly
-% as they do in \pkg{babel}: the second command prints the number with \textit{gereshayim} before
-% the last letter, and the latter uses in addition the final forms of Hebrew letters.
-% Examples:
-% ¦\hebrewnumeral{1750}¦ yields \texthebrew{\hebrewnumeral{1750}},
-% ¦\Hebrewnumeral{1750}¦ yields \texthebrew{\Hebrewnumeral{1750}},
-% and ¦\Hebrewnumeralfinal{1750}¦ yields \texthebrew{\Hebrewnumeralfinal{1750}}.
+% \begin{itemize}
+% \item \Cmd\abjad outputs Arabic \textit{abjad} numbers according to the Mashriq varieties.
+% 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\abjadsyriac outputs Syriac abjad numerals.\footnote{%
+% A fine guide to numerals in Syriac can be found at \link{http://www.garzo.co.uk/documents/syriac-numerals.pdf}.}\\
+% Example: ¦\abjadsyriac{463}¦ yields \textsyriac{\abjadsyriac{463}}.
+%
+% \item \Cmd\armeniannumeral produces Armenian alphabetic numbering.
+% Example: ¦\armeniannumeral{1863}¦ yields \textarmenian{\armeniannumeral{1863}}.
+%
+% \item \Cmd\greeknumeral produces Greek alphabetic numbering, \Cmd\Greeknumeral outputs uppercased variants.
+% Example: ¦\greeknumeral{1863}¦ yields \textgreek{\greeknumeral{1863}},
+% ¦\Greeknumeral{1863}¦ results in \textgreek{\Greeknumeral{1863}}.
+%
+% \item \Cmd\hebrewnumeral, \Cmd\Hebrewnumeral and \Cmd\Hebrewnumeralfinal generate variants of Hebrew alphanumeric numerals.
+% The commands behave exactly as they do in \pkg{babel}: ¦\hebrewnumeral¦ outputs the numbers without any decoration,
+% ¦\Hebrewnumeral¦ adds \textit{gereshayim} before the last letter, ¦\Hebrewnumeralfinal¦ uses in addition the final forms of Hebrew letters.
+% Examples:
+% ¦\hebrewnumeral{1750}¦ yields \texthebrew{\hebrewnumeral{1750}},
+% ¦\Hebrewnumeral{1750}¦ yields \texthebrew{\Hebrewnumeral{1750}},
+% and ¦\Hebrewnumeralfinal{1750}¦ yields \texthebrew{\Hebrewnumeralfinal{1750}}.
+%
+% \item \Cmd\russiannumeral produces Russian numbering, with uppercased variant (for alphanumerical variant) via \Cmd\Russiannumeral.
+% Depending on the ¦numerals¦ option in the Russian language selection, this is either Arabic digit or Cyrillic
+% alphanumercial output.\\
+% Example: With ¦numerals=latin¦ ¦\russiannumeral{19}¦ yields \textrussian{\russiannumeral{19}},
+% with ¦numerals=cyrillic¦ ¦\russiannumeral{19}¦ results in \textrussian[numerals=cyrillic]{\russiannumeral{19}}.
+%
+% \item \Cmd\serbiannumeral produces Serbian numbering, with uppercased variant (for alphanumerical variant) via \Cmd\Serbiannumeral.
+% Depending on the ¦numerals¦ option in the Serbian language selection, this is either Arabic digit or Cyrillic
+% alphanumercial output.\\
+% Example: With ¦numerals=latin¦ ¦\serbiannumeral{19}¦ yields \textserbian{\serbiannumeral{19}},
+% with ¦numerals=cyrillic¦ ¦\serbiannumeral{19}¦ results in \textserbian[numerals=cyrillic]{\serbiannumeral{19}}.
+% \end{itemize}
+%
+%
+% \section{Footnotes in right-to-left context}
+%
+% With languages that use right-to-left scripts, footnote apparatuses are usually placed at the right side of the page bottom.
+% Consequently, the footnote rule also is to be placed right. Things get more tricky, though, if right-to-left and left-to-right
+% scripts are mixed. Then you might want to put the footnotes on some pages left, on some right, or even mix positions on a page.
+% Thus, footnote handling in right-to-left context sometimes needs manual intervention. This is described in what follows.
%
+% \subsection{Horizontal footnote position}
%
-% Support is also provided for Syriac abjad numerals, which can be generated
-% with \Cmd\abjadsyriac.\footnote{ %
-% A fine guide to numerals in Syriac can be found at \link{http://www.garzo.co.uk/documents/syriac-numerals.pdf}.}
-% Example: ¦\abjadsyriac{463}¦ yields \textsyriac{\abjadsyriac{463}}.
+% When right-to-left languages are used, the ¦\footnote¦ command becomes sensitive to the text directionality. The footnote is
+% always placed on the side that is currently the origin of direction: on the left side of the page in LTR paragraphs and
+% on the right in RTL paragraphs.
%
+% For cases where this is not desired, two additional footnote commands are provided: \Cmd\RTLfootnote and \Cmd\LTRfootnote.
+% ¦\LTRfootnote¦ always places the footnote on the left side, notwithstanding the current
+% directionality. Likewise, ¦\RTLfootnote¦ always places it on the right side. Like ¦\footnote¦, ¦\RTLfootnote¦
+% and ¦\LTRfootnote¦ provide an optional argument to customize the number.
+%
+%
+% \subsection{Footnote rule length and position}
+%
+% The default placement of the footnote rule differs in \XeTeX\ and \LuaTeX\ output (this is due to differences in the \textsf{bidi}
+% and \textsf{luabidi} packages). With \XeTeX, footnote rules are always placed left, which is often wrong in RTL context.
+% With \LuaTeX, by contrast, the rule is placed always right if the main language is a right-to-left language, and always left
+% if the main language is a left-to-right language, which is the right thing in many cases.
+%
+% In both cases, you can change the default behavior as follows:
+% \begin{itemize}
+% \item Put \Cmd\leftfootnoterule in the preamble to have all rules left-aligned.
+% \item Put \Cmd\rightfootnoterule in the preamble to have all rules right-aligned.
+% \item Put \Cmd\autofootnoterule in the preamble to have automatic placement depending on the context (see below for elaboration).
+% \item Put \Cmd\textwidthfootnoterule in the preamble to have a rule that spans the whole text width.
+% \end{itemize}
+% With ¦\autofootnoterule¦, the first footnote on the current page determines the placement. Note that this automatic can fail with
+% footnotes at page boundaries that differ in directionality from the first footnote on the page. You can work around such cases by switching to ¦\rightfootnoterule¦ or ¦\leftfootnoterule¦ on these pages.
+%
+% Note also that the rule switches might interfere in bad ways with packages or classes that redefine footnotes themselves. This is also the reason
+% why ¦\autofootnoterule¦ is not used by default.
%
% \section{Calendars}
%
@@ -925,8 +1438,7 @@ issues and follow progress.
% \Cmd\Hijritoday\ formats the Hijri date for the current day.
% This command is now locale-aware\new{v1.1.1}: its output will differ depending on the
% currently active language. Presently \pkg{polyglossia}’s language definition files
-% for Arabic, Farsi, Urdu, Turkish, Bahasa Indonesia and Bahasa Melayu
-% provide a localized version of ¦\Hijritoday¦.
+% for Arabic, Farsi, Urdu, Turkish and Malay provide a localized version of ¦\Hijritoday¦.
% If the formatting macro for the current language is undefined, the Hijri date will be formatted
% in Arabic or in roman transliteration, depending of the current writing direction.
% You can define a new format or redefine one with the command
@@ -955,38 +1467,69 @@ issues and follow progress.
%
% ^^A\section{Varia}
%
+% \section{Accessing language information}
+%
+% The following is specifically relevant to package authors who need information about the languages in use.
+%
+% In order to get such information, \pkg{polyglossia} provides the following macros:
+%
+% \begin{itemize}
+% \item \Cmd\languagename\ stores the currently active (polyglossia) language name.
+% \item \Cmd\mainlanguagename\ stores the (polyglossia) language name of the main document language.
+% \item \Cmd\languagevariant\ stores the language variant if set. The macro is empty if no variant has been set.
+% \item \Cmd\mainlanguagevariant\ stores the language variant of the main document language if set.
+% The macro is empty if no variant has been set.
+% \item \Cmd\babelname\ stores the corresponding name of the currently active language (variant) in \pkg{babel}.
+% This might not only be useful if you want to support both \pkg{babel} and \pkg{polyglossia}, but also
+% since this name is unique for a given language variety (\eg ngerman, german, swissgerman etc.).
+% Note that this macro is also defined for languages that are not supported in \pkg{babel}. In that
+% case, they are equal to the polyglossia language name.
+% \item \Cmd\mainbabelname\ analogously stores the name of document's main language (variant) in \pkg{babel}.
+% \end{itemize}
+% ^^A
+% If you want to have a full list of loaded languages/variants, use the following macros:
+% \begin{itemize}
+% \item \Cmd{\xpg@loaded}\ stores a comma-separated list of all loaded languages (polyglossia name)
+% \item \Cmd{\xpg@vloaded}\ stores a comma-separated list of all loaded variants
+% \item \Cmd{\xpg@bloaded}\ stores a comma-separated list of \pkg{babel} names of all language variants
+% \end{itemize}
+% ^^A
+% Finally, you can test whether a language is loaded by
+% \displaycmd{\iflanguageloaded\{⟨lang⟩\}\{⟨true⟩\}\{⟨false⟩\}}{\iflanguageloaded}
+% where \texttt{⟨lang⟩} is a \pkg{polyglossia} language name, or
+% \displaycmd{\ifbabellanguageloaded\{⟨lang⟩\}\{⟨true⟩\}\{⟨false⟩\}}{\ifbabellanguageloaded}
+% where \texttt{⟨lang⟩} is a \pkg{babel} language name.
%
% \section{Acknowledgements (by François Charette)}
% \pkg{Polyglossia} is notable for being a recycle box of previous contributions
% by other people. I take this opportunity to thank the following individuals,
-% whose splendid work has made my task almost trivial in comparision: Johannes
-% Braams and the numerous contributors to the \pkg{babel}{} package (in particular
-% Boris Lavva and others for its Hebrew support), Alexej Kryukov (\pkg{antomega}), Will
-% Robertson (\pkg{fontspec}), Apostolos Syropoulos (\pkg{xgreek}), Youssef Jabri
-% (\pkg{arabi}), and Vafa Khalighi (\pkg{xepersian} and \pkg{bidi}).
-% The work of Mojca Miklavec and Arthur Reutenauer on hyphenation patterns with their package
+% whose splendid work has made my task almost trivial in comparision: \TA{Johannes
+% Braams} and the numerous contributors to the \pkg{babel} package (in particular
+% \TA{Boris Lavva} and others for its Hebrew support), \TA{Alexej Kryuko}v (\pkg{antomega}),
+% \TA{Will Robertson} (\pkg{fontspec}), \TA{Apostolos Syropoulos} (\pkg{xgreek}), \TA{Youssef Jabri}
+% (\pkg{arabi}), and \TA{Vafa Khalighi} (\pkg{xepersian} and \pkg{bidi}).
+% The work of \TA{Mojca Miklavec} and \TA{Arthur Reutenauer} on hyphenation patterns with their package
% \pkg{hyph-utf8} is of course invaluable. I should also thank other
-% individuals for their assistance in supporting specific languages: Yves Codet
-% (Sanskrit), Zdenek Wagner (Hindi), Mikhal Oren (Hebrew), Sergey Astanin (Russian),
-% Khaled Hosny (Arabic), Sertaç Ö. Yıldız (Turkish), Kamal Abdali (Urdu),
-% and several other members of the \XeTeX\ user community, notably Enrico Gregorio, who
+% individuals for their assistance in supporting specific languages: \TA{Yves Codet}
+% (Sanskrit), \TA{Zdenĕk Wagner} (Hindi), \TA{Mikhal Oren} (Hebrew), \TA{Sergey Astanin} (Russian),
+% \TA{Khaled Hosny} (Arabic), \TA{Sertaç Ö. Yıldız} (Turkish), \TA{Kamal Abdali} (Urdu),
+% and several other members of the \XeTeX\ user community, notably \TA{Enrico Gregorio}, who
% has sent me many useful suggestions and corrections and contributed the ¦\newXeTeXintercharclass¦
% mechanism in xelatex.ini which is now used by polyglossia.
-% More recently, Kevin Godby of the \href{http://ubuntu-manual.org}{Ubuntu Manual} project has
+% More recently, \TA{Kevin Godby} of the \href{http://ubuntu-manual.org}{Ubuntu Manual} project has
% contributed very useful feedback, bug hunting and, with the help of translators,
% new language definition files for Asturian, Lithuanian, Occitan, Bengali, Malayalam, Marathi, Tamil, and Telugu.
% It is particularly heartening to realize that this package is used to typeset a widely-read
% document in dozens of different languages!
-% Support for Lao was also added thanks to Brian Wilson.
-% I also thank Alan Munn for kindly proof-reading the penultimate version of this documentation.
-% And of course my gratitude also goes to Jonathan Kew, the formidable author of \XeTeX!
+% Support for Lao was also added thanks to \TA{Brian Wilson}.
+% I also thank \TA{Alan Munn} for kindly proof-reading the penultimate version of this documentation.
+% And of course my gratitude also goes to \TA{Jonathan Kew}, the formidable author of \XeTeX!
%
% \section{More acknowledgements (by Arthur Reutenauer)}
% Many thanks to all the people who have contributed bugfixes and new features to
-% Polyglossia since I took over. Most of them can be identified from the version
-% control log on \href{https://github.com/reutenauer/polyglossia}{GitHub} and I won’t try to name them
+% Polyglossia since I took over. Most of them can be identified from the contributor statistics on \href{https://github.com/reutenauer/polyglossia/graphs/contributors}{GitHub} and I won’t try to name them
% all (maybe, one day ...); among the ones who sent contributions directly to me
-% I would like to especially thank Claudio Beccari, the indefatigable champion of
+% I would like to especially thank \TA{Claudio Beccari}, the indefatigable champion of
% Romance languages, and beyond!
%
%
@@ -1005,6 +1548,7 @@ issues and follow progress.
\PolyglossiaSetup{albanian}{
hyphennames={albanian},
+ langtag=SQI,
hyphenmins={2,2},
indentfirst=true,
fontsetup=true,
@@ -1278,9 +1822,10 @@ and may look very wrong.}
langtag=ARA,
scripttag=arab,
hyphennames={nohyphenation},
- fontsetup=true
+ fontsetup=true,
+ envname=Arabic,
+ localnumeral=arabicnumerals
%TODO localalph={abjad,abjad}
- %TODO localnumber=arabicnumber
}
\newif\ifeastern@numerals
@@ -1400,6 +1945,9 @@ and may look very wrong.}
\fi%
\fi}}
+
+\newcommand{\arabicnumerals}[2]{\arabicnumber{#2}}
+
\def\arabicnumber#1{%
\ifeastern@numerals
\arabicdigits{\number#1}%
@@ -1445,35 +1993,40 @@ and may look very wrong.}
\ifnum#1=\z@\fi\abj@maghribi@num@iii}
\def\arabic@numbers{%
- \let\@origalph\@alph%
- \let\@origAlph\@Alph%
\let\@alph\abjad%
\let\@Alph\abjad%
}
+
\def\noarabic@numbers{%
- \let\@alph\@origalph%
- \let\@Alph\@origAlph%
- }
+ \let\@alph\latin@alph%
+ \let\@Alph\latin@Alph%
+}
+
+% Store original definition
+\let\xpg@save@arabic\@arabic
\def\arabic@globalnumbers{%
- \let\orig@arabic\@arabic%
\let\@arabic\arabicnumber%
- \renewcommand\thefootnote{\protect\arabicnumber{\c@footnote}}%
- }
+ \renewcommand\thefootnote{\localnumeral*{footnote}}%
+ \renewcommand\theequation{\localnumeral*{equation}}%
+}
-\def\noarabic@globalnumbers{
- \let\@arabic\orig@arabic%
- \renewcommand\thefootnote{\protect\number{\c@footnote}}%
- }
+\def\noarabic@globalnumbers{%
+ \let\@arabic\xpg@save@arabic%
+}
+
+% Save original \MakeUppercase definition
+\let\xpg@save@MakeUppercase\MakeUppercase
\def\blockextras@arabic{%
- \let\orig@MakeUppercase\MakeUppercase%
\def\MakeUppercase##1{##1}%
% TODO disable \@Roman and \@roman ?
- }
+}
+
\def\noextras@arabic{%
- \let\MakeUppercase\orig@MakeUppercase%
- }
+ % restore original \MakeUppercase definition
+ \let\MakeUppercase\xpg@save@MakeUppercase
+}
% \end{macrocode}
% \iffalse
@@ -1492,35 +2045,57 @@ and may look very wrong.}
langtag=HYE,
hyphennames={armenian},
hyphenmins={2,2},
- fontsetup=true
+ fontsetup=true,
+ localnumeral=armeniannumerals
+}
+
+\newif\if@eastern@armenian
+\@eastern@armenianfalse
+\define@choicekey*+{armenian}{variant}[\val\nr]{western,eastern}[western]{%
+ \ifcase\nr\relax
+ % western:
+ \@eastern@armenianfalse%
+ \or
+ % eastern:
+ \@eastern@armeniantrue%
+ \fi
+ \xpg@info{Option: Armenian, variant=\val}%
+}{\xpg@warning{Unknown Armenian variant `#1'}}
+
+\newif\if@armenian@numerals
+\@armenian@numeralsfalse
+\define@key{armenian}{numerals}[armenian]{%
+ \ifstrequal{#1}{arabic}{\@armenian@numeralsfalse}{\@armenian@numeralstrue}%
+}
+
+% Taken from ArmTeX. Audit!
+\def\captionsarmenian{%
+ \def\refname{Հղումներ}%
+ \def\abstractname{Սեղմագիր}%
+ \def\bibname{Գրականություն}%
+ \def\prefacename{Նախաբան}%
+ \def\chaptername{Գլուխ}%
+ \def\appendixname{Հավելված}%
+ \def\contentsname{Բովանդակություն}%
+ \def\listfigurename{Նկարների ցանկ}%
+ \def\listtablename{Աղյուսակների ցանկ}%
+ \def\indexname{Առարկայական ցանկ}%
+ \def\figurename{Նկար}%
+ \def\tablename{Աղյուսակ}%
+ \def\partname{Մաս}%
+ \def\pagename{էջ}%
+ \def\seename{տե՛ս}%
+ \def\alsoname{տե՛ս նաեւ}%
+ \def\enclname{Կից՝}%
+ \def\ccname{Կրկնօրինակը՝}%
+% The \headtoname is empty: the typesetter should use the dative (trakan
+% holov) of the recipient's name.
+ \def\headtoname{}%
+ \def\proofname{Ապացույց}%
+ \def\glossaryname{Տերմինների ցանկ}%
}
-%\def\captionsarmenian{%
-% \def\refname{}%
-% \def\abstractname{}%
-% \def\bibname{}%
-% \def\prefacename{}%
-% \def\chaptername{}%
-% \def\appendixname{}%
-% \def\contentsname{}%
-% \def\listfigurename{}%
-% \def\listtablename{}%
-% \def\indexname{}%
-% \def\authorname{}%
-% \def\figurename{}%
-% \def\tablename{}%
-% %\def\thepart{}%
-% \def\partname{}%
-% \def\pagename{}%
-% \def\seename{}%
-% \def\alsoname{}%
-% \def\enclname{}%
-% \def\ccname{}%
-% \def\headtoname{}%
-% \def\proofname{}%
-% \def\glossaryname{}%
-%}
-\def\datearmenian{%
+\def\date@western@armenian{%
\def\today{\ifcase\month\or
Յունուար\or
Փետրուար\or
@@ -1534,7 +2109,103 @@ and may look very wrong.}
Հոկտեմբեր\or
Նոյեմբեր\or
Դեկտեմբեր\fi
- \number\day,\space\number\year}}
+ \number\day,\space\number\year}%
+}
+
+\def\date@eastern@armenian{%
+ \def\today{\ifcase\month\or
+ Հունվար\or
+ Փետրվար\or
+ Մարտ\or
+ Ապրիլ\or
+ Մայիս\or
+ Հունիս\or
+ Հուլիս\or
+ Օգոստոս\or
+ Սեպտեմբեր\or
+ Հոկտեմբեր\or
+ Նոյեմբեր\or
+ Դեկտեմբեր\fi
+ \number\day,\space\number\year}%
+}
+
+\def\datearmenian{%
+ \if@eastern@armenian
+ \date@eastern@armenian%
+ \else
+ \date@western@armenian%
+ \fi
+}
+
+\newcommand{\armeniannumerals}[2]{%
+ \if@armenian@numerals
+ \armeniannumber{#2}%
+ \else
+ #2%
+ \fi%
+}
+
+\def\armenian@numbers{%
+ \if@armenian@numerals
+ \def\armenian@alph##1{\expandafter\armeniannumeral\expandafter{\the##1}}%
+ \let\@alph\armenian@alph%
+ \fi%
+}
+
+\def\noarmenian@numbers{%
+ \let\@alph\latin@alph%
+ \let\armenian@alph\@undefined%
+}
+
+\def\armenian@globalnumbers{%
+ \if@armenian@numerals
+ \let\@arabic\armeniannumber%
+ \renewcommand\thefootnote{\localnumeral*{footnote}}%
+ \renewcommand\theequation{\localnumeral*{equation}}%
+ \fi
+}
+
+% Store original definition
+\let\xpg@save@arabic\@arabic
+
+\def\noarmenian@globalnumbers{
+ \let\@arabic\xpg@save@arabic%
+}
+
+\protected\def\armeniannumber#1{\expandafter\@armeniannumber\expandafter{\number#1}}
+\def\@armeniannumber#1{%
+ \ifnum#1<\@ne\space\arm@ill@value{#1}%
+ \else
+ \ifnum#1<10\expandafter\arm@num@i\number#1%
+ \else
+ \ifnum#1<100\expandafter\arm@num@ii\number#1%
+ \else
+ \ifnum#1<\@m\expandafter\arm@num@iii\number#1%
+ \else
+ \ifnum#1<\@M\expandafter\arm@num@iv\number#1%
+ \else
+ \space\arm@ill@value{#1}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+}
+
+\let\armeniannumeral=\armeniannumber
+\def\arm@num@i#1{%
+ \ifcase#1\or Ա\or Բ\or Գ\or Դ\or Ե\or Զ\or Է\or Ը\or Թ\fi}
+\def\arm@num@ii#1{%
+ \ifcase#1\or Ժ\or Ի\or Լ\or Խ\or Ծ\or Կ\or Հ\or Ձ\or Ղ\fi
+ \arm@num@i}
+\def\arm@num@iii#1{%
+ \ifcase#1\or Ճ\or Մ\or Յ\or Ն\or Շ\or Ո\or Չ\or Պ\or Ջ\fi
+ \arm@num@ii}
+\def\arm@num@iv#1{%
+ \ifcase#1\or Ռ\or Ս\or Վ\or Տ\or Ր\or Ց\or Ւ\or Փ\or Ք\fi
+ \arm@num@iii}
+\def\arm@ill@value#1{\xpg@warning{Illegal value (#1) for Armenian numeral}[$#1$]}
+
% \end{macrocode}
% \iffalse
%</gloss-armenian.ldf>
@@ -1551,6 +2222,7 @@ and may look very wrong.}
\PolyglossiaSetup{asturian}{
hyphennames={asturian,catalan},
hyphenmins={2,2},
+ langtag=AST,
frenchspacing=true,
indentfirst=true,
fontsetup=true,
@@ -1596,49 +2268,24 @@ and may look very wrong.}
% \subsection{gloss-bahasai.ldf}
% \begin{macrocode}
\ProvidesFile{gloss-bahasai.ldf}[polyglossia: module for bahasa indonesia]
-\RequirePackage{hijrical}
+
+% We only provide this gloss for babel compatibility. Since bahasai is
+% a malay variety, we use 'malay' with variant 'indonesian' now.
+
+\input{gloss-malay.ldf}
\PolyglossiaSetup{bahasai}{%
- language=Bahasa Indonesia,
+ language=Indonesian,
+ langtag=IND,
hyphennames={indonesian,indon,bahasai,bahasa,bahasam,malay,melayu},
hyphenmins={2,2},
fontsetup=true}
-\def\captionsbahasai{%
- \def\refname{Pustaka}%
- \def\abstractname{Ringkasan}%
- \def\bibname{Bibliografi}%
- \def\prefacename{Pendahuluan}%
- \def\chaptername{Bab}%
- \def\appendixname{Lampiran}%
- \def\contentsname{Daftar Isi}%
- \def\listfigurename{Daftar Gambar}%
- \def\listtablename{Daftar Tabel}%
- \def\indexname{Indeks}%
- \def\figurename{Gambar}%
- \def\tablename{Tabel}%
- %\def\thepart{}%
- \def\partname{Bagian}%
- \def\pagename{Halaman}%
- \def\seename{lihat}%
- \def\alsoname{lihat juga}%
- \def\enclname{Lampiran}%
- \def\ccname{cc}%
- \def\headtoname{Kepada}%
- \def\proofname{Bukti}%
- \def\glossaryname{Daftar Istilah}%
- }
-\def\datebahasai{%
- \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
- \space \number\year}}
+\let\captionsbahasai\captionsmalay@indonesian
+\let\datebahasai\datemalay@indonesian
-\def\hijrimonthbahasai#1{\ifcase#1%
-\or Muharram\or Safar\or Rabiul awal\or Rabiul akhir\or Jumadil awal\or Jumadil akhir\or Rajab%
-\or Sya'ban\or Ramadhan\or Syawal\or Dzulkaidah\or Dzulhijjah\fi}
\DefineFormatHijriDate{bahasai}{%
-\number\value{Hijriday}\space\hijrimonthbahasai{\value{Hijrimonth}}\space\number\value{Hijriyear}}
+ \number\value{Hijriday}\space\hijrimonthmalay@indonesian{\value{Hijrimonth}}\space\number\value{Hijriyear}}
% \end{macrocode}
% \iffalse
@@ -1650,57 +2297,24 @@ and may look very wrong.}
% \subsection{gloss-bahasam.ldf}
% \begin{macrocode}
\ProvidesFile{gloss-bahasam.ldf}[polyglossia: module for bahasa melayu]
-\RequirePackage{hijrical}
+
+% We only provide this gloss for babel compatibility. Since bahasai is
+% a malay variety, we use 'malay' with variant 'indonesian' now.
+
+\input{gloss-malay.ldf}
+
\PolyglossiaSetup{bahasam}{%
- language=Bahasa Melayu,
+ language=Malay,
+ langtag=MLY,
hyphennames={malay,melayu,bahasam,bahasa,bahasai,indonesian,indon},
hyphenmins={2,2},
fontsetup=true}
-\def\captionsbahasam{%
- \def\refname{Rujukan}%
- \def\abstractname{Abstrak}%
- \def\bibname{Bibliografi}%
- \def\prefacename{Pendahuluan}%
- \def\chaptername{Bab}%
- \def\appendixname{Lampiran}%
- \def\contentsname{Kandungan}%
- \def\listfigurename{Senarai Rajah}%
- \def\listtablename{Senarai Jadual}%
- \def\indexname{Indeks}%
- \def\figurename{Rajah}%
- \def\tablename{Jadual}%
- \def\thepart{}%
- \def\partname{Bahagian}%
- \def\pagename{Halaman}%
- \def\seename{lihat}%
- \def\alsoname{lihat juga}%
- \def\enclname{Lampiran}%
- \def\ccname{salinan kpd}%
- \def\headtoname{Kepada}%
- \def\proofname{Bukti}%
- \def\glossaryname{Senarai Istilah}%
- }
-\def\datebahasam{%
- \def\bahasam@day{%
- \ifcase\day\or%
- 1hb\or 2hb\or 3hb\or 4hb\or 5hb\or%
- 6hb\or 7hb\or 8hb\or 9hb\or 10hb\or%
- 11hb\or 12hb\or 13hb\or 14hb\or 15hb\or%
- 16hb\or 17hb\or 18hb\or 19hb\or 20hb\or%
- 21hb\or 22hb\or 23hb\or 24hb\or 25hb\or%
- 26hb\or 27hb\or 28hb\or 29hb\or 30hb\or%
- 31hb\fi}%
- \def\today{\bahasam@day~\ifcase\month\or
- Januari\or Februari\or Mac\or April\or Mei\or Jun\or
- Julai\or Ogos\or September\or Oktober\or November\or Disember\fi
- \space \number\year}}
+\let\captionsbahasam\captionsmalay@malay
+\let\datebahasam\datemalay@malay
-\def\hijrimonthbahasam#1{\ifcase#1%
-\or Muharram\or Safar\or Rabiulawal\or Rabiulakhir\or Jamadilawal\or Jamadilakhir\or Rejab%
-\or Syaaban\or Ramadan\or Syawal\or Zulkaedah\or Zulhijah\fi}
\DefineFormatHijriDate{bahasam}{%
-\number\value{Hijriday}\space\hijrimonthbahasam{\value{Hijrimonth}}\space\number\value{Hijriyear}}
+ \number\value{Hijriday}\space\hijrimonthmalay@malay{\value{Hijrimonth}}\space\number\value{Hijriyear}}
% \end{macrocode}
% \iffalse
@@ -1715,6 +2329,7 @@ and may look very wrong.}
\PolyglossiaSetup{basque}{
hyphennames={basque},
hyphenmins={2,2},
+ langtag=EUQ,
indentfirst=true,
fontsetup=true,
}
@@ -1779,8 +2394,8 @@ and may look very wrong.}
hyphennames={bengali},
hyphenmins={2,2},%CHECK
fontsetup=true,
+ localnumeral=bengalinumerals
%TODO nouppercase=true,
- %TODO localnumber=bengalinumber
}
\def\tmp@western{Western}
@@ -1834,7 +2449,7 @@ and may look very wrong.}
}
\def\captionsbengali{%
- \def\refname{তথ্যসুত্রসমূহ}%
+ \def\refname{তথ্যসূত্রসমূহ}%
\def\abstractname{সারসংক্ষেপ}%
\def\bibname{তথ্যবিবরণ}%
\def\prefacename{পূর্বকথা}%
@@ -1844,8 +2459,8 @@ and may look very wrong.}
\def\listfigurename{ছবি/নকশা সমূহের তালিকা}%
\def\listtablename{তালিকাসারণী}%
\def\indexname{সূচক/নির্দেশক}%
- \def\figurename{ছবি/নকশা}%
- \def\tablename{সারনী}%
+ \def\figurename{চিত্র}%
+ \def\tablename{সারণী}%
%\def\thepart{}% TODO
\def\partname{খন্ড}%
\def\pagename{পৃষ্ঠা}%
@@ -1860,14 +2475,14 @@ and may look very wrong.}
\def\datebengali{%
\def\bengalimonth{%
\ifcase\month\or
- জানুয়ারী\or
- ফেব্রুয়ারী\or
+ জানুয়ারি\or
+ ফেব্রুয়ারি\or
মার্চ\or
এপ্রিল\or
মে\or
জুন\or
জুলাই\or
- আগষ্ট\or
+ আগস্ট\or
সেপ্টেম্বর\or
অক্টোবর\or
নভেম্বর\or
@@ -1875,6 +2490,8 @@ and may look very wrong.}
\def\today{\bengalinumber\day\space\bengalimonth\space\bengalinumber\year}%
}
+\newcommand{\bengalinumerals}[2]{\bengalinumber{#2}}
+
\def\bengalinumber#1{%
\ifbengali@devanagari@numerals
\devanagaridigits{\number#1}%
@@ -1886,8 +2503,19 @@ and may look very wrong.}
\fi
\fi}
-\def\bengalinumber#1{\bengalidigits{\number#1}}% Takes number
-\def\bengalinumeral#1{\bengalinumber{\csname c@#1\endcsname}}% Takes counter
+\def\bengalinumeral#1{\expandafter\bengalinumber\expandafter{\the##1}}% Takes counter
+
+\def\bengali@globalnumbers{%
+ \let\@arabic\bengalinumber%
+ \renewcommand\thefootnote{\localnumeral*{footnote}}%
+}
+
+% Store original definition
+\let\xpg@save@arabic\@arabic
+
+\def\nobengali@globalnumbers{%
+ \let\@arabic\xpg@save@arabic%
+}
\def\blockextras@bengali{\extras@bengali}
\def\inlineextras@bengali{\extras@bengali}
@@ -1901,44 +2529,29 @@ and may look very wrong.}
%
% \subsection{gloss-brazil.ldf}
% \begin{macrocode}
-\ProvidesFile{gloss-brazil.ldf}[polyglossia: module for portuguese]
+\ProvidesFile{gloss-brazil.ldf}[polyglossia: module for brazilian portuguese]
+
+% We only provide this gloss for backwards compatibility. The name
+% 'brazil' was selected in accordance with babel.
+% Since brazil is a variety of portuguese, we use 'portuguese' now.
+
+% FIXME: Once we support babel aliases (#112) this gloss can go.
+
+\xpg@warning{The language name 'brazil' is deprectated.\MessageBreak
+ Please use 'portuguese' with variant 'brazilian' instead.}
+
+\input{gloss-portuguese.ldf}
+
\PolyglossiaSetup{brazil}{
language=Brazilian Portuguese,
+ langtag=PTG,
hyphennames={brazil,portuguese,portuges},
hyphenmins={2,3},
fontsetup=true,
}
-\def\captionsbrazil{%
- \def\refname{Referências}%
- \def\abstractname{Resumo}%
- \def\bibname{Referências Bibliográficas}%
- \def\prefacename{Prefácio}%
- \def\chaptername{Capítulo}%
- \def\appendixname{Apêndice}%
- \def\contentsname{Sumário}%
- \def\listfigurename{Lista de Figuras}%
- \def\listtablename{Lista de Tabelas}%
- \def\indexname{Índice Remissivo}%
- \def\figurename{Figura}%
- \def\tablename{Tabela}%
- %\def\thepart{}%
- \def\partname{Parte}%
- \def\pagename{Página}%
- \def\seename{veja}%
- \def\alsoname{veja também}%
- \def\enclname{Anexo}%
- \def\ccname{Cópia para}%
- \def\headtoname{Para}%
- \def\proofname{Demonstração}%
- \def\glossaryname{Glossário}%
- }
-\def\datebrazil{%
- \def\today{\number\day\space de\space\ifcase\month\or
- janeiro\or fevereiro\or março\or abril\or maio\or junho\or
- julho\or agosto\or setembro\or outubro\or novembro\or dezembro%
- \fi\space de\space\number\year}%
- }
+\let\captionsportuges\captionsportuguese@brazil
+\let\dateportuges\dateportuguese@brazil
% \end{macrocode}
% \iffalse
@@ -1953,6 +2566,7 @@ and may look very wrong.}
\PolyglossiaSetup{breton}{
hyphennames={breton},
hyphenmins={2,2},
+ langtag=BRE,
frenchspacing=true,
indentfirst=true,
fontsetup=true,
@@ -2078,8 +2692,6 @@ and may look very wrong.}
\xpg@ill@value{#1}{bulgarian@alph}\fi}%
\def\bulgarian@numbers{%
- \let\latin@Alph\@Alph%
- \let\latin@alph\@alph%
\let\@Alph\bulgarian@Alph%
\let\@alph\bulgarian@alph%
}
@@ -2145,6 +2757,7 @@ and may look very wrong.}
\PolyglossiaSetup{catalan}{
hyphennames={catalan},
hyphenmins={2,2},
+ langtag=CAT,
frenchspacing=true,
indentfirst=true,
fontsetup=true,
@@ -2156,9 +2769,11 @@ and may look very wrong.}
\else
\setkeys{catalan}{babelshorthands=false}
\fi
+
\ifcsundef{initiate@active@char}{%
-\input{babelsh.def}%
-\initiate@active@char{"}%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
}{}
%%% adapted from Babel's catalan.ldf
@@ -2296,172 +2911,6 @@ and may look very wrong.}
% \end{macrocode}
% \iffalse
%</gloss-catalan.ldf>
-%<*gloss-classiclatin.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-classiclatin.ldf}
-% \begin{macrocode}
-%%
-%% This is file `gloss-classiclatin.ldf',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% gloss-latin.dtx (with options: `laclassic')
-%% ------------------------------------------------------------------
-%% Latin module for polyglossia
-%% Copyright (C) Claudio Beccari 2013-2016
-%% Copyright (C) Élie Roux 2016
-%% This work is distributed under the MIT License.
-%%
-%% See the postamble.
-%% ------------------------------------------------------------------
-\ProvidesFile{gloss-classiclatin.ldf}
- [2016/09/10 v.1.03 Latin support from polyglossia]
-%%
-
-
-\PolyglossiaSetup{classiclatin}{%
- hyphennames={classiclatin},
- hyphenmins={2,2},
- frenchspacing=true,
- fontsetup=true,
-}
-\def\classicuclccodes{\lccode`\V=`\u \uccode`\u=`\V}
-\def\noclassicuclccodes{\lccode`\V=`\v \uccode`\u=`\U}
-\def\classiclatincaptions{%
- \def\prefacename{Praefatio}%
- \def\refname{Conspectus librorum}%
- \def\abstractname{Summarium}%
- \def\bibname{Conspectus librorum}%
- \def\chaptername{Caput}%
- \def\appendixname{Additamentum}%
- \def\contentsname{Index}%
- \def\listfigurename{Conspectus descriptionum}%
- \def\listtablename{Conspectus tabularum}%
- \def\indexname{Index rerum notabilium}%
- \def\figurename{Descriptio}%
- \def\tablename{Tabula}%
- \def\partname{Pars}%
- \def\enclname{Additur}%
- \def\ccname{Exemplar}%
- \def\headtoname{\ignorespaces}%
- \def\pagename{charta}%
- \def\seename{cfr.}%
- \def\alsoname{cfr.}%
- \def\proofname{Demonstratio}%
- \def\glossaryname{Glossarium}%
- }
-
-\def\classiclatindate{%
- \def\today{\uppercase\expandafter{\romannumeral\day}%
- \space \ifcase\month
- \or Januarii\or Februarii\or Martii\or Aprilis\or Maii\or Junii\or
- Julii\or Augusti\or Septembris\or Octobris\or Nouembris\or
- Decembris\fi
- \space \uppercase\expandafter{\romannumeral\year}}}
-
-\define@boolkey{classiclatin}[classiclatin@]{babelshorthands}[true]{}
-
-\ifsystem@babelshorthands
- \setkeys{classiclatin}{babelshorthands=true}
-\else
- \setkeys{classiclatin}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}\initiate@active@char{"}}{}
-
-\def\classiclatin@shorthands{%
- \def\language@group{classiclatin}%
- \bbl@activate{"}%
- \declare@shorthand{classiclatin}{"}{\relax
- \ifmmode
- \def\xpgcla@next{''}%
- \else
- \def\xpgcla@nextdq{\futurelet\xpgla@temp\xpgla@cwm}%
- \fi
- \xpgcla@nextdq}%
-}
-
-\def\xpgcla@allowhyphens{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}
-\newcommand*{\xpgcla@cwm}{\let\xpgcla@@nextdq\relax
- \ifcat\noexpand\xpgcla@temp a%
- \let\xpgcla@@nextdq\xpgcla@allowhyphens
- \else
- \ifx\xpgcla@temp\ae
- \let\xpgcla@@nextdq\xpgcla@allowhyphens
- \else
- \ifx\xpgcla@temp\oe
- \let\xpgcla@@nextdq\xpgcla@allowhyphens
- \else
- \if\noexpand\xpgla@temp\string|%
- \def\xpgcla@@nextdq{\xpgcla@allowhyphens\@gobble}%
- \fi
- \fi
- \fi
- \fi
- \xpgla@@nextdq}%
-\def\noclassiclatin@shorthands{%
- \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}%
-}
-
-\let\xpgcla@savedvalues\empty
-\AtEndPreamble{%
- \edef\xpgcla@savedvalues{%
- \clubpenalty=\the\clubpenalty\space
- \@clubpenalty=\the\@clubpenalty\space
- \widowpenalty=\the\widowpenalty\space
- \finalhyphendemerits=\the\finalhyphendemerits}%
-}
-
-\def\noextras@classiclatin{%
- \lccode\string"2019=\z@
- \noclassiclatin@shorthands
- \noclassicuclccodes
- \xpgcla@savedvalues
-}
-
-\def\blockextras@classiclatin{%
- \lccode\string"2019=\string"2019
- \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000
- \finalhyphendemerits=50000000
- \classicuclccodes
- \ifclassiclatin@babelshorthands\classiclatin@shorthands\fi
-}
-
-\def\inlineextras@classiclatin{%
- \lccode\string"2019=\string"2019
- \classicuclccodes
- \ifclassiclatin@babelshorthands\classiclatin@shorthands\fi
-}
-%% Copyright (C) Claudio Beccari 2013-2016
-%% Copyright (C) Élie Roux 2016
-%%
-%% Permission is hereby granted, free of charge, to any person obtaining
-%% a copy of this software and associated documentation files
-%% (the "Software"), to deal in the Software without restriction, including
-%% without limitation the rights to use, copy, modify, merge, publish,
-%% distribute, sublicense, and/or sell copies of the Software, and to permit
-%% persons to whom the Software is furnished to do so, subject to the following
-%% conditions:
-%%
-%% The above copyright notice and this permission notice shall be included in
-%% all copies or substantial portions of the Software.
-%%
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-%% THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-%% IN THE SOFTWARE.
-%%
-%% End of file `gloss-classiclatin.ldf'.
-% \end{macrocode}
-% \iffalse
-%</gloss-classiclatin.ldf>
%<*gloss-coptic.ldf>
% \fi
% \clearpage
@@ -2517,8 +2966,10 @@ and may look very wrong.}
% \begin{macrocode}
\ProvidesFile{gloss-croatian.ldf}[polyglossia: module for croatian]
\PolyglossiaSetup{croatian}{
+ langtag=HRV,
hyphennames={croatian},
hyphenmins={2,2}, % aligned with https://ctan.org/pkg/hrhyph patterns and http://lebesgue.math.hr/~nenad/Diplomski/Maja_Ribaric_2011.pdf
+ frenchspacing=true, % recommendation from Damir Bralić
indentfirst=false, % recommendation from Damir Bralić
fontsetup=true
}
@@ -2562,13 +3013,169 @@ and may look very wrong.}
% \subsection{gloss-czech.ldf}
% \begin{macrocode}
\ProvidesFile{gloss-czech.ldf}[polyglossia: module for czech]
+
\PolyglossiaSetup{czech}{
hyphennames={czech},
hyphenmins={2,2},
+ langtag=CSY,
frenchspacing=true,
fontsetup=true,
}
+\define@boolkey{czech}[czech@]{babelshorthands}[true]{}
+
+\define@boolkey{czech}[czech@]{splithyphens}[true]{}
+
+\define@boolkey{czech}[czech@]{vlna}[true]{}
+
+\ifsystem@babelshorthands
+ \setkeys{czech}{babelshorthands=true}
+\else
+ \setkeys{czech}{babelshorthands=false}
+\fi
+
+\ifcsundef{initiate@active@char}{%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
+}{}
+
+\def\cs@@splithyphen#1{%
+ \kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
+ \nobreak\hskip\z@%
+}
+
+\def\cs@splithyphen{%
+ \cs@@splithyphen{-}%
+}
+
+\def\czech@shorthands{%
+ \bbl@activate{"}%
+ \def\language@group{czech}%
+ \declare@shorthand{czech}{"=}{\cs@splithyphen}%
+ \declare@shorthand{czech}{"`}{„}%
+ \declare@shorthand{czech}{"'}{“}%
+ \declare@shorthand{czech}{"<}{«}%
+ \declare@shorthand{czech}{">}{»}%
+}
+
+\def\noczech@shorthands{%
+ \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}%
+}
+
+\ifxetex
+ % splithyphens
+ \newXeTeXintercharclass\czech@hyphen % -
+ % vlna
+ \newXeTeXintercharclass\czech@openpunctuation
+ \newXeTeXintercharclass\czech@nonsyllabicpreposition
+ \ifdefined\e@alloc@intercharclass@top
+ \chardef\czech@boundary=\e@alloc@intercharclass@top
+ \else
+ \ifdefined\XeTeXinterwordspaceshaping
+ \chardef\czech@boundary=4095 %
+ \def\newXeTeXintercharclass{%
+ \e@alloc\XeTeXcharclass\chardef
+ \xe@alloc@intercharclass\m@ne\@ucharclass@boundary}
+ \else
+ \chardef\czech@boundary=255
+ \fi
+ \fi
+\fi
+
+\def\czech@hyphens{%
+ \ifluatex
+ \xpg@warning{The 'splithyphens' option only works for XeLaTeX.\MessageBreak
+ Please use the luavlna package to enable the feature for LuaLaTeX}
+ \else
+ \XeTeXinterchartokenstate=1
+ \XeTeXcharclass `\- \czech@hyphen
+ \XeTeXinterchartoks \z@ \czech@hyphen = {\cs@@splithyphen}% "-" -> "\cs@@splithyphen-"
+ % necessary if used together with vlna:
+ \XeTeXinterchartoks \czech@nonsyllabicpreposition \czech@hyphen = {\cs@@splithyphen}% "-" -> "\cs@@splithyphen-"
+ \fi%
+}
+
+\def\noczech@hyphens{%
+ \ifxetex
+ \XeTeXcharclass `\- \z@
+ \fi%
+}
+
+% Add nonbreakable space after single-letter word to
+% prevent them to land at the end of a line
+\def\czech@vlna{%
+ \ifluatex
+ \xpg@warning{The 'vlna' option only works for XeLaTeX.\MessageBreak
+ Please use the luavlna package to enable the feature for LuaLaTeX}
+ \else
+ % Code taken and adapted from xevlna.sty
+ \XeTeXinterchartokenstate=1
+ \XeTeXcharclass `\( \czech@openpunctuation
+ \XeTeXcharclass `\[ \czech@openpunctuation
+ \XeTeXcharclass `\„ \czech@openpunctuation
+ \XeTeXcharclass `\» \czech@openpunctuation
+ \XeTeXcharclass `\K \czech@nonsyllabicpreposition
+ \XeTeXcharclass `\k \czech@nonsyllabicpreposition
+ \XeTeXcharclass `\S \czech@nonsyllabicpreposition
+ \XeTeXcharclass `\s \czech@nonsyllabicpreposition
+ \XeTeXcharclass `\V \czech@nonsyllabicpreposition
+ \XeTeXcharclass `\v \czech@nonsyllabicpreposition
+ \XeTeXcharclass `\Z \czech@nonsyllabicpreposition
+ \XeTeXcharclass `\z \czech@nonsyllabicpreposition
+ \XeTeXcharclass `\O \czech@nonsyllabicpreposition
+ \XeTeXcharclass `\o \czech@nonsyllabicpreposition
+ \XeTeXcharclass `\U \czech@nonsyllabicpreposition
+ \XeTeXcharclass `\u \czech@nonsyllabicpreposition
+ \XeTeXcharclass `\A \czech@nonsyllabicpreposition
+ \XeTeXcharclass `\a \czech@nonsyllabicpreposition
+ \XeTeXcharclass `\I \czech@nonsyllabicpreposition
+ \XeTeXcharclass `\i \czech@nonsyllabicpreposition
+ \XeTeXinterchartoks \czech@boundary \czech@nonsyllabicpreposition {\czech@interchartoks}
+ \XeTeXinterchartoks \czech@openpunctuation \czech@nonsyllabicpreposition {\czech@interchartoks}
+ \def\czech@nointerchartoks{\let\czech@interchartoks\czech@PreCSpreposition}
+ \def\czech@PreCSpreposition{\def\next{}%
+ \ifnum\catcode`\ =10 % nothing will be done in verbatim
+ \ifmmode % nothing in math
+ \else
+ \let\czech@interchartoks\czech@nointerchartoks
+ \let\next\czech@ExamineCSpreposition
+ \fi \fi
+ \next%
+ }
+ \def\czech@ExamineCSpreposition ##1{##1\futurelet\next\czech@ProcessCSpreposition}
+ \def\czech@ProcessCSpreposition{\ifx\next\czech@XeTeXspace\nobreak\fi}
+ \futurelet\czech@XeTeXspace{ }\czech@nointerchartoks
+ \fi
+}
+
+\def\noczech@vlna{%
+ \ifluatex
+ \else
+ \XeTeXcharclass`\(\z@
+ \XeTeXcharclass`\[\z@
+ \XeTeXcharclass`\„\z@
+ \XeTeXcharclass`\»\z@
+ \XeTeXcharclass`\K\z@
+ \XeTeXcharclass`\k\z@
+ \XeTeXcharclass`\S\z@
+ \XeTeXcharclass`\s\z@
+ \XeTeXcharclass`\V\z@
+ \XeTeXcharclass`\v\z@
+ \XeTeXcharclass`\Z\z@
+ \XeTeXcharclass`\z\z@
+ \XeTeXcharclass`\O\z@
+ \XeTeXcharclass`\o\z@
+ \XeTeXcharclass`\U\z@
+ \XeTeXcharclass`\u\z@
+ \XeTeXcharclass`\A\z@
+ \XeTeXcharclass`\a\z@
+ \XeTeXcharclass`\I\z@
+ \XeTeXcharclass`\i\z@
+ \fi
+}
+
+
\def\captionsczech{%
\def\refname{Reference}%
\def\abstractname{Abstrakt}%
@@ -2592,13 +3199,34 @@ and may look very wrong.}
\def\headtoname{Komu}%
\def\proofname{Důkaz}%
\def\glossaryname{Slovník}%was Glosář
- }
+}
+
\def\dateczech{%
\def\today{\number\day.~\ifcase\month\or
ledna\or února\or března\or dubna\or května\or
června\or července\or srpna\or září\or
října\or listopadu\or prosince\fi
- \space \number\year}}
+ \space \number\year}%
+}
+
+\def\noextras@czech{%
+ \noczech@shorthands%
+ \noczech@hyphens%
+ \noczech@vlna%
+ \ifxetex\XeTeXinterchartokenstate=0\fi%
+}
+
+\def\blockextras@czech{%
+ \ifczech@babelshorthands\czech@shorthands\fi%
+ \ifczech@vlna\czech@vlna\fi%
+ \ifczech@splithyphens\czech@hyphens\fi%
+}
+
+\def\inlineextras@czech{%
+ \ifczech@babelshorthands\czech@shorthands\fi%
+ \ifczech@vlna\czech@vlna\fi%
+ \ifczech@splithyphens\czech@hyphens\fi%
+}
% \end{macrocode}
% \iffalse
@@ -2613,6 +3241,7 @@ and may look very wrong.}
\PolyglossiaSetup{danish}{
hyphennames={danish},
hyphenmins={2,3},
+ langtag=DAN,
frenchspacing=true,
fontsetup=true,
}
@@ -2636,13 +3265,16 @@ and may look very wrong.}
\def\headtoname{Til}% in letter
\def\pagename{Side}%
\def\seename{Se}%
- \def\alsoname{Se også}}%
+ \def\alsoname{Se også}%
\def\proofname{Bevis}%
\def\glossaryname{Gloseliste}%
+}
+\def\datedanish{%
\def\today{\number\day.~\ifcase\month\or
januar\or februar\or marts\or april\or maj\or juni\or
juli\or august\or september\or oktober\or november\or december\fi
\space\number\year}
+}
% \end{macrocode}
% \iffalse
@@ -2664,6 +3296,7 @@ and may look very wrong.}
\PolyglossiaSetup{divehi}{
script=Thaana,
scripttag=thaa,
+ langtag=DIV,% TODO Support DHV as well?
direction=RL,
hyphennames={nohyphenation},
fontsetup=true
@@ -2695,13 +3328,17 @@ and may look very wrong.}
% }
%\def\datedivehi{\def\today{<++>}}
+% Save original \MakeUppercase definition
+\let\xpg@save@MakeUppercase\MakeUppercase
+
\def\blockextras@divehi{%
- \let\@@MakeUppercase\MakeUppercase%
\def\MakeUppercase##1{##1}%
- }
+}
+
\def\noextras@divehi{%
- \let\MakeUppercase\@@MakeUppercase%
- }
+ % restore original \MakeUppercase definition
+ \let\MakeUppercase\xpg@save@MakeUppercase%
+}
% \end{macrocode}
% \iffalse
@@ -2716,6 +3353,7 @@ and may look very wrong.}
\PolyglossiaSetup{dutch}{
hyphennames={dutch},
hyphenmins={2,2},
+ langtag=NLD,
frenchspacing=true,
fontsetup=true,
}
@@ -2729,8 +3367,9 @@ and may look very wrong.}
\fi
\ifcsundef{initiate@active@char}{%
-\input{babelsh.def}%
-\initiate@active@char{"}%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
}{}
\def\dutch@shorthands{%
@@ -2804,66 +3443,124 @@ and may look very wrong.}
\PolyglossiaSetup{english}{
hyphennames={english,american,usenglish,USenglish},
hyphenmins={2,3},
+ langtag=ENG,
fontsetup=true,
}
-\newif\if@british@locale
-\@british@localefalse
-\providebool{@british@hyphen}
+\providebool{british@hyphen}
\providebool{english@ordinalmonthday}
+\providebool{british@dateformat}
+
+% US English (\l@english) is default
+% Initialize its settings
+\def\english@variant{english}
+\british@hyphenfalse
+\english@ordinalmonthdayfalse
+\british@dateformatfalse
+% Option ordinalmonthday
\define@boolkey{english}[english@]{ordinalmonthday}[true]{}
-%% English is a special case in that \l@english is reserved for US English, so
-%% we need to handle it differently
-\define@key{english}{variant}{%
- %needs to be reset for loop over hyphennames below:
- \def\do##1{%
- \xpg@ifdefined{#1}%
- {\csletcs{l@english}{l@#1}\listbreak}%
- {}%
- }%
- \ifstrequal{#1}{uk}%
- {\@british@localetrue
- \xpg@info{Option: english variant=british}}%
- {\ifstrequal{#1}{british}%
- {\@british@localetrue
- \xpg@info{Option: english variant=british}}%
- {\ifstrequal{#1}{us}% these patterns are the default so we don't need to reset them
- {\@british@hyphenfalse\english@ordinalmonthdayfalse
- \xpg@info{Option: english variant=american}}%
- {\ifstrequal{#1}{american}%
- {\@british@hyphenfalse\english@ordinalmonthdayfalse
- \xpg@info{Option: english variant=american}}%
- {\ifstrequal{#1}{usmax}%
- {\@british@hyphenfalse\english@ordinalmonthdayfalse
- \ifluatex\else\setkeys[xpg@setup]{english}{hyphennames={usenglishmax}}\fi
- \xpg@info{Option: english variant=american (with additional patterns)}%
- \xpg@ifdefined{usenglishmax}{}%
- {\xpg@warning{No hyphenation patterns were loaded for "US English Max"\MessageBreak
- I will use the standard patterns for US English instead}%
- \adddialect\l@usenglishmax\l@english\relax}%
- \gdef\english@language{\language=\l@usenglishmax}}%
- {\ifstrequal{#1}{australian}%
- {\@british@hyphentrue\english@ordinalmonthdayfalse
- \xpg@info{Option: english variant=australian}}%
- {\ifstrequal{#1}{newzealand}%
- {\@british@hyphentrue\english@ordinalmonthdayfalse
- \xpg@info{Option: english variant=newzealand}}%
- {\xpg@warning{Unknown English variant `#1'}}%
- }}}}}}%
- \if@british@locale\@british@hyphentrue\english@ordinalmonthdaytrue\fi
- \if@british@hyphen
- \ifluatex\else\setkeys[xpg@setup]{english}{hyphennames={ukenglish,british,UKenglish}}\fi
- \xpg@ifdefined{ukenglish}{}%
- {\xpg@warning{No hyphenation patterns were loaded for British English\MessageBreak
- I will use the patterns for US English instead}%
- \adddialect\l@ukenglish\l@english\relax}%
- \gdef\english@language{\language=\l@ukenglish\xpg@set@language@luatex@ii{ukenglish}}%
- \fi
- % and we reset \do to its previous definition here:
- \def\do##1{\setotherlanguage{#1}}%
-}
+\define@choicekey*+{english}{variant}[\val\nr]{uk,british,us,american,usmax,australian,newzealand,canadian}{%
+ \ifcase\nr\relax
+ % uk:
+ \british@hyphentrue
+ \british@dateformattrue
+ \english@ordinalmonthdaytrue
+ \SetLanguageKeys{english}{babelname=british}%
+ \xpg@info{Option: English, variant=british}%
+ \or
+ % british:
+ \british@hyphentrue
+ \british@dateformattrue
+ \english@ordinalmonthdaytrue
+ \SetLanguageKeys{english}{babelname=british}%
+ \xpg@info{Option: english variant=british}%
+ \or
+ % us:
+ \british@hyphenfalse
+ \british@dateformatfalse
+ \english@ordinalmonthdayfalse
+ \SetLanguageKeys{english}{babelname=american}%
+ \xpg@info{Option: English, variant=american}%
+ \or
+ % american:
+ \british@hyphenfalse
+ \british@dateformatfalse
+ \english@ordinalmonthdayfalse
+ \SetLanguageKeys{english}{babelname=american}%
+ \xpg@info{Option: English, variant=american}%
+ \or
+ % usmax:
+ \british@hyphenfalse
+ \british@dateformatfalse
+ \english@ordinalmonthdayfalse
+ \SetLanguageKeys{english}{babelname=american}%
+ \xpg@info{Option: english variant=american (with additional patterns)}%
+ \xpg@ifdefined{usenglishmax}{}%
+ {\xpg@warning{No hyphenation patterns were loaded for "US English Max"\MessageBreak
+ I will use the standard patterns for US English instead}%
+ \adddialect\l@usenglishmax\l@english\relax%
+ }%
+ \def\english@variant{usenglishmax}%
+ \or
+ % australian:
+ % These use the british hyphenation patterns
+ % but date formats without ordinals
+ \british@hyphentrue
+ \british@dateformattrue
+ \english@ordinalmonthdayfalse
+ \SetLanguageKeys{english}{babelname=australian}%
+ \xpg@info{Option: English, variant=australian}%
+ \or
+ % newzealand:
+ % These use the british hyphenation patterns
+ % but date formats without ordinals
+ \british@hyphentrue
+ \british@dateformattrue
+ \english@ordinalmonthdayfalse
+ \SetLanguageKeys{english}{babelname=newzealand}%
+ \xpg@info{Option: English, variant=newzealand}%
+ \or
+ % canadian:
+ % This is currently equivalent to usenglish (as in babel)
+ \british@hyphenfalse
+ \british@dateformatfalse
+ \english@ordinalmonthdayfalse
+ \SetLanguageKeys{english}{babelname=canadian}%
+ \xpg@info{Option: English, variant=american}%
+ \fi
+ \ifbritish@hyphen
+ \xpg@ifdefined{ukenglish}{}%
+ {\xpg@warning{No hyphenation patterns were loaded for British English\MessageBreak
+ I will use the patterns for US English instead}%
+ \adddialect\l@ukenglish\l@english\relax%
+ }%
+ \def\english@variant{ukenglish}%
+ \fi
+}{\xpg@warning{Unknown English variant `#1'}}
+
+\ifxetex
+ % Check if \l@english is defined. If not, try to set it to some variety
+ % (specific order as in the csv list below), or null language if everything fails
+ \xpg@ifdefined{english}{}{%
+ \def\do##1{%
+ \xpg@ifdefined{#1}%
+ {\csletcs{l@english}{l@#1}\listbreak}%
+ {%
+ \xpg@warning{No hyphenation patterns for English found"\MessageBreak
+ I will use the 'null' language instead}%
+ \adddialect\l@english0
+ }%
+ }%
+ \docsvlist{british, american, usenglishmax, australian, newzealand}
+ \xpg@ifdefined{english}{}{}
+ }%
+\fi
+
+\def\english@language{%
+ \polyglossia@setup@language@patterns{\english@variant}
+}%
\def\captionsenglish{%
\def\prefacename{Preface}%
@@ -2903,7 +3600,7 @@ and may look very wrong.}
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi}%
\def\today{%
- \if@british@locale
+ \ifbritish@dateformat
\english@day\space\english@month\space\number\year
\else
\english@month\space\english@day,\space\number\year
@@ -2923,6 +3620,7 @@ and may look very wrong.}
\PolyglossiaSetup{esperanto}{
hyphennames={esperanto},
hyphenmins={2,2},
+ langtag=NTO,
fontsetup=true,
%TODO localalph={esperanto@alph,esperanto@Alph}
}
@@ -2972,8 +3670,6 @@ and may look very wrong.}
P\or R\or S\or Ŝ\or T\or U\or Ŭ\or V\or Z\else\xpg@ill@value{#1}{esperanto@Alph}\fi}%
\def\esperanto@numbers{%
- \let\latin@Alph\@Alph%
- \let\latin@alph\@alph%
\let\@Alph\esperanto@Alph%
\let\@alph\esperanto@alph%
}
@@ -2996,6 +3692,7 @@ and may look very wrong.}
\PolyglossiaSetup{estonian}{
hyphennames={estonian},
hyphenmins={2,2},
+ langtag=ETI,
frenchspacing=true,
fontsetup=true,
}
@@ -3040,135 +3737,46 @@ and may look very wrong.}
% \subsection{gloss-farsi.ldf}
% \begin{macrocode}
\ProvidesFile{gloss-farsi.ldf}[polyglossia: module for farsi]
-\ifluatex
- \xpg@warning{Farsi is not supported with LuaTeX.\MessageBreak
-I will proceed with the compilation, but\MessageBreak
-the output is not guaranteed to be correct\MessageBreak
-and may look very wrong.}
-\fi
-\RequireBidi
-\RequirePackage{arabicnumbers}
-\RequirePackage{farsical}
-\RequirePackage{hijrical}
+
+% We only provide this gloss for babel compatibility.
+% The proper English language name is Persian.
+
+\input{gloss-persian.ldf}
+
\PolyglossiaSetup{farsi}{
script=Arabic,
direction=RL,
scripttag=arab,
langtag=FAR,
hyphennames={nohyphenation},
- fontsetup=true
+ fontsetup=true,
+ localnumeral=farsinumerals
}
-\newif\if@western@numerals
-\def\tmp@western{western}
\define@key{farsi}{numerals}[eastern]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@western\@western@numeralstrue\else%
- \@western@numeralsfalse%
- \fi}
+ \setkeys{persian}{numerals=#1}}
-%this is needed for \abjad in arabicnumbers.sty
-\def\tmp@true{true}
\define@key{farsi}{abjadjimnotail}[true]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@true\abjad@jim@notailtrue%
- \else
- \abjad@jim@notailfalse
- \fi}
+ \setkeys{persian}{abjadjimnotail=#1}}
-% NOT YET USED
\define@key{farsi}{locale}[default]{%
- \def\@farsi@locale{#1}}
-
-%TODO add option for CALENDAR
+ \setkeys{persian}{locale=#1}}
\setkeys{farsi}{locale,numerals}
-\def\farsigregmonth#1{\ifcase#1%
- \or ژانویه\or فوریه\or مارس\or آوریل\or مه\or ژوئن\or ژوئیه\or اوت\or سپتامبر\or اکتبر\or نوامبر\or دسامبر\fi}
-\def\farsimonth#1{\ifcase#1%
- \or کانون ثانی\or شباط\or اذار%%or ادار
- \or نیسان\or ایار\or حزیران\or تموز\or آب\or ایلول\or تشرین اول\or تشرین ثانی\or کانون اول\fi}
-
%\Hijritoday is now locale-aware and will format the date with this macro:
\DefineFormatHijriDate{farsi}{\@ensure@RTL{%
-\farsinumber{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\farsinumber{\value{Hijriyear}}}}
+ \farsinumber{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\farsinumber{\value{Hijriyear}}}}
-\def\captionsfarsi{%
-\def\prefacename{\@ensure@RTL{پیشگفتار}}%
-\def\refname{\@ensure@RTL{مراجع}}%
-\def\abstractname{\@ensure@RTL{چکیده}}%
-\def\bibname{\@ensure@RTL{کتاب‌نامه}}%
-\def\chaptername{\@ensure@RTL{فصل}}%
-\def\appendixname{\@ensure@RTL{پیوست}}%
-\def\contentsname{\@ensure@RTL{فهرست مطالب}}%
-\def\listfigurename{\@ensure@RTL{لیست تصاویر}}%
-\def\listtablename{\@ensure@RTL{لیست جداول}}%
-\def\indexname{\@ensure@RTL{نمایه}}%
-\def\figurename{\@ensure@RTL{شكل}}%
-\def\tablename{\@ensure@RTL{جدول}}%
-\def\partname{\@ensure@RTL{بخش}}%
-\def\enclname{\@ensure@RTL{پیوست}}%
-\def\ccname{\@ensure@RTL{رونوشت}}%
-\def\headtoname{\@ensure@RTL{به}}%
-\def\pagename{\@ensure@RTL{صفحة}}%
-\def\seename{\@ensure@RTL{ببینید}}%
-\def\alsoname{\@ensure@RTL{نیز ببینید}}%
-\def\proofname{\@ensure@RTL{برهان}}%
-\def\glossaryname{\@ensure@RTL{دانش‌نامه}}%
-}
-\def\datefarsi{%
- \def\today{\@ensure@RTL{\farsinumber\day\space\farsigregmonth{\month}\space\farsinumber\year}}%
-}
+\let\captionsfarsi\captionspersian
+\let\datefarsi\datepersian
+\let\farsi@numbers\persian@numbers
+\let\nofarsi@numbers\nopersian@numbers
+\let\farsi@globalnumbers\persian@globalnumbers
+\let\nofarsi@globalnumbers\nopersian@globalnumbers
+\let\blockextras@farsi\blockextras@persian
+\let\noextras@farsi\noextras@persian
-\def\farsinumber#1{%
- \if@western@numerals
- \number#1%
- \else
- \ifnum\XeTeXcharglyph"06F0 > 0%
- \farsidigits{\number#1}%
- %%{\protect\addfontfeature{Mapping=farsidigits}\number#1}%
- \else%
- \arabicdigits{\number#1}%
- %%{\protect\addfontfeature{Mapping=arabicdigits}\number#1}%
- \fi
- \fi}
-
-%\def\farsinum#1{\expandafter\farsinumber\csname c@#1\endcsname}
-%\def\farsibracenum#1{(\expandafter\farsinumber\csname c@#1\endcsname)}
-%\def\farsiornatebracenum#1{\char"FD3E\expandafter\farsinumber\csname c@#1\endcsname\char"FD3F}
-%\def\farsialph#1{\expandafter\@farsialph\csname c@#1\endcsname}
-
-\def\farsi@numbers{%
- \let\@latinalph\@alph%
- \let\@latinAlph\@Alph%
- \let\@alph\abjad%
- \let\@Alph\abjad%
-}
-\def\nofarsi@numbers{%
- \let\@alph\@latinalph%
- \let\@Alph\@latinAlph%
- }
-
-\def\farsi@globalnumbers{%
- \let\orig@arabic\@arabic%
- \let\@arabic\farsinumber%
- % For some reason \thefootnote needs to be set separately:
- \renewcommand\thefootnote{\protect\farsinumber{\c@footnote}}%
- }
-
-\def\nofarsi@globalnumbers{
- \let\@arabic\orig@arabic%
- \renewcommand\thefootnote{\protect\number{\c@footnote}}%
- }
-
-\def\blockextras@farsi{%
- \let\@@MakeUppercase\MakeUppercase%
- \def\MakeUppercase##1{##1}%
- }
-\def\noextras@farsi{%
- \let\MakeUppercase\@@MakeUppercase%
- }
% \end{macrocode}
% \iffalse
%</gloss-farsi.ldf>
@@ -3182,10 +3790,41 @@ and may look very wrong.}
\PolyglossiaSetup{finnish}{
hyphennames={finnish},
hyphenmins={2,2},
+ langtag=FIN,
frenchspacing=true,
fontsetup=true,
}
+\define@boolkey{finnish}[finnish@]{babelshorthands}[true]{}
+
+\ifsystem@babelshorthands
+ \setkeys{finnish}{babelshorthands=true}
+\else
+ \setkeys{finnish}{babelshorthands=false}
+\fi
+
+\ifcsundef{initiate@active@char}{%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
+}{}
+
+\def\finnish@shorthands{%
+ \bbl@activate{"}%
+ \def\language@group{finnish}%
+ \declare@shorthand{finnish}{"-}{\nobreak-\bbl@allowhyphens}
+ \declare@shorthand{finnish}{"|}{\textormath{\penalty@M\discretionary{-}{}{\kern.03em}}{}}%
+ \declare@shorthand{finnish}{""}{\hskip\z@skip}%
+ \declare@shorthand{finnish}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
+ \declare@shorthand{finnish}{"=}{\penalty@M-\hskip\z@skip}%
+ \declare@shorthand{finnish}{"/}{\textormath
+ {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}%
+}
+
+\def\nofinnish@shorthands{%
+ \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}%
+}
+
\def\captionsfinnish{%
\def\refname{Viitteet}%
\def\abstractname{Tiivistelmä}%
@@ -3209,7 +3848,7 @@ and may look very wrong.}
\def\headtoname{Vastaanottaja}%
\def\proofname{Todistus}%
\def\glossaryname{Sanasto}%
- }
+}
\def\datefinnish{%
\def\today{\number\day.~\ifcase\month\or
tammikuuta\or helmikuuta\or maaliskuuta\or huhtikuuta\or
@@ -3217,6 +3856,18 @@ and may look very wrong.}
syyskuuta\or lokakuuta\or marraskuuta\or joulukuuta\fi
\space\number\year}}
+\def\noextras@finnish{%
+ \nofinnish@shorthands%
+}
+
+\def\blockextras@finnish{%
+ \iffinnish@babelshorthands\finnish@shorthands\fi%
+}
+
+\def\inlineextras@finnish{%
+ \iffinnish@babelshorthands\finnish@shorthands\fi%
+}
+
% \end{macrocode}
% \iffalse
%</gloss-finnish.ldf>
@@ -3231,12 +3882,43 @@ and may look very wrong.}
\PolyglossiaSetup{french}{%
language=French,
script=Latin,
+ langtag=FRA,
hyphennames={french,francais},
frenchspacing=true,
indentfirst=true,
hyphenmins={2,2},
fontsetup=true}
+\def\french@variant{french}
+\define@choicekey*+{french}{variant}[\val\nr]{french,canadian,acadian}[french]{%
+ \ifcase\nr\relax
+ % french:
+ \def\french@variant{french}%
+ \or
+ % canadian:
+ \def\french@variant{canadien}%
+ \SetLanguageKeys{french}{babelname=canadien}%
+ \xpg@ifdefined{canadien}{}%
+ {\xpg@warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
+ I will use the standard patterns for French instead}%
+ \adddialect\l@canadien\l@french\relax}%
+ \or
+ % acadian:
+ \def\french@variant{acadian}%
+ \SetLanguageKeys{french}{babelname=canadien}%
+ \xpg@ifdefined{acadian}{}%
+ {\xpg@warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
+ I will use the standard patterns for French instead}%
+ \adddialect\l@acadian\l@french\relax}%
+ \fi
+ \xpg@info{Option: French, variant=\val}%
+}{\xpg@warning{Unknown French variant `#1'}}
+
+
+\def\french@language{%
+ \polyglossia@setup@language@patterns{\french@variant}
+}%
+
\ifluatex
\newluatexattribute\xpg@frpt %
\directlua{polyglossia.load_frpt()}%
@@ -3250,36 +3932,77 @@ and may look very wrong.}
\fi
\def\xpg@unskip{\ifhmode\ifdim\lastskip>\z@\unskip\fi\fi}
-\def\xpg@nospace#1{#1}
-
-\ifx\@makefntext\undefined\else
- \let\nofrench@makefntext\@makefntext
- \long\def\french@makefntext#1{\parindent1em \noindent\quad\ifx\@thefnmark\empty\else\@thefnmark.\space\fi #1}
- \let\@makefntext\french@makefntext
- \define@boolkey{french}[french@]{frenchfootnote}[true]{%
- \def\@tmpa{#1}
- \def\@tmptrue{true}
- \ifx\@tmpa\@tmptrue
- \let\@makefntext\french@makefntext
- \else
- \let\@makefntext\nofrench@makefntext
- \fi
- }
-\fi
+% Save original footnote definition
+\let\xpg@orig@makefntext\@makefntext
+
+\define@boolkey{french}[french@]{frenchfootnote}[true]{%
+ \AfterPreamble{%
+ \ifdefstring{\xpg@main@language}{french}{%
+ \iffrench@frenchfootnote
+ \ifx\@makefntext\undefined\else
+ \long\def\french@makefntext##1{%
+ \parindent1em \noindent\quad%
+ \ifx\@thefnmark\empty\else%
+ \@thefnmark.\space\fi ##1%
+ }
+ \let\@makefntext\french@makefntext
+ \fi
+ \else
+ \let\@makefntext\xpg@orig@makefntext
+ \fi
+ }{\xpg@warning{Option 'frenchfootnote' only supported if French is main language!}}%
+ }%
+}
+
+\define@boolkey{french}[french@]{autospacing}[true]{}
+\french@autospacingtrue
-\newif\iffrench@automaticspacesaroundguillemets
+\newif\iffrench@autospaceguillemets
+\define@boolkey{french}[french@]{autospaceguillemets}[true]{}
+\french@autospaceguillemetstrue
+
+% Backwards compatibility
\define@boolkey{french}[french@]{automaticspacesaroundguillemets}[true]{%
- %\def\tmp@true{true}%
- %\def\@tmpa{#1}%
- %\ifx\@tmpa\tmp@true
+ \iffrench@automaticspacesaroundguillemets
+ \setkeys{french}{autospaceguillemets=true}%
+ \else
+ \setkeys{french}{autospaceguillemets=false}%
+ \fi
+}
+
+% name is for compatibility with babel
+\let\french@ttfamilyORI\ttfamily
+\DeclareRobustCommand\french@ttfamilyFB{\nofrench@punctuation\french@ttfamilyORI}
+
+% Allow to switch on autospacing in ttfamily context
+\define@boolkey{french}[french@]{autospacetypewriter}[true]{}
+\french@autospacetypewriterfalse
+
+% This is how babel-french has it
+\define@boolkey{french}[french@]{OriginalTypewriter}[true]{%
+ \iffrench@OriginalTypewriter
+ \setkeys{french}{autospacetypewriter=false}%
+ \else
+ \setkeys{french}{autospacetypewriter=true}%
+ \fi
+}
+
+\def\french@fontsetup{%
+ \unless\iffrench@autospacetypewriter
+ \let\ttfamily\french@ttfamilyFB
+ \fi
+}
+
+
+\def\nofrench@fontsetup{%
+ \let\ttfamily\french@ttfamilyORI
}
-\french@automaticspacesaroundguillemetstrue
\def\french@punctuation{%
\lccode"2019="2019
\ifluatex
- \global\xpg@frpt=1\relax %
+ \xpg@frpt=1\relax %
\directlua{polyglossia.activate_frpt()}%
\else
\XeTeXinterchartokenstate=1
@@ -3301,24 +4024,24 @@ and may look very wrong.}
\XeTeXcharclass `\[ \french@closebrackets
\XeTeXcharclass `\{ \french@openbrackets
\XeTeXcharclass `\} \french@closebrackets
- \XeTeXinterchartoks \z@ \french@punctthin = {\nobreak\thinspace}%
+ \XeTeXinterchartoks \z@ \french@punctthin = {\thinspace}%
\XeTeXinterchartoks \z@ \french@punctthick = {\nobreakspace}%
- \XeTeXinterchartoks \xpg@boundaryclass \french@punctthin = {\xpg@unskip\nobreak\thinspace}%
+ \XeTeXinterchartoks \xpg@boundaryclass \french@punctthin = {\xpg@unskip\thinspace}%
\XeTeXinterchartoks \xpg@boundaryclass \french@punctthick = {\xpg@unskip\nobreakspace}%
- \XeTeXinterchartoks \french@punctguillstart \z@ = {\nobreakspace}% "«a" -> "« a"
- % \XeTeXinterchartoks \z@ \french@punctguillstart = {\nobreakspace}% "a«" unchanged?
- % \XeTeXinterchartoks \french@punctguillend \z@ = {\nobreakspace}% "»a" unchanged?
- \XeTeXinterchartoks \z@ \french@punctguillend = {\nobreakspace}% "a»" -> "a »"
- \iffrench@automaticspacesaroundguillemets
- \XeTeXinterchartoks \french@punctguillstart \xpg@boundaryclass = {\nobreakspace\xpg@nospace\relax}% "« " -> "«~"
- \XeTeXinterchartoks \xpg@boundaryclass \french@punctguillend = {\xpg@unskip\nobreakspace}% " »" -> "~»"
- \fi
- \XeTeXinterchartoks \french@punctguillend \french@punctthin = {\nobreak\thinspace}% "»;" -> "» ;"
- \XeTeXinterchartoks \french@punctguillend \french@punctthick = {\nobreakspace}% "»:" -> "» :"
- \XeTeXinterchartoks \french@punctthin \french@punctguillend = {\nobreakspace}% "?»" -> "? »"
+ \iffrench@autospaceguillemets
+ \XeTeXinterchartoks \french@punctguillstart \z@ = {\thinspace}% "«a" -> "«\,a"
+ % \XeTeXinterchartoks \z@ \french@punctguillstart = {\nobreakspace}% "a«" unchanged?
+ % \XeTeXinterchartoks \french@punctguillend \z@ = {\nobreakspace}% "»a" unchanged?
+ \XeTeXinterchartoks \z@ \french@punctguillend = {\thinspace}% "a»" -> "a\,»"
+ \XeTeXinterchartoks \french@punctguillstart \xpg@boundaryclass = {\thinspace\ignorespaces}% "« " -> "«\,"
+ \XeTeXinterchartoks \xpg@boundaryclass \french@punctguillend = {\xpg@unskip\thinspace}% " »" -> "\,»"
+ \fi
+ \XeTeXinterchartoks \french@punctguillend \french@punctthin = {\thinspace}% "»;" -> "»\,;"
+ \XeTeXinterchartoks \french@punctguillend \french@punctthick = {\nobreakspace}% "»:" -> "» :"
+ \XeTeXinterchartoks \french@punctthin \french@punctguillend = {\thinspace}% "?»" -> "?\,»"
\XeTeXinterchartoks \french@openbrackets \french@punctthin = {\xpg@unskip}% "(?" -> "(?" and not "( ?"
\XeTeXinterchartoks \french@punctthin \french@closebrackets = {\xpg@unskip}% "?)" -> "?)" (code not need, just for symetry with previous one)
- \XeTeXinterchartoks \french@closebrackets \french@punctthin = {\nobreak\thinspace}% ")?" -> ") ?"
+ \XeTeXinterchartoks \french@closebrackets \french@punctthin = {\thinspace}% ")?" -> ")\,?"
\XeTeXinterchartoks \french@closebrackets \french@punctthick = {\nobreakspace}% "):" -> ") :"
\fi
}
@@ -3326,7 +4049,7 @@ and may look very wrong.}
\def\nofrench@punctuation{%
\lccode"2019=\z@
\ifluatex
- \global\xpg@frpt=0\relax %
+ \xpg@frpt=0\relax %
% Though it would make compilation slightly faster, it is not possible to
% safely uncomment the following line. Imagine the following case: you start
% a paragraph by some french text, then, in the same paragraph, you change
@@ -3380,6 +4103,7 @@ and may look very wrong.}
\def\headtoname{}%
\def\proofname{Démonstration}%
}
+
\def\datefrench{%
\def\today{\ifx\ier\undefined\def\ier{er}\fi
\ifnum\day=1\relax 1\ier%
@@ -3392,15 +4116,30 @@ and may look very wrong.}
\def\noextras@french{%
\nofrench@punctuation%
- }
+ \nofrench@fontsetup%
+}
\def\blockextras@french{%
- \french@punctuation%
- }
+ \iffrench@autospacing
+ \french@punctuation%
+ \fi
+ \french@fontsetup%
+}
\def\inlineextras@french{%
- \french@punctuation%
- }
+ \iffrench@autospacing
+ \french@punctuation%
+ \fi
+ \french@fontsetup%
+}
+
+\def\NoAutoSpacing{%
+ \nofrench@punctuation%
+}
+
+\def\AutoSpacing{%
+ \french@punctuation%
+}
\def\ier{\textsuperscript{er}}
\def\iers{\textsuperscript{ers}}
@@ -3430,17 +4169,50 @@ and may look very wrong.}
% \subsection{gloss-friulan.ldf}
% \begin{macrocode}
\ProvidesFile{gloss-friulan.ldf}[polyglossia: module for friulan]
-\makeatletter
+
+% We only provide this gloss for babel compatibility.
+
+\input{gloss-friulian.ldf}
+
\PolyglossiaSetup{friulan}{%
+ language=Friulian,
hyphennames={friulan,furlan},
hyphenmins={2,2},
+ langtag=FRL,
indentfirst=false,
fontsetup=true,
frenchspacing=true,
}
+\let\captionsfriulan\captionsfriulian
+\let\datefriulan\datefriulian
+\let\noextras@friulan\noextras@friulian
+\let\blockextras@friulan\blockextras@friulian
+\let\inlineextras@friulan\inlineextras@friulian
+
+% \end{macrocode}
+% \iffalse
+%</gloss-friulan.ldf>
+%<*gloss-friulian.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-friulian.ldf}
+% \begin{macrocode}
+\ProvidesFile{gloss-friulian.ldf}[polyglossia: module for friulian]
+
+\PolyglossiaSetup{friulian}{%
+ language=Friulian,
+ babelname=friulan,
+ hyphennames={friulan,furlan},
+ hyphenmins={2,2},
+ langtag=FRL,
+ indentfirst=false,
+ fontsetup=true,
+ frenchspacing=true,
+}
-\def\captionsfriulan{%
+\def\captionsfriulian{%
\def\prefacename{Prefazion}%
\def\refname{Riferiments}%
\def\abstractname{Somari}%
@@ -3464,7 +4236,7 @@ and may look very wrong.}
\def\glossaryname{Glossari}%
}
-\def\datefriulan{%
+\def\datefriulian{%
\def\today{\number\day\space di\space\ifcase\month\or
Genâr\or Fevrâr\or Març\or Avril\or Mai\or Jugn\or
Lui\or Avost\or Setembar\or Otobar\or Novembar\or Dicembar%
@@ -3479,23 +4251,138 @@ and may look very wrong.}
}
-\def\noextras@friulan{%
+\def\noextras@friulian{%
\lccode\string"2019=\z@
}
-\def\blockextras@friulan{%
+\def\blockextras@friulian{%
\lccode\string"2019=\string"2019
\clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000
\finalhyphendemerits=50000000
}
-\def\inlineextras@friulan{%
+\def\inlineextras@friulian{%
\lccode\string"2019=\string"2019
}
% \end{macrocode}
% \iffalse
-%</gloss-friulan.ldf>
+%</gloss-friulian.ldf>
+%<*gloss-gaelic.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-gaelic.ldf}
+% \begin{macrocode}
+\ProvidesFile{gloss-gaelic.ldf}[polyglossia: module for gaelic]
+
+\PolyglossiaSetup{gaelic}{
+ language=Irish,
+ babelname=irish,
+ hyphennames={irish},
+ hyphenmins={2,2},
+ langtag=IRI,
+ fontsetup=true,
+}
+
+\def\gaelic@variant{irish}
+\define@choicekey*+{gaelic}{variant}[\val\nr]{irish,scottish}[irish]{%
+ \ifcase\nr\relax
+ % irish:
+ \gdef\gaelic@variant{irish}%
+ \SetLanguageKeys{gaelic}{language=Irish,langtag=IRI,babelname=irish}%
+ \xpg@fontsetup@latin{gaelic}%
+ \or
+ % scottish:
+ \gdef\gaelic@variant{scottish}%
+ \SetLanguageKeys{gaelic}{language=Gaelic,langtag=GAE,babelname=scottish}%
+ \xpg@fontsetup@latin{gaelic}%
+ \fi
+ \xpg@info{Option: gaelic, variant=\val}%
+}{\xpg@warning{Unknown gaelic variant `#1'}}
+
+\def\captionsgaelic@irish{%
+ \def\refname{Tagairtí}%
+ \def\abstractname{Achoimre}%
+ \def\bibname{Leabharliosta}%
+ \def\prefacename{Réamhrá}% <-- also "Brollach"
+ \def\refname{Tagairtí}%
+ \def\chaptername{Tagairtí}%
+ \def\appendixname{Aguisín}%
+ \def\contentsname{Clár Ábhair}%
+ \def\listfigurename{Léaráidí}%
+ \def\listtablename{Táblaí}%
+ \def\indexname{Innéacs}%
+ \def\figurename{Léaráid}%
+ \def\tablename{Tábla}%
+ %\def\thepart{}%
+ \def\partname{Cuid}%
+ \def\pagename{Leathanach}%
+ \def\seename{féach}%
+ \def\alsoname{féach freisin}%
+ \def\enclname{faoi iamh}%
+ \def\ccname{cc}%
+ \def\headtoname{Go}%
+ \def\proofname{Cruthúnas}%
+ \def\glossaryname{Glossary}%
+}
+
+\def\captionsgaelic@scottish{%
+ \def\refname{Iomraidh}%
+ \def\abstractname{Brìgh}%
+ \def\bibname{Leabhraichean}%
+ \def\prefacename{Preface}% <-- needs translation
+ \def\chaptername{Caibideil}%
+ \def\appendixname{Ath-sgr`ıobhadh}%
+ \def\contentsname{Clàr-obrach}%
+ \def\listfigurename{Liosta Dhealbh}%
+ \def\listtablename{Liosta Chlàr}%
+ \def\indexname{Clàr-innse}%
+ \def\figurename{Dealbh}%
+ \def\tablename{Clàr}%
+ %\def\thepart{}%
+ \def\partname{Cuid}%
+ \def\pagename{t.d.}%
+ \def\seename{see}% <-- needs translation
+ \def\alsoname{see also}% <-- needs translation
+ \def\enclname{a-staigh}%
+ \def\ccname{lethbhreac gu}%
+ \def\headtoname{gu}%
+ \def\proofname{Proof}% <-- needs translation
+ \def\glossaryname{Glossary}% <-- needs translation
+}
+
+\def\captionsgaelic{%
+ \csname captionsgaelic@\gaelic@variant\endcsname%
+}
+
+\def\dategaelic@irish{%
+ \def\today{%
+ \number\day\space \ifcase\month\or
+ Eanáir\or Feabhra\or Márta\or Aibreán\or
+ Bealtaine\or Meitheamh\or Iúil\or Lúnasa\or
+ Meán Fómhair\or Deireadh Fómhair\or
+ Mí na Samhna\or Mí na Nollag\fi
+ \space \number\year}%
+}
+
+\def\dategaelic@scottish{%
+ \def\today{%
+ \number\day\space \ifcase\month\or
+ am Faoilteach\or an Gearran\or am Màrt\or an Giblean\or
+ an Cèitean\or an t-Òg mhios\or an t-Iuchar\or
+ Lùnasdal\or an Sultuine\or an Dàmhar\or
+ an t-Samhainn\or an Dubhlachd\fi
+ \space \number\year}%
+}
+
+\def\dategaelic{%
+ \csname dategaelic@\gaelic@variant\endcsname%
+}
+
+% \end{macrocode}
+% \iffalse
+%</gloss-gaelic.ldf>
%<*gloss-galician.ldf>
% \fi
% \clearpage
@@ -3506,6 +4393,7 @@ and may look very wrong.}
\PolyglossiaSetup{galician}{
hyphennames={galician},
hyphenmins={2,2},
+ langtag=GAL,
indentfirst=true,
fontsetup=true,
}
@@ -3554,63 +4442,86 @@ and may look very wrong.}
hyphenmins={2,2},
frenchspacing=true,
fontsetup=true,
+ langtag=DEU,
+ babelname=ngerman
}
-\def\tmp@old{old}
-\def\tmp@oldyr{1901}
\newif\if@german@oldspelling
\@german@oldspellingfalse
-\define@key{german}{spelling}[new]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@oldyr\def\@tmpa{old}\fi
- \ifx\@tmpa\tmp@old
- \xpg@ifdefined{german}{}{%
- \xpg@nopatterns{german}%
- \adddialect\l@german\l@nohyphenation
- }
- \@german@oldspellingtrue
- \else % try ngerman
- \xpg@ifdefined{ngerman}{%
+\define@choicekey*+{german}{spelling}[\val\nr]{new,old,1901}[new]{%
+ \ifcase\nr\relax
+ % new:
\@german@oldspellingfalse
- }{% fall back to german
- \xpg@ifdefined{german}{%
- \xpg@warning{You asked for `ngerman' but only `german' hyphenation is available!}%
- \@german@oldspellingtrue
- }{%
- \xpg@nopatterns{ngerman}%
- \adddialect\l@ngerman\l@nohyphenation
- }%
- }%
- \fi
-}
+ \or
+ % old:
+ \@german@oldspellingtrue
+ \or
+ % 1901:
+ \@german@oldspellingtrue
+ \fi
+ \german@set@babelname%
+ \xpg@info{Option: German, spelling=\val}%
+}{\xpg@warning{Unknown German spelling `#1'}}
\newif\if@austrian@locale
\@austrian@localefalse
\newif\if@swiss@locale
\@swiss@localefalse
-\def\tmp@austrian{austrian}
-\def\tmp@swiss{swiss}
-\define@key{german}{variant}[german]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@austrian\@austrian@localetrue\else
- \@austrian@localefalse%
- \fi
- \ifx\@tmpa\tmp@swiss\@swiss@localetrue
- \xpg@ifdefined{swissgerman}{}%
- {\xpg@warning{No hyphenation patterns were loaded for "Swiss German (Old Spelling)"\MessageBreak
- I will use the standard patterns for German (old spelling) instead}%
- \adddialect\l@swissgerman\l@german\relax}%
- \else
- \@swiss@localefalse%
- \fi}
+\define@choicekey*+{german}{variant}[\val\nr]{german,austrian,swiss}[german]{%
+ \ifcase\nr\relax
+ % german:
+ \@swiss@localefalse%
+ \@austrian@localefalse%
+ \or
+ % austrian:
+ \@austrian@localetrue%
+ \@swiss@localefalse%
+ \or
+ % swiss:
+ \@swiss@localetrue%
+ \@austrian@localefalse%
+ \xpg@ifdefined{swissgerman}{}%
+ {%
+ \xpg@warning{No hyphenation patterns were loaded for "Swiss German (Old Spelling)"\MessageBreak
+ I will use the standard patterns for German (old spelling) instead}%
+ \adddialect\l@swissgerman\l@german\relax%
+ }%
+ \fi
+ \german@set@babelname%
+ \xpg@info{Option: German, variant=\val}%
+}{\xpg@warning{Unknown German variant `#1'}}
+
+\def\german@set@babelname{%
+ \if@german@oldspelling
+ \if@swiss@locale
+ \SetLanguageKeys{german}{babelname=swissgerman}%
+ \else
+ \if@austrian@locale
+ \SetLanguageKeys{german}{babelname=austrian}%
+ \else
+ \SetLanguageKeys{german}{babelname=german}%
+ \fi\fi
+ \else
+ \if@swiss@locale
+ \SetLanguageKeys{german}{babelname=nswissgerman}%
+ \fi
+ \if@austrian@locale
+ \SetLanguageKeys{german}{babelname=naustrian}%
+ \fi
+ \fi
+}
\newif\if@german@fraktur
-\def\tmp@fraktur{fraktur}
-\define@key{german}{script}[latin]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@fraktur\@german@frakturtrue\else
- \@german@frakturfalse%
- \fi}
+\define@choicekey*+{german}{script}[\val\nr]{latin,fraktur}[latin]{%
+ \ifcase\nr\relax
+ % latin:
+ \@german@frakturfalse%
+ \or
+ % fraktur:
+ \@german@frakturtrue%
+ \fi
+ \xpg@info{Option: German, script=\val}%
+}{\xpg@warning{Unknown German script `#1'}}
\define@boolkey{german}[german@]{latesthyphen}[false]{}
@@ -3625,8 +4536,9 @@ and may look very wrong.}
\fi
\ifcsundef{initiate@active@char}{%
-\input{babelsh.def}%
-\initiate@active@char{"}%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
}{}
\def\german@shorthands{%
@@ -3741,43 +4653,28 @@ and may look very wrong.}
\if@german@fraktur\date@german@fraktur\else\date@german\fi
}
-\def\german@language{\ifxetex\language=%
- \csname l@%
- \if@swiss@locale
- \if@german@oldspelling
- swissgerman%
- \else
- ngerman%
- \ifgerman@latesthyphen
- -x-latest
- \fi
- \fi
- \else% (german, austrian)
- \if@german@oldspelling\else n\fi german\ifgerman@latesthyphen -x-latest\fi
- \fi
- \endcsname\else\ifluatex
- % LuaTeX
+\def\german@language{%
\ifgerman@latesthyphen
\if@german@oldspelling
\if@swiss@locale
- \xpg@set@language@luatex@iv{swissgerman}%
+ \polyglossia@setup@language@patterns{swissgerman}%
\else
- \xpg@set@language@luatex@iv{german-x-latest}%
+ \polyglossia@setup@language@patterns{german-x-latest}%
\fi
\else
- \xpg@set@language@luatex@iv{ngerman-x-latest}%
+ \polyglossia@setup@language@patterns{ngerman-x-latest}%
\fi
\else% (latesthyphen=false)
\if@german@oldspelling
\if@swiss@locale
- \xpg@set@language@luatex@iv{swissgerman}%
+ \polyglossia@setup@language@patterns{swissgerman}%
\else
- \xpg@set@language@luatex@iv{german}%
+ \polyglossia@setup@language@patterns{german}%
\fi
\else
- \xpg@set@language@luatex@iv{ngerman}%
+ \polyglossia@setup@language@patterns{ngerman}%
\fi
- \fi\fi\fi
+ \fi
}
\def\noextras@german{%
@@ -3805,9 +4702,12 @@ and may look very wrong.}
\PolyglossiaSetup{greek}{
script=Greek,
scripttag=grek,
+ langtag=ELL,
frenchspacing=true,
indentfirst=true,
fontsetup=true,
+ localnumeral=greeknumerals,
+ Localnumeral=Greeknumerals
%TODO localalph={greek@alph,greek@Alph}
}
@@ -3819,31 +4719,6 @@ and may look very wrong.}
% this file imported from xgreek fixes the \lccode and \uccode of Greek letters:
\input{xgreek-fixes.def}
-%TODO: set these in \define@key instead:
-\ifx\l@greek\@undefined
- \ifx\l@polygreek\@undefined
- \xpg@nopatterns{Greek}%
- \adddialect\l@greek\l@nohyphenation
- \else
- \let\l@greek\l@polygreek
- \fi
-\fi
-\ifx\l@monogreek\@undefined
- \xpg@warning{No hyphenation patterns were loaded for Monotonic Greek\MessageBreak
- I will use the patterns loaded for \string\l@greek instead}
- \adddialect\l@monogreek\l@greek
-\fi
-\ifx\l@ancientgreek\@undefined
- \xpg@warning{No hyphenation patterns were loaded for Ancient Greek\MessageBreak
- I will use the patterns loaded for \string\l@greek instead}
- \adddialect\l@ancientgreek\l@greek
-\fi
-
-%set monotonic as default
-\def\greek@variant{\l@monogreek}% monotonic
-\def\captionsgreek{\monogreekcaptions}%
-\def\dategreek{\datemonogreek}%
-
\def\tmp@mono{mono}
\def\tmp@monotonic{monotonic}
\def\tmp@poly{poly}
@@ -3851,39 +4726,62 @@ and may look very wrong.}
\def\tmp@ancient{ancient}
\def\tmp@ancientgreek{ancientgreek}
+\def\greek@variant{monogreek}
+
\define@key{greek}{variant}[monotonic]{%
\def\@tmpa{#1}%
+ \xpg@ifdefined{greek}{}{%
+ \xpg@nopatterns{greek}%
+ \adddialect\l@greek\l@nohyphenation
+ }
\ifx\@tmpa\tmp@poly\def\@tmpa{polytonic}\fi
\ifx\@tmpa\tmp@ancientgreek\def\@tmpa{ancient}\fi
\ifx\@tmpa\tmp@polytonic%
- \def\greek@variant{\l@polygreek}%
+ \xpg@ifdefined{polygreek}{}%
+ {\xpg@warning{No hyphenation patterns were loaded for Polytonic Greek\MessageBreak
+ I will use the patterns loaded for \string\l@greek\space instead}%
+ \adddialect\l@polygreek\l@greek\relax}%
+ \def\greek@variant{polygreek}%
\def\captionsgreek{\polygreekcaptions}%
\def\dategreek{\datepolygreek}%
+ \SetLanguageKeys{greek}{babelname=polutonikogreek}%
\xpg@info{Option: Polytonic Greek}%
\else
\ifx\@tmpa\tmp@ancient
- \def\greek@variant{\l@ancientgreek}%
+ \xpg@ifdefined{ancientgreek}{}%
+ {\xpg@warning{No hyphenation patterns were loaded for Ancient Greek\MessageBreak
+ I will use the patterns loaded for \string\l@greek\space instead}%
+ \adddialect\l@ancientgreek\l@greek\relax}%
+ \def\greek@variant{ancientgreek}%
\def\captionsgreek{\ancientgreekcaptions}%
\def\dategreek{\dateancientgreek}%
\xpg@info{Option: Ancient Greek}%
\else %monotonic
- \def\greek@variant{\l@monogreek}% monotonic
+ \xpg@ifdefined{monogreek}{}%
+ {\xpg@warning{No hyphenation patterns were loaded for Monotonic Greek\MessageBreak
+ I will use the patterns loaded for \string\l@greek\space instead}%
+ \adddialect\l@monogreek\l@greek\relax}%
+ \def\greek@variant{monogreek}% monotonic
\def\captionsgreek{\monogreekcaptions}%
\def\dategreek{\datemonogreek}%
\xpg@info{Option: Monotonic Greek}%
\fi
\fi}
-\def\greek@language{\language=\greek@variant}
+\def\greek@language{%
+ \polyglossia@setup@language@patterns{\greek@variant}
+}
+
\newif\if@greek@numerals
\define@key{greek}{numerals}[greek]{%
-\ifstrequal{#1}{arabic}{\@greek@numeralsfalse}{\@greek@numeralstrue}}
+ \ifstrequal{#1}{arabic}{\@greek@numeralsfalse}{\@greek@numeralstrue}%
+}
\define@boolkey{greek}{attic}[true]{\xpg@warning{Greek option `attic' is no longer required.}}
% This sets the defaults
-\setkeys{greek}{numerals}
+\setkeys{greek}{numerals,variant}
\def\monogreekcaptions{%
\def\refname{Αναφορές}%
@@ -3997,8 +4895,8 @@ and may look very wrong.}
\def\ccname{Κοινοποίησις}%
\def\headtoname{Πρὸς}%
\def\pagename{Σελὶς}%
- \def\seename{ὃρα}%
- \def\alsoname{ὃρα ὡσαύτως}%
+ \def\seename{ὅρα}%
+ \def\alsoname{ὅρα ὡσαύτως}%
\def\proofname{Ἀπόδειξις}%
\def\glossaryname{Γλωσσάριον}%
\def\refname{Ἀναφοραὶ}%
@@ -4031,14 +4929,18 @@ and may look very wrong.}
Δεκεμβρίου\fi}}
% the code for alphabetic numbers and attic numerals
-% is copied verbatim from xgreek.sty
-\DeclareRobustCommand\anw@false{%
- \DeclareRobustCommand\anw@print{}}
-\DeclareRobustCommand\anw@true{%
- \DeclareRobustCommand\anw@print{ʹ}}
+\newrobustcmd\anw@print{}
+\newrobustcmd\anw@false{%
+ \renewrobustcmd\anw@print{}}
+\newrobustcmd\anw@true{%
+ \renewrobustcmd\anw@print{ʹ}}
\anw@true
-\def\greeknumber#1{%
+\newcommand{\greeknumerals}[2]{\greeknumber{#2}}
+\newcommand{\Greeknumerals}[2]{\Greeknumber{#2}}
+
+\protected\def\greeknumber#1{\expandafter\@greeknumber\expandafter{\number#1}}
+\def\@greeknumber#1{%
\ifnum#1<\@ne\space\gr@ill@value{#1}%
\else
\ifnum#1<10\expandafter\gr@num@i\number#1%
@@ -4062,8 +4964,31 @@ and may look very wrong.}
\fi
\fi
}
-\def\Greeknumber#1{%
- \expandafter\MakeUppercase\expandafter{\greeknumber{#1}}}
+\protected\def\Greeknumber#1{\expandafter\@Greeknumber\expandafter{\number#1}}
+\def\@Greeknumber#1{%
+ \ifnum#1<\@ne\space\gr@ill@value{#1}%
+ \else
+ \ifnum#1<10\expandafter\gr@Num@i\number#1%
+ \else
+ \ifnum#1<100\expandafter\gr@Num@ii\number#1%
+ \else
+ \ifnum#1<\@m\expandafter\gr@Num@iii\number#1%
+ \else
+ \ifnum#1<\@M\expandafter\gr@Num@iv\number#1%
+ \else
+ \ifnum#1<100000\expandafter\gr@Num@v\number#1%
+ \else
+ \ifnum#1<1000000\expandafter\gr@Num@vi\number#1%
+ \else
+ \space\gr@ill@value{#1}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+}
\let\greeknumeral=\greeknumber
\let\Greeknumeral=\Greeknumber
\def\gr@num@i#1{%
@@ -4086,6 +5011,27 @@ and may look very wrong.}
\def\gr@num@vi#1{%
͵\ifcase#1\or ρ\or σ\or τ\or υ\or φ\or χ\or ψ\or ω\or ϡ\fi
\gr@num@v}
+\def\gr@Num@i#1{%
+ \ifcase#1 \or Α\or Β\or Γ\or Δ\or Ε\or \MakeUppercase{Ϛ}\or Ζ\or Η\or θ\fi
+ \ifnum#1=\z@\else\anw@true\fi\anw@print}
+\def\gr@Num@ii#1{%
+ \ifcase#1 \or Ι\or Κ\or Λ\or Μ\or Ν\or Ξ\or Ο\or Π\or \MakeUppercase{ϟ}\fi
+ \ifnum#1=\z@\else\anw@true\fi\gr@Num@i}
+\def\gr@Num@iii#1{%
+ \ifcase#1 \or Ρ\or Σ\or Τ\or Υ\or Φ\or Χ\or Ψ\or Ω\or \MakeUppercase{ϡ}\fi
+ \ifnum#1=\z@\anw@false\else\anw@true\fi\gr@Num@ii}
+\def\gr@Num@iv#1{%
+ \ifnum#1=\z@\else ͵\fi
+ \ifcase#1 \or Α\or Β\or Γ\or Δ\or Ε\or \MakeUppercase{Ϛ}\or Ζ\or Η\or θ\fi
+ \gr@Num@iii}
+\def\gr@Num@v#1{%
+ \ifnum#1=\z@\else ͵\fi
+ \ifcase#1 \or Ι\or Κ\or Λ\or Μ\or Ν\or Ξ\or Ο\or Π\or \MakeUppercase{ϟ}\fi
+\gr@Num@iv}
+ \def\gr@Num@vi#1{%
+͵ \ifcase#1 \or Ρ\or Σ\or Τ\or Υ\or Φ\or Χ\or Ψ\or Ω\or \MakeUppercase{ϡ}\fi
+ \gr@Num@v}
+\def\gr@ill@value#1{\xpg@warning{Illegal value (#1) for Greek numeral}[$#1$]}
%%%% Attic numerals (no longer optional)
\newcount\@attic@num
@@ -4129,11 +5075,9 @@ and may look very wrong.}
\let\atticnum=\atticnumeral
\def\greek@numbers{%
- \let\latin@alph\@alph%
- \let\latin@Alph\@Alph%
\if@greek@numerals
- \def\greek@alph##1{\protect\greeknumber{##1}}%
- \def\greek@Alph##1{\protect\Greeknumber{##1}}%
+ \def\greek@alph##1{\expandafter\greeknumeral\expandafter{\the##1}}%
+ \def\greek@Alph##1{\expandafter\Greeknumeral\expandafter{\the##1}}%
\let\@alph\greek@alph%
\let\@Alph\greek@Alph%
\fi}
@@ -4164,14 +5108,14 @@ and may look very wrong.}
\RequireBidi
\RequirePackage{hebrewcal}
-\providebool{@hebrew@marcheshvan}
-
\PolyglossiaSetup{hebrew}{
script=Hebrew,
direction=RL,
scripttag=hebr,
+ langtag=IWR,
hyphennames={nohyphenation},
fontsetup=true,
+ localnumeral=hebrewnumerals
%TODO localalph={hebrewnumeral,Hebrewnumeral}
%digits = hebrewnumber
}
@@ -4187,16 +5131,10 @@ and may look very wrong.}
\@calendar@hebrewfalse%
\fi}
-\define@boolkey{hebrew}[@xpg@hebrew@]{marcheshvan}[false]{%
- \def\@tmpa{#1}%
- \def\@tmptrue{true}%
- \ifx\@tmpa\@tmptrue
- \@xpg@hebrew@marcheshvantrue
- \else
- \@xpg@hebrew@marcheshvanfalse
- \fi}
+\newif\if@xpg@hebrew@marcheshvan
+\@xpg@hebrew@marcheshvanfalse
-\setkeys{hebrew}{marcheshvan}
+\define@boolkey{hebrew}[@xpg@hebrew@]{marcheshvan}[true]{}
% hebrewcal.sty also defines the boolean key fullyear (default=false)
@@ -4256,42 +5194,49 @@ and may look very wrong.}
\input{babel-hebrewalph.def}
+\newcommand{\hebrewnumerals}[2]{\hebrewnumber{#2}}
+
\def\hebrewnumber#1{%
\if@hebrew@numerals
- \protect\hebrewnumeral{#1}%
+ \hebrewnumeral{#1}%
\else
\number#1%
\fi
}
\def\hebrew@numbers{%
- \let\@origalph\@alph%
- \let\@origAlph\@Alph%
\let\@alph\hebrewnumeral%
\let\@Alph\Hebrewnumeral%
}
+
\def\nohebrew@numbers{%
- \let\@alph\@origalph%
- \let\@Alph\@origAlph%
+ \let\@alph\latin@alph%
+ \let\@Alph\latin@Alph%
}
\def\hebrew@globalnumbers{%
- \let\orig@arabic\@arabic%
\let\@arabic\hebrewnumber%
- \renewcommand\thefootnote{\protect\hebrewnumber{\c@footnote}}%
+ \renewcommand\thefootnote{\localnumeral*{footnote}}%
}
+
+% Store original definition
+\let\xpg@save@arabic\@arabic
+
\def\nohebrew@globalnumbers{%
- \let\@arabic\orig@arabic%
- \renewcommand\thefootnote{\protect\number{\c@footnote}}%
+ \let\@arabic\xpg@save@arabic%
}
+% Save original \MakeUppercase definition
+\let\xpg@save@MakeUppercase\MakeUppercase
+
\def\blockextras@hebrew{%
- \let\@@MakeUppercase\MakeUppercase%
\def\MakeUppercase##1{##1}%
- }
+}
+
\def\noextras@hebrew{%
- \let\MakeUppercase\@@MakeUppercase%
- }
+ % restore original \MakeUppercase definition
+ \let\MakeUppercase\xpg@save@MakeUppercase%
+}
% \end{macrocode}
% \iffalse
@@ -4302,27 +5247,21 @@ and may look very wrong.}
%
% \subsection{gloss-hindi.ldf}
% \begin{macrocode}
-% UTF-8 strings kindly provided by Zdenek Wagner, 10-03-2008
+% UTF-8 strings kindly provided by Zdenĕk Wagner, 10-03-2008
% with corrections and additional contributions by Anshuman Pandey
% TODO: add option for velthuis transliteration with link to
% Velthuis Devanagari project.
\ProvidesFile{gloss-hindi.ldf}[polyglossia: module for hindi]
-\ifluatex
- \xpg@warning{Hindi is not supported with LuaTeX.\MessageBreak
-I will proceed with the compilation, but\MessageBreak
-the output is not guaranteed to be correct\MessageBreak
-and may look very wrong.}
-\fi
\RequirePackage{devanagaridigits}
\PolyglossiaSetup{hindi}{
script=Devanagari,
scripttag=deva,
langtag=HIN,
%% hyphennames={hindi,!sanskrit}, TODO: implement fallback patterns (with ! prefix)
- fontsetup=true
+ fontsetup=true,
+ localnumeral=hindinumerals
%TODO nouppercase=true,
- %TODO localnumber=hindinumber
}
\ifx\l@hindi\@undefined%
@@ -4336,7 +5275,9 @@ and may look very wrong.}
\fi
\fi
-\def\hindi@language{\language=\l@hindi}
+\def\hindi@language{%
+ \polyglossia@setup@language@patterns{hindi}%
+}
\def\tmp@western{Western}
\newif\ifhindi@devanagari@numerals
@@ -4348,6 +5289,8 @@ and may look very wrong.}
\hindi@devanagari@numeralsfalse
\fi}
+\newcommand{\hindinumerals}[2]{\hindinumber{#2}}
+
\def\hindinumber#1{%
\ifhindi@devanagari@numerals
\devanagaridigits{\number#1}%
@@ -4358,13 +5301,13 @@ and may look very wrong.}
\def\captionshindi{%
\def\abstractname{सारांश}%
\def\appendixname{परिशिष्ट}%
- \def\bibname{संदर्भ ग्रन्थ}%
+ \def\bibname{संदर्भ ग्रंथ}%
\def\ccname{}%
\def\chaptername{अध्याय}%
\def\contentsname{विषय सूची}%
\def\enclname{}%
\def\figurename{चित्र}% रेखाचित्र
- \def\headpagename{पृषठ}%
+ \def\headpagename{पृष्ठ}%
\def\headtoname{}%
\def\indexname{सूची}%
% सूचक
@@ -4372,7 +5315,7 @@ and may look very wrong.}
% अनुक्रमणि
\def\listfigurename{चित्रों की सूची}%
\def\listtablename{तालिकाओं की सूची}%
- \def\pagename{पृषठ}%
+ \def\pagename{पृष्ठ}%
\def\partname{खणड}%
\def\prefacename{प्रस्तावना}% प्राक्कथन
\def\refname{हवाले}%
@@ -4398,17 +5341,110 @@ and may look very wrong.}
\space\hindinumber\year}%
}
+% Save original \MakeUppercase definition
+\let\xpg@save@MakeUppercase\MakeUppercase
+
\def\blockextras@hindi{%
- \let\@@MakeUppercase\MakeUppercase%
\def\MakeUppercase##1{##1}%
}
+
\def\noextras@hindi{%
- \let\MakeUppercase\@@MakeUppercase%
+ % restore original \MakeUppercase definition
+ \let\MakeUppercase\xpg@save@MakeUppercase%
}
% \end{macrocode}
% \iffalse
%</gloss-hindi.ldf>
+%<*gloss-hungarian.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-hungarian.ldf}
+% \begin{macrocode}
+\ProvidesFile{gloss-hungarian.ldf}[polyglossia: module for hungarian]
+
+\PolyglossiaSetup{hungarian}{
+ babelname=magyar,
+ hyphennames={magyar,hungarian},
+ langtag=HUN,
+ hyphenmins={2,2},
+ fontsetup=true,
+}
+
+\frenchspacing
+
+\def\captionshungarian{%
+ \def\refname{Hivatkozások}%
+ \def\abstractname{Kivonat}%
+ \def\bibname{Irodalomjegyzék}%
+ \def\prefacename{Előszó}%
+ \def\chaptername{fejezet}%
+ \def\appendixname{Függelék}%
+ \def\contentsname{Tartalomjegyzék}%
+ \def\listfigurename{Ábrák jegyzéke}%
+ \def\listtablename{Táblázatok jegyzéke}%
+ \def\indexname{Tárgymutató}%
+ \def\figurename{ábra}%
+ \def\tablename{táblázat}%
+ %\def\thepart{}%
+ \def\partname{rész}%
+ \def\pagename{oldal}%
+ \def\seename{lásd}%
+ \def\alsoname{lásd még}%
+ \def\enclname{Melléklet}%
+ \def\ccname{Körlevél–címzettek}%
+ \def\headtoname{Címzett}%
+ \def\proofname{Bizonyítás}%
+ \def\glossaryname{Szójegyzék}%
+}
+
+\def\datehungarian{%
+ \def\today{%
+ \number\year.\nobreakspace\ifcase\month\or
+ január\or február\or március\or
+ április\or május\or június\or
+ július\or augusztus\or szeptember\or
+ október\or november\or december\fi
+ \space\number\day.}%
+ \def\ondatehungarian{%
+ \number\year.\nobreakspace\ifcase\month\or
+ január\or február\or március\or
+ április\or május\or június\or
+ július\or augusztus\or szeptember\or
+ október\or november\or december\fi
+ \space\ifcase\day\or
+ 1-jén\or 2-án\or 3-án\or 4-én\or 5-én\or
+ 6-án\or 7-én\or 8-án\or 9-én\or 10-én\or
+ 11-én\or 12-én\or 13-án\or 14-én\or 15-én\or
+ 16-án\or 17-én\or 18-án\or 19-én\or 20-án\or
+ 21-én\or 22-én\or 23-án\or 24-én\or 25-én\or
+ 26-án\or 27-én\or 28-án\or 29-én\or 30-án\or
+ 31-én\fi}%
+ \let\ontoday\ondatehungarian}
+
+% change 'táblázat x.x' to 'x.x. táblázat'
+\def\xpg@hungarian@fnum@table{\thetable.~\tablename}
+\let\xpg@save@fnum@table\fnum@table
+
+% change 'ábra x.x' to 'x.x. ábra'
+\def\xpg@hungarian@fnum@figure{\thefigure.~\figurename}
+\let\xpg@save@fnum@figure\fnum@figure
+
+\def\blockextras@hungarian{%
+ \let\fnum@table\xpg@hungarian@fnum@table
+ \let\fnum@figure\xpg@hungarian@fnum@figure
+}
+
+\def\noextras@hungarian{%
+ \let\fnum@table\xpg@save@fnum@table
+ \let\fnum@figure\xpg@save@fnum@figure
+ \let\ontoday\@undefined
+}
+
+% \end{macrocode}
+% \iffalse
+%</gloss-hungarian.ldf>
%<*gloss-icelandic.ldf>
% \fi
% \clearpage
@@ -4419,6 +5455,7 @@ and may look very wrong.}
\PolyglossiaSetup{icelandic}{
hyphennames={icelandic},
hyphenmins={2,2},
+ langtag=ISL,
fontsetup=true,
}
@@ -4468,6 +5505,7 @@ and may look very wrong.}
\PolyglossiaSetup{interlingua}{
hyphennames={interlingua},
hyphenmins={2,2},
+ langtag=INA,
frenchspacing=true,
indentfirst=true,
fontsetup=true,
@@ -4514,45 +5552,21 @@ and may look very wrong.}
% \subsection{gloss-irish.ldf}
% \begin{macrocode}
\ProvidesFile{gloss-irish.ldf}[polyglossia: module for irish]
+
+% We only provide this gloss for babel compatibility. Since irish is
+% a gaelic variety, we use 'gaelic' with variant 'irish' now.
+
+\input{gloss-gaelic.ldf}
+
\PolyglossiaSetup{irish}{
hyphennames={irish},
hyphenmins={2,2},
+ langtag=IRI,
fontsetup=true,
}
-\def\captionsirish{%
- \def\refname{Tagairtí}%
- \def\abstractname{Achoimre}%
- \def\bibname{Leabharliosta}%
- \def\prefacename{Réamhrá}% <-- also "Brollach"
- \def\refname{Tagairtí}%
- \def\chaptername{Tagairtí}%
- \def\appendixname{Aguisín}%
- \def\contentsname{Clár Ábhair}%
- \def\listfigurename{Léaráidí}%
- \def\listtablename{Táblaí}%
- \def\indexname{Innéacs}%
- \def\figurename{Léaráid}%
- \def\tablename{Tábla}%
- %\def\thepart{}%
- \def\partname{Cuid}%
- \def\pagename{Leathanach}%
- \def\seename{féach}%
- \def\alsoname{féach freisin}%
- \def\enclname{faoi iamh}%
- \def\ccname{cc}%
- \def\headtoname{Go}%
- \def\proofname{Cruthúnas}%
- \def\glossaryname{Glossary}%
- }
-\def\dateirish{%
- \def\today{%
- \number\day\space \ifcase\month\or
- Eanáir\or Feabhra\or Márta\or Aibreán\or
- Bealtaine\or Meitheamh\or Iúil\or Lúnasa\or
- Meán Fómhair\or Deireadh Fómhair\or
- Mí na Samhna\or Mí na Nollag\fi
- \space \number\year}}
+\let\captionsirish\captionsgaelic@irish
+\let\dateirish\dategaelic@irish
% \end{macrocode}
% \iffalse
@@ -4568,6 +5582,7 @@ and may look very wrong.}
\PolyglossiaSetup{italian}{
hyphennames={italian},
hyphenmins={2,2},
+ langtag=ITA,
frenchspacing=true,
indentfirst=true,
fontsetup=true,
@@ -4584,8 +5599,9 @@ and may look very wrong.}
\fi
\ifcsundef{initiate@active@char}{%
-\input{babelsh.def}%
-\initiate@active@char{"}%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
}{}
\def\italian@shorthands{%
@@ -4955,10 +5971,11 @@ and may look very wrong.}
\PolyglossiaSetup{kannada}{
script=Kannada,
scripttag=knda,
- langtag=KNDA,
+ langtag=KAN,
hyphennames={kannada},
hyphenmins={2,2},
- fontsetup=true
+ fontsetup=true,
+ localnumeral=kannadanumerals
}
%% Defining Kannada digits equivalents to english
@@ -5026,7 +6043,9 @@ and may look very wrong.}
\def\today{\kannadanumber\day\space\kannadamonth\space\kannadanumber\year}%
}
-%% Based on the settings displays rrespective numbers
+\newcommand{\kannadanumerals}[2]{\kannadanumber{#2}}
+
+%% Based on the settings displays respective numbers
\def\kannadanumber#1{%
\ifkannada@numerals
\kannadadigits{\number#1}%
@@ -5050,7 +6069,8 @@ and may look very wrong.}
scripttag=khmr,%
langtag=KHM,%
hyphennames={nohyphenation},%
- fontsetup=true%
+ fontsetup=true,%
+ localnumeral=khmernumerals%
}
\newif\if@khmer@numerals
\def\tmp@khmer{khmer}
@@ -5117,6 +6137,9 @@ and may look very wrong.}
\expandafter\@khmer@digits%
\fi
}
+
+\newcommand{\khmernumerals}[2]{\khmernumber{#2}}
+
\def\khmernumber#1{%
\if@khmer@numerals%
\khmerdigits{\number#1}%
@@ -5126,11 +6149,10 @@ and may look very wrong.}
\def\khmer@globalnumbers{%
\let\orig@arabic\@arabic%
\let\@arabic\khmernumber%
- \renewcommand{\thefootnote}{\protect\khmernumber{\c@footnote}}%
+ \renewcommand{\thefootnote}{\localnumeral*{footnote}}%
}
\def\nokhmer@globalnumbers{%
\let\@arabic\orig@arabic%
- \renewcommand\thefootnote{\protect\number{\c@footnote}}%
}
\def\thepart{\arabic{part}}
\def\@khmeralph#1{%
@@ -5153,16 +6175,14 @@ and may look very wrong.}
\or យ\or រ\or ល\or វ\or ស\or ហ\or ឡ\or អ%
\else\xpg@ill@value{#1}{@khmeralph}\fi}
\def\khmer@numbers{%
- \let\@latinalph\@alph%
- \let\@latinAlph\@Alph%
\if@khmer@numerals
\let\@alph\@khmeralph%
\let\@Alph\@khmerAlph%
\fi%
}
\def\nokhmer@numbers{%
- \let\@alph\@latinalph%
- \let\@Alph\@latinAlph%
+ \let\@alph\latin@alph%
+ \let\@Alph\latin@Alph%
}
\def\blockextras@khmer{%
\XeTeXlinebreaklocale "kh" %
@@ -5198,7 +6218,7 @@ and may look very wrong.}
\deftranslation[to=khmer]{Examples}{\examplename}%
\AtEndDocument{\immediate\write\@auxout{\string\@writefile{nav}%
{\noexpand\headcommand{\noexpand\def\noexpand%
- \inserttotalframenumber{\khmernumber{\the\c@framenumber}}}}}}%
+ \inserttotalframenumber{\localnumeral*{framenumber}}}}}}%
}{}
% \end{macrocode}
% \iffalse
@@ -5216,8 +6236,7 @@ and may look very wrong.}
scripttag=hang,
language=Korean,
langtag=KOR,
- hyphennames={english,USenglish},
- hyphenmins={2,3},
+ hyphennames={nohyphenation},
frenchspacing=true,
fontsetup=true
}
@@ -5238,8 +6257,8 @@ and may look very wrong.}
\else
\captions@korean@hanja
\fi
- \def\seename{$rightarrow$}%
- \def\alsoname{$Rightarrow$}%
+ \def\seename{$\rightarrow$}%
+ \def\alsoname{$\Rightarrow$}%
}
\def\captions@korean@hangul{%
\def\koreanTHEname{제}%
@@ -5305,14 +6324,12 @@ and may look very wrong.}
}
\def\korean@numbers{%
- \let\@orig@alph\@alph
- \let\@orig@Alph\@Alph
\let\@alph\@koreanalph
\let\@Alph\@koreanAlph
}
\def\nokorean@numbers{%
- \let\@alph\@orig@alph
- \let\@Alph\@orig@Alph
+ \let\@alph\latin@alph
+ \let\@Alph\latin@Alph
}
\let\nokorean@globalnumbers\nokorean@numbers
@@ -5346,7 +6363,7 @@ and may look very wrong.}
\XeTeXinterchartokenstate\z@
\XeTeXlinebreakpenalty\z@
\XeTeXlinebreakskip\z@skip
- \XeTeXlinebreaklocale ""
+ \XeTeXlinebreaklocale "en"
\noextras@korean@common
}
\else % luatex
@@ -5366,435 +6383,435 @@ and may look very wrong.}
\def\@chapapp##1##2{\koreanTHEname ##1##2##1\chaptername}%
\fi
\fi
- \ifdefined\baselinestretch
- \let\xpg@orig@linestretch\baselinestretch
- \def\baselinestretch{1.3888}\selectfont
- \fi
- \ifdefined\footnotesep
- \edef\xpg@orig@footnotesep{\noexpand\footnotesep=\the\footnotesep\relax}%
- \footnotesep=1.3888\footnotesep
- \fi
}
\def\noextras@korean@common{%
- \ifdefined\xpg@orig@footnotesep \xpg@orig@footnotesep \fi
- \ifdefined\xpg@orig@linestretch \let\baselinestretch\xpg@orig@linestretch \fi
- \ifdefined\xpg@orig@@chapapp \let\@chapapp\xpg@orig@@chapapp \fi
+ \ifdefined\xpg@orig@@chapapp \let\@chapapp\xpg@orig@@chapapp \fi
}
-\ifxetex % XeTeX
+\ifluatex % luatex
+\protected\def\inhibitglue{\hskip\z@skip}
+\ifdefined\newattribute\else
+ \let\newattribute\newluatexattribute
+ \let\unsetattribute\unsetluatexattribute
+\fi
+\newattribute\xpg@attr@korean
+\newattribute\xpg@attr@autojosa
% user commands for Josa
% Josa : particles in Korean grammar that immediately follow a noun or pronoun.
% Josa might vary depending on previous character.
-\protected\def\jong {\global\let\XPGKO@let@josa=0}\jong
-\protected\def\rieul{\global\let\XPGKO@let@josa=1}
-\protected\def\jung {\global\let\XPGKO@let@josa=2}
-\protected\def\가{\xpg@make@josa 가이}
-\protected\def\이{\futurelet\@let@token\xpg@make@josa@I}
-\protected\def\은{\xpg@make@josa 는은} \let\는\은
-\protected\def\을{\xpg@make@josa 를을} \let\를\을
-\protected\def\와{\xpg@make@josa 와과} \let\과\와
-\protected\def\으{\xpg@make@josa \empty 으}
+\protected\def\rieul{\global\let\xpg@josa@zwang\@ne}
+\protected\def\jung {\global\let\xpg@josa@zwang\tw@}
+\protected\def\jong {\global\let\xpg@josa@zwang\thr@@}
+\protected\def\은{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 은\endgroup\xpg@reset@josa}
+\let\는\은
+\protected\def\을{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 을\endgroup\xpg@reset@josa}
+\let\를\을
+\protected\def\와{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 와\endgroup\xpg@reset@josa}
+\let\과\와
+\protected\def\가{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 가\endgroup\xpg@reset@josa}
+\protected\def\이{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 이\endgroup\xpg@reset@josa}
+\protected\def\라{\이 라}
+\protected\def\으{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 으\endgroup\xpg@reset@josa}
\protected\def\로{\으 로}
-\protected\def\라{\xpg@make@josa 라{이라}}
-\def\xpg@make@josa@II{\xpg@make@josa\relax 이}
-\def\xpg@make@josa@I{%
- \ifcat\@let@token\xpg@catcode@letter
- \expandafter\expandafter\expandafter\count@\expandafter
- \xpg@letter@to@num\meaning\@let@token\relax
- \ifnum 0\ifnum\count@>"ABFF \ifnum\count@<"D7A4 1\fi\fi>\z@
- \expandafter\expandafter\expandafter\xpg@make@josa@II
+\def\xpg@reset@josa {\global\let\xpg@josa@zwang\z@}\xpg@reset@josa
+% load lua file for korean
+\directlua{ require "polyglossia-korean" }
+% \end{macrocode}
+% \iffalse
+%</gloss-korean.ldf>
+%<*gloss-kurdish.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-kurdish.ldf}
+% \begin{macrocode}
+% Created on September 1, 2019
+% Sina Ahmadi (https://sinaahmadi.github.io/)
+\ProvidesFile{gloss-kurdish.ldf}[polyglossia: module for Kurdish]
+
+\RequireBidi
+\RequirePackage{arabicnumbers}
+\RequirePackage{farsical}
+\RequirePackage{hijrical}
+
+\PolyglossiaSetup{kurdish}{
+ script=Arabic,
+ direction=RL,
+ scripttag=arab,
+ langtag=KUR,
+ hyphennames={nohyphenation},
+ fontsetup=true,
+ localnumeral=kurdishnumerals
+}
+
+\newif\if@kurdish@kurmanji
+\def\kurdish@variant{sorani}
+\define@choicekey*+{kurdish}{variant}[\val\nr]{sorani,kurmanji}[sorani]{%
+ \ifcase\nr\relax
+ % sorani:
+ \def\kurdish@variant{sorani}%
+ \@kurdish@kurmanjifalse%
+ \or
+ % kurmanji:
+ \def\kurdish@variant{kurmanji}%
+ \@kurdish@kurmanjitrue%
+ \fi
+ \kurdish@set@variety%
+ \xpg@info{Option: kurdish, variant=\val}%
+}{\xpg@warning{Unknown Kurdish variant `#1'}}
+
+\newif\if@kurdish@latin
+\newif\if@kurdish@arabic
+\define@choicekey*+{kurdish}{script}[\val\nr]{Arabic,Latin}{%
+ \ifcase\nr\relax
+ % Arabic:
+ \@kurdish@latinfalse%
+ \@kurdish@arabictrue%
+ \or
+ % Latin:
+ \@kurdish@latintrue%
+ \@kurdish@arabicfalse%
+ \fi
+ \kurdish@set@variety%
+ \xpg@info{Option: kurdish, script=\val}%
+}{\xpg@warning{Unknown Kurdish script `#1'}}
+
+
+\newif\if@western@numerals
+\newif\if@force@western@numerals
+\def\kurdish@script{arabic}
+\def\kurdish@pattern{nohyphenation}
+
+\def\kurdish@set@variety{%
+ \if@kurdish@latin% Latin explicitly set
+ \@western@numeralstrue%
+ \if@kurdish@kurmanji
+ \def\kurdish@pattern{kurmanji}%
+ \SetLanguageKeys{kurdish}{script=Latin,direction=LR,scripttag=latn,babelname=kurmanji}%
+ \else
+ \SetLanguageKeys{kurdish}{script=Latin,direction=LR,scripttag=latn,babelname=kurdish}%
+ \fi
+ \def\kurdish@script{latin}
+ \xpg@fontsetup@latin{kurdish}%
+ \else
+ \if@kurdish@arabic% Arabic explicitly set
+ \if@kurdish@kurmanji
+ \if@force@western@numerals\else\@western@numeralsfalse\fi%
+ \SetLanguageKeys{kurdish}{script=Arabic,direction=RL,scripttag=arab,babelname=kurmanji}%
+ \def\kurdish@script{arabic}%
\else
- \expandafter\expandafter\expandafter\가
+ \SetLanguageKeys{kurdish}{script=Arabic,direction=RL,scripttag=arab,babelname=kurdish}%
\fi
- \else
- \expandafter\가
- \fi
+ \xpg@fontsetup@nonlatin{kurdish}%
+ \else% sorani=Arabic, kurmanji=Latin
+ \if@kurdish@kurmanji
+ \@western@numeralstrue%
+ \SetLanguageKeys{kurdish}{script=Latin,direction=LR,scripttag=latn,babelname=kurmanji}%
+ \xpg@fontsetup@latin{kurdish}%
+ \def\kurdish@script{latin}
+ \else
+ \SetLanguageKeys{kurdish}{script=Arabic,direction=RL,scripttag=arab,babelname=kurdish}%
+ \xpg@fontsetup@nonlatin{kurdish}%
+ \fi
+ \fi
+ \fi
+}
+
+\def\tmp@western{western}
+\define@key{kurdish}{numerals}[eastern]{%
+ \def\@tmpa{#1}%
+ \ifx\@tmpa\tmp@western\@western@numeralstrue\@force@western@numeralstrue\else%
+ \@western@numeralsfalse%
+ \fi%
+}
+
+%this is needed for \abjad in arabicnumbers.sty
+\def\tmp@true{true}
+\define@key{kurdish}{abjadjimnotail}[true]{%
+ \def\@tmpa{#1}%
+ \ifx\@tmpa\tmp@true\abjad@jim@notailtrue%
+ \else
+ \abjad@jim@notailfalse
+ \fi%
+}
+
+% NOT YET USED
+\define@key{kurdish}{locale}[default]{%
+ \def\@kurdish@locale{#1}}
+
+
+%TODO add option for CALENDAR
+
+\setkeys{kurdish}{variant,locale}
+
+\def\kurdish@language{%
+ \polyglossia@setup@language@patterns{\kurdish@pattern}%
+}%
+
+\def\kurdishNativemonth#1{\ifcase#1%
+ \or رێبه‌ندان\or ره‌شه‌مێ\or خاكه‌لێوه‌\or گوڵان\or جۆزه‌ردان\or پووشپه‌ڕ\or خه‌رمانان\or گه‌لاوێژ\or ره‌زبه‌ر\or گه‌ڵارێزان\or سه‌رماوه‌ز\or به‌فرانبار\fi}
+\def\kurdishmonth#1{\ifcase#1%
+ \or کانونی دووەم\or شوبات\or ئازار\or نیسان\or ئایار\or حوزه‌یران\or ته‌ممووز\or ئاب\or ئه‌یلوول\or تشرینی یه‌كه‌م\or تشرینی دووهه‌م\or كانوونی یه‌كه‌م\fi}
+
+%\Hijritoday is now locale-aware and will format the date with this macro:
+\DefineFormatHijriDate{kurdish}{%
+ \@ensure@RTL{%
+ \kurdishnumber{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\kurdishnumber{\value{Hijriyear}}%
+ }%
+}
+
+\def\captionskurdish@sorani@arabic{%
+ \def\prefacename{\@ensure@RTL{پێشه‌كی}}%
+ \def\refname{\@ensure@RTL{سه‌رچاوه‌کان}}%
+ \def\abstractname{\@ensure@RTL{پوخته‌}}%
+ \def\bibname{\@ensure@RTL{کتێبنامه‌}}%
+ \def\chaptername{\@ensure@RTL{به‌ندی}}%
+ \def\appendixname{\@ensure@RTL{پاشکۆ}}%
+ \def\contentsname{\@ensure@RTL{نێوه‌ڕۆک}}%
+ \def\listfigurename{\@ensure@RTL{لیستی وێنه‌کان}}%
+ \def\listtablename{\@ensure@RTL{لیستی خشته‌کان}}%
+ \def\indexname{\@ensure@RTL{پێنوێن}}%
+ \def\figurename{\@ensure@RTL{وێنه‌}}%
+ \def\tablename{\@ensure@RTL{خشتە}}%
+ \def\partname{\@ensure@RTL{به‌شی}}%
+ \def\enclname{\@ensure@RTL{هاوپێچ}}%
+ \def\ccname{\@ensure@RTL{روونووس}}%
+ \def\headtoname{\@ensure@RTL{بۆ}}%
+ \def\pagename{\@ensure@RTL{لاپه‌ڕه‌}}%
+ \def\seename{\@ensure@RTL{چاو لێکه‌ن}}%
+ \def\alsoname{\@ensure@RTL{هه‌روه‌ها چاو لێکه‌ن}}%
+ \def\proofname{\@ensure@RTL{سەلماندن}}%
+ \def\glossaryname{\@ensure@RTL{فه‌رهه‌نگۆک}}%
+}
+
+\def\captionskurdish@sorani@latin{%
+ \def\prefacename{Pêşekî}%
+ \def\refname{Serçawekan}%
+ \def\abstractname{Puxte}%
+ \def\bibname{Kitêbname}%
+ \def\chaptername{Bendî}%
+ \def\appendixname{Paşko}%
+ \def\contentsname{Nêwerrok}%
+ \def\listfigurename{Lîstî Wênekan}%
+ \def\listtablename{Lîstî Xiştekan}%
+ \def\indexname{Pêrrist}%
+ \def\figurename{Wêney}%
+ \def\tablename{Xiştey}%
+ \def\partname{Beşî}%
+ \def\enclname{Hawpêç}%
+ \def\ccname{Rûnûs}%
+ \def\headtoname{Bo}%
+ \def\pagename{Laperre}%
+ \def\seename{Çaw lêken}%
+ \def\alsoname{Herweha çaw lêken}%
+ \def\proofname{Selmandin}%
+ \def\glossaryname{Ferhengok}%
+}
+
+\def\captionskurdish@kurmanji@latin{%
+ \def\prefacename{Peşgotin}%
+ \def\refname{Pirtuken bijartî}%
+ \def\abstractname{Kurtebîr}%
+ \def\bibname{Çavkanîya Pirtukan}%
+ \def\chaptername{Serê}%
+ \def\appendixname{Tebînîya}%
+ \def\contentsname{Navêrok}%
+ \def\listfigurename{Hejmara Dimena}%
+ \def\listtablename{Hejmara Kevalen}%
+ \def\indexname{Endeks}%
+ \def\figurename{Dimenê}%
+ \def\tablename{Kevala}%
+ \def\partname{Bêşa}%
+ \def\enclname{Dumahik}%
+ \def\ccname{Belavker}%
+ \def\headtoname{Ji bo}%
+ \def\pagename{Rûpelê}%
+ \def\seename{binêra}%
+ \def\alsoname{le vêya ji binêra}%
+ \def\proofname{Delîl}%
+ \def\glossaryname{Çavkanîya lêkolînê}%
+}
+
+\def\captionskurdish@kurmanji@arabic{%
+ \def\prefacename{\@ensure@RTL{پێشگۆتن}}%
+ \def\refname{\@ensure@RTL{پرتووکێن بژارتی}}%
+ \def\abstractname{\@ensure@RTL{کورتەبیر}}%
+ \def\bibname{\@ensure@RTL{چاڤکانییا پرتووکان}}%
+ \def\chaptername{\@ensure@RTL{سەرێ}}%
+ \def\appendixname{\@ensure@RTL{پاشکۆ}}%
+ \def\contentsname{\@ensure@RTL{ناڤێرۆک}}%
+ \def\listfigurename{\@ensure@RTL{هەژمارا دیمەنا}}%
+ \def\listtablename{\@ensure@RTL{هەژمارا کەڤالێن}}%
+ \def\indexname{\@ensure@RTL{پێرست}}%
+ \def\figurename{\@ensure@RTL{دیمەنێ}}%
+ \def\tablename{\@ensure@RTL{کەڤالا}}%
+ \def\partname{\@ensure@RTL{بەشا}}%
+ \def\enclname{\@ensure@RTL{دوماهک}}%
+ \def\ccname{\@ensure@RTL{بەلاڤکەر}}%
+ \def\headtoname{\@ensure@RTL{ژ بۆ}}%
+ \def\pagename{\@ensure@RTL{رووپەلێ}}%
+ \def\seename{\@ensure@RTL{بنێرا}}%
+ \def\alsoname{\@ensure@RTL{لە ڤێیا ژ بنێرا}}%
+ \def\proofname{\@ensure@RTL{دەلیل}}%
+ \def\glossaryname{\@ensure@RTL{چاڤکانییا لێکۆلینێ}}%
+}
+
+\def\captionskurdish{%
+ \csname captionskurdish@\kurdish@variant @\kurdish@script\endcsname%
+}
+
+\def\datekurdish@sorani@arabic{%
+ \def\today{\@ensure@RTL{\kurdishnumber\day{ی}\space\kurdishmonth{\month}{ی}\space\kurdishnumber\year}}%
+}
+
+\def\datekurdish@sorani@latin{%
+ \def\today{%
+ \number\day.~\ifcase\month\or
+ \januaryname\or \februaryname\or \marchname\or \aprilname\or
+ \mayname\or \junename\or \julyname\or \augustname\or
+ \septembername\or \octobername\or \novembername\or
+ \decembername\or \@ctrerr\fi~\number\year}%
+ \def\ontoday{%
+ \number\day’ê~\ifcase\month\or
+ \januaryname\or \februaryname\or \marchname\or \aprilname\or
+ \mayname\or \junename\or \julyname\or \augustname\or
+ \septembername\or \octobername\or \novembername\or
+ \decembername\or \@ctrerr\fi ê~\number\year}%
+ \def\januaryname{Kanûnî Yekem}%
+ \def\februaryname{Şubat}%
+ \def\marchname{Azar}%
+ \def\aprilname{Nîsan}%
+ \def\mayname{Ayar}%
+ \def\junename{Huzeyran}%
+ \def\julyname{Temmûz}%
+ \def\augustname{Ab}%
+ \def\septembername{Eylûl}%
+ \def\octobername{Tişrînî Yekem}%
+ \def\novembername{Tişrînî Dûhem}%
+ \def\decembername{Kanûnî Dûhem}%
+}
+
+\def\datekurdish@kurmanji@latin{%
+ \def\today{%
+ \number\day.~\ifcase\month\or
+ \januaryname\or \februaryname\or \marchname\or \aprilname\or
+ \mayname\or \junename\or \julyname\or \augustname\or
+ \septembername\or \octobername\or \novembername\or
+ \decembername\or \@ctrerr\fi~\number\year}%
+ \def\ontoday{%
+ \number\day’ê~\ifcase\month\or
+ \januaryname\or \februaryname\or \marchname\or \aprilname\or
+ \mayname\or \junename\or \julyname\or \augustname\or
+ \septembername\or \octobername\or \novembername\or
+ \decembername\or \@ctrerr\fi ê~\number\year}%
+ \def\januaryname{Çileya Paşîn}%
+ \def\februaryname{Sibat}%
+ \def\marchname{Adar}%
+ \def\aprilname{Nîsan}%
+ \def\mayname{Gulan}%
+ \def\junename{Hezîran}%
+ \def\julyname{Tîrmeh}%
+ \def\augustname{Tebax}%
+ \def\septembername{Îlon}%
+ \def\octobername{Çiriya Pêşîn}%
+ \def\novembername{Çiriya Paşîn}%
+ \def\decembername{Çileya Pêşîn}%
+}
+
+\def\datekurdish@kurmanji@arabic{%
+ \datekurdish@sorani@arabic% FIXME: correct?
+}
+
+% TODO: babel-kurmanji has these "alternative" month names
+% How to integrate them ("montnames=alternative" is not really good)?
+% It seems the month name question is all but straightforward:
+% https://en.wikipedia.org/wiki/Kurdish_calendar#Names
+%\def\datekurdish@kurmanji@alternate{%
+% \datekurdish@kurmanji
+% \def\januaryname{Rêbendan}%
+% \def\februaryname{Reşemih}%
+% \def\aprilname{Cotan}% % Avrêl
+% \def\junename{Pûşper}%
+% \def\augustname{Gelavêj}%
+% \def\septembername{Gelarezan}% % Rezber
+% \def\octobername{Kewçêr}%
+% \def\novembername{Sermawez}%
+% \def\decembername{Berfandar}%
+%}
+
+\def\datekurdish{%
+ \csname datekurdish@\kurdish@variant @\kurdish@script\endcsname%
}
-\def\xpg@make@josa#1#2{%
- \ifcat\xpg@catcode@letter\XPGKO@let@josa
- \expandafter\expandafter\expandafter\count@\expandafter
- \xpg@letter@to@num\meaning\XPGKO@let@josa\relax
- \else\ifcat\xpg@catcode@other\XPGKO@let@josa
- \expandafter\expandafter\expandafter\count@\expandafter
- \xpg@character@to@num\meaning\XPGKO@let@josa\relax
+
+\newcommand{\kurdishnumerals}[2]{\kurdishnumber{#2}}
+
+\def\kurdishnumber#1{%
+ \if@western@numerals
+ \number#1%
+ \else
+ \ifxetex
+ \ifnum\XeTeXcharglyph"06F0 > 0\relax
+ \farsidigits{\number#1}%
+ \else%
+ \arabicdigits{\number#1}%
+ \fi
+ \else\ifluatex
+ \expandafter\ifnum\directlua{polyglossia.check_char(0x6F0)} > 0\relax
+ \farsidigits{\number#1}%
+ \else%
+ \arabicdigits{\number#1}%
+ \fi
\fi\fi
- \ifnum\count@<"3260
- \else\ifnum\count@<"3280 \advance\count@-"60
- \else\ifnum\count@<"AC00
- \else\ifnum\count@<"D7A4 % Hangul syllables
- \advance\count@-"AC00
- \@tempcnta\count@ \divide\@tempcnta28 \multiply\@tempcnta28
- \advance\count@-\@tempcnta \advance\count@"11A7
- \else\ifnum\count@<"FF00
- \else\ifnum\count@<"FF5B \advance\count@-"FEE0
- \fi\fi\fi\fi\fi \fi
- \ifnum\count@<"11A8
- \ifnum "30=\count@ \count@\z@ % 0
- \else\ifnum "31=\count@ \count@\@ne % 1
- \else\ifnum "33=\count@ \count@\z@ % 3
- \else\ifnum "36=\count@ \count@\z@ % 6
- \else\ifnum "37=\count@ \count@\@ne % 7
- \else\ifnum "38=\count@ \count@\@ne % 8
- \else\ifnum "4C=\count@ \count@\@ne % L
- \else\ifnum "4D=\count@ \count@\z@ % M
- \else\ifnum "4E=\count@ \count@\z@ % N
- \else\ifnum "6C=\count@ \count@\@ne % l
- \else\ifnum "6D=\count@ \count@\z@ % m
- \else\ifnum "6E=\count@ \count@\z@ % n
- \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi
- \else\ifnum\count@<"1200
- \ifnum\count@="11AF \count@\@ne \else \count@\z@ \fi
- \else\ifnum\count@<"3131
- \else\ifnum\count@<"318F
- \ifnum \count@="3139 \count@\@ne
- \else\ifnum\count@<"314F \count@\z@
- \else\ifnum\count@>"3164
- \ifnum\count@<"3187 \count@\z@ \fi
- \fi\fi\fi
- \else\ifnum\count@<"3200
- \else\ifnum\count@<"321F
- \ifnum \count@="3203 \count@\@ne
- \else\ifnum\count@<"320E \count@\z@
- \fi\fi
- \else\ifnum\count@<"D7CB
- \else\ifnum\count@<"D7FC \count@\z@
- \fi\fi\fi\fi\fi \fi\fi\fi
- \ifcase\count@ #2% jong
- \or \ifx#1\empty\else#2\fi% rieul
- \else #1% jung
- \fi
+ \fi
}
-\expandafter\def\expandafter\xpg@character@to@num\detokenize{the character} #1#2\relax{`#1\relax}
-\expandafter\def\expandafter\xpg@letter@to@num\detokenize{the letter} #1#2\relax{`#1\relax}
-\begingroup
-\catcode`A=11 \catcode`0=12
-\global\let\xpg@catcode@letter=A \global\let\xpg@catcode@other=0
-\endgroup
-% macros for interchartoks (Josa selection)
-\def\XPGKOstartID{\global\futurelet\XPGKO@let@josa\XPGKO@skipID}
-\def\XPGKOstartAA{\global\futurelet\XPGKO@let@josa\XPGKO@skipAA}
-\def\XPGKO@skipID{\XeTeXinterchartoks\XeTeXcharclassBoundary\XeTeXcharclassID{\empty}}
-\def\XPGKO@skipAA{\XeTeXinterchartoks\XeTeXcharclassBoundary\XPGKOcharclassAA{\empty}}
-\def\XPGKOstopID {\XeTeXinterchartoks\XeTeXcharclassBoundary\XeTeXcharclassID{\XPGKOstartID}}
-\def\XPGKOstopAA {\XeTeXinterchartoks\XeTeXcharclassBoundary\XPGKOcharclassAA{\XPGKOstartAA}}
-% macros for interchartoks (CJK punctuations)
-\def\XPGKOstartOP{\leavevmode\hbox to.5em\bgroup\hss}%
-\def\XPGKOstopOP {\egroup}%
-\def\XPGKOstartCL{\leavevmode\hbox to.5em\bgroup}%
-\def\XPGKOstopCL {\hss\egroup}%
-\let\XPGKOstartFS\XPGKOstartCL \let\XPGKOstopFS\XPGKOstopCL
-\let\XPGKOstartMD\XPGKOstartOP \let\XPGKOstopMD\XPGKOstopCL
-\let\XPGKOnobreak \nobreak
-\def\XPGKOhalfzero {\hskip \XPGKOhalfdim \relax}%
-\def\XPGKOhalfhalf {\hskip \XPGKOhalfdim minus \XPGKOhalfdim \relax}%
-\def\XPGKOhalfquarter {\hskip \XPGKOhalfdim minus.5\XPGKOhalfdim \relax}%
-\def\XPGKOquarterquarter {\hskip .5\XPGKOhalfdim minus.5\XPGKOhalfdim \relax}%
-\def\XPGKOiiiquarterquarter{\hskip1.5\XPGKOhalfdim minus.5\XPGKOhalfdim \relax}%
-\def\XPGKOlatincjk {\hskip .5\XPGKOhalfdim plus.25\XPGKOhalfdim minus.125\XPGKOhalfdim}%
-% user macro to force zero skip
-\let\inhibitglue\relax
-% initialize interchartoks and classes
-\ifdim\the\XeTeXversion\XeTeXrevision pt<0.99994pt
- \let\XeTeXcharclassIgnore \@cclvi
- \let\XeTeXcharclassBoundary\@cclv
-\else
- \chardef\XeTeXcharclassIgnore =4096
- \chardef\XeTeXcharclassBoundary=4095
-\fi
-\ifdefined\XeTeXcharclassID\else
- \ifdefined\xtxHanGlue
- \let\XeTeXcharclassID\@ne
- \let\XeTeXcharclassOP\tw@
- \let\XeTeXcharclassCL\thr@@
- \else % email from JW
- \newXeTeXintercharclass\XeTeXcharclassID
- \newXeTeXintercharclass\XeTeXcharclassOP
- \newXeTeXintercharclass\XeTeXcharclassCL
- \global\let\XeTeXcharclassCJ\XeTeXcharclassID
- \global\let\XeTeXcharclassEX\XeTeXcharclassCL
- \global\let\XeTeXcharclassIS\XeTeXcharclassCL
- \global\let\XeTeXcharclassNS\XeTeXcharclassCL
- \global\let\XeTeXcharclassCM\XeTeXcharclassIgnore
- \input load-unicode-xetex-classes %
- \fi
-\fi
-% assign Hangul
-\count@="AC00 \loop
- \XeTeXcharclass\count@\XeTeXcharclassID
- \ifnum\count@<"D7A3
- \advance\count@\@ne
- \repeat
-\count@="1100 \loop
- \XeTeXcharclass\count@\XeTeXcharclassID
- \ifnum\count@<"11FF
- \advance\count@\@ne
- \repeat
-\count@="A960 \loop
- \XeTeXcharclass\count@\XeTeXcharclassID
- \ifnum\count@<"A97C
- \advance\count@\@ne
- \repeat
-\count@="D7B0 \loop
- \XeTeXcharclass\count@\XeTeXcharclassID
- \ifnum\count@<"D7FB
- \advance\count@\@ne
- \repeat
-% more classes
-\newXeTeXintercharclass\XPGKOcharclassMD % ・ : ;
-\newXeTeXintercharclass\XPGKOcharclassFS % 。 .
-\newXeTeXintercharclass\XPGKOcharclassLD % ― … ‥
-\newXeTeXintercharclass\XPGKOcharclassEX % ? !
-\newXeTeXintercharclass\XPGKOcharclassAO % ascii (
-\newXeTeXintercharclass\XPGKOcharclassAC % ascii )
-\newXeTeXintercharclass\XPGKOcharclassAA % ascii letters/numbers
-% unset all interchartoks
-\def\unsetvariantkoreaninterchartoks{%
- \@tfor\@tmpa :=\XeTeXcharclassID\XeTeXcharclassOP\XeTeXcharclassCL\XPGKOcharclassMD\XPGKOcharclassFS
- \XPGKOcharclassLD\XPGKOcharclassEX\XPGKOcharclassAO\XPGKOcharclassAC\XPGKOcharclassAA
- \do{\count@\XeTeXcharclassBoundary \loop
- \XeTeXinterchartoks\@tmpa\count@{}%
- \XeTeXinterchartoks\count@\@tmpa{}%
- \ifnum\count@=\XeTeXcharclassBoundary \count@\m@ne \fi
- \ifnum\count@<\xe@alloc@intercharclass
- \advance\count@\@ne
- \repeat
- }%
+
+%\def\kurdishnum#1{\expandafter\kurdishnumber\csname c@#1\endcsname}
+%\def\kurdishbracenum#1{(\expandafter\kurdishnumber\csname c@#1\endcsname)}
+%\def\kurdishornatebracenum#1{\char"FD3E\expandafter\kurdishnumber\csname c@#1\endcsname\char"FD3F}
+%\def\kurdishalph#1{\expandafter\@farsialph\csname c@#1\endcsname}
+
+\def\kurdish@numbers{%
+ \if@western@numerals%
+ \else%
+ \let\@alph\abjad%
+ \let\@Alph\abjad%
+ \fi%
+}
+
+\def\nokurdish@numbers{%
+ \let\@alph\@latinalph%
+ \let\@Alph\@latinAlph%
+}
+
+\def\kurdish@globalnumbers{%
+ \let\@arabic\kurdishnumber%
+ \renewcommand\thefootnote{\localnumeral*{footnote}}%
+ \renewcommand\theequation{\localnumeral*{equation}}%
+}
+
+% Store original definition
+\let\xpg@save@arabic\@arabic
+
+\def\nokurdish@globalnumbers{
+ \let\@arabic\xpg@save@arabic%
+ \renewcommand\thefootnote{\protect\number{\c@footnote}}%
+}
+
+% Save original \MakeUppercase definition
+\let\xpg@save@MakeUppercase\MakeUppercase
+
+\def\blockextras@kurdish{%
+ \def\MakeUppercase##1{##1}%
+}
+
+\def\noextras@kurdish{%
+ \let\MakeUppercase\xpg@save@MakeUppercase%
}
-% interchartoks for classic/modern variants
-\def\setvariantkoreaninterchartoks{%
- \count@\XeTeXcharclassBoundary \loop
- \ifnum\count@=\XeTeXcharclassID\else
- \ifnum\count@=\XeTeXcharclassOP\else
- \ifnum\count@=\XeTeXcharclassCL\else
- \ifnum\count@=\XPGKOcharclassMD\else
- \ifnum\count@=\XPGKOcharclassFS\else
- \ifnum\count@=\XPGKOcharclassAA\else
- \XeTeXinterchartoks\count@\XeTeXcharclassID{\XPGKOstartID}%
- \XeTeXinterchartoks\count@\XeTeXcharclassOP{\XPGKOstartOP}%
- \XeTeXinterchartoks\count@\XeTeXcharclassCL{\XPGKOstartCL}%
- \XeTeXinterchartoks\count@\XPGKOcharclassMD{\XPGKOstartMD}%
- \XeTeXinterchartoks\count@\XPGKOcharclassFS{\XPGKOstartFS}%
- \XeTeXinterchartoks\count@\XPGKOcharclassAA{\XPGKOstartAA}%
- \XeTeXinterchartoks\XeTeXcharclassID\count@{\XPGKOstopID}%
- \XeTeXinterchartoks\XeTeXcharclassOP\count@{\XPGKOstopOP}%
- \XeTeXinterchartoks\XeTeXcharclassCL\count@{\XPGKOstopCL}%
- \XeTeXinterchartoks\XPGKOcharclassMD\count@{\XPGKOstopMD}%
- \XeTeXinterchartoks\XPGKOcharclassFS\count@{\XPGKOstopFS}%
- \XeTeXinterchartoks\XPGKOcharclassAA\count@{\XPGKOstopAA}%
- \fi\fi\fi\fi\fi\fi
- \ifnum\count@=\XeTeXcharclassBoundary \count@\m@ne \fi
- \ifnum\count@<\xe@alloc@intercharclass
- \advance\count@\@ne
- \repeat
- %
- \XeTeXinterchartoks\XPGKOcharclassAA\XeTeXcharclassID{\XPGKOstopAA\XPGKOlatincjk\XPGKOstartID}%
- \XeTeXinterchartoks\XPGKOcharclassAA\XeTeXcharclassOP{\XPGKOstopAA\XPGKOhalfhalf\XPGKOstartOP}%
- \XeTeXinterchartoks\XPGKOcharclassAA\XeTeXcharclassCL{\XPGKOstopAA\XPGKOstartCL}%
- \XeTeXinterchartoks\XPGKOcharclassAA\XPGKOcharclassMD{\XPGKOstopAA\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}%
- \XeTeXinterchartoks\XPGKOcharclassAA\XPGKOcharclassFS{\XPGKOstopAA\XPGKOstartFS}%
- \XeTeXinterchartoks\XPGKOcharclassAA\XPGKOcharclassAA{\XPGKOstartAA}%
- %
- \XeTeXinterchartoks\XeTeXcharclassID\XeTeXcharclassID{\XPGKOstartID}%
- \XeTeXinterchartoks\XeTeXcharclassID\XeTeXcharclassOP{\XPGKOstopID\XPGKOhalfhalf\XPGKOstartOP}%
- \XeTeXinterchartoks\XeTeXcharclassID\XeTeXcharclassCL{\XPGKOstopID\XPGKOstartCL}%
- \XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassMD{\XPGKOstopID\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}%
- \XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassFS{\XPGKOstopID\XPGKOstartFS}%
- \XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassAO{\XPGKOstopID\XPGKOlatincjk}%
- \XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassAA{\XPGKOstopID\XPGKOlatincjk\XPGKOstartAA}%
- %
- \XeTeXinterchartoks\XeTeXcharclassOP\XeTeXcharclassID{\XPGKOstopOP\XPGKOstartID}%
- \XeTeXinterchartoks\XeTeXcharclassOP\XeTeXcharclassOP{\XPGKOstopOP\XPGKOstartOP}%
- \XeTeXinterchartoks\XeTeXcharclassOP\XeTeXcharclassCL{\XPGKOstopOP\XPGKOstartCL}%
- \XeTeXinterchartoks\XeTeXcharclassOP\XPGKOcharclassMD{\XPGKOstopOP\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}%
- \XeTeXinterchartoks\XeTeXcharclassOP\XPGKOcharclassFS{\XPGKOstopOP\XPGKOstartFS}%
- \XeTeXinterchartoks\XeTeXcharclassOP\XPGKOcharclassAA{\XPGKOstopOP\XPGKOstartAA}%
- %
- \XeTeXinterchartoks\XeTeXcharclassCL\XeTeXcharclassID{\XPGKOstopCL\XPGKOhalfhalf\XPGKOstartID}%
- \XeTeXinterchartoks\XeTeXcharclassCL\XeTeXcharclassOP{\XPGKOstopCL\XPGKOhalfhalf\XPGKOstartOP}%
- \XeTeXinterchartoks\XeTeXcharclassCL\XeTeXcharclassCL{\XPGKOstopCL\XPGKOstartCL}%
- \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassMD{\XPGKOstopCL\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}%
- \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassFS{\XPGKOstopCL\XPGKOstartFS}%
- \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassLD{\XPGKOstopCL\XPGKOnobreak\XPGKOhalfhalf}%
- \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassEX{\XPGKOstopCL\XPGKOnobreak\XPGKOhalfhalf}%
- \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassAO{\XPGKOstopCL\XPGKOhalfhalf}%
- \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassAC{\XPGKOstopCL\XPGKOnobreak\XPGKOhalfhalf}%
- \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassAA{\XPGKOstopCL\XPGKOhalfhalf\XPGKOstartAA}%
- %
- \XeTeXinterchartoks\XPGKOcharclassMD\XeTeXcharclassID{\XPGKOstopMD\XPGKOquarterquarter\XPGKOstartID}%
- \XeTeXinterchartoks\XPGKOcharclassMD\XeTeXcharclassOP{\XPGKOstopMD\XPGKOquarterquarter\XPGKOstartOP}%
- \XeTeXinterchartoks\XPGKOcharclassMD\XeTeXcharclassCL{\XPGKOstopMD\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartCL}%
- \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassMD{\XPGKOstopMD\XPGKOnobreak\XPGKOhalfquarter\XPGKOstartMD}%
- \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassFS{\XPGKOstopMD\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartFS}%
- \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassLD{\XPGKOstopMD\XPGKOnobreak\XPGKOquarterquarter}%
- \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassEX{\XPGKOstopMD\XPGKOnobreak\XPGKOquarterquarter}%
- \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassAO{\XPGKOstopMD\XPGKOquarterquarter}%
- \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassAC{\XPGKOstopMD\XPGKOnobreak\XPGKOquarterquarter}%
- \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassAA{\XPGKOstopMD\XPGKOquarterquarter\XPGKOstartAA}%
- %
- \XeTeXinterchartoks\XPGKOcharclassFS\XeTeXcharclassID{\XPGKOstopFS\XPGKOhalfzero\XPGKOstartID}%
- \XeTeXinterchartoks\XPGKOcharclassFS\XeTeXcharclassOP{\XPGKOstopFS\XPGKOhalfzero\XPGKOstartOP}%
- \XeTeXinterchartoks\XPGKOcharclassFS\XeTeXcharclassCL{\XPGKOstopFS\XPGKOstartCL}%
- \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassMD{\XPGKOstopFS\XPGKOnobreak\XPGKOiiiquarterquarter\XPGKOstartMD}%
- \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassFS{\XPGKOstopFS\XPGKOstartFS}%
- \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassLD{\XPGKOstopFS\XPGKOnobreak\XPGKOhalfzero}%
- \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassEX{\XPGKOstopFS\XPGKOnobreak\XPGKOhalfzero}%
- \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassAO{\XPGKOstopFS\XPGKOhalfzero}%
- \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassAC{\XPGKOstopFS\XPGKOnobreak\XPGKOhalfzero}%
- \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassAA{\XPGKOstopFS\XPGKOhalfzero\XPGKOstartAA}%
- %
- \XeTeXinterchartoks\XPGKOcharclassLD\XeTeXcharclassOP{\XPGKOhalfhalf\XPGKOstartOP}%
- \XeTeXinterchartoks\XPGKOcharclassLD\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}%
- %
- \XeTeXinterchartoks\XPGKOcharclassEX\XeTeXcharclassID{\XPGKOhalfhalf\XPGKOstartID}%
- \XeTeXinterchartoks\XPGKOcharclassEX\XeTeXcharclassOP{\XPGKOhalfhalf\XPGKOstartOP}%
- \XeTeXinterchartoks\XPGKOcharclassEX\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}%
- \XeTeXinterchartoks\XPGKOcharclassEX\XPGKOcharclassAO{\XPGKOhalfhalf}%
- \XeTeXinterchartoks\XPGKOcharclassEX\XPGKOcharclassAC{\XPGKOnobreak\XPGKOhalfhalf}%
- \XeTeXinterchartoks\XPGKOcharclassEX\XPGKOcharclassAA{\XPGKOhalfhalf\XPGKOstartAA}%
- %
- \XeTeXinterchartoks\XPGKOcharclassAO\XeTeXcharclassOP{\XPGKOnobreak\XPGKOhalfhalf\XPGKOstartOP}%
- \XeTeXinterchartoks\XPGKOcharclassAO\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}%
- %
- \XeTeXinterchartoks\XPGKOcharclassAC\XeTeXcharclassID{\XPGKOlatincjk\XPGKOstartID}%
- \XeTeXinterchartoks\XPGKOcharclassAC\XeTeXcharclassOP{\XPGKOhalfhalf\XPGKOstartOP}%
- \XeTeXinterchartoks\XPGKOcharclassAC\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}%
-}
-% char classes for classic/modern variants
-\def\setvariantkoreancharclasses{}
-\def\unsetvariantkoreancharclasses{}
-\def\@tmpa#1=#2{%
- \edef\setvariantkoreancharclasses{%
- \unexpanded\expandafter{\setvariantkoreancharclasses
- \XeTeXcharclass#1=#2}}%
- \edef\unsetvariantkoreancharclasses{%
- \noexpand\XeTeXcharclass#1=\the\XeTeXcharclass#1\relax
- \unexpanded\expandafter{\unsetvariantkoreancharclasses}}%
-}
-\count@"30 \loop % 0 .. 9
- \expandafter\@tmpa\the\count@=\XPGKOcharclassAA
- \ifnum\count@<"39
- \advance\count@\@ne
- \repeat
-\count@"41 \loop % A .. Z
- \expandafter\@tmpa\the\count@=\XPGKOcharclassAA
- \ifnum\count@<"5A
- \advance\count@\@ne
- \repeat
-\count@"61 \loop % a .. z
- \expandafter\@tmpa\the\count@=\XPGKOcharclassAA
- \ifnum\count@<"7A
- \advance\count@\@ne
- \repeat
-% NS
-\@tmpa "3005=\XeTeXcharclassID % 々 IDEOGRAPHIC ITERATION MARK
-\@tmpa "301C=\XeTeXcharclassID % 〜 WAVE DASH
-\@tmpa "303B=\XeTeXcharclassID % 〻 VERTICAL IDEOGRAPHIC ITERATION MARK
-\@tmpa "303C=\XeTeXcharclassID % 〼 MASU MARK
-\@tmpa "309B=\XeTeXcharclassID % ゛ KATAKANA-HIRAGANA VOICED SOUND MARK
-\@tmpa "309C=\XeTeXcharclassID % ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
-\@tmpa "309D=\XeTeXcharclassID % ゝ HIRAGANA ITERATION MARK
-\@tmpa "309E=\XeTeXcharclassID % ゞ HIRAGANA VOICED ITERATION MARK
-\@tmpa "30A0=\XeTeXcharclassID % ゠ KATAKANA-HIRAGANA DOUBLE HYPHEN
-\@tmpa "30FD=\XeTeXcharclassID % ヽ KATAKANA ITERATION MARK
-\@tmpa "30FE=\XeTeXcharclassID % ヾ KATAKANA VOICED ITERATION MARK
-\@tmpa "A015=\XeTeXcharclassID % ꀕ YI SYLLABLE ITERATION MARK
-\@tmpa "FF9E=\XeTeXcharclassID % ゙ HALFWIDTH KATAKANA VOICED SOUND MARK
-\@tmpa "FF9F=\XeTeXcharclassID % ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
-% IS
-\@tmpa "FE13=\XeTeXcharclassID % ︓ PRESENTATION FORM FOR VERTICAL COLON
-\@tmpa "FE14=\XeTeXcharclassID % ︔ PRESENTATION FORM FOR VERTICAL SEMICOLON
-% CJ
-\ifnum\the\XeTeXcharclass"3041=\XeTeXcharclassID \else
- \@tmpa "3041=\XeTeXcharclassID % ぁ HIRAGANA LETTER SMALL A
- \@tmpa "3043=\XeTeXcharclassID % ぃ HIRAGANA LETTER SMALL I
- \@tmpa "3045=\XeTeXcharclassID % ぅ HIRAGANA LETTER SMALL U
- \@tmpa "3047=\XeTeXcharclassID % ぇ HIRAGANA LETTER SMALL E
- \@tmpa "3049=\XeTeXcharclassID % ぉ HIRAGANA LETTER SMALL O
- \@tmpa "3063=\XeTeXcharclassID % っ HIRAGANA LETTER SMALL TU
- \@tmpa "3083=\XeTeXcharclassID % ゃ HIRAGANA LETTER SMALL YA
- \@tmpa "3085=\XeTeXcharclassID % ゅ HIRAGANA LETTER SMALL YU
- \@tmpa "3087=\XeTeXcharclassID % ょ HIRAGANA LETTER SMALL YO
- \@tmpa "308E=\XeTeXcharclassID % ゎ HIRAGANA LETTER SMALL WA
- \@tmpa "3095=\XeTeXcharclassID % ゕ HIRAGANA LETTER SMALL KA
- \@tmpa "3096=\XeTeXcharclassID % ゖ HIRAGANA LETTER SMALL KE
- \@tmpa "30A1=\XeTeXcharclassID % ァ KATAKANA LETTER SMALL A
- \@tmpa "30A3=\XeTeXcharclassID % ィ KATAKANA LETTER SMALL I
- \@tmpa "30A5=\XeTeXcharclassID % ゥ KATAKANA LETTER SMALL U
- \@tmpa "30A7=\XeTeXcharclassID % ェ KATAKANA LETTER SMALL E
- \@tmpa "30A9=\XeTeXcharclassID % ォ KATAKANA LETTER SMALL O
- \@tmpa "30C3=\XeTeXcharclassID % ッ KATAKANA LETTER SMALL TU
- \@tmpa "30E3=\XeTeXcharclassID % ャ KATAKANA LETTER SMALL YA
- \@tmpa "30E5=\XeTeXcharclassID % ュ KATAKANA LETTER SMALL YU
- \@tmpa "30E7=\XeTeXcharclassID % ョ KATAKANA LETTER SMALL YO
- \@tmpa "30EE=\XeTeXcharclassID % ヮ KATAKANA LETTER SMALL WA
- \@tmpa "30F5=\XeTeXcharclassID % ヵ KATAKANA LETTER SMALL KA
- \@tmpa "30F6=\XeTeXcharclassID % ヶ KATAKANA LETTER SMALL KE
- \@tmpa "30FC=\XeTeXcharclassID % ー KATAKANA-HIRAGANA PROLONGED SOUND MARK
- \count@"31F0 \loop
- \expandafter\@tmpa\the\count@=\XeTeXcharclassID
- \ifnum\count@<"31FF
- \advance\count@\@ne
- \repeat
- \count@"FF67 \loop
- \expandafter\@tmpa\the\count@=\XeTeXcharclassID
- \ifnum\count@<"FF70
- \advance\count@\@ne
- \repeat
-\fi
-%
-\@tmpa "28=\XPGKOcharclassAO % ( LEFT PARENTHESIS
-\@tmpa "5B=\XPGKOcharclassAO % [ LEFT SQUARE BRACKET
-\@tmpa "60=\XPGKOcharclassAO % ` GRAVE ACCENT
-\@tmpa "7B=\XPGKOcharclassAO % { LEFT CURLY BRACKET
-\@tmpa "AB=\XPGKOcharclassAO % « LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
-%
-\@tmpa "21=\XPGKOcharclassAC % ! EXCLAMATION MARK
-\@tmpa "27=\XPGKOcharclassAC % ' APOSTROPHE
-\@tmpa "29=\XPGKOcharclassAC % ) RIGHT PARENTHESIS
-\@tmpa "2C=\XPGKOcharclassAC % , COMMA
-\@tmpa "2E=\XPGKOcharclassAC % . FULL STOP
-\@tmpa "3B=\XPGKOcharclassAC % ; SEMICOLON
-\@tmpa "3F=\XPGKOcharclassAC % ? QUESTION MARK
-\@tmpa "5D=\XPGKOcharclassAC % ] RIGHT SQUARE BRACKET
-\@tmpa "7D=\XPGKOcharclassAC % } RIGHT CURLY BRACKET
-\@tmpa "BB=\XPGKOcharclassAC % » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
-%
-\@tmpa "2018=\XeTeXcharclassOP % ‘ LEFT SINGLE QUOTATION MARK
-\@tmpa "201C=\XeTeXcharclassOP % “ LEFT DOUBLE QUOTATION MARK
-%
-\@tmpa "2019=\XeTeXcharclassCL % ’ RIGHT SINGLE QUOTATION MARK
-\@tmpa "201D=\XeTeXcharclassCL % ” RIGHT DOUBLE QUOTATION MARK
-% NS
-\@tmpa "00B7=\XPGKOcharclassMD % · MIDDLE DOT
-\@tmpa "30FB=\XPGKOcharclassMD % ・ KATAKANA MIDDLE DOT
-\@tmpa "FE54=\XPGKOcharclassMD % ﹔ SMALL SEMICOLON
-\@tmpa "FE55=\XPGKOcharclassMD % ﹕ SMALL COLON
-\@tmpa "FF1A=\XPGKOcharclassMD % : FULLWIDTH COLON
-\@tmpa "FF1B=\XPGKOcharclassMD % ; FULLWIDTH SEMICOLON
-\@tmpa "FF65=\XPGKOcharclassMD % ・ HALFWIDTH KATAKANA MIDDLE DOT
-%
-\@tmpa "3002=\XPGKOcharclassFS % 。 IDEOGRAPHIC FULL STOP
-\@tmpa "FE12=\XPGKOcharclassFS % ︒ PRESENTATION FORM FOR VERTICAL IDEOGRAPHIC FULL STOP
-\@tmpa "FE52=\XPGKOcharclassFS % ﹒ SMALL FULL STOP
-\@tmpa "FF0E=\XPGKOcharclassFS % . FULLWIDTH FULL STOP
-\@tmpa "FF61=\XPGKOcharclassFS % 。 HALFWIDTH IDEOGRAPHIC FULL STOP
-%
-\@tmpa "2014=\XPGKOcharclassLD % — EM DASH
-\@tmpa "2015=\XPGKOcharclassLD % ― HORIZONTAL BAR
-\@tmpa "2025=\XPGKOcharclassLD % ‥ TWO DOT LEADER
-\@tmpa "2026=\XPGKOcharclassLD % … HORIZONTAL ELLIPSIS
-% EX
-\@tmpa "FE15=\XPGKOcharclassEX % ︕ PRESENTATION FORM FOR VERTICAL EXCLAMATION MARK
-\@tmpa "FE16=\XPGKOcharclassEX % ︖ PRESENTATION FORM FOR VERTICAL QUESTION MARK
-\@tmpa "FE56=\XPGKOcharclassEX % ﹖ SMALL QUESTION MARK
-\@tmpa "FE57=\XPGKOcharclassEX % ﹗ SMALL EXCLAMATION MARK
-\@tmpa "FF01=\XPGKOcharclassEX % ! FULLWIDTH EXCLAMATION MARK
-\@tmpa "FF1F=\XPGKOcharclassEX % ? FULLWIDTH QUESTION MARK
% \end{macrocode}
% \iffalse
-%</gloss-korean.ldf>
+%</gloss-kurdish.ldf>
%<*gloss-lao.ldf>
% \fi
% \clearpage
@@ -5811,9 +6828,11 @@ and may look very wrong.}
\PolyglossiaSetup{lao}{
script=Lao,
scripttag=lao,
+ langtag=LAO,
hyphennames={lao},
hyphenmins={1,1},
fontsetup=true,
+ localnumeral=laonumerals
%TODO localalph={xxx@alph,xxx@Alph}
%TODO localdigits=laonumber
}
@@ -5879,6 +6898,8 @@ and may look very wrong.}
\fi
}
+\newcommand{\laonumerals}[2]{\laonumber{#2}}
+
\def\laonumber#1{%
\if@lao@numerals
\laodigits{\number#1}%
@@ -5889,16 +6910,56 @@ and may look very wrong.}
\def\lao@globalnumbers{%
\let\orig@arabic\@arabic%
\let\@arabic\laonumber%
- \renewcommand{\thefootnote}{\protect\laonumber{\c@footnote}}%
+ \renewcommand{\thefootnote}{\localnumeral*{footnote}}%
}
\def\nolao@globalnumbers{%
\let\@arabic\orig@arabic%
- \renewcommand\thefootnote{\protect\number{\c@footnote}}%
}
% \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
@@ -5928,6 +6989,7 @@ and may look very wrong.}
\PolyglossiaSetup{latin}{%
hyphennames={latin},
hyphenmins={2,2},
+ langtag=LAT,
frenchspacing=true,
fontsetup=true,
}
@@ -5958,7 +7020,6 @@ and may look very wrong.}
\let\latin@variant\l@latin
\xpg@set@language@luatex@ii{latin}
\medievaltrue \classictrue
- \classicuclccodes
\xpg@info{Option: Medieval Latin}%
\else
\ifx\@tempa\tmp@classic
@@ -5971,7 +7032,7 @@ and may look very wrong.}
\let\latin@variant\l@classiclatin
\fi
\fi
- \medievalfalse\classictrue\classicuclccodes
+ \medievalfalse\classictrue
\xpg@info{Option: Classic Latin}%
\else
\ifx\@tempa\tmp@liturgical\unless\ifluatex
@@ -6181,6 +7242,7 @@ and may look very wrong.}
\lccode\string"2019=\string"2019
\clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000
\finalhyphendemerits=50000000
+ \ifclassic\classicuclccodes\fi
\iflatin@babelshorthands\latin@shorthands\fi
\iflatin@ecclesiastic\unless\ifluatex\ecclesiasticlatin@punctuation
\let\@makefntext\latin@ecclesiastic@makefntext\fi
@@ -6189,6 +7251,7 @@ and may look very wrong.}
\def\inlineextras@latin{%
\lccode\string"2019=\string"2019
+ \ifclassic\classicuclccodes\fi
\iflatin@babelshorthands\latin@shorthands\fi
\iflatin@ecclesiastic
\unless\ifluatex\ecclesiasticlatin@punctuation
@@ -6231,6 +7294,7 @@ and may look very wrong.}
\PolyglossiaSetup{latvian}{
hyphennames={latvian},
hyphenmins={2,2},
+ langtag=LVI,
fontsetup=true,
}
@@ -6281,31 +7345,33 @@ and may look very wrong.}
\PolyglossiaSetup{lithuanian}{
hyphennames={lithuanian},
hyphenmins={2,2},
+ langtag=LTH,
+ indentfirst=true, % TODO Dokumentų rengimo taisyklių, patvirtintų Lietuvos vyriausiojo archyvaro 2011 m. liepos 4 d. įsakymu Nr. V-117, 29.1 punktą
fontsetup=true
}
\def\captionslithuanian{%
+ \def\prefacename{Pratarmė}%
\def\refname{Literatūra}%
\def\abstractname{Santrauka}%
\def\bibname{Literatūra}%
- \def\prefacename{Pratarmė}%
- \def\chaptername{Skyrius}%
+ \def\chaptername{Skyrius}% TODO letter case
\def\appendixname{Priedas}%
\def\contentsname{Turinys}%
\def\listfigurename{Iliustracijų sąrašas}%
\def\listtablename{Lentelių sąrašas}%
\def\indexname{Rodyklė}%
\def\figurename{pav.}%
- \def\tablename{lentelė}%
+ \def\tablename{lentelė}% TODO any special reason for \protect in babel?
\def\partname{Dalis}%
- \def\pagename{puslapis}%
- \def\seename{žiūrėk}%
- \def\alsoname{taip pat}%
\def\enclname{Įdėta}%
\def\ccname{Kopijos}%
- \def\headtoname{Kam}%
+ \def\headtoname{Kam}% TODO empty in babel?
+ \def\pagename{puslapis}%
+ \def\seename{žiūrėk}%
+ \def\alsoname{taip pat}% TODO some other variants are considered in babel?
\def\proofname{Įrodymas}%
- \def\glossaryname{Terminų žodynas}%
+ \def\glossaryname{Terminų žodynas}% TODO some other variants are considered in babel?
}
\def\datelithuanian{%
@@ -6340,200 +7406,6 @@ and may look very wrong.}
% \end{macrocode}
% \iffalse
%</gloss-lithuanian.ldf>
-%<*gloss-liturgicallatin.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-liturgicallatin.ldf}
-% \begin{macrocode}
-%%
-%% This is file `gloss-liturgicallatin.ldf',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% gloss-latin.dtx (with options: `laliturgic')
-%% ------------------------------------------------------------------
-%% Latin module for polyglossia
-%% Copyright (C) Claudio Beccari 2013-2016
-%% Copyright (C) Élie Roux 2016
-%% This work is distributed under the MIT License.
-%%
-%% See the postamble.
-%% ------------------------------------------------------------------
-\ProvidesFile{gloss-liturgiclatin.ldf}
- [2016/09/10 v.1.03 Latin support from polyglossia]
-%%
-
-
-\PolyglossiaSetup{liturgicallatin}{%
- hyphennames={liturgicallatin},
- hyphenmins={2,2},
- frenchspacing=true,
- fontsetup=true,
-}
-\def\liturgicallatincaptions{%
- \def\prefacename{Præfatio}%
- \def\refname{Conspectus librorum}%
- \def\abstractname{Summarium}%
- \def\bibname{Conspectus librorum}%
- \def\chaptername{Caput}%
- \def\appendixname{Additamentum}%
- \def\contentsname{Index}%
- \def\listfigurename{Conspectus descriptionum}%
- \def\listtablename{Conspectus tabularum}%
- \def\indexname{Index rerum notabilium}%
- \def\figurename{Descriptio}%
- \def\tablename{Tabula}%
- \def\partname{Pars}%
- \def\enclname{Additur}%
- \def\ccname{Exemplar}%
- \def\headtoname{\ignorespaces}%
- \def\pagename{charta}%
- \def\seename{cfr.}%
- \def\alsoname{cfr.}%
- \def\proofname{Demonstratio}%
- \def\glossaryname{Glossarium}%
- }
-
-\def\liturgicallatindate{%
- \def\today{\uppercase\expandafter{\romannumeral\day}%
- \space \ifcase\month%
- \or Januarii\or Februarii\or Martii\or Aprilis\or Maji\or Junii\or%
- Julii\or Augusti\or Septembris\or Octobris\or Novembris\or%
- Decembris\fi%
- \space \uppercase\expandafter{\romannumeral\year}}}
-
-\define@boolkey{liturgicallatin}[liturgicallatin@]{babelshorthands}[true]{}
-
-\ifsystem@babelshorthands
- \setkeys{liturgicallatin}{babelshorthands=true}
-\else
- \setkeys{liturgicallatin}{babelshorthands=false}
-\fi
-
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \initiate@active@char{'}%
-}{}
-
-\def\liturgicallatin@shorthands{%
- \def\language@group{liturgicallatin}%
- \bbl@activate{"}%
- \declare@shorthand{liturgicallatin}{"}{\relax
- \ifmmode
- \def\xpglla@next{''}%
- \else
- \def\xpglla@nextdq{\futurelet\xpglla@temp\xpglla@cwm}%
- \fi
- \xpglla@nextdq}%
- \bbl@activate{'}%
- \declare@shorthand{liturgicallatin}{'}{\relax
- \ifmmode
- \def\xpglla@nextsq{'}%
- \else
- \def\xpglla@nextsq{\futurelet\temp@A\xpglla@putacute}%
- \fi
- \xpgla@nextsq}%
-}
-
-\def\xpglla@allowhyphens{\bbl@allowhyphens
- \discretionary{-}{}{}\bbl@allowhyphens}
-
-\newcommand*{\xpglla@cwm}{\let\xpglla@@nextdq\relax
- \ifcat\noexpand\xpglla@temp a%
- \let\xpglla@@nextdq\xpglla@allowhyphens
- \else
- \ifx\xpglla@temp\ae
- \let\xpglla@@nextdq\xpglla@allowhyphens
- \else
- \ifx\xpglla@temp\oe
- \let\xpglla@@nextdq\xpglla@allowhyphens
- \else
- \if\noexpand\xpglla@temp\string|%
- \def\xpglla@@nextdq{\xpglla@allowhyphens\@gobble}%
- \fi
- \fi
- \fi
- \fi
- \xpglla@@nextdq}%
-
-\def\xpglla@putacute#1{\let\xpglla@nextsq\relax%
-\if a\xpglla@temp@A
- æ\kern-0.175em^^^^0301\kern0.175em\xpglla@allowhyphens
-\else
-\if o\xpglla@temp@A
- œ\kern-0.175em^^^^0301\kern0.175em\xpglla@allowhyphens
-\else
- \if æ\xpglla@temp@A
- æ^^^^0301%
- \else
- \if œ\xpglla@temp@A
- œ^^^^0301%
- \else
- \string'%
- \fi
- \fi
-\fi
-\fi}%
-\def\noliturgicallatin@shorthands{%
- \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}%
- \@ifundefined{initiate@active@char}{}{\bbl@deactivate{'}}%
-}
-
-\let\xpglla@savedvalues\empty
-\AtEndPreamble{%
- \edef\xpglla@savedvalues{%
- \clubpenalty=\the\clubpenalty\space
- \@clubpenalty=\the\@clubpenalty\space
- \widowpenalty=\the\widowpenalty\space
- \finalhyphendemerits=\the\finalhyphendemerits}%
-}
-
-\def\noextras@liturgicallatin{%
- \lccode\string"2019=\z@
- \noliturgicallatin@shorthands
- \xpglla@savedvalues
-}
-
-\def\blockextras@liturgicallatin{%
- \lccode\string"2019=\string"2019
- \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000
- \finalhyphendemerits=50000000
- \ifliturgicallatin@babelshorthands\liturgicallatin@shorthands\fi
-}
-
-\def\inlineextras@liturgicallatin{%
- \lccode\string"2019=\string"2019
- \ifliturgicallatin@babelshorthands\liturgicallatin@shorthands\fi
-}
-%% Copyright (C) Claudio Beccari 2013-2016
-%% Copyright (C) Élie Roux 2016
-%%
-%% Permission is hereby granted, free of charge, to any person obtaining
-%% a copy of this software and associated documentation files
-%% (the "Software"), to deal in the Software without restriction, including
-%% without limitation the rights to use, copy, modify, merge, publish,
-%% distribute, sublicense, and/or sell copies of the Software, and to permit
-%% persons to whom the Software is furnished to do so, subject to the following
-%% conditions:
-%%
-%% The above copyright notice and this permission notice shall be included in
-%% all copies or substantial portions of the Software.
-%%
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-%% THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-%% IN THE SOFTWARE.
-%%
-%% End of file `gloss-liturgicallatin.ldf'.
-% \end{macrocode}
-% \iffalse
-%</gloss-liturgicallatin.ldf>
%<*gloss-lsorbian.ldf>
% \fi
% \clearpage
@@ -6541,48 +7413,23 @@ and may look very wrong.}
% \subsection{gloss-lsorbian.ldf}
% \begin{macrocode}
\ProvidesFile{gloss-lsorbian.ldf}[polyglossia: module for lower sorbian]
+
+% We only provide this gloss for babel compatibility. Since lsorbian is
+% a sorbian variety, we use 'sorbian' with variant 'lower' now.
+
+\input{gloss-sorbian.ldf}
+
\PolyglossiaSetup{lsorbian}{
+ language=Lower Sorbian,
+ babelname=lowersorbian,
hyphennames={lsorbian,lowersorbian,Lsorbian},
+ langtag=LSB,
hyphenmins={2,2},
fontsetup=true,
}
-\def\captionslsorbian{%
- \def\refname{Referency}%
- \def\abstractname{Abstrakt}%
- \def\bibname{Literatura}%
- \def\prefacename{Zawod}%
- \def\chaptername{Kapitl}%
- \def\appendixname{Dodawki}%
- \def\contentsname{Wopśimjeśe}%
- \def\listfigurename{Zapis wobrazow}%
- \def\listtablename{Zapis tabulkow}%
- \def\indexname{Indeks}%
- \def\figurename{Wobraz}%
- \def\tablename{Tabulka}%
- %\def\thepart{}%
- \def\partname{Źěl}%
- \def\pagename{Strona}%
- \def\seename{gl.}%
- \def\alsoname{gl.~teke}%
- \def\enclname{Pśiłoga}%
- \def\ccname{CC}%
- \def\headtoname{Komu}%
- \def\proofname{Proof}%
- \def\glossaryname{Glossary}%
- }
-\def\datelsorbian{%
- \def\today{\number\day.~\ifcase\month\or
- januara\or februara\or měrca\or apryla\or maja\or
- junija\or julija\or awgusta\or septembra\or oktobra\or
- nowembra\or decembra\fi
- \space \number\year}%
- \def\oldtoday{\textlsorbian{\number\day.~\ifcase\month\or
- wjelikego rožka\or małego rožka\or nalětnika\or
- jatšownika\or rožownika\or smažnika\or pražnika\or
- žnjeńca\or požnjeńca\or winowca\or nazymnika\or
- godownika\fi\space \number\year}}%
- }
+\let\captionslsorbian\captionssorbian@lsorbian
+\let\datelsorbian\datesorbian@lsorbian
% \end{macrocode}
% \iffalse
@@ -6623,8 +7470,6 @@ and may look very wrong.}
\xpg@ill@value{#1}{macedonian@alph}\fi}%
\def\macedonian@numbers{%
- \let\latin@Alph\@Alph%
- \let\latin@alph\@alph%
\let\@Alph\macedonian@Alph%
\let\@alph\macedonian@alph%
}
@@ -6687,77 +7532,206 @@ and may look very wrong.}
% \subsection{gloss-magyar.ldf}
% \begin{macrocode}
\ProvidesFile{gloss-magyar.ldf}[polyglossia: module for magyar]
+
+% We only provide this gloss for babel compatibility.
+
+\input{gloss-hungarian.ldf}
+
\PolyglossiaSetup{magyar}{
hyphennames={magyar,hungarian},
+ langtag=HUN,
hyphenmins={2,2},
fontsetup=true,
}
-\frenchspacing
+\let\captionsmagyar\captionshungarian
+\let\datemagyar\datehungarian
+\let\ondatemagyar\ondatehungarian
+\let\blockextras@magyar\blockextras@hungarian
+\let\noextras@magyar\noextras@hungarian
-% change 'táblázat x.x' to 'x.x. táblázat'
-\newcommand{\@magyar@fnum@table}{\thetable.~\tablename}
-\let\fnum@table\@magyar@fnum@table
+% \end{macrocode}
+% \iffalse
+%</gloss-magyar.ldf>
+%<*gloss-malay.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-malay.ldf}
+% \begin{macrocode}
+\ProvidesFile{gloss-malay.ldf}[polyglossia: module for malay]
-% change 'ábra x.x' to 'x.x. ábra'
-\newcommand{\@magyar@fnum@figure}{\thefigure.~\figurename}
-\let\fnum@figure\@magyar@fnum@figure
+\RequirePackage{hijrical}
-\def\captionsmagyar{%
- \def\refname{Hivatkozások}%
- \def\abstractname{Kivonat}%
- \def\bibname{Irodalomjegyzék}%
- \def\prefacename{Előszó}%
- \def\chaptername{fejezet}%
- \def\appendixname{Függelék}%
- \def\contentsname{Tartalomjegyzék}%
- \def\listfigurename{Ábrák jegyzéke}%
- \def\listtablename{Táblázatok jegyzéke}%
- \def\indexname{Tárgymutató}%
- \def\figurename{ábra}%
- \def\tablename{táblázat}%
+\PolyglossiaSetup{malay}{%
+ language=Malay,
+ langtag=MLY,
+ hyphennames={malay,melayu,bahasam,bahasai,indonesian,indon,bahasa},
+ hyphenmins={2,2},
+ fontsetup=true}
+
+\providebool{malay@melayu}
+\malay@melayufalse
+\def\malay@variant{malay}
+\define@choicekey*+{malay}{variant}[\val\nr]{indonesian,malaysian}[malaysian]{%
+ \ifcase\nr\relax
+ % indonesian:
+ \def\malay@variant{indonesian}%
+ \malay@melayufalse
+ \or
+ % malaysian:
+ \def\malay@variant{malay}%
+ \malay@melayutrue
+ \fi
+ \ifmalay@melayu
+ \SetLanguageKeys{malay}{language=Malay,langtag=MLY,babelname=bahasam}%
+ \xpg@fontsetup@latin{malay}%
+ % Check if \l@malay is defined. If not, try to set it to some variety
+ % (specific order as in the csv list below), or null language if everything fails
+ \xpg@ifdefined{malay}{}{%
+ \def\do##1{%
+ \xpg@ifdefined{##1}%
+ {\csletcs{l@malay}{l@##1}\listbreak}%
+ {}%
+ }%
+ \docsvlist{melayu,bahasam,bahasai,indonesian,indon,bahasa}
+ \xpg@ifdefined{malay}{}{%
+ \xpg@warning{No hyphenation patterns for Malay (Malaysian) found\MessageBreak
+ I will use the 'null' language instead}%
+ \adddialect\l@malay0%
+ }%
+ }%
+ \else
+ \SetLanguageKeys{malay}{language=Indonesian,langtag=IND,babelname=bahasa}%
+ \xpg@fontsetup@latin{malay}%
+ % Check if \l@indonesian is defined. If not, try to set it to some variety
+ % (specific order as in the csv list below), or null language if everything fails
+ \xpg@ifdefined{indonesian}{}{%
+ \def\do##1{%
+ \xpg@ifdefined{##1}%
+ {\csletcs{l@indonesian}{l@##1}\listbreak}%
+ {}%
+ }%
+ \docsvlist{indon,bahasai,bahasam,malay,melayu,bahasa}
+ \xpg@ifdefined{indonesian}{}{%
+ \xpg@warning{No hyphenation patterns for Malay (Indonesian) found\MessageBreak
+ I will use the 'null' language instead}%
+ \adddialect\l@indonesian0
+ }%
+ }%
+ \fi
+ \xpg@info{Option: malay, variant=\val}%
+}{\xpg@warning{Unknown malay variant `#1'}}
+
+
+\def\malay@language{%
+ \polyglossia@setup@language@patterns{\malay@variant}%
+}%
+
+
+\def\captionsmalay@indonesian{%
+ \def\refname{Pustaka}%
+ \def\abstractname{Ringkasan}%
+ \def\bibname{Bibliografi}%
+ \def\prefacename{Pendahuluan}%
+ \def\chaptername{Bab}%
+ \def\appendixname{Lampiran}%
+ \def\contentsname{Daftar Isi}%
+ \def\listfigurename{Daftar Gambar}%
+ \def\listtablename{Daftar Tabel}%
+ \def\indexname{Indeks}%
+ \def\figurename{Gambar}%
+ \def\tablename{Tabel}%
%\def\thepart{}%
- \def\partname{rész}%
- \def\pagename{oldal}%
- \def\seename{lásd}%
- \def\alsoname{lásd még}%
- \def\enclname{Melléklet}%
- \def\ccname{Körlevél–címzettek}%
- \def\headtoname{Címzett}%
- \def\proofname{Bizonyítás}%
- \def\glossaryname{Szójegyzék}%
- }
-\def\datemagyar{%
- \def\today{%
- \number\year.\nobreakspace\ifcase\month\or
- január\or február\or március\or
- április\or május\or június\or
- július\or augusztus\or szeptember\or
- október\or november\or december\fi
- \space\number\day.}%
- \def\ondatemagyar{%
- \number\year.\nobreakspace\ifcase\month\or
- január\or február\or március\or
- április\or május\or június\or
- július\or augusztus\or szeptember\or
- október\or november\or december\fi
- \space\ifcase\day\or
- 1-jén\or 2-án\or 3-án\or 4-én\or 5-én\or
- 6-án\or 7-én\or 8-án\or 9-én\or 10-én\or
- 11-én\or 12-én\or 13-án\or 14-én\or 15-én\or
- 16-án\or 17-én\or 18-án\or 19-én\or 20-án\or
- 21-én\or 22-én\or 23-án\or 24-én\or 25-én\or
- 26-án\or 27-én\or 28-án\or 29-én\or 30-án\or
- 31-én\fi}%
- \let\ontoday\ondatemagyar}
+ \def\partname{Bagian}%
+ \def\pagename{Halaman}%
+ \def\seename{lihat}%
+ \def\alsoname{lihat juga}%
+ \def\enclname{Lampiran}%
+ \def\ccname{cc}%
+ \def\headtoname{Kepada}%
+ \def\proofname{Bukti}%
+ \def\glossaryname{Daftar Istilah}%
+}
-\def\noextras@magyar{%
- \let\ontoday\@undefined
+\def\captionsmalay@malay{%
+ \def\refname{Rujukan}%
+ \def\abstractname{Abstrak}%
+ \def\bibname{Bibliografi}%
+ \def\prefacename{Pendahuluan}%
+ \def\chaptername{Bab}%
+ \def\appendixname{Lampiran}%
+ \def\contentsname{Kandungan}%
+ \def\listfigurename{Senarai Rajah}%
+ \def\listtablename{Senarai Jadual}%
+ \def\indexname{Indeks}%
+ \def\figurename{Rajah}%
+ \def\tablename{Jadual}%
+ \def\thepart{}%
+ \def\partname{Bahagian}%
+ \def\pagename{Halaman}%
+ \def\seename{lihat}%
+ \def\alsoname{lihat juga}%
+ \def\enclname{Lampiran}%
+ \def\ccname{salinan kpd}%
+ \def\headtoname{Kepada}%
+ \def\proofname{Bukti}%
+ \def\glossaryname{Senarai Istilah}%
+}
+
+\def\captionsmalay{%
+ \csname captionsmalay@\malay@variant\endcsname%
}
+\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
+ \space \number\year}}
+
+\def\datemalay@malay{%
+ \def\bahasam@day{%
+ \ifcase\day\or%
+ 1hb\or 2hb\or 3hb\or 4hb\or 5hb\or%
+ 6hb\or 7hb\or 8hb\or 9hb\or 10hb\or%
+ 11hb\or 12hb\or 13hb\or 14hb\or 15hb\or%
+ 16hb\or 17hb\or 18hb\or 19hb\or 20hb\or%
+ 21hb\or 22hb\or 23hb\or 24hb\or 25hb\or%
+ 26hb\or 27hb\or 28hb\or 29hb\or 30hb\or%
+ 31hb\fi}%
+ \def\today{\bahasam@day~\ifcase\month\or
+ Januari\or Februari\or Mac\or April\or Mei\or Jun\or
+ Julai\or Ogos\or September\or Oktober\or November\or Disember\fi
+ \space \number\year}}
+
+\def\datemalay{%
+ \csname datemalay@\malay@variant\endcsname%
+}
+
+% Hijri calendar localizations
+\def\hijrimonthmalay@indonesian#1{%
+ \ifcase#1%
+ \or Muharram\or Safar\or Rabiul awal\or Rabiul akhir\or Jumadil awal\or Jumadil akhir\or Rajab%
+ \or Sya'ban\or Ramadhan\or Syawal\or Dzulkaidah\or Dzulhijjah\fi%
+}
+
+\def\hijrimonthmalay@malay#1{%
+ \ifcase#1%
+ \or Muharram\or Safar\or Rabiulawal\or Rabiulakhir\or Jamadilawal\or Jamadilakhir\or Rejab%
+ \or Syaaban\or Ramadan\or Syawal\or Zulkaedah\or Zulhijah\fi%
+}
+
+\def\hijrimonthmalay{%
+ \csname hijrimonthmalay@\malay@variant\endcsname%
+}
+
+%\Hijritoday is now locale-aware and will format the date with this macro:
+\DefineFormatHijriDate{malay}{%
+ \number\value{Hijriday}\space\hijrimonthmalay{\value{Hijrimonth}}\space\number\value{Hijriyear}}
+
% \end{macrocode}
% \iffalse
-%</gloss-magyar.ldf>
+%</gloss-malay.ldf>
%<*gloss-malayalam.ldf>
% \fi
% \clearpage
@@ -6850,8 +7824,8 @@ and may look very wrong.}
hyphennames={marathi},
hyphenmins={2,2},%CHECK
fontsetup=true,
+ localnumeral=marathinumerals
%TODO nouppercase=true,
- %TODO localnumber=marathinumber
}
\def\tmp@western{Western}
@@ -6864,6 +7838,8 @@ and may look very wrong.}
\marathi@devanagari@numeralsfalse
\fi}
+\newcommand{\marathinumerals}[2]{\marathinumber{#2}}
+
\def\marathinumber#1{%
\ifmarathi@devanagari@numerals
\devanagaridigits{\number#1}%
@@ -6880,9 +7856,9 @@ and may look very wrong.}
\def\appendixname{परिशिष्ट}%
\def\contentsname{अनुक्रमणिका}%
\def\listfigurename{आकृत्यांची यादी}%
- \def\listtablename{कॊष्टकांची यादी}%
+ \def\listtablename{कोष्टकांची यादी}%
\def\indexname{सूची}%
- \def\figurename{आक्रुती}%
+ \def\figurename{आकृती}%
\def\tablename{कोष्टक}%
%\def\thepart{}% TODO
\def\partname{भाग}%
@@ -6894,6 +7870,7 @@ and may look very wrong.}
\def\headtoname{प्रति}%
\def\proofname{सिद्धता}%
\def\glossaryname{स्पष्टीकरणांची यादी}%
+ \def\authorsand{आणि}%
}
\def\datemarathi{%
\def\marathimonth{%
@@ -6917,6 +7894,207 @@ and may look very wrong.}
% \end{macrocode}
% \iffalse
%</gloss-marathi.ldf>
+%<*gloss-mongolian.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-mongolian.ldf}
+% \begin{macrocode}
+\ProvidesFile{gloss-mongolian.ldf}[polyglossia: module for mongolian]
+
+\RequirePackage{cyrillicnumbers}
+
+\PolyglossiaSetup{mongolian}{
+ script=Cyrillic,
+ scripttag=cyrl,
+ langtag=MNG,
+ hyphennames={mongolian},
+ hyphenmins={2,2},
+ frenchspacing=true,
+ fontsetup,
+ localnumeral=mongoliannumerals,
+ Localnumeral=Mongoliannumerals
+}
+
+% This file is derived from mongolian-babel. which
+% provides support for Mongolian (Khalkha variety)
+% with Cyrillic script
+% TODO: Implement script=mongolian and maybe other
+% variants of Mongolian
+
+\newif\ifcyrillic@numerals
+\define@key{mongolian}{numerals}[arabic]{%
+ \ifstrequal{#1}{cyrillic}%
+ {\cyrillic@numeralstrue}%
+ {\cyrillic@numeralsfalse}%
+}
+
+\define@boolkey{mongolian}[mongolian@]{babelshorthands}[false]{}
+
+\setkeys{mongolian}{numerals}
+
+\ifsystem@babelshorthands
+ \setkeys{mongolian}{babelshorthands=true}
+\else
+ \setkeys{mongolian}{babelshorthands=false}
+\fi
+
+\ifcsundef{initiate@active@char}{%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
+}{}
+
+\def\mongolian@shorthands{%
+ \bbl@activate{"}%
+ \def\language@group{mongolian}%
+ \declare@shorthand{mongolian}{"`}{„}%
+ \declare@shorthand{mongolian}{"'}{“}%
+ \declare@shorthand{mongolian}{"<}{«}%
+ \declare@shorthand{mongolian}{">}{»}%
+ \declare@shorthand{mongolian}{""}{\hskip\z@skip}%
+ \declare@shorthand{mongolian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
+ \declare@shorthand{mongolian}{"=}{\nobreak-\hskip\z@skip}%
+ \declare@shorthand{mongolian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}%
+ \declare@shorthand{mongolian}{"-}{%
+ \def\mongolian@sh@tmp{%
+ \if\mongolian@sh@next-\expandafter\mongolian@sh@emdash%
+ \else\expandafter\mongolian@sh@hyphen\fi%
+ }%
+ \futurelet\mongolian@sh@next\mongolian@sh@tmp%
+ }%
+ \def\mongolian@sh@hyphen{%
+ \nobreak\-\bbl@allowhyphens}%
+ \def\mongolian@sh@emdash##1##2{\cdash-##1##2}%
+ \def\cdash##1##2##3{\def\tempx@{##3}%
+ \def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
+ \ifx\tempx@\tempa@\@Acdash\else
+ \ifx\tempx@\tempb@\@Bcdash\else
+ \ifx\tempx@\tempc@\@Ccdash\else
+ \errmessage{Wrong usage of cdash}\fi\fi\fi}%
+ \def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
+ \cyrdash\hskip.2em\ignorespaces}%
+ \def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
+ \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
+ \def\@Ccdash{\leavevmode
+ \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
+ \ifx\cyrdash\undefined
+ \def\cyrdash{\hbox to.8em{--\hss--}}%
+ \fi
+ \declare@shorthand{mongolian}{",}{\nobreak\hskip.2em\ignorespaces}%
+}
+
+\def\nomongolian@shorthands{%
+ \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}%
+}
+
+% Taken from babel-mongolian
+\def\captionsmongolian{%
+ \def\prefacename{Өмнөх үг}%
+ \def\refname{Ашигласан ном}%
+ \def\abstractname{Удиртгал}%
+ \def\bibname{Номзүй}%
+ \def\chaptername{Бүлэг}%
+ \def\appendixname{Хавсралт}%
+ \ifcsundef{thechapter}%
+ {\def\contentsname{Агуулга}}%
+ {\def\contentsname{Гарчиг}}%
+ \def\listfigurename{Зургийн жагсаалт}%
+ \def\listtablename{Хүснэгтийн жагсаалт}%
+ \def\indexname{Товъёг}%
+ \def\authorname{Нэрийн хэлхээ}%
+ \def\figurename{Зураг}%
+ \def\tablename{Хүснэгт}%
+ \def\partname{Хэсэг}%
+ \def\enclname{Ишлэл}%
+ \def\ccname{э.с.}%
+ \def\headtoname{}%
+ \def\pagename{тал}%
+ \def\seename{талд үз}%
+ \def\alsoname{мөн талд үз}%
+ \def\proofname{Баталгаа}%
+}
+
+\def\datemongolian{%
+ \def\today{\number\year~оны \ifcase\month\or
+ 1-р\or 2-р\or 3-р\or 4-р\or 5-р\or 6-р\or
+ 7-р\or 8-р\or 9-р\or 10-р\or 11-р\or 12-р\fi
+ ~сарын \number\day}}
+
+\newcommand{\mongoliannumerals}[2]{\mongoliannumber{#2}}
+\newcommand{\Mongoliannumerals}[2]{\Mongoliannumber{#2}}
+
+\def\mongoliannumber#1{%
+ \ifcyrillic@numerals
+ \cyr@alph{#1}%
+ \else
+ \number#1%
+ \fi%
+}
+
+\def\Mongoliannumber#1{%
+ \ifcyrillic@numerals
+ \cyr@Alph{#1}%
+ \else
+ \number#1%
+ \fi%
+}
+
+\let\mongoliannumeral=\mongoliannumber
+\let\Mongoliannumeral=\Mongoliannumber
+
+\def\Asbuk#1{\expandafter\cyr@Alph\csname c@#1\endcsname}
+
+\def\asbuk#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. We now use proper cyrillic numbering.
+
+%\def\mongolian@Alph#1{\ifcase#1\or
+% А\or Б\or В\or Г\or Д\or Е\or Ж\or
+% З\or И\or К\or Л\or М\or Н\or О\or
+% П\or Р\or С\or Т\or У\or Ф\or Х\or
+% Ц\or Ч\or Ш\or Щ\or Э\or Ю\or Я\else\xpg@ill@value{#1}{mongolian@Alph}\fi}
+
+%\def\mongolian@alph#1{\ifcase#1\or
+% а\or б\or в\or г\or д\or е\or ж\or
+% з\or и\or к\or л\or м\or н\or о\or
+% п\or р\or с\or т\or у\or ф\or х\or
+% ц\or ч\or ш\or щ\or э\or ю\or я\else\xpg@ill@value{#1}{mongolian@alph}\fi}
+
+\def\mongolian@numbers{%
+ \let\latin@alph\@alph
+ \let\latin@Alph\@Alph
+ \ifcyrillic@numerals%
+ \def\mongolian@alph##1{\expandafter\mongoliannumeral\expandafter{\the##1}}%
+ \def\mongolian@Alph##1{\expandafter\Mongoliannumeral\expandafter{\the##1}}%
+ \let\@alph\mongolian@alph%
+ \let\@Alph\mongolian@Alph%
+ \fi
+}
+
+\def\nomongolian@numbers{%
+ \let\@alph\latin@alph%
+ \let\@Alph\latin@Alph%
+}
+
+\def\noextras@mongolian{%
+ \ifcyrillic@numerals\nomongolian@numbers\fi%
+ \nomongolian@shorthands%
+}
+
+\def\blockextras@mongolian{%
+ \ifcyrillic@numerals\mongolian@numbers\fi%
+ \ifmongolian@babelshorthands\mongolian@shorthands\fi%
+}
+
+\def\inlineextras@mongolian{%
+ \ifmongolian@babelshorthands\mongolian@shorthands\fi%
+}
+
+% \end{macrocode}
+% \iffalse
+%</gloss-mongolian.ldf>
%<*gloss-nko.ldf>
% \fi
% \clearpage
@@ -6927,12 +8105,16 @@ and may look very wrong.}
\PolyglossiaSetup{nko}{%
script=N'ko,
scripttag=nko~,
+ langtag=NKO,
fontsetup=true,
hyphennames={nohyphenation},
- direction=RL
+ direction=RL,
+ localnumeral=nkonumerals
}
\RequirePackage{nkonumbers}%
+\newcommand{\nkonumerals}[2]{\nkonumber{#2}}
+
\def\captionsnko{%
\def\prefacename{ߢߍߛߓߍ}%
\def\refname{ߞߐߡߊߛߙߋ}%
@@ -6961,27 +8143,27 @@ and may look very wrong.}
% ߂߀߁߃ ߞߏ߲ߞߏߜߍ ߕߟߋ߬ ߁߈ (RTL)
% ( 18 February 2013 )
% The word "ߕߟߋ߬" is mandatory between month name and day number.
+% Replace "ߕߟߋ߬" by "ߕߋ߬ߟߋ߫" if and only if day = 2 or day = 3 or day = 9
+% or (day >= 20 and day <= 29).
+
+\newcommand*\nkodayprefix[1]{%
+ \ifnum\numexpr#1=2 ߕߋ߬ߟߋ߫\else%
+ \ifnum\numexpr#1=3 ߕߋ߬ߟߋ߫\else%
+ \ifnum\numexpr#1=9 ߕߋ߬ߟߋ߫\else%
+ \ifnum\numexpr#1>19\ifnum\numexpr#1<30 ߕߋ߬ߟߋ߫\else ߕߟߋ߬\fi\else ߕߟߋ߬\fi%
+ \fi%
+ \fi%
+ \fi%
+}
-\def\datenko{%
- \def\today{%
- \nkonumber{\year}\space
- \ifcase\month
- \orߓߌ߲ߠߊߥߎߟߋ߲%
- \orߞߏ߲ߞߏߜߍ%
- \orߕߙߊߓߊ
- \orߞߏ߲ߞߏߘߌ߬ߓߌ%
- \orߘߓߊ߬ߕߊ%
- \orߥߊ߬ߛߌߥߊ߬ߙߊ%
- \orߞߊ߬ߙߌߝߐ߭%
- \orߘߓߊ߬ߓߌߟߊ%
- \orߕߎߟߊߝߌ߲%
- \orߞߏ߲ߓߌߕߌ߮%
- \orߣߍߣߍߓߊ%
- \orߞߏ߬ߟߌ߲߬ߞߏߟߌ߲\fi
- \spaceߕߟߋ߬
- \space\nkonumber{\day}
- }%
+\newcommand*\nkoday[1]{%
+ % If day = 1, put above "߁", NKO_COMBINING_SHORT_RISING_TONE
+ \ifnum\numexpr#1=1 ߁߭\else%
+ \nkonumber{#1}
+ \fi
+}
+\def\datenko{%
\def\today{%
\nkonumber{\year}\space
\ifcase\month
@@ -6997,8 +8179,8 @@ and may look very wrong.}
\or ߞߏ߲ߓߌߕߌ߮%
\or ߣߍߣߍߓߊ%
\or ߞߏ߬ߟߌ߲߬ߞߏߟߌ߲\fi
- \space ߕߟߋ߬
- \space\nkonumber{\day}
+ \space\nkodayprefix{\number\day}
+ \space\nkoday{\day}
}%
}%
@@ -7011,15 +8193,89 @@ and may look very wrong.}
%
% \subsection{gloss-norsk.ldf}
% \begin{macrocode}
-\ProvidesFile{gloss-norsk.ldf}[polyglossia: module for norwegian]
+\ProvidesFile{gloss-norsk.ldf}[polyglossia: module for norwegian (bokmal)]
+
+% We only provide this gloss for babel compatibility. Since norsk is
+% actually norwegian bokmal, we use 'norwegian' with variant 'bokmal' now.
+
+\input{gloss-norwegian.ldf}
+
\PolyglossiaSetup{norsk}{
hyphennames={norsk},
hyphenmins={2,2},
+ langtag=NOR,
frenchspacing=true,
fontsetup=true,
}
-\def\captionsnorsk{%
+\let\captionsnorsk\captionsnorwegian@norsk
+\let\datenorsk\datenorwegian@norsk
+
+% \end{macrocode}
+% \iffalse
+%</gloss-norsk.ldf>
+%<*gloss-norwegian.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-norwegian.ldf}
+% \begin{macrocode}
+\ProvidesFile{gloss-norwegian.ldf}[polyglossia: module for norwegian]
+\PolyglossiaSetup{norwegian}{
+ hyphennames={nynorsk},
+ langtag=NYN,
+ hyphenmins={2,2},
+ frenchspacing=true,
+ fontsetup=false,
+}
+
+\def\norwegian@variant{nynorsk}
+\define@choicekey*+{norwegian}{variant}[\val\nr]{nynorsk,bokmal}[nynorsk]{%
+ \ifcase\nr\relax
+ % nynorsk:
+ \def\norwegian@variant{nynorsk}%
+ \SetLanguageKeys{norwegian}{langtag=NYN,babelname=nynorsk}%
+ \xpg@fontsetup@latin{norwegian}%
+ \or
+ % bokmal:
+ \def\norwegian@variant{norsk}%
+ \SetLanguageKeys{norwegian}{langtag=NOR,babelname=norsk}%
+ \xpg@fontsetup@latin{norwegian}%
+ \fi
+ \xpg@info{Option: norwegian, variant=\val}%
+}{\xpg@warning{Unknown norwegian variant `#1'}}
+
+
+\def\norwegian@language{%
+ \polyglossia@setup@language@patterns{\norwegian@variant}
+}%
+
+\def\captionsnorwegian@nynorsk{%
+ \def\refname{Referansar}%
+ \def\abstractname{Sammendrag}%
+ \def\bibname{Litteratur}%
+ \def\prefacename{Forord}%
+ \def\chaptername{Kapittel}%
+ \def\appendixname{Tillegg}%
+ \def\contentsname{Innhald}%
+ \def\listfigurename{Figurar}%
+ \def\listtablename{Tabellar}%
+ \def\indexname{Register}%
+ \def\figurename{Figur}%
+ \def\tablename{Tabell}%
+ %\def\thepart{}% <<<
+ \def\partname{Del}%
+ \def\pagename{Side}%
+ \def\seename{Sjå}%
+ \def\alsoname{Sjå òg}%
+ \def\enclname{Vedlegg}%
+ \def\ccname{Kopi til}%
+ \def\headtoname{Til}%
+ \def\proofname{Bevis}%
+ \def\glossaryname{Ordliste}%
+}
+
+\def\captionsnorwegian@norsk{%
\def\refname{Referanser}%
\def\abstractname{Sammendrag}%
\def\bibname{Bibliografi}%
@@ -7042,18 +8298,33 @@ and may look very wrong.}
\def\headtoname{Til}%
\def\proofname{Bevis}%
\def\glossaryname{Ordliste}%
- }
+}
+
+\def\captionsnorwegian{%
+ \csname captionsnorwegian@\norwegian@variant\endcsname%
+}
-\def\datenorsk{%
+\def\datenorwegian@nynorsk{%
\def\today{\number\day.~\ifcase\month\or
januar\or februar\or mars\or april\or mai\or juni\or
juli\or august\or september\or oktober\or november\or desember
\fi\space\number\year}%
- }
+}
+
+\def\datenorwegian@norsk{%
+ \def\today{\number\day.~\ifcase\month\or
+ januar\or februar\or mars\or april\or mai\or juni\or
+ juli\or august\or september\or oktober\or november\or
+ desember\fi\space\number\year}%
+}
+
+\def\datenorwegian{%
+ \csname datenorwegian@\norwegian@variant\endcsname%
+}
% \end{macrocode}
% \iffalse
-%</gloss-norsk.ldf>
+%</gloss-norwegian.ldf>
%<*gloss-nynorsk.ldf>
% \fi
% \clearpage
@@ -7061,44 +8332,22 @@ and may look very wrong.}
% \subsection{gloss-nynorsk.ldf}
% \begin{macrocode}
\ProvidesFile{gloss-nynorsk.ldf}[polyglossia: module for norwegian (Nynorsk)]
+
+% We only provide this gloss for babel compatibility. Since nynorsk is
+% a norwegian variety, we use 'norwegian' with variant 'nynorsk' now.
+
+\input{gloss-norwegian.ldf}
+
\PolyglossiaSetup{nynorsk}{
hyphennames={nynorsk},
+ langtag=NYN,
hyphenmins={2,2},
frenchspacing=true,
fontsetup=true,
}
-\def\captionsnynorsk{%
- \def\refname{Referansar}%
- \def\abstractname{Sammendrag}%
- \def\bibname{Litteratur}%
- \def\prefacename{Forord}%
- \def\chaptername{Kapittel}%
- \def\appendixname{Tillegg}%
- \def\contentsname{Innhald}%
- \def\listfigurename{Figurar}%
- \def\listtablename{Tabellar}%
- \def\indexname{Register}%
- \def\figurename{Figur}%
- \def\tablename{Tabell}%
- %\def\thepart{}% <<<
- \def\partname{Del}%
- \def\pagename{Side}%
- \def\seename{Sjå}%
- \def\alsoname{Sjå òg}%
- \def\enclname{Vedlegg}%
- \def\ccname{Kopi til}%
- \def\headtoname{Til}%
- \def\proofname{Bevis}%
- \def\glossaryname{Ordliste}%
- }
-
-\def\datenynorsk{%
- \def\today{\number\day.~\ifcase\month\or
- januar\or februar\or mars\or april\or mai\or juni\or
- juli\or august\or september\or oktober\or november\or desember
- \fi\space\number\year}%
- }
+\let\captionsnorsk\captionsnorwegian@nynorsk
+\let\datenorsk\datenorwegian@nynorsk
% \end{macrocode}
% \iffalse
@@ -7130,6 +8379,7 @@ and may look very wrong.}
module for Occitan]
\PolyglossiaSetup{occitan}{
hyphennames={occitan},
+ langtag=OCI,
hyphenmins={2,2},
frenchspacing=true,
indentfirst=true,
@@ -7142,10 +8392,13 @@ and may look very wrong.}
\else
\setkeys{occitan}{babelshorthands=false}
\fi
+
\ifcsundef{initiate@active@char}{%
-\input{babelsh.def}%
-\initiate@active@char{"}%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
}{}
+
\def\occitan@shorthands{%
\bbl@activate{"}%
\def\language@group{occitan}%
@@ -7269,6 +8522,165 @@ and may look very wrong.}
% \end{macrocode}
% \iffalse
%</gloss-occitan.ldf>
+%<*gloss-persian.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-persian.ldf}
+% \begin{macrocode}
+\ProvidesFile{gloss-persian.ldf}[polyglossia: module for persian]
+\ifluatex
+ \xpg@warning{Persian is not supported with LuaTeX.\MessageBreak
+I will proceed with the compilation, but\MessageBreak
+the output is not guaranteed to be correct\MessageBreak
+and may look very wrong.}
+\fi
+\RequireBidi
+\RequirePackage{arabicnumbers}
+\RequirePackage{farsical}
+\RequirePackage{hijrical}
+\PolyglossiaSetup{persian}{
+ babelname=farsi,
+ script=Arabic,
+ direction=RL,
+ scripttag=arab,
+ langtag=FAR,
+ hyphennames={nohyphenation},
+ fontsetup=true,
+ localnumeral=farsinumerals
+}
+
+\newif\if@western@numerals
+\def\tmp@western{western}
+\define@key{persian}{numerals}[eastern]{%
+ \def\@tmpa{#1}%
+ \ifx\@tmpa\tmp@western\@western@numeralstrue\else%
+ \@western@numeralsfalse%
+ \fi}
+
+%this is needed for \abjad in arabicnumbers.sty
+\def\tmp@true{true}
+\define@key{persian}{abjadjimnotail}[true]{%
+ \def\@tmpa{#1}%
+ \ifx\@tmpa\tmp@true\abjad@jim@notailtrue%
+ \else
+ \abjad@jim@notailfalse
+ \fi}
+
+% NOT YET USED
+\define@key{persian}{locale}[default]{%
+ \def\@persian@locale{#1}}
+
+%TODO add option for CALENDAR
+
+\setkeys{persian}{locale,numerals}
+
+\def\farsigregmonth#1{\ifcase#1%
+ \or ژانویه\or فوریه\or مارس\or آوریل\or مه\or ژوئن\or ژوئیه\or اوت\or سپتامبر\or اکتبر\or نوامبر\or دسامبر\fi}
+\def\farsimonth#1{\ifcase#1%
+ \or کانون ثانی\or شباط\or اذار%%or ادار
+ \or نیسان\or ایار\or حزیران\or تموز\or آب\or ایلول\or تشرین اول\or تشرین ثانی\or کانون اول\fi}
+
+%\Hijritoday is now locale-aware and will format the date with this macro:
+\DefineFormatHijriDate{persian}{\@ensure@RTL{%
+\farsinumber{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\farsinumber{\value{Hijriyear}}}}
+
+\def\captionspersian{%
+\def\prefacename{\@ensure@RTL{پیشگفتار}}%
+\def\refname{\@ensure@RTL{مراجع}}%
+\def\abstractname{\@ensure@RTL{چکیده}}%
+\def\bibname{\@ensure@RTL{کتاب‌نامه}}%
+\def\chaptername{\@ensure@RTL{فصل}}%
+\def\appendixname{\@ensure@RTL{پیوست}}%
+\def\contentsname{\@ensure@RTL{فهرست مطالب}}%
+\def\listfigurename{\@ensure@RTL{لیست تصاویر}}%
+\def\listtablename{\@ensure@RTL{لیست جداول}}%
+\def\indexname{\@ensure@RTL{نمایه}}%
+\def\figurename{\@ensure@RTL{شكل}}%
+\def\tablename{\@ensure@RTL{جدول}}%
+\def\partname{\@ensure@RTL{بخش}}%
+\def\enclname{\@ensure@RTL{پیوست}}%
+\def\ccname{\@ensure@RTL{رونوشت}}%
+\def\headtoname{\@ensure@RTL{به}}%
+\def\pagename{\@ensure@RTL{صفحة}}%
+\def\seename{\@ensure@RTL{ببینید}}%
+\def\alsoname{\@ensure@RTL{نیز ببینید}}%
+\def\proofname{\@ensure@RTL{برهان}}%
+\def\glossaryname{\@ensure@RTL{دانش‌نامه}}%
+}
+\def\datepersian{%
+ \def\today{\@ensure@RTL{\farsinumber\day\space\farsigregmonth{\month}\space\farsinumber\year}}%
+}
+
+\newcommand{\farsinumerals}[2]{\farsinumber{#2}}
+
+\newif\ifpersiandigits
+
+\def\farsinumber#1{%
+ \if@western@numerals
+ \number#1%
+ \else
+ \ifxetex
+ \ifnum\XeTeXcharglyph"06F0 > 0\relax
+ \persiandigitstrue
+ \fi
+ \else\ifluatex
+ \expandafter\ifnum\directlua{polyglossia.check_char(0x6F0)} > 0\relax
+ \persiandigitstrue
+ \fi
+ \fi\fi
+ \ifpersiandigits
+ \farsidigits{\number#1}%
+ %%{\protect\addfontfeature{Mapping=farsidigits}\number#1}%
+ \else%
+ \arabicdigits{\number#1}%
+ %%{\protect\addfontfeature{Mapping=arabicdigits}\number#1}%
+ \fi
+ \fi
+}
+
+%\def\farsinum#1{\expandafter\farsinumber\csname c@#1\endcsname}
+%\def\farsibracenum#1{(\expandafter\farsinumber\csname c@#1\endcsname)}
+%\def\farsiornatebracenum#1{\char"FD3E\expandafter\farsinumber\csname c@#1\endcsname\char"FD3F}
+%\def\farsialph#1{\expandafter\@farsialph\csname c@#1\endcsname}
+
+\def\persian@numbers{%
+ \let\@alph\abjad%
+ \let\@Alph\abjad%
+}
+
+\def\nopersian@numbers{%
+ \let\@alph\@latinalph%
+ \let\@Alph\@latinAlph%
+}
+
+\def\persian@globalnumbers{%
+ \let\@arabic\farsinumber%
+ \renewcommand\thefootnote{\localnumeral*{footnote}}%
+ \renewcommand\theequation{\localnumeral*{equation}}%
+}
+
+% Store original definition
+\let\xpg@save@arabic\@arabic
+
+\def\nopersian@globalnumbers{
+ \let\@arabic\xpg@save@arabic%
+}
+
+% Save original \MakeUppercase definition
+\let\xpg@save@MakeUppercase\MakeUppercase
+
+\def\blockextras@persian{%
+ \def\MakeUppercase##1{##1}%
+}
+
+\def\noextras@persian{%
+ % restore original \MakeUppercase definition
+ \let\MakeUppercase\xpg@save@MakeUppercase
+}
+% \end{macrocode}
+% \iffalse
+%</gloss-persian.ldf>
%<*gloss-piedmontese.ldf>
% \fi
% \clearpage
@@ -7281,6 +8693,7 @@ and may look very wrong.}
\PolyglossiaSetup{piedmontese}{
hyphennames={piedmontese},
hyphenmins={2,2},
+ langtag=PMS,
frenchspacing=true,
fontsetup=true,
}
@@ -7295,8 +8708,9 @@ and may look very wrong.}
\fi
\ifcsundef{initiate@active@char}{%
-\input{babelsh.def}%
-\initiate@active@char{"}%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
}{}
\def\piedmontese@shorthands{%
@@ -7401,6 +8815,7 @@ and may look very wrong.}
\PolyglossiaSetup{polish}{
hyphennames={polish},
hyphenmins={2,2},
+ langtag=PLK,
frenchspacing=true,
fontsetup=true,
}
@@ -7446,14 +8861,71 @@ and may look very wrong.}
%
% \subsection{gloss-portuges.ldf}
% \begin{macrocode}
-\ProvidesFile{gloss-portuges.ldf}[polyglossia: module for portuguese]
+\ProvidesFile{gloss-portuges.ldf}[polyglossia: module for portuguese (DEPRECATED!)]
+
+% We only provide this gloss for backwards compatibility. The name
+% 'portuges' was selected in accordance with babel (which probably
+% introduced it in 8.3 filename times). Since polyglossia uses full
+% English language names, we use 'portuguese' now.
+
+% FIXME: Once we support babel aliases (#112) this gloss can go.
+
+\xpg@warning{The language name 'portuges' is deprectated.\MessageBreak
+ Please use 'portuguese' instead.}
+
+\input{gloss-portuguese.ldf}
+
\PolyglossiaSetup{portuges}{
hyphennames={portuges,portuguese},
hyphenmins={2,3},
+ langtag=PTG,
+ fontsetup=true,
+}
+
+\let\captionsportuges\captionsportuguese@portuges
+\let\dateportuges\dateportuguese@portuges
+
+% \end{macrocode}
+% \iffalse
+%</gloss-portuges.ldf>
+%<*gloss-portuguese.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-portuguese.ldf}
+% \begin{macrocode}
+\ProvidesFile{gloss-portuguese.ldf}[polyglossia: module for portuguese]
+\PolyglossiaSetup{portuguese}{
+ babelname=portuges,
+ hyphennames={portuges,portuguese},
+ hyphenmins={2,3},
+ langtag=PTG,
fontsetup=true,
}
-\def\captionsportuges{%
+\def\portuguese@variant{portuges}
+\define@choicekey*+{portuguese}{variant}[\val\nr]{portuguese,brazilian}[portuguese]{%
+ \ifcase\nr\relax
+ % portuguese:
+ \def\portuguese@variant{portuges}%
+ \or
+ % brazilian:
+ \def\portuguese@variant{brazil}%
+ \SetLanguageKeys{portuguese}{babelname=brazil}%
+ \xpg@ifdefined{brazil}{}%
+ {\xpg@warning{No hyphenation patterns were loaded for "Portuguese (Brazil)"\MessageBreak
+ I will use the standard patterns for Portuguese instead}%
+ \adddialect\l@brazil\l@portuges\relax}%
+ \fi
+ \xpg@info{Option: portuguese, variant=\val}%
+}{\xpg@warning{Unknown portuguese variant `#1'}}
+
+
+\def\portuguese@language{%
+ \polyglossia@setup@language@patterns{\portuguese@variant}
+}%
+
+\def\captionsportuguese@portuges{%
\def\refname{Referências}%
\def\abstractname{Resumo}%
\def\bibname{Bibliografia}%
@@ -7466,7 +8938,6 @@ and may look very wrong.}
\def\indexname{Índice}%
\def\figurename{Figura}%
\def\tablename{Tabela}%
- %\def\thepart{}%
\def\partname{Parte}%
\def\pagename{Página}%
\def\seename{ver}%
@@ -7476,18 +8947,58 @@ and may look very wrong.}
\def\headtoname{Para}%
\def\proofname{Demonstração}%
\def\glossaryname{Glossário}%
- }
+}
+
+\def\captionsportuguese@brazil{%
+ \def\refname{Referências}%
+ \def\abstractname{Resumo}%
+ \def\bibname{Referências Bibliográficas}%
+ \def\prefacename{Prefácio}%
+ \def\chaptername{Capítulo}%
+ \def\appendixname{Apêndice}%
+ \def\contentsname{Sumário}%
+ \def\listfigurename{Lista de Figuras}%
+ \def\listtablename{Lista de Tabelas}%
+ \def\indexname{Índice Remissivo}%
+ \def\figurename{Figura}%
+ \def\tablename{Tabela}%
+ \def\partname{Parte}%
+ \def\pagename{Página}%
+ \def\seename{veja}%
+ \def\alsoname{veja também}%
+ \def\enclname{Anexo}%
+ \def\ccname{Cópia para}%
+ \def\headtoname{Para}%
+ \def\proofname{Demonstração}%
+ \def\glossaryname{Glossário}%
+}
-\def\dateportuges{%
+\def\captionsportuguese{%
+ \csname captionsportuguese@\portuguese@variant\endcsname%
+}
+
+\def\dateportuguese@portuges{%
\def\today{\number\day\space de\space\ifcase\month\or
Janeiro\or Fevereiro\or Março\or Abril\or Maio\or Junho\or
Julho\or Agosto\or Setembro\or Outubro\or Novembro\or Dezembro\fi
\space de\space\number\year}%
- }
+}
+
+
+\def\dateportuguese@brazil{%
+ \def\today{\number\day\space de\space\ifcase\month\or
+ janeiro\or fevereiro\or março\or abril\or maio\or junho\or
+ julho\or agosto\or setembro\or outubro\or novembro\or dezembro%
+ \fi\space de\space\number\year}%
+}
+
+\def\dateportuguese{%
+ \csname dateportuguese@\portuguese@variant\endcsname%
+}
% \end{macrocode}
% \iffalse
-%</gloss-portuges.ldf>
+%</gloss-portuguese.ldf>
%<*gloss-romanian.ldf>
% \fi
% \clearpage
@@ -7499,6 +9010,7 @@ and may look very wrong.}
\PolyglossiaSetup{romanian}{
hyphennames={romanian},
hyphenmins={2,2},
+ langtag=ROM,
fontsetup=true,
}
@@ -7549,6 +9061,7 @@ and may look very wrong.}
\PolyglossiaSetup{romansh}{%
hyphennames={romansh},
hyphenmins={2,2},
+ langtag=RMS,
indentfirst=true,
fontsetup=true,
}
@@ -7595,6 +9108,9 @@ and may look very wrong.}
% \subsection{gloss-russian.ldf}
% \begin{macrocode}
\ProvidesFile{gloss-russian.ldf}[polyglossia: module for russian]
+
+\RequirePackage{cyrillicnumbers}
+
\PolyglossiaSetup{russian}{
script=Cyrillic,
scripttag=cyrl,
@@ -7602,22 +9118,30 @@ and may look very wrong.}
hyphennames={russian},
hyphenmins={2,2},
frenchspacing=true,
- fontsetup
- %TODO localalph={russian@alph,russian@Alph}
+ fontsetup,
+ localnumeral=russiannumerals,
+ Localnumeral=Russiannumerals
}
+\newif\if@russian@modern
\define@key{russian}{spelling}[modern]{%
\ifstrequal{#1}{old}%
- {\def\captionsrussian{\captionsrussian@old}%
- \def\daterussian{\daterussian@old}}%
- {\def\captionsrussian{\captionsrussian@modern}%
- \def\daterussian{\daterussian@modern}}%
+ {\@russian@modernfalse}%
+ {\@russian@moderntrue}%
}
+\def\captionsrussian{%
+ \if@russian@modern\captionsrussian@modern\else\captionsrussian@old\fi%
+}%
+
+\def\daterussian{%
+ \if@russian@modern\daterussian@modern\else\daterussian@old\fi%
+}%
+
\newif\ifcyrillic@numerals
-\define@key{russian}{numerals}[latin]{%
+\define@key{russian}{numerals}[arabic]{%
\ifstrequal{#1}{cyrillic}%
- {\cyrillic@numeralstrue}
+ {\cyrillic@numeralstrue}%
{\cyrillic@numeralsfalse}%
}
@@ -7634,6 +9158,7 @@ and may look very wrong.}
\ifcsundef{initiate@active@char}{%
\input{babelsh.def}%
\initiate@active@char{"}%
+ \shorthandoff{"}%
}{}
\def\russian@shorthands{%
@@ -7649,8 +9174,8 @@ and may look very wrong.}
\declare@shorthand{russian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}%
\declare@shorthand{russian}{"-}{%
\def\russian@sh@tmp{%
- \if\russian@sh@next-\expandafter\russian@sh@emdash
- \else\expandafter\russian@sh@hyphen\fi
+ \if\russian@sh@next-\expandafter\russian@sh@emdash%
+ \else\expandafter\russian@sh@hyphen\fi%
}%
\futurelet\russian@sh@next\russian@sh@tmp}%
\def\russian@sh@hyphen{%
@@ -7669,7 +9194,7 @@ and may look very wrong.}
\def\@Ccdash{\leavevmode
\nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
\ifx\cyrdash\undefined
- \def\cyrdash{\hbox to.8em{--\hss--}}
+ \def\cyrdash{\hbox to.8em{--\hss--}}%
\fi
\declare@shorthand{russian}{",}{\nobreak\hskip.2em\ignorespaces}%
}
@@ -7719,7 +9244,8 @@ and may look very wrong.}
октября\or
ноября\or
декабря\fi%
- \space \number\year\space г.}}
+ \space \number\year\space г.}%
+}
\def\captionsrussian@old{%
\def\prefacename{Предисловіе}%
@@ -7745,7 +9271,8 @@ and may look very wrong.}
\def\seename{см.}%
\def\alsoname{см.~также}%
\def\proofname{Доказательство}%
-}
+}
+
\def\daterussian@old{%
\def\today{\number\day%
\space\ifcase\month\or%
@@ -7761,18 +9288,24 @@ and may look very wrong.}
октября\or
ноября\or
декабря\fi%
- \space \number\year\space г.}}
+ \space \number\year\space г.}%
+}
% The following is based on some ideas from ruscor.sty
\def\russian@capsformat{%
\ifdef{\KOMAScript}{%
\ifdef{\chapterformat}{%
\renewcommand{\chapterformat}{\prechapter\thechapter\postchapter}}{}%
- \renewcommand{\sectionformat}{\presection\thesection\postsection}%
- \renewcommand{\subsectionformat}{\presubsection\thesubsection\postsubsection}%
- \renewcommand{\subsubsectionformat}{\presubsubsection\thesubsubsection\postsubsubsection}%
- \renewcommand{\paragraphformat}{\preparagraph\theparagraph\postparagraph}%
- \renewcommand{\subparagraphformat}{\presubparagraph\thesubparagraph\postsubparagraph}%
+ \ifdef{\sectionformat}{%
+ \renewcommand{\sectionformat}{\presection\thesection\postsection}}{}%
+ \ifdef{\subsectionformat}{%
+ \renewcommand{\subsectionformat}{\presubsection\thesubsection\postsubsection}}{}%
+ \ifdef{\subsubsectionformat}{%
+ \renewcommand{\subsubsectionformat}{\presubsubsection\thesubsubsection\postsubsubsection}}{}%
+ \ifdef{\paragraphformat}{%
+ \renewcommand{\paragraphformat}{\preparagraph\theparagraph\postparagraph}}{}%
+ \ifdef{\subparagraphformat}{%
+ \renewcommand{\subparagraphformat}{\presubparagraph\thesubparagraph\postsubparagraph}}{}%
}{%
\def\@seccntformat##1{\csname pre##1\endcsname%
\csname the##1\endcsname%
@@ -7790,27 +9323,58 @@ and may look very wrong.}
\def\presubsection{}%
\def\presubsubsection{}%
\def\preparagraph{}%
- \def\presubparagraph{}}
+ \def\presubparagraph{}%
+}
-\def\Asbuk#1{\expandafter\russian@Alph\csname c@#1\endcsname}
-\def\russian@Alph#1{\ifcase#1\or
- А\or Б\or В\or Г\or Д\or Е\or Ж\or
- З\or И\or К\or Л\or М\or Н\or О\or
- П\or Р\or С\or Т\or У\or Ф\or Х\or
- Ц\or Ч\or Ш\or Щ\or Э\or Ю\or Я\else\xpg@ill@value{#1}{russian@Alph}\fi}
-\def\asbuk#1{\expandafter\russian@alph\csname c@#1\endcsname}
-\def\russian@alph#1{\ifcase#1\or
- а\or б\or в\or г\or д\or е\or ж\or
- з\or и\or к\or л\or м\or н\or о\or
- п\or р\or с\or т\or у\or ф\or х\or
- ц\or ч\or ш\or щ\or э\or ю\or я\else\xpg@ill@value{#1}{russian@alph}\fi}
+\newcommand{\russiannumerals}[2]{\russiannumber{#2}}
+\newcommand{\Russiannumerals}[2]{\Russiannumber{#2}}
+
+\def\russiannumber#1{%
+ \ifcyrillic@numerals
+ \cyr@alph{#1}%
+ \else
+ \number#1%
+ \fi%
+}
+
+\def\Russiannumber#1{%
+ \ifcyrillic@numerals
+ \cyr@Alph{#1}%
+ \else
+ \number#1%
+ \fi%
+}
+
+\let\russiannumeral=\russiannumber
+\let\Russiannumeral=\Russiannumber
+
+\def\Asbuk#1{\expandafter\cyr@Alph\csname c@#1\endcsname}
+
+\def\asbuk#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. We now use proper cyrillic numbering.
+
+%\def\russian@Alph#1{\ifcase#1\or
+% А\or Б\or В\or Г\or Д\or Е\or Ж\or
+% З\or И\or К\or Л\or М\or Н\or О\or
+% П\or Р\or С\or Т\or У\or Ф\or Х\or
+% Ц\or Ч\or Ш\or Щ\or Э\or Ю\or Я\else\xpg@ill@value{#1}{russian@Alph}\fi}
+
+%\def\russian@alph#1{\ifcase#1\or
+% а\or б\or в\or г\or д\or е\or ж\or
+% з\or и\or к\or л\or м\or н\or о\or
+% п\or р\or с\or т\or у\or ф\or х\or
+% ц\or ч\or ш\or щ\or э\or ю\or я\else\xpg@ill@value{#1}{russian@alph}\fi}
\def\russian@numbers{%
- \let\latin@alph\@alph%
- \let\latin@Alph\@Alph%
- \ifcyrillic@numerals
- \let\@alph\russian@alph%
- \let\@Alph\russian@Alph%
+ \let\latin@alph\@alph
+ \let\latin@Alph\@Alph
+ \ifcyrillic@numerals%
+ \def\russian@alph##1{\expandafter\russiannumeral\expandafter{\the##1}}%
+ \def\russian@Alph##1{\expandafter\Russiannumeral\expandafter{\the##1}}%
+ \let\@alph\russian@alph%
+ \let\@Alph\russian@Alph%
\fi
}
@@ -7823,22 +9387,27 @@ and may look very wrong.}
\ifdef{\KOMAScript}{%
\ifdef{\chapterformat}{%
\renewcommand{\chapterformat}{\thechapter\autodot\enskip}}{}%
- \renewcommand{\sectionformat}{\thesection\autodot\enskip}%
- \renewcommand{\subsectionformat}{\thesubsection\autodot\enskip}%
- \renewcommand{\subsubsectionformat}{\thesubsubsection\autodot\enskip}%
- \renewcommand{\paragraphformat}{\theparagraph\autodot\enskip}%
- \renewcommand{\subparagraphformat}{\thesubparagraph\autodot\enskip}%
+ \ifdef{\sectionformat}{%
+ \renewcommand{\sectionformat}{\thesection\autodot\enskip}}{}%
+ \ifdef{\subsectionformat}{%
+ \renewcommand{\subsectionformat}{\thesubsection\autodot\enskip}}{}%
+ \ifdef{\subsubsectionformat}{%
+ \renewcommand{\subsubsectionformat}{\thesubsubsection\autodot\enskip}}{}%
+ \ifdef{\paragraphformat}{%
+ \renewcommand{\paragraphformat}{\theparagraph\autodot\enskip}}{}%
+ \ifdef{\subparagraphformat}{%
+ \renewcommand{\subparagraphformat}{\thesubparagraph\autodot\enskip}}{}%
}{%
\def\@seccntformat##1{\csname the##1\endcsname\quad}% = LaTeX kernel
}%
- \ifcyrillic@numerals\norussian@numbers\fi
+ \ifcyrillic@numerals\norussian@numbers\fi%
\norussian@shorthands%
}
\def\blockextras@russian{%
\russian@capsformat%
- \ifcyrillic@numerals\russian@numbers\fi
- \ifrussian@babelshorthands\russian@shorthands\fi
+ \ifcyrillic@numerals\russian@numbers\fi%
+ \ifrussian@babelshorthands\russian@shorthands\fi%
}
\def\inlineextras@russian{%
@@ -7868,21 +9437,46 @@ and may look very wrong.}
% \end{macrocode}
% \iffalse
%</gloss-russian.ldf>
-%<*gloss-samin.ldf>
+%<*gloss-sami.ldf>
% \fi
% \clearpage
%
-% \subsection{gloss-samin.ldf}
+% \subsection{gloss-sami.ldf}
% \begin{macrocode}
-\ProvidesFile{gloss-samin.ldf}[polyglossia: module for samin]
+\ProvidesFile{gloss-sami.ldf}[polyglossia: module for sami]
-\PolyglossiaSetup{samin}{
+\PolyglossiaSetup{sami}{
+ babelname=samin,
hyphennames={samin},
hyphenmins={2,2},
+ language={Northern Sami},
+ langtag=NSM,
fontsetup=true,
}
-\def\captionssamin{%
+% TODO: Add other Sami varieties
+\def\sami@variant{northern}
+%\define@choicekey*+{sami}{variant}[\val\nr]{northern}[nothern]{%
+% \ifcase\nr\relax
+% % northern:
+% \def\sami@variant{samin}%
+% \SetLanguageKeys{sami}{language=Northern Sami,langtag=NSM}%
+% \xpg@fontsetup@latin{sami}%
+% \or
+% % other:
+% \def\sami@variant{}%
+% \SetLanguageKeys{sami}{language= Sami,langtag=}%
+% \xpg@fontsetup@latin{sami}%
+% \fi
+% \xpg@info{Option: sami, variant=\val}%
+%}{\xpg@warning{Unknown sami variant `#1'}}
+
+
+%\def\sami@language{%
+% \polyglossia@setup@language@patterns{\sami@variant}
+%}%
+
+\def\captionssami@northern{%
\def\refname{Čujuhusat}%
\def\abstractname{Čoahkkáigeassu}%
\def\bibname{Girjjálašvuohta}%
@@ -7905,8 +9499,13 @@ and may look very wrong.}
\def\headtoname{Vuostáiváldi}%
\def\proofname{Duođaštus}%
\def\glossaryname{Sátnelistu}%
- }
-\def\datesamin{%
+}
+
+\def\captionssami{%
+ \csname captionssami@\sami@variant\endcsname%
+}
+
+\def\datesami@northern{%
\def\today{\ifcase\month\or
ođđajagemánu\or
guovvamánu\or
@@ -7921,7 +9520,38 @@ and may look very wrong.}
skábmamánu\or
juovlamánu\fi
\space\number\day.~b.\space\number\year}%
- }
+}
+
+\def\datesami{%
+ \csname datesami@\sami@variant\endcsname%
+}
+
+% \end{macrocode}
+% \iffalse
+%</gloss-sami.ldf>
+%<*gloss-samin.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-samin.ldf}
+% \begin{macrocode}
+\ProvidesFile{gloss-samin.ldf}[polyglossia: module for samin]
+
+% We only provide this gloss for babel compatibility. Since samin is
+% a sami variety, we use 'sami' with variant 'northern' now.
+
+\input{gloss-sami.ldf}
+
+\PolyglossiaSetup{samin}{
+ hyphennames={samin},
+ hyphenmins={2,2},
+ language={Northern Sami},
+ langtag=NSM,
+ fontsetup=true,
+}
+
+\let\captionssamin\captionssami@nothern
+\let\datesamin\datesami@nothern
% \end{macrocode}
% \iffalse
@@ -7933,6 +9563,13 @@ and may look very wrong.}
% \subsection{gloss-sanskrit.ldf}
% \begin{macrocode}
\ProvidesFile{gloss-sanskrit.ldf}[polyglossia: module for sanskrit]
+\ifluatex
+ \xpg@warning{Sanskrit is not supported with LuaTeX.\MessageBreak
+I will proceed with the compilation, but\MessageBreak
+the output is not guaranteed to be correct\MessageBreak
+and may look very wrong.}
+\fi
+
\RequirePackage{devanagaridigits}
\PolyglossiaSetup{sanskrit}{
@@ -7941,11 +9578,10 @@ and may look very wrong.}
hyphenmins={1,3},
frenchspacing=true,
fontsetup=false, % will be done below
- %TODO localnumber=sanskritnumber
+ localnumeral=sanskritnumerals
}
\define@key{sanskrit}{Script}[Devanagari]{%
- \setkeys[xpg@setup]{sanskrit}{script=#1}%
\ifcsdef{fontsetup@sanskrit@#1}%
{\csname fontsetup@sanskrit@#1\endcsname}%
{\xpg@error{`#1' is not a valid script for Sanskrit}%
@@ -7953,65 +9589,82 @@ and may look very wrong.}
}
\def\fontsetup@sanskrit@Devanagari{%
- \def\xpg@scripttag@sanskrit{deva}%
+ \SetLanguageKeys{sanskrit}{scripttag=deva,script=Devanagari}
\xpg@fontsetup@nonlatin{sanskrit}}
\def\fontsetup@sanskrit@Gujarati{%
- \def\xpg@scripttag@sanskrit{gujr}%
+ \SetLanguageKeys{sanskrit}{scripttag=gujr,script=Gujarati}
\xpg@fontsetup@nonlatin{sanskrit}}
\def\fontsetup@sanskrit@Malayalam{%
- \def\xpg@scripttag@sanskrit{mlym}%
+ \SetLanguageKeys{sanskrit}{scripttag=mlym,script=Malayalam}
\xpg@fontsetup@nonlatin{sanskrit}}
\def\fontsetup@sanskrit@Bengali{%
- \def\xpg@scripttag@sanskrit{beng}%
+ \SetLanguageKeys{sanskrit}{scripttag=beng,script=Bengali}
\xpg@fontsetup@nonlatin{sanskrit}}
\def\fontsetup@sanskrit@Kannada{%
- \def\xpg@scripttag@sanskrit{knda}%
+ \SetLanguageKeys{sanskrit}{scripttag=knda,script=Kannada}
\xpg@fontsetup@nonlatin{sanskrit}}
\def\fontsetup@sanskrit@Telugu{%
- \def\xpg@scripttag@sanskrit{telu}%
+ \SetLanguageKeys{sanskrit}{scripttag=telu,script=Telugu}
\xpg@fontsetup@nonlatin{sanskrit}}
-%% DW
\def\fontsetup@sanskrit@Latin{%
- \def\xpg@scripttag@sanskrit{latn}%
- \xpg@fontsetup@latin{sanskrit}}
-%% DW
+ \SetLanguageKeys{sanskrit}{scripttag=latn,script=Latin}
+ \xpg@fontsetup@latin{sanskrit}}
\setkeys{sanskrit}{Script} %sets the default for Devanagari
-%% TODO option for numerals (Devanagari or Western)
-%\def\tmp@western{Western}
-%\newif\ifsanskrit@devanagari@numerals
-%\sanskrit@devanagari@numeralstrue
-%
-%\define@key{sanskrit}{numerals}[Devanagari]{%
-% \def\@tmpa{#1}%
-% \ifx\@tmpa\tmp@western
-% \sanskrit@devanagari@numeralsfalse
-% \fi}
+\def\tmp@western{Western}
+\newif\ifsanskrit@devanagari@numerals
+\sanskrit@devanagari@numeralstrue
+
+\define@key{sanskrit}{numerals}[Devanagari]{%
+ \def\@tmpa{#1}%
+ \ifx\@tmpa\tmp@western
+ \sanskrit@devanagari@numeralsfalse
+ \fi%
+}
+
+\newcommand{\sanskritnumerals}[2]{\sanskritnumber{#2}}
-\newXeTeXintercharclass\sanskrit@punctthin % ! ? ; : danda double_danda
+\def\sanskritnumber#1{%
+ \ifsanskrit@devanagari@numerals
+ \devanagaridigits{\number#1}%
+ \else
+ \number#1%
+ \fi%
+}
+
+% FIXME: Support LuaTeX
+\ifxetex
+ \newXeTeXintercharclass\sanskrit@punctthin % ! ? ; : danda double_danda
+\fi
\def\sanskrit@punctthinspace{{\unskip\thinspace}}
\def\sanskrit@punctuation{%
- \XeTeXinterchartokenstate=1%
- \XeTeXcharclass `\! \sanskrit@punctthin
- \XeTeXcharclass `\? \sanskrit@punctthin
- \XeTeXcharclass `\; \sanskrit@punctthin
- \XeTeXcharclass `\: \sanskrit@punctthin
- \XeTeXcharclass `\। \sanskrit@punctthin
- \XeTeXcharclass `\॥ \sanskrit@punctthin
- \XeTeXinterchartoks \z@ \sanskrit@punctthin = \sanskrit@punctthinspace
+ % FIXME: Support LuaTeX
+ \ifxetex
+ \XeTeXinterchartokenstate=1%
+ \XeTeXcharclass `\! \sanskrit@punctthin
+ \XeTeXcharclass `\? \sanskrit@punctthin
+ \XeTeXcharclass `\; \sanskrit@punctthin
+ \XeTeXcharclass `\: \sanskrit@punctthin
+ \XeTeXcharclass `\। \sanskrit@punctthin
+ \XeTeXcharclass `\॥ \sanskrit@punctthin
+ \XeTeXinterchartoks \z@ \sanskrit@punctthin = \sanskrit@punctthinspace
+ \fi
}
\def\nosanskrit@punctuation{%
- \XeTeXcharclass `\! \z@
- \XeTeXcharclass `\? \z@
- \XeTeXcharclass `\; \z@
- \XeTeXcharclass `\: \z@
- \XeTeXcharclass `\। \z@
- \XeTeXcharclass `\॥ \z@
- \XeTeXinterchartokenstate=0%
+ % FIXME: Support LuaTeX
+ \ifxetex
+ \XeTeXcharclass `\! \z@
+ \XeTeXcharclass `\? \z@
+ \XeTeXcharclass `\; \z@
+ \XeTeXcharclass `\: \z@
+ \XeTeXcharclass `\। \z@
+ \XeTeXcharclass `\॥ \z@
+ \XeTeXinterchartokenstate=0%
+ \fi
}
\def\noextras@sanskrit{%
@@ -8033,46 +9686,20 @@ and may look very wrong.}
% \begin{macrocode}
\ProvidesFile{gloss-scottish.ldf}[polyglossia: module for scottish]
+% We only provide this gloss for babel compatibility. Since scottish is
+% a gaelic variety, we use 'gaelic' with variant 'scottish' now.
+
+\input{gloss-gaelic.ldf}
+
\PolyglossiaSetup{scottish}{
hyphennames={scottish},
hyphenmins={2,2},
+ langtag=GAE,
fontsetup=true,
}
-\def\captionsscottish{%
- \def\refname{Iomraidh}%
- \def\abstractname{Brìgh}%
- \def\bibname{Leabhraichean}%
- \def\prefacename{Preface}% <-- needs translation
- \def\chaptername{Caibideil}%
- \def\appendixname{Ath-sgr`ıobhadh}%
- \def\contentsname{Clàr-obrach}%
- \def\listfigurename{Liosta Dhealbh}%
- \def\listtablename{Liosta Chlàr}%
- \def\indexname{Clàr-innse}%
- \def\figurename{Dealbh}%
- \def\tablename{Clàr}%
- %\def\thepart{}%
- \def\partname{Cuid}%
- \def\pagename{t.d.}%
- \def\seename{see}% <-- needs translation
- \def\alsoname{see also}% <-- needs translation
- \def\enclname{a-staigh}%
- \def\ccname{lethbhreac gu}%
- \def\headtoname{gu}%
- \def\proofname{Proof}% <-- needs translation
- \def\glossaryname{Glossary}% <-- needs translation
- }
-
-\def\datescottish{%
- \def\today{%
- \number\day\space \ifcase\month\or
- am Faoilteach\or an Gearran\or am Màrt\or an Giblean\or
- an Cèitean\or an t-Òg mhios\or an t-Iuchar\or
- Lùnasdal\or an Sultuine\or an Dàmhar\or
- an t-Samhainn\or an Dubhlachd\fi
- \space \number\year}%
- }
+\let\captionsscottish\captionsgaelic@scottish
+\let\datescottish\dategaelic@scottish
% \end{macrocode}
% \iffalse
@@ -8089,29 +9716,33 @@ and may look very wrong.}
%% same thing for all languages that have a "script" key !
%% BETTER APPROACH: see gloss-sanskrit!
+\RequirePackage{cyrillicnumbers}
+
\PolyglossiaSetup{serbian}{
langtag=SRB,
hyphennames={serbian},
hyphenmins={2,2},
indentfirst=true,
- fontsetup=false
+ fontsetup=false,
+ localnumeral=serbiannumerals,
+ Localnumeral=Serbiannumerals
%TODO localalph
}
\newif\if@serbian@cyr
-\define@key{serbian}{Script}[Cyrillic]{% TODO FIXDOC: keyname is CHANGED: script -> Script !!!
+\define@key{serbian}{Script}[Cyrillic]{%
\ifstrequal{#1}{Cyrillic}%
{\@serbian@cyrtrue
- \setkeys[xpg@setup]{serbian}{script=Cyrillic}%
- \def\xpg@scripttag@serbian{cyrl}%
+ \SetLanguageKeys{serbian}{scripttag=cyrl,script=Cyrillic,babelname=serbianc}
\xpg@fontsetup@nonlatin{serbian}%
}%
{\ifstrequal{#1}{Latin}%
{\@serbian@cyrfalse
- \xpg@fontsetup@latin{serbian}%
- %TODO \def\serbian@language{\language=\l@serbianlat}%
- % or should we use Croatian patterns as a fallback for the time being???
+ \SetLanguageKeys{serbian}{scripttag=latn,script=Latin}
+ \xpg@fontsetup@latin{serbian}%
+ %TODO \def\serbian@language{\language=\l@serbianlat}%
+ % or should we use Croatian patterns as a fallback for the time being???
}%
{\xpg@error{Unknown script `#1' for Serbian language\MessageBreak
Valid values are "Cyrillic" and "Latin"}}%
@@ -8119,15 +9750,24 @@ and may look very wrong.}
}
\define@key{serbian}{script}[Cyrillic]{\setkeys{serbian}{Script=#1}}
-\setkeys{serbian}{Script}
+\newif\ifserbian@numerals
+\define@key{serbian}{numerals}[arabic]{%
+ \ifstrequal{#1}{latin}{\serbian@numeralsfalse}{%
+ \ifstrequal{#1}{cyrillic}%
+ {\serbian@numeralstrue}
+ {\serbian@numeralsfalse}%
+ }%
+}
+
+\setkeys{serbian}{Script,numerals}
\def\captionsserbian{%
\if@serbian@cyr\captionsserbian@cyr\else\captionsserbian@lat\fi
- }
+}
\def\dateserbian{%
\if@serbian@cyr\dateserbian@cyr\else\dateserbian@lat\fi
- }
+}
\def\captionsserbian@lat{%
\def\refname{Bibliografija}%
@@ -8156,13 +9796,14 @@ and may look very wrong.}
\def\headtoname{Prima}%
\def\proofname{Dokaz}%
\def\glossaryname{Rečnik nepoznatih reči}%
- }
+}
+
\def\dateserbian@lat{%
\def\today{\number\day .~\ifcase\month\or
januar\or februar\or mart\or april\or maj\or
jun\or jul\or avgust\or septembar\or oktobar\or novembar\or
decembar\fi \space \number\year.}%
- }
+}
\def\captionsserbian@cyr{%
\def\refname{Библиографија}%
@@ -8190,14 +9831,82 @@ and may look very wrong.}
\def\headtoname{Прима}%
\def\proofname{Доказ}%
\def\glossaryname{Речник непознатих речи}%
- }
+}
+
\def\dateserbian@cyr{%
\def\today{\number\day .~\ifcase\month\or
јануар\or фебруар\or март\or април\or мај\or
јун\or јул\or август\or септембар\or октобар\or новембар\or
децембар\fi \space \number\year.}%
- }
+}
+
+
+\newcommand{\serbiannumerals}[2]{\serbiannumber{#2}}
+\newcommand{\Serbiannumerals}[2]{\Serbiannumber{#2}}
+
+\def\serbiannumber#1{%
+ \ifserbian@numerals
+ \cyr@alph{#1}%
+ \else
+ \number#1%
+ \fi
+}
+
+\def\Serbiannumber#1{%
+ \ifserbian@numerals
+ \cyr@Alph{#1}%
+ \else
+ \number#1%
+ \fi
+}
+
+\let\serbiannumeral=\serbiannumber
+\let\Serbiannumeral=\Serbiannumber
+
+\def\serbian@numbers{%
+ \let\latin@alph\@alph
+ \let\latin@Alph\@Alph
+ \ifserbian@numerals
+ \def\serbian@alph##1{\expandafter\serbiannumeral\expandafter{\the##1}}%
+ \def\serbian@Alph##1{\expandafter\Serbiannumeral\expandafter{\the##1}}%
+ \let\@alph\serbian@alph%
+ \let\@Alph\serbian@Alph%
+ \fi
+}
+
+\def\noserbian@numbers{%
+ \let\@alph\latin@alph
+ \let\@Alph\latin@Alph
+}
+
+\def\blockextras@serbian{%
+ \ifserbian@numerals\serbian@numbers\fi
+}
+
+\def\noextras@serbian{%
+ \ifserbian@numerals\noserbian@numbers\fi
+}
+
+\def\Asbuk#1{\expandafter\cyr@Alph\csname c@#1\endcsname}
+
+\def\asbuk#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. We now use proper cyrillic numbering.
+
+%\def\cyr@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 Ш\else\xpg@ill@value{#1}{cyr@Alph}\fi}
+%\def\cyr@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 ш\else\xpg@ill@value{#1}{cyr@alph}\fi}
+
+
% \end{macrocode}
% \iffalse
%</gloss-serbian.ldf>
@@ -8212,6 +9921,7 @@ and may look very wrong.}
\PolyglossiaSetup{slovak}{
hyphennames={slovak},
hyphenmins={2,2},
+ langtag=SKY,
fontsetup=true,
}
@@ -8261,7 +9971,9 @@ and may look very wrong.}
\PolyglossiaSetup{slovenian}{
hyphennames={slovenian,slovene},
+ babelname=slovene,
hyphenmins={2,2},
+ langtag=SLV,
fontsetup=true,
}
@@ -8319,15 +10031,189 @@ and may look very wrong.}
\def\Abeceda#1{\expandafter\slovenian@Alph\csname c@#1\endcsname}
\def\setlocalalph{%
- \def\extras@slovenian{\let\savealph\alph\let\saveAlph\Alph\let\alph\abeceda\let\Alph\Abeceda}
+ \def\extras@slovenian{\let\alph\abeceda\let\Alph\Abeceda}
\def\blockextras@slovenian{\extras@slovenian}
\def\inlineextras@slovenian{\extras@slovenian}
- \def\noextras@slovenian{\let\alph\savealph\let\Alph\saveAlph}
+ \def\noextras@slovenian{\let\alph\latinalph\let\Alph\latinAlph}
}
% \end{macrocode}
% \iffalse
%</gloss-slovenian.ldf>
+%<*gloss-sorbian.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-sorbian.ldf}
+% \begin{macrocode}
+\ProvidesFile{gloss-sorbian.ldf}[polyglossia: module for sorbian]
+
+\PolyglossiaSetup{sorbian}{
+ language=Upper Sorbian,
+ babelname=uppersorbian,
+ hyphennames={usorbian,uppersorbian},
+ langtag=USB,
+ hyphenmins={2,2},
+ fontsetup=true,
+}
+
+\def\sorbian@variant{usorbian}
+\define@choicekey*+{sorbian}{variant}[\val\nr]{upper,lower}[upper]{%
+ \ifcase\nr\relax
+ % upper:
+ \def\sorbian@variant{usorbian}%
+ \SetLanguageKeys{sorbian}{language=Upper Sorbian,langtag=USB,babelname=uppersorbian}%
+ \xpg@fontsetup@latin{sorbian}%
+ % Check if \l@usorbian is defined. If not, try to set it to some variety
+ % (specific order as in the csv list below), or null language if everything fails
+ \xpg@ifdefined{usorbian}{}{%
+ \def\do##1{%
+ \xpg@ifdefined{##1}%
+ {\csletcs{l@usorbian}{l@##1}\listbreak}%
+ {}%
+ }%
+ \docsvlist{uppersorbian}
+ \xpg@ifdefined{usorbian}{}{%
+ \xpg@warning{No hyphenation patterns for Upper Sorbian found\MessageBreak
+ I will use the 'null' language instead}%
+ \adddialect\l@usorbian0%
+ }
+ }%
+ \or
+ % lower:
+ \def\sorbian@variant{lsorbian}%
+ \SetLanguageKeys{sorbian}{language=Lower Sorbian,langtag=LSB,babelname=lowersorbian}%
+ \xpg@fontsetup@latin{sorbian}%
+ % Check if \l@lsorbian is defined. If not, try to set it to some variety
+ % (specific order as in the csv list below), or null language if everything fails
+ \xpg@ifdefined{lsorbian}{}{%
+ \def\do##1{%
+ \xpg@ifdefined{##1}%
+ {\csletcs{l@lsorbian}{l@##1}\listbreak}%
+ {}%
+ }%
+ \docsvlist{lowersorbian,Lsorbian,usorbian,uppersorbian}
+ \xpg@ifdefined{lsorbian}{}{%
+ \xpg@warning{No hyphenation patterns for Lower Sorbian found\MessageBreak
+ I will use the 'null' language instead}%
+ \adddialect\l@lsorbian0%
+ }
+ }%
+ \fi
+ \xpg@info{Option: sorbian, variant=\val}%
+}{\xpg@warning{Unknown sorbian variant `#1'}}
+
+
+\define@boolkey{sorbian}[sorbian@]{olddate}[true]{}
+
+\setkeys{sorbian}{variant}
+
+
+\def\sorbian@language{%
+ \polyglossia@setup@language@patterns{\sorbian@variant}%
+}%
+
+
+\def\captionssorbian@lsorbian{%
+ \def\refname{Referency}%
+ \def\abstractname{Abstrakt}%
+ \def\bibname{Literatura}%
+ \def\prefacename{Zawod}%
+ \def\chaptername{Kapitl}%
+ \def\appendixname{Dodawki}%
+ \def\contentsname{Wopśimjeśe}%
+ \def\listfigurename{Zapis wobrazow}%
+ \def\listtablename{Zapis tabulkow}%
+ \def\indexname{Indeks}%
+ \def\figurename{Wobraz}%
+ \def\tablename{Tabulka}%
+ %\def\thepart{}%
+ \def\partname{Źěl}%
+ \def\pagename{Strona}%
+ \def\seename{gl.}%
+ \def\alsoname{gl.~teke}%
+ \def\enclname{Pśiłoga}%
+ \def\ccname{CC}%
+ \def\headtoname{Komu}%
+ \def\proofname{Proof}%
+ \def\glossaryname{Glossary}%
+}
+
+\def\captionssorbian@usorbian{%
+ \def\refname{Referency}%
+ \def\abstractname{Abstrakt}%
+ \def\bibname{Literatura}%
+ \def\prefacename{Zawod}%
+ \def\chaptername{Kapitl}%
+ \def\appendixname{Dodawki}%
+ \def\contentsname{Wobsah}%
+ \def\listfigurename{Zapis wobrazow}%
+ \def\listtablename{Zapis tabulkow}%
+ \def\indexname{Indeks}%
+ \def\figurename{Wobraz}%
+ \def\tablename{Tabulka}%
+ %\def\thepart{}%
+ \def\partname{Dźěl}%
+ \def\pagename{Strona}%
+ \def\seename{hl.}%
+ \def\alsoname{hl.~tež}%
+ \def\enclname{Přłoha}%
+ \def\ccname{CC}%
+ \def\headtoname{Komu}%
+ \def\proofname{Proof}% <-- needs translation
+ \def\glossaryname{Glossary}% <-- needs translation
+}%
+
+\def\captionssorbian{%
+ \csname captionssorbian@\sorbian@variant\endcsname%
+}
+
+\def\datesorbian@lsorbian{%
+ \def\oldtoday{%
+ \number\day.~\ifcase\month\or
+ wjelikego rožka\or małego rožka\or nalětnika\or
+ jatšownika\or rožownika\or smažnika\or pražnika\or
+ žnjeńca\or požnjeńca\or winowca\or nazymnika\or
+ godownika\fi\space \number\year}%
+ \def\today{%
+ \ifsorbian@olddate
+ \oldtoday%
+ \else
+ \number\day.~\ifcase\month\or
+ januara\or februara\or měrca\or apryla\or maja\or
+ junija\or julija\or awgusta\or septembra\or oktobra\or
+ nowembra\or decembra\fi
+ \space \number\year%
+ \fi
+ }%
+}
+
+\def\datesorbian@usorbian{%
+ \def\oldtoday{\number\day.~\ifcase\month\or
+ wulkeho róžka\or małeho róžka\or nalětnika\or
+ jutrownika\or róžownika\or smažnika\or pražnika\or
+ žnjenca\or požnjenca\or winowca\or nazymnika\or
+ hodownika\fi \space \number\year}%
+ \def\today{%
+ \ifsorbian@olddate
+ \oldtoday%
+ \else
+ \number\day.~\ifcase\month\or
+ januara\or februara\or měrca\or apryla\or meje\or junija\or
+ julija\or awgusta\or septembra\or oktobra\or
+ nowembra\or decembra\fi
+ \space \number\year%
+ \fi
+ }%
+}
+
+\def\datesorbian{%
+ \csname datesorbian@\sorbian@variant\endcsname%
+}
+
+% \end{macrocode}
+% \iffalse
+%</gloss-sorbian.ldf>
%<*gloss-spanish.ldf>
% \fi
% \clearpage
@@ -8338,6 +10224,7 @@ and may look very wrong.}
\PolyglossiaSetup{spanish}{
hyphennames={spanish},
hyphenmins={2,2},
+ langtag=ESP,
frenchspacing=true,
indentfirst=true,
fontsetup=true,
@@ -8388,6 +10275,7 @@ and may look very wrong.}
\PolyglossiaSetup{swedish}{
hyphennames={swedish},
hyphenmins={2,2},
+ langtag=SVE,
frenchspacing=true,
fontsetup=true,
}
@@ -8452,9 +10340,11 @@ and may look very wrong.}
\PolyglossiaSetup{syriac}{
script=Syriac,
scripttag=syrc,
+ langtag=SYR,
direction=RL,
hyphennames={syriac,nohyphenation},
fontsetup=true,
+ localnumeral=syriacnumerals
%TODO localalph
}
@@ -8556,18 +10446,31 @@ and may look very wrong.}
\def\@syriacnumber#1{%
\if@eastern@numerals
- \ifnum\XeTeXcharglyph"0661 > 0%
- %%% we test for the presence of one of ١٢٣٤٥٦٧٨٩٠ in the Syriac font,
- %%% else we try \arabicfont if defined (and give a warning),
- %%% else we fall back to the Western numerals.
- %%\protect\addfontfeature{Mapping=arabicdigits}\number#1}%
- \protect\arabicdigits{\number#1}%
- \else%
- \ifcsdef{arabicfont}%
- {\protect\arabicdigits{\number#1}%
- \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs: I am using \string\arabicfont instead}}%
- {\number#1%%% <---changed from \RL{\protect\reset@font\protect\number#1}%
- \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs: since \string\arabicfont is not defined, we'll use Western numerals instead}}%
+ %%% we test for the presence of one of ١٢٣٤٥٦٧٨٩٠ in the Syriac font,
+ %%% else we try \arabicfont if defined (and give a warning),
+ %%% else we fall back to the Western numerals.
+ \ifxetex
+ \ifnum\XeTeXcharglyph"0661 > 0%
+ %%\protect\addfontfeature{Mapping=arabicdigits}\number#1}%
+ \protect\arabicdigits{\number#1}%
+ \else%
+ \ifcsdef{arabicfont}%
+ {\protect\arabicdigits{\number#1}%
+ \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs: I am using \string\arabicfont instead}}%
+ {\number#1%%% <---changed from \RL{\protect\reset@font\protect\number#1}%
+ \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs: since \string\arabicfont is not defined, we'll use Western numerals instead}}%
+ \fi
+ \else% LuaTeX
+ \expandafter\ifnum\directlua{polyglossia.check_char(0x661)} > 0\relax
+ %%\protect\addfontfeature{Mapping=arabicdigits}\number#1}%
+ \protect\arabicdigits{\number#1}%
+ \else%
+ \ifcsdef{arabicfont}%
+ {\protect\arabicdigits{\number#1}%
+ \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs: I am using \string\arabicfont instead}}%
+ {\number#1%%% <---changed from \RL{\protect\reset@font\protect\number#1}%
+ \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs: since \string\arabicfont is not defined, we'll use Western numerals instead}}%
+ \fi
\fi
\else
%%\RL{\protect\reset@font\number#1}%
@@ -8575,32 +10478,40 @@ and may look very wrong.}
\fi}
\def\syriac@numbers{%
- \let\@latinalph\@alph%
- \let\@latinAlph\@Alph%
\let\@alph\abjadsyriac%
\let\@Alph\abjadsyriac%
}
+
\def\nosyriac@numbers{%
- \let\@alph\@latinalph%
- \let\@Alph\@latinAlph%
- }
+ \let\@alph\latin@alph%
+ \let\@Alph\latin@Alph%
+}
+
+\newcommand{\syriacnumerals}[2]{\syriacnumber{#2}}
+
+% Store original definition
+\let\xpg@save@arabic\@arabic
+
\def\syriac@globalnumbers{%
- \let\orig@arabic\@arabic%
\let\@arabic\syriacnumber%
- \renewcommand\thefootnote{\protect\syriacnumber{\c@footnote}}%
+ \renewcommand\thefootnote{\localnumeral*{footnote}}%
}
+
\def\nosyriac@globalnumbers{%
- \let\@arabic\orig@arabic%
- \renewcommand\thefootnote{\protect\number{\c@footnote}}%
- }
+ \let\@arabic\xpg@save@arabic%
+}
+
+% Save original \MakeUppercase definition
+\let\xpg@save@MakeUppercase\MakeUppercase
\def\blockextras@syriac{%
- \let\@@MakeUppercase\MakeUppercase%
\def\MakeUppercase##1{##1}%
- }
+}
+
\def\noextras@syriac{%
- \let\MakeUppercase\@@MakeUppercase%
- }
+ % restore original \MakeUppercase definition
+ \let\MakeUppercase\xpg@save@MakeUppercase%
+}
% \end{macrocode}
% \iffalse
@@ -8767,8 +10678,10 @@ and may look very wrong.}
\PolyglossiaSetup{thai}{
script=Thai,
scripttag=thai,
+ langtag=THA,
hyphennames={nohyphenation},
- fontsetup=true
+ fontsetup=true,
+ localnumeral=thainumerals
%TODO localalph={xxx@alph,xxx@Alph}
%TODO localdigits=thainumber
}
@@ -8834,6 +10747,8 @@ and may look very wrong.}
\fi
}
+\newcommand{\thainumerals}[2]{\thainumber{#2}}
+
\def\thainumber#1{%
\if@thai@numerals
\thaidigits{\number#1}%
@@ -8856,26 +10771,23 @@ and may look very wrong.}
ศ\or ษ\or ส\or ห\or ฬ\or อ\or ฮ\else\xpg@ill@value{#1}{@thaialph}\fi}
\def\thai@numbers{%
- \let\@latinalph\@alph%
- \let\@latinAlph\@Alph%
\if@thai@numerals
\let\@alph\@thaialph%
\let\@Alph\@thaiAlph%
\fi
}
\def\nothai@numbers{%
- \let\@alph\@latinalph%
- \let\@Alph\@latinAlph%
+ \let\@alph\latin@alph%
+ \let\@Alph\latin@Alph%
}
\def\thai@globalnumbers{%
\let\orig@arabic\@arabic%
\let\@arabic\thainumber%
- \renewcommand{\thefootnote}{\protect\thainumber{\c@footnote}}%
+ \renewcommand{\thefootnote}{\localnumeral*{footnote}}%
}
\def\nothai@globalnumbers{%
\let\@arabic\orig@arabic%
- \renewcommand\thefootnote{\protect\number{\c@footnote}}%
}
\def\blockextras@thai{%
@@ -8907,10 +10819,11 @@ and may look very wrong.}
\PolyglossiaSetup{tibetan}{
script=Tibetan,
scripttag=tibt,
+ langtag=TIB,
hyphennames={nohyphenation},
- fontsetup=true
+ fontsetup=true,
+ localnumeral=tibetannumerals
%TODO localalph={xxx@alph,xxx@Alph}
- %TODO localdigits=tibetannumber
}
\newif\if@tibetan@numerals
@@ -9025,29 +10938,28 @@ and may look very wrong.}
\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}}
+
\def\tibetan@numbers{%
- \let\@latinalph\@alph%
- \let\@latinAlph\@Alph%
\if@tibetan@numerals
\let\@alph\@tibetanalph%
\let\@Alph\@tibetanAlph%
\fi
}
\def\notibetan@numbers{%
- \let\@alph\@latinalph%
- \let\@Alph\@latinAlph%
+ \let\@alph\latin@alph%
+ \let\@Alph\latin@Alph%
}
\def\tibetan@globalnumbers{%
\let\xpg@orig@arabic\@arabic%
\let\@arabic\tibetannumber%
- \renewcommand{\thefootnote}{\protect\tibetannumber{\c@footnote}}%
+ \renewcommand{\thefootnote}{\localnumeral*{footnote}}%
}
\def\notibetan@globalnumbers{%
\let\@arabic\xpg@orig@arabic%
- \renewcommand\thefootnote{\protect\number{\c@footnote}}%
}
\def\noextras@tibetan{%
@@ -9269,8 +11181,9 @@ and may look very wrong.}
\fi
\ifcsundef{initiate@active@char}{%
-\input{babelsh.def}%
-\initiate@active@char{"}%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
}{}
\def\ukrainian@shorthands{%
@@ -9389,8 +11302,6 @@ and may look very wrong.}
ц\or ч\or ш\or щ\or ю\or я\else\xpg@ill@value{#1}{ukrainian@alph}\fi}
\def\ukrainian@numbers{%
- \let\latin@Alph\@Alph%
- \let\latin@alph\@alph%
\let\@Alph\ukrainian@Alph%
\let\@alph\ukrainian@alph%
}
@@ -9465,9 +11376,9 @@ and may look very wrong.}
scripttag=arab,
langtag=URD,
hyphennames={urdu,nohyphenation},
- fontsetup=true
+ fontsetup=true,
+ localnumeral=urdunumerals
%TODO localalph={abjad,abjad}
- %TODO localnumber=urdunumber
}
\newif\if@western@numerals
@@ -9557,37 +11468,41 @@ and may look very wrong.}
\fi}
\def\urdu@numbers{%
- \let\@latinalph\@alph%
- \let\@latinAlph\@Alph%
\let\@alph\abjad%
\let\@Alph\abjad%
- }
+}
\def\nourdu@numbers{%
- \let\@alph\@latinalph%
- \let\@Alph\@latinAlph%
- }
+ \let\@alph\latin@alph%
+ \let\@Alph\latin@Alph%
+}
+
+\newcommand{\urdunumerals}[2]{\urdunumber{#2}}
+
+% Store original definition
+\let\xpg@save@arabic\@arabic
\def\urdu@globalnumbers{%
- \let\orig@arabic\@arabic%
\let\@arabic\urdunumber%
% For some reason \thefootnote needs to be set separately:
- \renewcommand\thefootnote{\protect\urdunumber{\c@footnote}}%
- }
+ \renewcommand\thefootnote{\localnumeral*{footnote}}%
+}
\def\nourdu@globalnumbers{
- \let\@arabic\orig@arabic%
- \renewcommand\thefootnote{\protect\number{\c@footnote}}%
- }
+ \let\@arabic\xpg@save@arabic%
+}
+
+% Save original \MakeUppercase definition
+\let\xpg@save@MakeUppercase\MakeUppercase
\def\blockextras@urdu{%
- \let\@@MakeUppercase\MakeUppercase%
\def\MakeUppercase##1{##1}%
- }
+}
\def\noextras@urdu{%
- \let\MakeUppercase\@@MakeUppercase%
- }
+ % restore original \MakeUppercase definition
+ \let\MakeUppercase\xpg@save@MakeUppercase%
+}
% \end{macrocode}
% \iffalse
@@ -9600,50 +11515,22 @@ and may look very wrong.}
% \begin{macrocode}
\ProvidesFile{gloss-usorbian.ldf}[polyglossia: module for upper sorbian]
+% We only provide this gloss for babel compatibility. Since usorbian is
+% a sorbian variety, we use 'sorbian' with variant 'upper' now.
+
+\input{gloss-sorbian.ldf}
+
\PolyglossiaSetup{usorbian}{
+ language=Upper Sorbian,
+ babelname=uppersorbian,
hyphennames={usorbian,uppersorbian},
hyphenmins={2,2},
+ langtag=USB,
fontsetup=true,
}
-\def\captionsusorbian{%
- \def\refname{Referency}%
- \def\abstractname{Abstrakt}%
- \def\bibname{Literatura}%
- \def\prefacename{Zawod}%
- \def\chaptername{Kapitl}%
- \def\appendixname{Dodawki}%
- \def\contentsname{Wobsah}%
- \def\listfigurename{Zapis wobrazow}%
- \def\listtablename{Zapis tabulkow}%
- \def\indexname{Indeks}%
- \def\figurename{Wobraz}%
- \def\tablename{Tabulka}%
- %\def\thepart{}%
- \def\partname{Dźěl}%
- \def\pagename{Strona}%
- \def\seename{hl.}%
- \def\alsoname{hl.~tež}%
- \def\enclname{Přłoha}%
- \def\ccname{CC}%
- \def\headtoname{Komu}%
- \def\proofname{Proof}% <-- needs translation
- \def\glossaryname{Glossary}% <-- needs translation
- }%
-
-\def\dateusorbian{%
- \def\today{\number\day.~\ifcase\month\or
- januara\or februara\or měrca\or apryla\or meje\or junija\or
- julija\or awgusta\or septembra\or oktobra\or
- nowembra\or decembra\fi
- \space \number\year}%
- %TODO implement option olddate:
- \def\oldtoday{\number\day.~\ifcase\month\or
- wulkeho róžka\or małeho róžka\or nalětnika\or
- jutrownika\or róžownika\or smažnika\or pražnika\or
- žnjenca\or požnjenca\or winowca\or nazymnika\or
- hodownika\fi \space \number\year}%
- }
+\let\captionsusorbian\captionssorbian@usorbian
+\let\dateusorbian\datesorbian@usorbian
% \end{macrocode}
% \iffalse
@@ -9710,6 +11597,7 @@ and may look very wrong.}
\PolyglossiaSetup{welsh}{
hyphennames={welsh},
hyphenmins={2,3},
+ langtag=WEL,
fontsetup=true,
}
@@ -9773,11 +11661,12 @@ and may look very wrong.}
Mai\or Mehefin\or Gorffennaf\or Awst\or
Medi\or Hydref\or Tachwedd\or Rhagfyr\fi%
\space\number\year}%
-
\def\formaltoday{%
- \expandafter\welsh@article\welsh@ordinal@long\day\space o\space\ifcase\month\or Ionawr\or Chwefror\or Fawrth\or Ebrill\or Fai\or Fehefin\or Orffenaf\or Awst\or Fedi\or Hydref\or Dachwedd\or Ragfyr\fi
+ \expandafter\welsh@article\welsh@ordinal@long\day\space o\space\ifcase\month\or
+ Ionawr\or Chwefror\or Fawrth\or Ebrill\or Fai\or Fehefin\or Orffenaf\or Awst\or
+ Fedi\or Hydref\or Dachwedd\or Ragfyr\fi%
\space\number\year}%
- }
+}
% \end{macrocode}
% \iffalse
@@ -9929,15 +11818,15 @@ local nodecodes = nodes.nodecodes
local insert_node_before = node.insert_before
local insert_node_after = node.insert_after
-local remove_node = nodes.remove
+local remove_node = node.remove
local has_attribute = node.has_attribute
local node_copy = node.copy
local new_node = node.new
+local math_code = nodecodes.math
local end_of_math = node.end_of_math
if not end_of_math then -- luatex < .76
local traverse_nodes = node.traverse_id
- local math_code = nodecodes.math
local end_of_math = function (n)
for n in traverse_nodes(math_code, n.next) do
return n
@@ -10075,10 +11964,10 @@ local function process(head)
if somespace then
local somepenalty = somepenalty(prevprev,10000)
if somepenalty then
- head = remove_node(head,prev,true)
- head = remove_node(head,prevprev,true)
+ head = remove_node(head,prev)
+ head = remove_node(head,prevprev)
else
- head = remove_node(head,prev,true)
+ head = remove_node(head,prev)
end
end
insert_node_before(head,start,get_penalty_node())
@@ -10092,13 +11981,13 @@ local function process(head)
if somepenalty then
local somespace = somespace(nextnext,true)
if somespace then
- head = remove_node(head,next,true)
- head = remove_node(head,nextnext,true)
+ head = remove_node(head,next)
+ head = remove_node(head,nextnext)
end
else
local somespace = somespace(next,true)
if somespace then
- head = remove_node(head,next,true)
+ head = remove_node(head,next)
end
end
insert_node_after(head,start,get_kern_node(map[2]*quad))
@@ -10140,6 +12029,618 @@ polyglossia.thickspace = thickpace
% \end{macrocode}
% \iffalse
%</polyglossia-frpt.lua>
+%<*polyglossia-korean.lua>
+% \fi
+% \clearpage
+%
+% \subsection{polyglossia-korean.lua}
+% \begin{macrocode}
+--
+-- polyglossia-korean.lua
+--
+
+local glyph_id = node.id"glyph"
+local hbox_id = node.id"hlist"
+local vbox_id = node.id"vlist"
+local glue_id = node.id"glue"
+local penalty_id = node.id"penalty"
+local disc_id = node.id"disc"
+
+--
+-- attr_korean: variant = plain (0), classic (1), modern (2)
+--
+local attr_korean = luatexbase.attributes["xpg@attr@korean"]
+local attr_josa = luatexbase.attributes["xpg@attr@autojosa"]
+
+--
+-- characters after which linebreak is not allowed
+--
+local nobr_after = {
+ [0x28] = 1, -- ( LEFT PARENTHESIS
+ [0x3C] = 1, -- < LESS-THAN SIGN
+ [0x5B] = 1, -- [ LEFT SQUARE BRACKET
+ [0x60] = 1, -- ` GRAVE ACCENT
+ [0x7B] = 1, -- { LEFT CURLY BRACKET
+ [0xAB] = 1, -- « LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+ [0x2018] = 1, -- ‘ LEFT SINGLE QUOTATION MARK
+ [0x201C] = 1, -- “ LEFT DOUBLE QUOTATION MARK
+ [0x2329] = 1, -- 〈 LEFT-POINTING ANGLE BRACKET
+ [0x3008] = 1, -- 〈 LEFT ANGLE BRACKET
+ [0x300A] = 1, -- 《 LEFT DOUBLE ANGLE BRACKET
+ [0x300C] = 1, -- 「 LEFT CORNER BRACKET
+ [0x300E] = 1, -- 『 LEFT WHITE CORNER BRACKET
+ [0x3010] = 1, -- 【 LEFT BLACK LENTICULAR BRACKET
+ [0x3014] = 1, -- 〔 LEFT TORTOISE SHELL BRACKET
+ [0x3016] = 1, -- 〖 LEFT WHITE LENTICULAR BRACKET
+ [0x3018] = 1, -- 〘 LEFT WHITE TORTOISE SHELL BRACKET
+ [0x301A] = 1, -- 〚 LEFT WHITE SQUARE BRACKET
+ [0x301D] = 1, -- 〝 REVERSED DOUBLE PRIME QUOTATION MARK
+ [0xFE17] = 1, -- ︗ PRESENTATION FORM FOR VERTICAL LEFT WHITE LENTICULAR BRACKET
+ [0xFE35] = 1, -- ︵ PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS
+ [0xFE37] = 1, -- ︷ PRESENTATION FORM FOR VERTICAL LEFT CURLY BRACKET
+ [0xFE39] = 1, -- ︹ PRESENTATION FORM FOR VERTICAL LEFT TORTOISE SHELL BRACKET
+ [0xFE3B] = 1, -- ︻ PRESENTATION FORM FOR VERTICAL LEFT BLACK LENTICULAR BRACKET
+ [0xFE3D] = 1, -- ︽ PRESENTATION FORM FOR VERTICAL LEFT DOUBLE ANGLE BRACKET
+ [0xFE3F] = 1, -- ︿ PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET
+ [0xFE41] = 1, -- ﹁ PRESENTATION FORM FOR VERTICAL LEFT CORNER BRACKET
+ [0xFE43] = 1, -- ﹃ PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET
+ [0xFE47] = 1, -- ﹇ PRESENTATION FORM FOR VERTICAL LEFT SQUARE BRACKET
+ [0xFE59] = 1, -- ﹙ SMALL LEFT PARENTHESIS
+ [0xFE5B] = 1, -- ﹛ SMALL LEFT CURLY BRACKET
+ [0xFE5D] = 1, -- ﹝ SMALL LEFT TORTOISE SHELL BRACKET
+ [0xFF08] = 1, -- ( FULLWIDTH LEFT PARENTHESIS
+ [0xFF3B] = 1, -- [ FULLWIDTH LEFT SQUARE BRACKET
+ [0xFF5B] = 1, -- { FULLWIDTH LEFT CURLY BRACKET
+ [0xFF5F] = 1, -- ⦅ FULLWIDTH LEFT WHITE PARENTHESIS
+ [0xFF62] = 1, -- 「 HALFWIDTH LEFT CORNER BRACKET
+}
+
+--
+-- characters before which linebreak is not allowed
+-- (currently, not much differences among the followings)
+-- 1: normal chars
+-- 2: hangul jamo vowels and trailing consonants
+-- 3: kana small letters
+-- 0: dashes (supress visible spacing)
+--
+local nobr_before = setmetatable({
+ [0x21] = 1, -- ! EXCLAMATION MARK
+ [0x22] = 1, -- " QUOTATION MARK
+ [0x27] = 1, -- ' APOSTROPHE
+ [0x29] = 1, -- ) RIGHT PARENTHESIS
+ [0x2C] = 1, -- , COMMA
+ [0x2D] = 0, -- - HYPHEN-MINUS
+ [0x2E] = 1, -- . FULL STOP
+ [0x2F] = 0, -- / SOLIDUS
+ [0x3A] = 0, -- : COLON
+ [0x3B] = 1, -- ; SEMICOLON
+ [0x3E] = 1, -- > GREATER-THAN SIGN
+ [0x3F] = 1, -- ? QUESTION MARK
+ [0x5C] = 0, -- \ REVERSE SOLIDUS
+ [0x5D] = 1, -- ] RIGHT SQUARE BRACKET
+ [0x7D] = 1, -- } RIGHT CURLY BRACKET
+ [0x7E] = 0, -- ~ TILDE
+ [0xB7] = 1, -- · MIDDLE DOT
+ [0xBB] = 1, -- » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+ [0x2013] = 0, -- – EN DASH
+ [0x2014] = 0, -- — EM DASH
+ [0x2015] = 1, -- ― HORIZONTAL BAR
+ [0x2019] = 1, -- ’ RIGHT SINGLE QUOTATION MARK
+ [0x201D] = 1, -- ” RIGHT DOUBLE QUOTATION MARK
+ [0x2025] = 1, -- ‥ TWO DOT LEADER
+ [0x2026] = 1, -- … HORIZONTAL ELLIPSIS
+ [0x232A] = 1, -- 〉 RIGHT-POINTING ANGLE BRACKET
+ [0x3001] = 1, -- 、 IDEOGRAPHIC COMMA
+ [0x3002] = 1, -- 。 IDEOGRAPHIC FULL STOP
+ [0x3005] = 1, -- 々 IDEOGRAPHIC ITERATION MARK
+ [0x3009] = 1, -- 〉 RIGHT ANGLE BRACKET
+ [0x300B] = 1, -- 》 RIGHT DOUBLE ANGLE BRACKET
+ [0x300D] = 1, -- 」 RIGHT CORNER BRACKET
+ [0x300F] = 1, -- 』 RIGHT WHITE CORNER BRACKET
+ [0x3011] = 1, -- 】 RIGHT BLACK LENTICULAR BRACKET
+ [0x3015] = 1, -- 〕 RIGHT TORTOISE SHELL BRACKET
+ [0x3017] = 1, -- 〗 RIGHT WHITE LENTICULAR BRACKET
+ [0x3019] = 1, -- 〙 RIGHT WHITE TORTOISE SHELL BRACKET
+ [0x301B] = 1, -- 〛 RIGHT WHITE SQUARE BRACKET
+ [0x301C] = 1, -- 〜 WAVE DASH
+ [0x301E] = 1, -- 〞 DOUBLE PRIME QUOTATION MARK
+ [0x301F] = 1, -- 〟 LOW DOUBLE PRIME QUOTATION MARK
+ [0x3035] = 1, -- 〵 VERTICAL KANA REPEAT MARK LOWER HALF
+ [0x303B] = 1, -- 〻 VERTICAL IDEOGRAPHIC ITERATION MARK
+ [0x303C] = 1, -- 〼 MASU MARK
+ [0x3041] = 3, -- ぁ HIRAGANA LETTER SMALL A
+ [0x3043] = 3, -- ぃ HIRAGANA LETTER SMALL I
+ [0x3045] = 3, -- ぅ HIRAGANA LETTER SMALL U
+ [0x3047] = 3, -- ぇ HIRAGANA LETTER SMALL E
+ [0x3049] = 3, -- ぉ HIRAGANA LETTER SMALL O
+ [0x3063] = 3, -- っ HIRAGANA LETTER SMALL TU
+ [0x3083] = 3, -- ゃ HIRAGANA LETTER SMALL YA
+ [0x3085] = 3, -- ゅ HIRAGANA LETTER SMALL YU
+ [0x3087] = 3, -- ょ HIRAGANA LETTER SMALL YO
+ [0x308E] = 3, -- ゎ HIRAGANA LETTER SMALL WA
+ [0x3095] = 3, -- ゕ HIRAGANA LETTER SMALL KA
+ [0x3096] = 3, -- ゖ HIRAGANA LETTER SMALL KE
+ [0x3099] = 1, -- COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK
+ [0x309A] = 1, -- COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+ [0x309B] = 1, -- ゛ KATAKANA-HIRAGANA VOICED SOUND MARK
+ [0x309C] = 1, -- ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+ [0x309D] = 1, -- ゝ HIRAGANA ITERATION MARK
+ [0x309E] = 1, -- ゞ HIRAGANA VOICED ITERATION MARK
+ [0x30A0] = 1, -- ゠ KATAKANA-HIRAGANA DOUBLE HYPHEN
+ [0x30A1] = 3, -- ァ KATAKANA LETTER SMALL A
+ [0x30A3] = 3, -- ィ KATAKANA LETTER SMALL I
+ [0x30A5] = 3, -- ゥ KATAKANA LETTER SMALL U
+ [0x30A7] = 3, -- ェ KATAKANA LETTER SMALL E
+ [0x30A9] = 3, -- ォ KATAKANA LETTER SMALL O
+ [0x30C3] = 3, -- ッ KATAKANA LETTER SMALL TU
+ [0x30E3] = 3, -- ャ KATAKANA LETTER SMALL YA
+ [0x30E5] = 3, -- ュ KATAKANA LETTER SMALL YU
+ [0x30E7] = 3, -- ョ KATAKANA LETTER SMALL YO
+ [0x30EE] = 3, -- ヮ KATAKANA LETTER SMALL WA
+ [0x30F5] = 3, -- ヵ KATAKANA LETTER SMALL KA
+ [0x30F6] = 3, -- ヶ KATAKANA LETTER SMALL KE
+ [0x30FB] = 1, -- ・ KATAKANA MIDDLE DOT
+ [0x30FC] = 1, -- ー KATAKANA-HIRAGANA PROLONGED SOUND MARK
+ [0x30FD] = 1, -- ヽ KATAKANA ITERATION MARK
+ [0x30FE] = 1, -- ヾ KATAKANA VOICED ITERATION MARK
+ [0xFE30] = 1, -- ︰ PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
+ [0xFE31] = 1, -- ︱ PRESENTATION FORM FOR VERTICAL EM DASH
+ [0xFE32] = 1, -- ︲ PRESENTATION FORM FOR VERTICAL EN DASH
+ [0xFE36] = 1, -- ︶ PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS
+ [0xFE38] = 1, -- ︸ PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET
+ [0xFE3A] = 1, -- ︺ PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET
+ [0xFE3C] = 1, -- ︼ PRESENTATION FORM FOR VERTICAL RIGHT BLACK LENTICULAR BRACKET
+ [0xFE3E] = 1, -- ︾ PRESENTATION FORM FOR VERTICAL RIGHT DOUBLE ANGLE BRACKET
+ [0xFE40] = 1, -- ﹀ PRESENTATION FORM FOR VERTICAL RIGHT ANGLE BRACKET
+ [0xFE42] = 1, -- ﹂ PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET
+ [0xFE44] = 1, -- ﹄ PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET
+ [0xFE48] = 1, -- ﹈ PRESENTATION FORM FOR VERTICAL RIGHT SQUARE BRACKET
+ [0xFE5A] = 1, -- ﹚ SMALL RIGHT PARENTHESIS
+ [0xFE5C] = 1, -- ﹜ SMALL RIGHT CURLY BRACKET
+ [0xFE5E] = 1, -- ﹞ SMALL RIGHT TORTOISE SHELL BRACKET
+ [0xFF01] = 1, -- ! FULLWIDTH EXCLAMATION MARK
+ [0xFF09] = 1, -- ) FULLWIDTH RIGHT PARENTHESIS
+ [0xFF0C] = 1, -- , FULLWIDTH COMMA
+ [0xFF0E] = 1, -- . FULLWIDTH FULL STOP
+ [0xFF1A] = 1, -- : FULLWIDTH COLON
+ [0xFF1B] = 1, -- ; FULLWIDTH SEMICOLON
+ [0xFF1F] = 1, -- ? FULLWIDTH QUESTION MARK
+ [0xFF3D] = 1, -- ] FULLWIDTH RIGHT SQUARE BRACKET
+ [0xFF5D] = 1, -- } FULLWIDTH RIGHT CURLY BRACKET
+ [0xFF60] = 1, -- ⦆ FULLWIDTH RIGHT WHITE PARENTHESIS
+ [0xFF61] = 1, -- 。 HALFWIDTH IDEOGRAPHIC FULL STOP
+ [0xFF63] = 1, -- 」 HALFWIDTH RIGHT CORNER BRACKET
+ [0xFF64] = 1, -- 、 HALFWIDTH IDEOGRAPHIC COMMA
+ [0xFF65] = 1, -- ・ HALFWIDTH KATAKANA MIDDLE DOT
+ [0xFF9E] = 1, -- ゙ HALFWIDTH KATAKANA VOICED SOUND MARK
+ [0xFF9F] = 1, -- ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
+}, { __index = function(_,c)
+ if c >= 0x1160 and c <= 0x11FF then return 2 end
+ if c >= 0xD7B0 and c <= 0xD7FF then return 2 end
+ if c >= 0x302A and c <= 0x302F then return 1 end
+ if c >= 0x31F0 and c <= 0x31FF then return 3 end
+ if c >= 0xFF67 and c <= 0xFF70 then return 3 end
+ if c >= 0xFE00 and c <= 0xFE0F then return 1 end
+ if c >= 0xFE10 and c <= 0xFE19 and not (c == 0xFE17) then return 1 end
+ if c >= 0xFE50 and c <= 0xFE58 then return 1 end
+ if c >= 0xE0100 and c <= 0xE01EF then return 1 end
+ end
+})
+
+--
+-- whether 'c' is a cjk character
+--
+local function is_cjk (c)
+ return c >= 0xAC00 and c <= 0xD7FF
+ or c >= 0x1100 and c <= 0x11FF
+ or c >= 0xA960 and c <= 0xA97F
+ or c >= 0x2E80 and c <= 0x9FFF
+ or c >= 0xF900 and c <= 0xFAFF
+ or c >= 0xFE10 and c <= 0xFE1F
+ or c >= 0xFE30 and c <= 0xFE6F
+ or c >= 0xFF00 and c <= 0xFFEF
+ or c >= 0x1F100 and c <= 0x1F2FF
+ or c >= 0x20000 and c <= 0x2FA1F
+ or nobr_after[c] and c > 0x2014
+ or nobr_before[c] and c > 0x2014
+end
+
+--
+-- classify cjk characters
+-- 1: openings
+-- 2: closings
+-- 3: centered chars
+-- 4: full stops
+-- 5: ellipses
+-- 6: exclamation and question marks
+-- 0: all others
+--
+local charclass = setmetatable({
+ [0x2018] = 1, [0x201C] = 1, [0x2329] = 1, [0x3008] = 1,
+ [0x300A] = 1, [0x300C] = 1, [0x300E] = 1, [0x3010] = 1,
+ [0x3014] = 1, [0x3016] = 1, [0x3018] = 1, [0x301A] = 1,
+ [0x301D] = 1, [0xFE17] = 1, [0xFE35] = 1, [0xFE37] = 1,
+ [0xFE39] = 1, [0xFE3B] = 1, [0xFE3D] = 1, [0xFE3F] = 1,
+ [0xFE41] = 1, [0xFE43] = 1, [0xFE47] = 1, [0xFF08] = 1,
+ [0xFF3B] = 1, [0xFF5B] = 1, [0xFF5F] = 1, [0xFF62] = 1,
+ [0x2019] = 2, [0x201D] = 2, [0x232A] = 2, [0x3001] = 2,
+ [0x3009] = 2, [0x300B] = 2, [0x300D] = 2, [0x300F] = 2,
+ [0x3011] = 2, [0x3015] = 2, [0x3017] = 2, [0x3019] = 2,
+ [0x301B] = 2, [0x301E] = 2, [0x301F] = 2, [0xFE10] = 2,
+ [0xFE11] = 2, [0xFE18] = 2, [0xFE36] = 2, [0xFE38] = 2,
+ [0xFE3A] = 2, [0xFE3C] = 2, [0xFE3E] = 2, [0xFE40] = 2,
+ [0xFE42] = 2, [0xFE44] = 2, [0xFE48] = 2, [0xFF09] = 2,
+ [0xFF0C] = 2, [0xFF3D] = 2, [0xFF5D] = 2, [0xFF60] = 2,
+ [0xFF63] = 2, [0xFF64] = 2, [0x00B7] = 3, [0x30FB] = 3,
+ [0xFF1A] = 3, [0xFF1B] = 3, [0xFF65] = 3, [0x3002] = 4,
+ [0xFE12] = 4, [0xFF0E] = 4, [0xFF61] = 4, [0x2015] = 5,
+ [0x2025] = 5, [0x2026] = 5, [0xFE19] = 5, [0xFE30] = 5,
+ [0xFE31] = 5, [0xFE15] = 6, [0xFE16] = 6, [0xFF01] = 6,
+ [0xFF1F] = 6,
+}, { __index = function() return 0 end })
+
+--
+-- table for spacing between char classes
+-- 1 stands for 0.5*fontsize when variant=classic
+--
+local intercharclass = { [0] =
+ { [0] = nil, {1,1}, nil, {.5,.5} },
+ { [0] = nil, nil, nil, {.5,.5} },
+ { [0] = {1,1}, {1,1}, nil, {.5,.5}, nil, {1,1}, {1,1} },
+ { [0] = {.5,.5},{.5,.5},{.5,.5},{1,.5}, {.5,.5},{.5,.5},{.5,.5} },
+ { [0] = {1,0}, {1,0}, nil, {1.5,.5},nil, {1,0}, {1,0} },
+ { [0] = nil, {1,1}, nil, {.5,.5} },
+ { [0] = {1,1}, {1,1}, nil, {.5,.5} },
+}
+
+--
+-- get a new penalty node
+--
+local function get_new_penalty (p)
+ local penalty = node.new("penalty")
+ penalty.penalty = p
+ return penalty
+end
+
+--
+-- get a new glue node
+--
+local function get_new_glue (...)
+ local glue = node.new("glue")
+ node.setglue(glue, ...)
+ return glue
+end
+
+--
+-- return 0.5*fontsize of given fontid
+-- space: true if variant=modern; then 0.5*interword_space
+--
+local function get_font_size (fid, space)
+ local size = font.getparameters(fid)
+ if space then
+ size = size and size.space or 196608
+ else
+ size = size and size.quad or 655360
+ end
+ return size/2
+end
+
+--
+-- charclass 1 thru 4 will be packed in \hbox to 0.5em{\hss? curr \hss?}
+-- when variant=classic/modern
+--
+local function glyph_to_box (head, curr, class)
+ local g, h = curr
+ local size = get_font_size(g.font)
+ head, curr = node.remove(head, curr)
+ g.next, g.prev = nil, nil
+ local hss = get_new_glue(0, 65536, 65536, 2, 2)
+ if class == 1 then
+ h, hss.next, g.prev = hss, g, hss
+ elseif class == 2 or class == 4 then
+ h, g.next, hss.prev = g, hss, g
+ else
+ local hss2 = node.copy(hss)
+ h, hss.next, g.prev, g.next, hss2.prev = hss, g, hss, hss2, g
+ end
+ h = nodes.simple_font_handler(h)
+ local box = node.hpack(h, size, "exactly")
+ if curr then
+ head, curr = node.insert_before(head, curr, box)
+ else
+ head, curr = node.insert_after(head, node.tail(head), box)
+ end
+ return head, curr
+end
+
+--
+-- insert spacing defined as charclass[a][b] between a and b
+-- f: fontid
+-- var: variant = plain, classic, modern
+-- cc: charclass of current char
+-- nc: charclass of next char
+-- nobr: linebreak is not allowed
+--
+local function insert_cjk_penalty_glue (head, curr, f, var, cc, nc, nobr)
+ if nobr or cc == 1 or nc > 1 then
+ local penalty = get_new_penalty(10000)
+ head, curr = node.insert_after(head, curr, penalty)
+ end
+ local factor = get_font_size(f, var == 2)
+ local t = intercharclass[cc][nc]
+ local glue = get_new_glue(t[1]*factor, nil, t[2]*factor)
+ head, curr = node.insert_after(head, curr, glue)
+ return head, curr
+end
+
+--
+-- insert inter-character spacing in other normal cases
+-- f: fontid
+-- var: variant = plain, classic, modern
+-- x: true between cjk and non-cjk (a little more spacing)
+--
+local function insert_penalty_glue (head, curr, f, var, x)
+ if var ~= 1 then
+ local penalty = get_new_penalty(50)
+ head, curr = node.insert_after(head, curr, penalty)
+ end
+ local size, glue = get_font_size(f, x and var == 2)
+ if x then
+ glue = get_new_glue(size/2, size/4, size/8)
+ else
+ glue = get_new_glue(0, size/10, size/50)
+ end
+ head, curr = node.insert_after(head, curr, glue)
+ return head, curr
+end
+
+--
+-- main process for linebreak and inter-character spacing
+-- lb: true if pre_linebreak_filter
+--
+local function korean_break (head, lb)
+ local curr = head
+ while curr do
+ if curr.id == glyph_id then
+ local var = node.has_attribute(curr, attr_korean)
+ if var then
+ local c, f = curr.char or 0, curr.font or 0
+ local cc, cjkc = charclass[c], is_cjk(c)
+
+ -- compress cjk punctuations when charclass is 1 thru 4
+ if var > 0 and cc > 0 and cc < 5 then
+ head, curr = glyph_to_box(head, curr, cc)
+ end
+
+ local next = curr.next
+ if next and next.id == glyph_id then
+ local n = next.char or 0
+ local nc = charclass[n]
+ local nobr = nobr_before[n] or nobr_after[c]
+
+ -- insert spacing as of intercharclass
+ if var > 0 and intercharclass[cc][nc] then
+ head, curr = insert_cjk_penalty_glue(head, curr, f, var, cc, nc, nobr)
+
+ -- or insert spacing when linebreak is allowed
+ elseif not nobr then
+ local cjkn = is_cjk(n)
+
+ -- if curr or next is cjk char
+ if cjkc or cjkn then
+
+ -- if between cjk and non-cjk
+ if var > 0 and not (cjkc and cjkn) and nobr_before[c] ~= 0 then
+ head, curr = insert_penalty_glue(head, curr, f, var, true)
+
+ -- or under pre_linebreak_filter
+ elseif lb then
+ head, curr = insert_penalty_glue(head, curr, f, var)
+ end
+ end
+ end
+ end
+ end
+ end
+ curr = curr.next
+ end
+ return head
+end
+
+--
+-- process for reordering hangul tone marks (U+302E, U+302F)
+-- some hangul fonts (eg. Noto CJK) are so designed that hangul tone marks
+-- should be moved to the first position of a syllable.
+-- Currently, this functionality is not provided by luaotfload.
+--
+local function reorder_tm (head)
+ local curr, tone = node.slide(head)
+ while curr do
+ if curr.id == glyph_id and node.has_attribute(curr, attr_korean) then
+ local c, wd = curr.char or 0, curr.width or 0
+ if (c == 0x302E or c == 0x302F) and wd > 0 then
+ tone = curr
+ elseif tone and not nobr_before[c] then
+ head = node.remove(head, tone)
+ tone.next, tone.prev = nil, nil
+ head, curr = node.insert_before(head, curr, tone)
+ tone = nil
+ end
+ end
+ curr = curr.prev
+ end
+ return head
+end
+
+--
+-- automatic josa selection
+--
+local josa_table = {
+ -- consonant ㄹ, vowel, other consonants
+ [0xAC00] = {0xC774, 0xAC00, 0xC774}, -- 가 => 이, 가, 이
+ [0xC740] = {0xC740, 0xB294, 0xC740}, -- 은 => 은, 는, 은
+ [0xC744] = {0xC744, 0xB97C, 0xC744}, -- 을 => 을, 를, 을
+ [0xC640] = {0xACFC, 0xC640, 0xACFC}, -- 와 => 과, 와, 과
+ [0xC73C] = {nil, nil, 0xC73C}, -- 으(로) => , , 으
+ [0xC774] = {0xC774, nil, 0xC774}, -- 이(라) => 이, , 이
+}
+
+--
+-- helper function for number-like characters
+--
+local function josa_char_num (t, c)
+ c = c % 10 + 0x30
+ return t[c] or 2
+end
+
+--
+-- decide josa selection
+--
+local josa_code = setmetatable({
+ [0x30] = 3, [0x31] = 1, [0x33] = 3, [0x36] = 3, [0x37] = 1,
+ [0x38] = 1, [0x4C] = 1, [0x4D] = 3, [0x4E] = 3, [0x6C] = 1,
+ [0x6D] = 3, [0x6E] = 3, [0xFB02] = 1, [0xFB04] = 1,
+},{ __index = function(t,c)
+ if c >= 0xAC00 and c <= 0xD7A3 then
+ c = (c - 0xAC00) % 28 + 0x11A7
+ end
+ if c >= 0x11A8 and c <= 0x11FF then
+ if c == 0x11AF then return 1 end
+ return 3
+ end
+ if c >= 0xD7CB and c <= 0xD7FB then return 3 end
+ if c >= 0x2170 and c <= 0x217F then c = c - 0x10 end
+ if c >= 0x2160 and c <= 0x216F then
+ if c >= 0x216C then return 3 end
+ return josa_char_num(t, c - 0x215F)
+ end
+ if c >= 0x2460 and c <= 0x2473 then return josa_char_num(t, c - 0x245F) end
+ if c >= 0x2474 and c <= 0x2487 then return josa_char_num(t, c - 0x2473) end
+ if c >= 0x2488 and c <= 0x249B then return josa_char_num(t, c - 0x2487) end
+ if c >= 0x249C and c <= 0x24B5 then return t[c - 0x249C + 0x61] or 2 end
+ if c >= 0x24B6 and c <= 0x24CF then return t[c - 0x24B6 + 0x61] or 2 end
+ if c >= 0x24D0 and c <= 0x24E9 then return t[c - 0x24D0 + 0x61] or 2 end
+ if c >= 0x3131 and c <= 0x318E then
+ if c == 0x3139 then return 1 end
+ if c >= 0x314F and c <= 0x3163 or c >= 0x3187 then return 2 end
+ return 3
+ end
+ if c >= 0x3260 and c <= 0x327E then c = c - 0x60 end
+ if c >= 0x3200 and c <= 0x321E then
+ if c == 0x3203 then return 1 end
+ if c >= 0x320E then return 2 end
+ return 3
+ end
+ if c >= 0xFF10 and c <= 0xFF19 then return josa_char_num(t, c - 0xFF10) end
+ if c >= 0xFF21 and c <= 0xFF3A then return t[c - 0xFF21 + 0x61] or 2 end
+ if c >= 0xFF41 and c <= 0xFF5A then return t[c - 0xFF41 + 0x61] or 2 end
+ return 2
+ end
+})
+
+--
+-- obtain char that comes just before the josa
+--
+local function get_prev_char (p)
+ while p do
+ if p.id == glyph_id then
+ local pc = p.char or 0
+ if not nobr_after[pc] then
+ if not nobr_before[pc] or nobr_before[pc] >= 2 then
+ return pc
+ end
+ end
+ elseif p.id == hbox_id or p.id == vbox_id then
+ local pc = get_prev_char(node.slide(p.head))
+ if pc then return pc end
+ end
+ p = p.prev
+ end
+end
+
+--
+-- main process of josa selection
+--
+local function auto_josa (head)
+ local curr, tofree = head, {}
+ while curr do
+ if curr.id == glyph_id then
+ local josa = node.has_attribute(curr, attr_josa)
+ if josa then
+ local cc = curr.char or 0
+ if josa == 0 then
+ josa = josa_code[get_prev_char(curr.prev) or 0x30]
+ end
+ if cc == 0xC774 then
+ local n = curr.next
+ if n and n.char and n.char >= 0xAC00 and n.char <= 0xD7A3 then
+ else
+ cc = 0xAC00
+ end
+ end
+ local new = josa_table[cc]
+ if new then
+ cc = new[josa]
+ if cc then
+ curr.char = cc
+ else
+ head = node.remove(head, curr)
+ table.insert(tofree, curr)
+ end
+ end
+ node.unset_attribute(curr, attr_josa)
+ end
+ end
+ curr = curr.next
+ end
+ for _,v in ipairs(tofree) do node.free(v) end
+ return head
+end
+
+--
+-- now register to luatex callbacks
+-- As char value of glyphs can be changed by opentype GSUB process,
+-- we have to occupy the first position among callback functions.
+--
+local prepend_to_callback
+if luatexbase.base_add_to_callback then
+ prepend_to_callback = function(name, func, desc)
+ luatexbase.add_to_callback(name, func, desc, 1)
+ end
+else
+ prepend_to_callback = function(name, func, desc)
+ local t = { {func, desc} }
+ for _,v in ipairs(luatexbase.callback_descriptions(name)) do
+ table.insert(t, {luatexbase.remove_from_callback(name, v)})
+ end
+ for _,v in ipairs(t) do
+ luatexbase.add_to_callback(name, v[1], v[2])
+ end
+ end
+end
+
+prepend_to_callback ("pre_linebreak_filter",
+ function(head)
+ head = auto_josa(head)
+ head = korean_break(head, true)
+ head = reorder_tm(head)
+ return head
+ end,
+ "polyglossia.lang_korean")
+
+prepend_to_callback ("hpack_filter",
+ function(head)
+ head = auto_josa(head)
+ head = korean_break(head)
+ head = reorder_tm(head)
+ return head
+ end,
+ "polyglossia.lang_korean")
+
+-- vim:ft=lua:tw=0:sw=4:ts=4:expandtab
+% \end{macrocode}
+% \iffalse
+%</polyglossia-korean.lua>
%<*polyglossia-tibt.lua>
% \fi
% \clearpage
@@ -10272,12 +12773,11 @@ end
polyglossia = polyglossia or {}
local polyglossia = polyglossia
-local current_language
-local last_language
-local default_language
+-- predefined l@nohyphenation or dummy new language
+local nohyphid = luatexbase.registernumber'l@nohyphenation' or lang.id(lang.new())
+-- key `nohyphenation` is for .sty file when possibly undefined l@nohyphenation
+local newloader_loaded_languages = { nohyphenation = nohyphid }
-polyglossia.newloader_loaded_languages = { }
-polyglossia.newloader_max_langid = 0
local newloader_available_languages = dofile(kpse.find_file('language.dat.lua'))
-- Suggestion by Dohyun Kim on #129
local t = { }
@@ -10297,26 +12797,13 @@ end
local function select_language(lang, id)
loadlang(lang, id)
- current_language = lang
- last_language = lang
+ polyglossia.current_language = lang
end
local function set_default_language(lang, id)
polyglossia.default_language = lang
end
-local function falsefun()
- return false
-end
-
-local function disable_hyphenation()
- luatexbase.add_to_callback("hyphenate", falsefun, "polyglossia.disable_hyphenation")
-end
-
-local function enable_hyphenation()
- luatexbase.remove_from_callback("hyphenate", "polyglossia.disable_hyphenation")
-end
-
local check_char
if luaotfload and luaotfload.aux and luaotfload.aux.font_has_glyph then
@@ -10352,16 +12839,19 @@ local function load_tibt_eol()
require('polyglossia-tibt')
end
+-- LaTeX's language register is \count19
+local lang_register = 19
+
-- New hyphenation pattern loader: use language.dat.lua directly and the language identifiers
local function newloader(langentry)
- loaded_language = polyglossia.newloader_loaded_languages[langentry]
+ local loaded_language = newloader_loaded_languages[langentry]
if loaded_language then
log_info('Language ' .. langentry .. ' already loaded; id is ' .. lang.id(loaded_language))
-- texio.write_nl('term and log', 'Language ' .. langentry .. ' already loaded with patterns ' .. tostring(loaded_language) .. '; id is ' .. lang.id(loaded_language))
-- texio.write_nl('term and log', 'Language ' .. langentry .. ' already loaded with patterns ' .. loaded_language['patterns'] .. '; id is ' .. lang.id(loaded_language))
return lang.id(loaded_language)
else
- langdata = newloader_available_languages[langentry]
+ local langdata = newloader_available_languages[langentry]
if langdata and langdata['special'] == 'language0' then return 0 end
if langdata then
@@ -10369,35 +12859,59 @@ local function newloader(langentry)
for k, v in pairs(langdata) do
s = s .. "\n" .. k .. "\t" .. tostring(v)
end
- polyglossia.newloader_max_langid = polyglossia.newloader_max_langid + 1
- -- langobject = lang.new(newloader_max_langid)
- lang.new(); lang.new(); lang.new()
- langobject = lang.new()
+
+ --
+ -- LaTeX's \newlanguage increases language register (count19),
+ -- whereas LuaTeX's lang.new() increases its own language id.
+ -- So when a user has declared, say, \newlanguage\lang@xyz, then
+ -- these two numbers do not match each other. If we do not consider
+ -- this possible situation, our newloader() function will
+ -- unfortunately overwrite the language \lang@xyz.
+ --
+ -- Threfore here we will compare LaTeX's \newlanguage number with
+ -- LuaTeX's lang.new() id and select the bigger one for our new
+ -- language object. Also we will update LaTeX's language register
+ -- by this new id, so that another possible \newlanguage should not
+ -- overwrite our language object.
+ --
+ -- get next \newlanguage allocation number
+ local langcnt = tex.count[lang_register] + 1
+ -- get new lang object
+ local langobject = lang.new()
+ local langid = lang.id(langobject)
+ -- get bigger one between \newlanguage and new lang obj id
+ local maxlangid = math.max(langcnt, langid)
+ -- set language register for possible \newlanguage
+ tex.setcount('global', lang_register, maxlangid)
+ -- get new lang object if needeed
+ if langid ~= maxlangid then
+ langobject = lang.new(maxlangid)
+ end
s = s .. "\npatterns: " .. langdata.patterns
log_info(s)
if langdata.patterns and langdata.patterns ~= '' then
- pattfilepath = kpse.find_file(langdata.patterns)
+ local pattfilepath = kpse.find_file(langdata.patterns)
if pattfilepath then
- pattfile = io.open(pattfilepath)
+ local pattfile = io.open(pattfilepath)
lang.patterns(langobject, pattfile:read('*all'))
pattfile:close()
end
end
if langdata.hyphenation and langdata.hyphenation ~= '' then
- hyphfilepath = kpse.find_file(langdata.hyphenation)
+ local hyphfilepath = kpse.find_file(langdata.hyphenation)
if hyphfilepath then
- hyphfile = io.open(hyphfilepath)
+ local hyphfile = io.open(hyphfilepath)
lang.hyphenation(langobject, hyphfile:read('*all'))
hyphfile:close()
end
end
- polyglossia.newloader_loaded_languages[langentry] = langobject
+ newloader_loaded_languages[langentry] = langobject
log_info('Language ' .. langentry .. ' was not yet loaded; created with id ' .. lang.id(langobject))
return lang.id(langobject)
else
log_warning('Language ' .. langentry .. ' not found in language.dat.lua')
- return 255
+ return nohyphid
end
end
end
@@ -10405,14 +12919,14 @@ end
polyglossia.loadlang = loadlang
polyglossia.select_language = select_language
polyglossia.set_default_language = set_default_language
-polyglossia.current_language = current_language -- doesn't seem to be working well :-(
-polyglossia.default_language = default_language
polyglossia.check_char = check_char
polyglossia.load_frpt = load_frpt
polyglossia.load_tibt_eol = load_tibt_eol
-polyglossia.disable_hyphenation = disable_hyphenation
-polyglossia.enable_hyphenation = enable_hyphenation
polyglossia.newloader = newloader
+polyglossia.newloader_loaded_languages = newloader_loaded_languages
+-- global variables:
+-- polyglossia.default_language
+-- polyglossia.current_language
% \end{macrocode}
% \iffalse
%</polyglossia.lua>
@@ -10426,7 +12940,7 @@ polyglossia.newloader = newloader
¦----------------------------------------------¦
¦ ¦
- ¦ THE POLYGLOSSIA PACKAGE v1.44 ¦
+ ¦ THE POLYGLOSSIA PACKAGE v1.45 ¦
¦ ¦
¦ Modern multilingual typesetting ¦
¦ with XeLaTeX and LuaLaTeX ¦
@@ -10435,7 +12949,8 @@ polyglossia.newloader = newloader
This package provides an alternative to Babel for users of XeLaTeX and LuaLaTeX
(with a few languages incompletely supported for the latter). This version
-includes support for 78 different languages.
+includes support for 75 different languages, some of which in different regional,
+national or scriptal varieties.
Polyglossia makes it possible to automate the following tasks:
@@ -10453,7 +12968,8 @@ Polyglossia makes it possible to automate the following tasks:
* For languages that have their own numeration system, modifying the formatting
of numbers appropriately.
* Ensuring the proper directionality if the document contains languages
- written from right to left (via the package bidi, available separately).
+ written from right to left (via the packages bidi and luabidi, available
+ separately).
LICENSE
@@ -10464,18 +12980,129 @@ Polyglossia is placed under the terms of the LaTeX Project Public Licence
LICENCE.txt for the text of the LPPL v1.3c, or
http://www.latex-project.org/lppl.txt for the latest version.
-This work has the LPPL maintenance status ‘maintained’. The current maintainer is Arthur Reutenauer.
+This work has the LPPL maintenance status ‘maintained’. The current maintainer is
+Arthur Reutenauer.
BUGS
-Polyglossia is full of bugs. If you run into one, or suspect you do, or you
-have a request or comment, please use the GitHub issue tracker:
-http://github.com/reutenauer/polyglossia/issues
+If you run into a bug, or suspect you do, or you have a request or comment, please
+use the GitHub issue tracker: http://github.com/reutenauer/polyglossia/issues
This is more efficient than contacting me by email as it allows me to track the
issues and follow progress.
%</../README>
%<*Changelog>
+1.45 (27-10-2019)
+
+New features:
+ * Introduce a framework for external packages to access language variants. This fixes,
+ among other things, long-standing problems in the interaction of biblatex and polyglossia.
+ * Add new macros \languagevariant, \mainlanguagevariant, \babelname and \mainbabelname
+ for package authors to access language information.
+ * Add new test \iflanguageloaded{<language>}{<true>}{<false>}, where <language>
+ can be a \polyglossia or babel language name.
+ * Add new macros \localnumeral, \localnumeral*, \Localnumeral and
+ \Localnumeral* that convert Arabic digitals to the local number scheme.
+ * Add new macro \pghyphenation to add language-specific hyphenation exceptions (#18).
+ * Add support form (Khalkha & Cyrillic) Mongolian in line with babel-mongolian (#23).
+ * Add option splithyphens and vlna to Czech (XeTeX only; for LuaTeX, use the package
+ luavlna to get these features) (#32).
+ * Add support for Kurdish, both Kurmanji and Sorani (#277).
+ * Implement proper Cyrillic (alphanumeric) numbering (#285).
+ * Add new language friulian.
+ This deprecates friulan (which is still supported for backwards compatibility).
+ * Add new language malay with variants indonesian and malaysian.
+ This deprecates bahasai and bahasam (which are still supported for
+ backwards compatibility).
+ * Add new language gaelic with variants irish and scottish.
+ This deprecates irish and scottish as own polyglossia languages (which
+ are still supported for backwards compatibility).
+ * Add new language hungarian.
+ This deprecates magyar (which is still supported for backwards compatibility).
+ * Add new language sorbian with variants lower and upper.
+ This deprecates lsorbian and usorbian (which are still supported for
+ backwards compatibility).
+ * Add new language portuguese with variants portuguese and brazilian.
+ This deprecates brazil and portuges (which are still supported for
+ backwards compatibility).
+ * Add new language norwegian with variants nynorsk and bokmal.
+ This deprecates nynorsk and norsk (which are still supported for
+ backwards compatibility).
+ * Add new language persian.
+ This deprecates farsi (which is still supported for backwards compatibility).
+ * Add new language sami. Currently only Northern Sami is supported.
+ This deprecates samin (which is still supported for backwards compatibility).
+ * gloss-serbian: add numerals=cyrillic option. Add \asbuk and \Asbuk (#285).
+ * Implement basic support for (French) canadien and (English) canadian (#22)
+ * Improve support for Armenian (#79): Add captions, Eastern month names
+ (accessible via variant=eastern) and Armenian alphabetic numbering
+ (via numerals=armenian and \armenicnumeral).
+ * Add french option autospacing and commands \AutoSpacing, \NoAutoSpacing
+ This allows to switch off autospacing globally or locally (#113)
+ * Fixup \normalfont (#203)
+ * Fix directionality issues in mixed RTL/LTR paragraphs (#204)
+ * Implement babelshorthands for Finnish (#212) and Czech.
+ * Implement access to current language via Lua (#243).
+ * Introduce french option option autospacetypewriter
+ alias OriginalTypewriter
+ * Support \aemph with lualatex
+ * Rename automaticspacesaroundguillemets to autospaceguillemets
+ The old option is kept for backwards compatibility.
+
+Bug fixes:
+ * Fix equation number in arabic and farsi (#7).
+ * Simplify and document Hebrew marcheshvan option (#16).
+ * Fix hyphenation of Greek with LuaTeX (#55).
+ * Fix N'ko date format (#63).
+ * Disable the extras of a language when a nested language starts (#66, #169).
+ * Properly implement bengali numbers (#69, #184).
+ * Fix conflicts with other packages caused by premature shorthand activation
+ in preamble (#81, #200).
+ * Fix kerning in math with French (#92).
+ * Fix expansion issue in Hebrew (#93).
+ * Fix numbering expansion issue in Greek (#110).
+ * Postpone \disablehyphenation in preamble until after setting of
+ document language (#125).
+ * Postpone the assignment of defaultfamily to BeginDocument,
+ thus do not overwrite \familydefault redefinitions in the preamble (#127).
+ * Reset number settings when switching language (#133).
+ * hebrew: Properly store \MakeUppercase for later restoration (#152).
+ * Fix whitespace issue in \datewelsh (#158).
+ * When switching language, set the language/script specific font families (#164).
+ * Correct some Bengali captions (#165).
+ * Fix documentation of Serbian (#168).
+ * Reset ucl codes in latin only if the respective variant is used (#172).
+ * Fix \disablehyphenation with LuaTeX (#187).
+ * Fix typos in Hindi captions (#202).
+ * Pass language options to the aux files (#205).
+ * Rewrite and fix English variant handling (#208).
+ * Define magyar caption formats in \blockextras and undef them in \noextras (#209).
+ * Ensure proper direction with arabic digits in Arabic and Farsi (#213).
+ * Fix \linespread with Korean (#218).
+ * Define russian caption before key allocation (#219).
+ * Register current language in polyglossia lua module after selection (#234).
+ * Fix babel language switching commands (#239).
+ \foreignlanguage and the starred otherlanguage* environment are not
+ supposed to change dates.
+ * Fix French spacing leaking beyond French (#270).
+ * Redefine fontfamilies for French only if language is loaded (#270).
+ * gloss-russian:
+ - check whether command exist before redefining (#280).
+ - Fix some whitespace issues.
+ * Fix and simplify frenchfootnote definition (#294).
+ * Fix footnote numbering in Farsi.
+ * Fix latin footnotes in Arabic documents.
+ * Set the correct main direction with luabidi.
+ * Fix autospaceguillemets option in French.
+ * Fix grouping in gloss-danish.ldf.
+ * Properly store \MakeUppercase and \@arabic for later restoration.
+
+Documentation:
+ * Add documentation about footnotes in RTL context
+ * Document tibetan numerals option (#109)
+ * Improve frenchfootnote documentation.
+ * Mention Japanese support in the docs.
+
1.44 (04-04-2019)
* Correction to Russian language file, by Maksim Zholudev (commit d2f383e)
* Added Macedonian language file, by Stefan Zlatinov (commit cd379e1)
diff --git a/macros/latex/contrib/polyglossia/polyglossia.ins b/macros/latex/contrib/polyglossia/polyglossia.ins
index 73105002bd..18037987e8 100644
--- a/macros/latex/contrib/polyglossia/polyglossia.ins
+++ b/macros/latex/contrib/polyglossia/polyglossia.ins
@@ -43,7 +43,6 @@
\generate{\file{gloss-breton.ldf}{\from{polyglossia.dtx}{gloss-breton.ldf}}}
\generate{\file{gloss-bulgarian.ldf}{\from{polyglossia.dtx}{gloss-bulgarian.ldf}}}
\generate{\file{gloss-catalan.ldf}{\from{polyglossia.dtx}{gloss-catalan.ldf}}}
-\generate{\file{gloss-classiclatin.ldf}{\from{polyglossia.dtx}{gloss-classiclatin.ldf}}}
\generate{\file{gloss-coptic.ldf}{\from{polyglossia.dtx}{gloss-coptic.ldf}}}
\generate{\file{gloss-croatian.ldf}{\from{polyglossia.dtx}{gloss-croatian.ldf}}}
\generate{\file{gloss-czech.ldf}{\from{polyglossia.dtx}{gloss-czech.ldf}}}
@@ -57,11 +56,14 @@
\generate{\file{gloss-finnish.ldf}{\from{polyglossia.dtx}{gloss-finnish.ldf}}}
\generate{\file{gloss-french.ldf}{\from{polyglossia.dtx}{gloss-french.ldf}}}
\generate{\file{gloss-friulan.ldf}{\from{polyglossia.dtx}{gloss-friulan.ldf}}}
+\generate{\file{gloss-friulian.ldf}{\from{polyglossia.dtx}{gloss-friulian.ldf}}}
+\generate{\file{gloss-gaelic.ldf}{\from{polyglossia.dtx}{gloss-gaelic.ldf}}}
\generate{\file{gloss-galician.ldf}{\from{polyglossia.dtx}{gloss-galician.ldf}}}
\generate{\file{gloss-german.ldf}{\from{polyglossia.dtx}{gloss-german.ldf}}}
\generate{\file{gloss-greek.ldf}{\from{polyglossia.dtx}{gloss-greek.ldf}}}
\generate{\file{gloss-hebrew.ldf}{\from{polyglossia.dtx}{gloss-hebrew.ldf}}}
\generate{\file{gloss-hindi.ldf}{\from{polyglossia.dtx}{gloss-hindi.ldf}}}
+\generate{\file{gloss-hungarian.ldf}{\from{polyglossia.dtx}{gloss-hungarian.ldf}}}
\generate{\file{gloss-icelandic.ldf}{\from{polyglossia.dtx}{gloss-icelandic.ldf}}}
\generate{\file{gloss-interlingua.ldf}{\from{polyglossia.dtx}{gloss-interlingua.ldf}}}
\generate{\file{gloss-irish.ldf}{\from{polyglossia.dtx}{gloss-irish.ldf}}}
@@ -70,32 +72,40 @@
\generate{\file{gloss-kannada.ldf}{\from{polyglossia.dtx}{gloss-kannada.ldf}}}
\generate{\file{gloss-khmer.ldf}{\from{polyglossia.dtx}{gloss-khmer.ldf}}}
\generate{\file{gloss-korean.ldf}{\from{polyglossia.dtx}{gloss-korean.ldf}}}
+\generate{\file{gloss-kurdish.ldf}{\from{polyglossia.dtx}{gloss-kurdish.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-latvian.ldf}{\from{polyglossia.dtx}{gloss-latvian.ldf}}}
\generate{\file{gloss-lithuanian.ldf}{\from{polyglossia.dtx}{gloss-lithuanian.ldf}}}
-\generate{\file{gloss-liturgicallatin.ldf}{\from{polyglossia.dtx}{gloss-liturgicallatin.ldf}}}
\generate{\file{gloss-lsorbian.ldf}{\from{polyglossia.dtx}{gloss-lsorbian.ldf}}}
\generate{\file{gloss-macedonian.ldf}{\from{polyglossia.dtx}{gloss-macedonian.ldf}}}
\generate{\file{gloss-magyar.ldf}{\from{polyglossia.dtx}{gloss-magyar.ldf}}}
+\generate{\file{gloss-malay.ldf}{\from{polyglossia.dtx}{gloss-malay.ldf}}}
\generate{\file{gloss-malayalam.ldf}{\from{polyglossia.dtx}{gloss-malayalam.ldf}}}
\generate{\file{gloss-marathi.ldf}{\from{polyglossia.dtx}{gloss-marathi.ldf}}}
+\generate{\file{gloss-mongolian.ldf}{\from{polyglossia.dtx}{gloss-mongolian.ldf}}}
\generate{\file{gloss-nko.ldf}{\from{polyglossia.dtx}{gloss-nko.ldf}}}
\generate{\file{gloss-norsk.ldf}{\from{polyglossia.dtx}{gloss-norsk.ldf}}}
+\generate{\file{gloss-norwegian.ldf}{\from{polyglossia.dtx}{gloss-norwegian.ldf}}}
\generate{\file{gloss-nynorsk.ldf}{\from{polyglossia.dtx}{gloss-nynorsk.ldf}}}
\generate{\file{gloss-occitan.ldf}{\from{polyglossia.dtx}{gloss-occitan.ldf}}}
+\generate{\file{gloss-persian.ldf}{\from{polyglossia.dtx}{gloss-persian.ldf}}}
\generate{\file{gloss-piedmontese.ldf}{\from{polyglossia.dtx}{gloss-piedmontese.ldf}}}
\generate{\file{gloss-polish.ldf}{\from{polyglossia.dtx}{gloss-polish.ldf}}}
\generate{\file{gloss-portuges.ldf}{\from{polyglossia.dtx}{gloss-portuges.ldf}}}
+\generate{\file{gloss-portuguese.ldf}{\from{polyglossia.dtx}{gloss-portuguese.ldf}}}
\generate{\file{gloss-romanian.ldf}{\from{polyglossia.dtx}{gloss-romanian.ldf}}}
\generate{\file{gloss-romansh.ldf}{\from{polyglossia.dtx}{gloss-romansh.ldf}}}
\generate{\file{gloss-russian.ldf}{\from{polyglossia.dtx}{gloss-russian.ldf}}}
+\generate{\file{gloss-sami.ldf}{\from{polyglossia.dtx}{gloss-sami.ldf}}}
\generate{\file{gloss-samin.ldf}{\from{polyglossia.dtx}{gloss-samin.ldf}}}
\generate{\file{gloss-sanskrit.ldf}{\from{polyglossia.dtx}{gloss-sanskrit.ldf}}}
\generate{\file{gloss-scottish.ldf}{\from{polyglossia.dtx}{gloss-scottish.ldf}}}
\generate{\file{gloss-serbian.ldf}{\from{polyglossia.dtx}{gloss-serbian.ldf}}}
\generate{\file{gloss-slovak.ldf}{\from{polyglossia.dtx}{gloss-slovak.ldf}}}
\generate{\file{gloss-slovenian.ldf}{\from{polyglossia.dtx}{gloss-slovenian.ldf}}}
+\generate{\file{gloss-sorbian.ldf}{\from{polyglossia.dtx}{gloss-sorbian.ldf}}}
\generate{\file{gloss-spanish.ldf}{\from{polyglossia.dtx}{gloss-spanish.ldf}}}
\generate{\file{gloss-swedish.ldf}{\from{polyglossia.dtx}{gloss-swedish.ldf}}}
\generate{\file{gloss-syriac.ldf}{\from{polyglossia.dtx}{gloss-syriac.ldf}}}
@@ -117,6 +127,7 @@
\generate{\file{thaidigits.map}{\from{polyglossia.dtx}{thaidigits.map}}}
\def\MetaPrefix{-- }
\generate{\file{polyglossia-frpt.lua}{\from{polyglossia.dtx}{polyglossia-frpt.lua}}}
+\generate{\file{polyglossia-korean.lua}{\from{polyglossia.dtx}{polyglossia-korean.lua}}}
\generate{\file{polyglossia-tibt.lua}{\from{polyglossia.dtx}{polyglossia-tibt.lua}}}
\generate{\file{polyglossia.lua}{\from{polyglossia.dtx}{polyglossia.lua}}}
\let\MetaPrefix\DoubleperCent
diff --git a/macros/latex/contrib/polyglossia/polyglossia.pdf b/macros/latex/contrib/polyglossia/polyglossia.pdf
index a276007b8e..0da109cf9d 100644
--- a/macros/latex/contrib/polyglossia/polyglossia.pdf
+++ b/macros/latex/contrib/polyglossia/polyglossia.pdf
Binary files differ
diff --git a/macros/latex/contrib/scontents/README.md b/macros/latex/contrib/scontents/README.md
index 5e2fcf02fd..bd42d3ab4f 100644
--- a/macros/latex/contrib/scontents/README.md
+++ b/macros/latex/contrib/scontents/README.md
@@ -1,6 +1,6 @@
## scontents — Stores LaTeX contents in memory or files
-- Version: 1.6
-- Date: 2019-10-26
+- Version: 1.7
+- Date: 2019-10-29
- Author: Pablo González
## Description
diff --git a/macros/latex/contrib/scontents/scontents.dtx b/macros/latex/contrib/scontents/scontents.dtx
index 70c7ea4b14..c2316fb999 100644
--- a/macros/latex/contrib/scontents/scontents.dtx
+++ b/macros/latex/contrib/scontents/scontents.dtx
@@ -30,6 +30,7 @@
\makeatother
% and later we will copy the write stream opened by imakeidx into \@indexfile
% so that entries written to both streams end up in the same file.
+\usepackage[english]{babel}
\usepackage[top=0.5in,bottom=0.5in,left=2in,right=0.7in,footskip=0.2in,headsep=10pt]{geometry}
\usepackage[osf,mono=false,scale=0.95,llscaled=0.95]{libertine}
\setmonofont[
@@ -46,8 +47,12 @@
\newfontfamily\sourcecodeprolight{SourceCodePro-Regular.otf}[Scale = 0.80,FakeStretch =0.75]
\RenewDocumentCommand{\MacroLongFont}{}
{ \sourcecodeprolight\small }
-\usepackage{unicode-math}
+% The character of visible space is now taken from Latin Modern Mono
+% to prevent fonts in T1. The original definition for xetex/luatex is
+% \def\verbvisiblespace{\usefont{OT1}{cmtt}{m}{n}\asciispace}
+\def\verbvisiblespace{{\fontfamily{lmtt}\selectfont\char"2423}}
+\usepackage{unicode-math}
% Unicode-math changes the position of the glyphs, so the position 26A is now
% a letter `j'. The doc package ensures that mathcode and the | actually prints
% a j inside docstrip guards. This changes the mathcode of | to 07C:
@@ -67,6 +72,7 @@
\newfontfamily\fetamontotf{ffmw10.otf}[
Scale = 0.95,%
RawFeature = {+latn,+rand,+kern,+size},%
+ FontFace = {bx}{n}{ffmw10.otf},
]
\usepackage[svgnames]{xcolor}
\usepackage[sf,bf,compact,medium,pagestyles]{titlesec}
@@ -74,6 +80,13 @@
\usepackage{adjustbox,multicol,listings,accsupp,titletoc}
\usepackage{scontents} % main
\usepackage[contents]{colordoc}
+\def\textnew#1{\color{color-def}#1\/}
+\def\AltMacroFont{\fontencoding\encodingdefault
+ \fontfamily\ttdefault
+ \fontseries\mddefault
+ \fontshape\updefault
+ \small
+ }%
% Patching colordoc.sty to work with l3doc.cls
\ExplSyntaxOn
@@ -121,6 +134,18 @@
% Colors for options
\definecolor{optcolor}{rgb}{0.281,0.275,0.485}
\definecolor{mypkgcolor}{RGB}{0,128,128}%
+
+% Logo with fetamont font for title
+\makeatletter
+\newsavebox{\logobox}
+\savebox{\logobox}{%
+ \normalsize\fetamontotf{\textcolor{mypkgcolor}{s}\textcolor{OrangeRed}{content}\textcolor{mypkgcolor}{s}}}
+\newcommand{\mylogo}{%
+ \settoheight{\@tempdima}{L}%
+ \resizebox{!}{\@tempdima}{\usebox{\logobox}}%
+ }
+\makeatother
+
% Custom \meta[...]{...}, \marg[...]{...} and \oarg[...]{...} with color
\ExplSyntaxOn
% User level commands
@@ -204,7 +229,6 @@
{
\textcolor{\l_userdoc_meta_brackcolor_tl}{#1}
}
-
% \envexamp{m}
\newsavebox{\boxexaenv}
\NewDocumentCommand{\envexamp}{m}
@@ -220,6 +244,19 @@
\end{lrbox}%
\usebox{\boxexaenv}
}
+\NewDocumentCommand{\envexaplain}{O{} m O{end}}
+ {
+ \begin{lrbox}{\boxexaenv}%
+ \begin{minipage}[t]{\marginparwidth}%
+ \raggedright\ttfamily\small
+ \textcolor{mypkgcolor}{{\textbackslash#1#2}}\myoarg
+ [type=tt,sbc=gray,ac=lightgray,cf=optcolor]{keyval ~ list}\par%
+ \hspace{0.5cm}\mymeta[type=tt,ac=lightgray,cf=gray]{env ~ contents}\par%
+ \textcolor{mypkgcolor}{{\textbackslash #3#2}}\par
+ \end{minipage}%
+ \end{lrbox}%
+ \usebox{\boxexaenv}
+ }
% \cmdexamp{s m o m o}
\DeclareDocumentCommand{\cmdexamp}{o m o m o}
@@ -227,7 +264,7 @@
\group_begin:
\small\ttfamily
\textcolor{mypkgcolor}{\textbackslash#2}
- \IfValueT{#1}{ \textcolor{red}{#1} }
+ \IfValueT{#1}{ \textcolor{MediumOrchid}{#1} }
\IfValueT{#3}{ \myoarg[type=tt,sbc=gray,ac=lightgray,cf=optcolor]{#3} }
\IfValueTF{#5}
{
@@ -238,7 +275,8 @@
{ \mymarg[type=tt,cbc=gray,ac=lightgray,cf=optcolor]{#4} }
\par
\group_end:
- \MYSortIndex{Commands}{Commands ~ provide ~ by ~ \textcolor{gray}{scontents}>\texttt{\textbackslash#2}}%
+ \MYSortIndex{Commands}{Commands ~ provide ~ by ~
+ {\fetamontotf{\textcolor{mypkgcolor}{s}\textcolor{OrangeRed}{content}\textcolor{mypkgcolor}{s}}}:}%
}
% \keyexamp{mmm}
@@ -259,7 +297,8 @@
\group_begin:
\IfBooleanTF{#1}
{
- \textsf{\textcolor{mypkgcolor}{s}\textcolor{OrangeRed}{content}\textcolor{mypkgcolor}{s}}
+ %\textsf{\textcolor{mypkgcolor}{s}\textcolor{OrangeRed}{content}\textcolor{mypkgcolor}{s}}
+ \fetamontotf{\textcolor{mypkgcolor}{s}\textcolor{OrangeRed}{content}\textcolor{mypkgcolor}{s}}
\MYSortIndex{packages}{Packages>\texttt{#2}}
}
{
@@ -274,8 +313,9 @@
{
\IfBooleanTF{#1}
{
- \textcolor{mypkgcolor}{\ttfamily{#2}}%
- \MYSortIndex{environment}{Environment ~ provide ~ by ~ \textcolor{gray}{scontents}:>\texttt{#2}}
+ \textcolor{mypkgcolor}{\ttfamily{#2}}%
+ \MYSortIndex{environment}{ Environment ~ provide ~ by ~
+ {\fetamontotf{\textcolor{mypkgcolor}{s}\textcolor{OrangeRed}{content}\textcolor{mypkgcolor}{s}}}:>\texttt{#2}}
}
{
\textcolor{darkgray}{\ttfamily{#2}}%
@@ -289,9 +329,13 @@
\IfBooleanTF{#1}
{
\tl_set:Nn \l_tmpa_tl { #2 }
- \regex_replace_once:nnN { (\*) } { \c{textcolor}\cB\{red\cE\}\cB\{\1\cE\} } \l_tmpa_tl
+ \regex_replace_once:nnN { (\*) } { \c{textcolor}\cB\{MediumOrchid\cE\}\cB\{\1\cE\} } \l_tmpa_tl
\textcolor{mypkgcolor}{\ttfamily\textbackslash{\tl_use:N \l_tmpa_tl}}
- \MYSortIndex{Commands}{Commands ~ provide ~ by ~ \textcolor{gray}{scontents}>\texttt{\textbackslash#2}}
+ \MYSortIndex{Commands}{ Commands ~ provide ~ by ~
+ {
+ \fetamontotf{
+ \textcolor{mypkgcolor}{s}\textcolor{OrangeRed}{content}\textcolor{mypkgcolor}{s}}
+ }:>\texttt{\textbackslash#2}}
}
{
\textcolor{darkgray}{\ttfamily\textbackslash{#2}}
@@ -310,17 +354,6 @@
\newcommand\emailampersat{{\color{optcolor}\footnotesize @}}%
\catcode`\_=8\relax%
-\makeatletter
-% Logo whit fetamont font for title
-\newsavebox{\logobox}
-\savebox{\logobox}{%
- \normalsize\fetamontotf{\textcolor{mypkgcolor}{s}\textcolor{OrangeRed}{content}\textcolor{mypkgcolor}{s}}}
-\newcommand{\mylogo}{%
- \settoheight{\@tempdima}{L}%
- \resizebox{!}{\@tempdima}{\usebox{\logobox}}%
- }
-\makeatother
-
% Custom vertamimsc
\makeatletter
\let\verbatimsc\@undefined
@@ -352,7 +385,7 @@
columns=fullflexible,%
stringstyle= {\color{red}},%
basicstyle=\ttfamily\small,%
- alsoletter=-,%
+ alsoletter={-,@,.},%
% comments
morecomment=[l]{\%},%
commentstyle=\lmmitalic\small\itshape\color{lightgray},%
@@ -361,36 +394,66 @@
keywords=[1]{begin,end,Verbatim},%
% Other words 2
keywordstyle=[2]{\color{blue!75}},%
- keywords=[2]{usepackage,section,documentclass,input,usemodule},%
+ keywords=[2]{usepackage,section,documentclass,input,usemodule,
+ subsection,ExplSyntaxOff,ExplSyntaxOn,RequirePackage,
+ ProvidesExplPackage},%
% Other words 3
keywordstyle=[3]{\color{optcolor!85}},%
- keywords=[3]{document,article},%
+ keywords=[3]{document,article,setlength,pagestyle,definecolor},%
% Reserved words 4 (scontents pkg)
keywordstyle=[4]{\color{mypkgcolor}},%
keywords=[4]{scontents,Scontents,getstored,typestored,verbatimsc,%
endverbatimsc,countsc,meaningsc,foreachsc,macros
- endscontents,startscontents,stopscontents},%
+ endscontents,startscontents,stopscontents,scontents.tex},%
% Reserved in red
keywordstyle=[5]{\color{red}},%
- keywords=[5]{makeatletter,makeatother,let,verb,undefined,makebox},%
+ keywords=[5]{makeatletter,makeatother,let,verb,@undefined,makebox,def,%
+ par,item,parindent,lstinline,@ifpackagelater,ver@xparse.sty,%
+ dospecials,do@noligs,char,outer},%
% Reserved in orange
keywordstyle=[6]{\color{optcolor}},%
- keywords=[6]{store-cmd,store-env,print-env,write-env,%
+ keywords=[6]{store-cmd,store-env,print-env,print-cmd,write-env,%
start,stopt,wrapper,sep,step,before,after,write-out,%
width-tab,force-eol,inner,outer,I,J,M,L,Ascheol},%
% Reserved in orange
keywordstyle=[7]{\color{OrangeRed}},%
- keywords=[7]{DefineVerbatimEnvironment,lstnewenvironment,newminted,newenvironment},%
+ keywords=[7]{DefineVerbatimEnvironment,lstnewenvironment,newminted,%
+ newtheorem,newenvironment,VerbatimEnvironment},%
% literate
- literate=*{\{}{{\textcolor{gray}{\{}}}{1}
- {\}}{{\textcolor{gray}{\}}}}{1}
+ literate=*{\{}{{{\color{gray}{\char`\{}}}}{1}
+ {\}}{{{\color{gray}{\char`\}}}}}{1}
+ {\|}{{{\color{gray}{\char`\|}}}}{1}
+ {\$}{{{\color{gray}{\char`\$}}}}{1}
+ {\#}{{{\color{optcolor}{\char`\#}}}}{1}
{[}{{\textcolor{gray}{[}}}{1}
{]}{{\textcolor{gray}{]}}}{1}
{,}{{\textcolor{gray}{,}}}{1}
+ {;}{{\textcolor{gray}{;}}}{1}
+ {\&}{{\textcolor{gray}{\&}}}{1}
{>}{{\textcolor{OrangeRed}{\guillemotright}}}{1}
- {*}{{\textcolor{red}{*}}}{1}
- {@}{{\textcolor{red}{@}}}{1}
+ {*}{{\textcolor{MediumOrchid}{*}}}{1}
+ %{@}{{\textcolor{red}{@}}}{1}
{\^}{{\textcolor{optcolor}{\textasciicircum}}}{1}
+ {0}{{\textcolor{MediumOrchid}{0}}}{1}
+ {1}{{\textcolor{MediumOrchid}{1}}}{1}
+ {2}{{\textcolor{MediumOrchid}{2}}}{1}
+ %{3}{{\textcolor{MediumOrchid}{3}}}{1}% expl3
+ {4}{{\textcolor{MediumOrchid}{4}}}{1}
+ {5}{{\textcolor{MediumOrchid}{5}}}{1}
+ {6}{{\textcolor{MediumOrchid}{6}}}{1}
+ {7}{{\textcolor{MediumOrchid}{7}}}{1}
+ {8}{{\textcolor{MediumOrchid}{8}}}{1}
+ {9}{{\textcolor{MediumOrchid}{9}}}{1}
+ {.0}{{\textcolor{MediumOrchid}{.0}}}{2}% Following is to ensure that only periods
+ {.1}{{\textcolor{MediumOrchid}{.1}}}{2}% followed by a digit are changed.
+ {.2}{{\textcolor{MediumOrchid}{.2}}}{2}
+ {.3}{{\textcolor{MediumOrchid}{.3}}}{2}
+ {.4}{{\textcolor{MediumOrchid}{.4}}}{2}
+ {.5}{{\textcolor{MediumOrchid}{.5}}}{2}
+ {.6}{{\textcolor{MediumOrchid}{.6}}}{2}
+ {.7}{{\textcolor{MediumOrchid}{.7}}}{2}
+ {.8}{{\textcolor{MediumOrchid}{.8}}}{2}
+ {.9}{{\textcolor{MediumOrchid}{.9}}}{2}
{=}{{\textcolor{gray}{=}}}{1},%
}[keywords,tex,comments,strings]% end languaje
@@ -428,13 +491,14 @@
\lstMakeShortInline[language=scontents-doc,basicstyle=\ttfamily]§
% Get file info
-\GetFileInfo{scontents.sty}
+\GetFileInfo{\jobname.sty}
% Config hyperref
+\definecolor{linkcolour}{cmyk}{0.64,0,0.95,0.40}% <-Olive Green
\hypersetup{
- linkcolor = blue!50,
- citecolor = red!50,%
- urlcolor = magenta,%
+ linkcolor = linkcolour,%
+ citecolor = linkcolour,%
+ urlcolor = linkcolour,%
colorlinks = true,%
linktoc = all,%
pdftitle = {.:: The scontents package --- \fileinfo{} ::.},%
@@ -477,7 +541,7 @@
\makeatletter
\renewcommand\tableofcontents{%
\begingroup%
-\section*{\contentsname\quad{\color{gray}\leaders\hrule height 5pt depth -4.4pt\hfill}%
+\section*{\contentsname\quad{\color{optcolor}\leaders\hrule height 5pt depth -4.4pt\hfill}%
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\vspace*{-14pt}
@@ -485,7 +549,7 @@
\begin{multicols}{2}%
\@starttoc{toc}%
\end{multicols}%
-\vspace*{-3pt}{\color{gray}\hrule height 0.6pt}%
+\vspace*{-3pt}{\color{optcolor}\hrule height 0.6pt}%
\vspace*{5pt}
\endgroup
}
@@ -499,7 +563,7 @@
% \title{
% \scalebox{1.025}{\mylogo}\\[2pt]
% \Large
-% \textsf{Stores \hologo{LaTeX} contents}\\[3pt]
+% \textsf{Stores \hologo{LaTeX}}{ \fetamontotf{contents} }\\[3pt]
% \fileversion{} --- \filedate\thanks{
% This file describes a documentation for \fileversion, last revised
% \filedate.}\\[25pt]
@@ -518,7 +582,7 @@
%
% \begin{scontents}[store-env=abstract,print-env=true]
% \begin{abstract}
-% The \mypkg*{scontents} package stores valid \hologo{(La)TeX} code in
+% The \mypkg*{scontents} package stores valid \hologo{LaTeX} code in
% \mymeta{sequences} using the \mypkg{l3seq} module of \mypkg{expl3}.
% The \mymeta{stored content}, including \emph{verbatim}, can be used
% as many times as desired in the document, additionally can be written
@@ -532,7 +596,7 @@
%
% \section{Motivation and Acknowledgments}
%
-% In \hologo{(La)TeX} there is no direct way to record content for later use, although
+% In \hologo{LaTeX} there is no direct way to record content for later use, although
% you can do this using §\macros§, recording \mymeta{verbatim content} is a
% problem, usually you can avoid this by creating external files or boxes. The
% general idea of this package is to try to imitate this implementation
@@ -613,12 +677,15 @@
%<*example>
% \fi
\begin{examplecode}[frame=single]
-\usepackage`\small\myoarg{key \textnormal{\textcolor{gray}{=}} val}`{scontents}
+\usepackage`\small\myoarg[type=tt]{key \textnormal{\textcolor{gray}{=}} val}`{scontents}
\end{examplecode}
% \iffalse
%</example>
% \fi
%
+% The package options are not available for \hologo{plainTeX} and
+% \hologo{ConTeXt}, see \ref{sec:confopt}.
+%
% \subsubsection*{For \hologo{plainTeX} users}
%
% \iffalse
@@ -768,12 +835,12 @@
% command to get the \mymeta{stored content} along with other utilities described
% in this documentation.
%
-% \subsection{The environment \env{scontents}}
-% \label{sec:scontents}
+% \subsection{The environment \texttt{scontents}}
+% \label{sec:envscontents}
%
% \vspace*{-10pt}
%
-% \begin{function}{scontents}
+% \begin{function}[label=SCONTENTS]{scontents}
% \begin{syntax}
% \envexamp{scontents}
% \end{syntax}
@@ -803,11 +870,14 @@
% \fi
\begin{examplecode}[frame=single]
\begin{scontents}[store-env=outer]
-This text is in the outer environment (before nested).
+This text is in the outer environment
+(before nested).
\begin{scontents}[store-env=inner]
-This text is found in the inner environment (inside of nested).
+This text is found in the inner environment
+(inside of nested).
\end{scontents}
-This text is in the outer environment (after nested).
+This text is in the outer environment
+(after nested).
\end{scontents}
\end{examplecode}
% \iffalse
@@ -821,11 +891,28 @@ This text is in the outer environment (after nested).
% It is advisable to store content within sequences with different names,
% so as not to get lost in the order in which content is stored.
%
+% \newpage
+%
+% \subsection*{Notes for \hologo{plainTeX} and \hologo{ConTeXt} users}
+%
% In \hologo{plainTeX} there is not environments as in \hologo{LaTeX}.
% Instead of using the environment \myenv*{scontents}, one should use a
% \emph{pseudo environment} delimited by \ics*{scontents} and \ics*{endscontents}.
-% \hologo{ConTeXt} users should use \ics*{startscontents} and \ics*{stopscontents}.
%
+% \vspace*{-10pt}
+% \begin{function}{\scontents,\endscontents}
+% \begin{syntax}
+% \envexaplain{scontents}
+% \end{syntax}
+% \end{function}
+%
+% \hologo{ConTeXt} users should use \ics*{startscontents} and \ics*{stopscontents}.
+% \vspace*{-10pt}
+% \begin{function}{\startscontents,\stopscontents}
+% \begin{syntax}
+% \envexaplain[start]{scontents}[stop]
+% \end{syntax}
+% \end{function}
% \subsection*{Options for environment}
%
% The environment options can be configured globally using option
@@ -1009,11 +1096,6 @@ This text is in the outer environment (after nested).
% stored in the \mymarg{seq name}. The key §width-tab§ is available for
% this command.
%
-% The \mypkg{verbatim} package is not compatible with the implementation
-% of the \myenv*{verbatimsc} environment used by this command, if you are
-% a user of that package consider customizing the \myenv*{verbatimsc}
-% environment.
-%
% \subsection{The environment \env{verbatimsc}}
% \label{sec:verbatimsc}
%
@@ -1026,11 +1108,12 @@ This text is in the outer environment (after nested).
%
% One consideration to keep in mind is that this is a \emph{representation}
% of the \mymeta{stored content} in a \emph{verbatim} environment and not
-% a real \emph{verbatim} environment.
+% a real \emph{verbatim} environment. The \mypkg{verbatim} package is not
+% compatible with the implementation of the \myenv*{verbatimsc} environment.
%
+% The \myenv*{verbatimsc} environment can be customized in the following ways:
%
-% The \myenv*{verbatimsc} environment can be customized in the
-% following ways:
+% \newpage
%
% Using the package \mypkg{fancyvrb}:
% \iffalse
@@ -1132,12 +1215,8 @@ This text is in the outer environment (after nested).
% The command \ics*{cleanseqsc} remove all contents stored in \mymarg{seq name}.
% \end{function}
%
-% \newpage
+% \section[The \textnormal{\texttt{scontents}} package in action]{The \mypkg*{scontents} package in action}
%
-% \pdfstringdefDisableCommands{%
-% \RenewExpandableDocumentCommand{\mypkg}{sm}{#2}%
-% }
-% \section{The \mypkg*{scontents} package in action}
% Remember the abstract on the first page?, this is it:
%
% \getstored{abstract}
@@ -1198,14 +1277,12 @@ by making use \mymeta{sequences}.
% I stored the content in memory and then ran §\getstored§ and
% §\typestored§. This is one of the ways you can use \mypkg*{scontents}.
%
-% \newpage
-%
% \section{Examples}
%
-% These are some (adapted) examples that have served as inspiration for
+% These are some adapted examples that have served as inspiration for
% the creation of this package.
%
-% \subsection{From answers package}
+% \subsection{From \texttt{answers} package}
%
% \subsubsection*{Example 1}
%
@@ -1213,23 +1290,19 @@ by making use \mymeta{sequences}.
%<*example>
% \fi
\begin{scontents}[write-out=scexamp1.ltx]
-\documentclass[12pt,a4paper]{article}
+\documentclass{article}
\usepackage[store-cmd=solutions]{scontents}
\newtheorem{ex}{Exercise}
\begin{document}
\section{Problems}
\begin{ex}
First exercise
-\Scontents{
- First solution.
-}
+\Scontents{First solution.}
\end{ex}
\begin{ex}
Second exercise
-\Scontents{
- Second solution.
-}
+\Scontents{Second solution.}
\end{ex}
\section{Solutions}
@@ -1240,11 +1313,11 @@ Second exercise
%</example>
% \fi
%
-% Adaptation of example 1 (ansexam1) of the package \mypkg{answers}
+% Adaptation of example 1 of the package \mypkg{answers}
% \textattachfile[color=0 0 1]{scexamp1.ltx}{\faFile*[regular]}.
% \lstinputlisting[language=scontents-doc,numbers=left]{scexamp1.ltx}
%
-% \subsection{From filecontentsdef package}
+% \subsection{From \texttt{filecontentsdef} package}
%
% \subsubsection*{Example 2}
%
@@ -1297,6 +1370,7 @@ seventies that the \NSA\ has known that for 40 years.\par
\documentclass{article}
\usepackage[store-cmd=tikz]{scontents}
\usepackage{tikz}
+\setlength{\parindent}{0pt}
\pagestyle{empty}
\Scontents*{\matrix{ \node (a) {$a$} ; & \node (b) {$b$} ; \\ } ;}
\Scontents*{\matrix[ampersand replacement=\&]
@@ -1316,10 +1390,27 @@ seventies that the \NSA\ has known that for 40 years.\par
\getstored[3]{tikz}
\end{tikzpicture}
-\section{source}
+\begin{scontents}[store-env=buffer]
+Hello World!
+
+This is a \verb*|fake poor man's buffer :)|.
+\end{scontents}
+
+\section{source tikz}
\typestored[1]{tikz}
\typestored[2]{tikz}
\typestored[3]{tikz}
+
+\section{fake buffer}
+\subsection{real content}
+\getstored[1]{buffer}
+\subsection{verbatim style}
+\typestored[1]{buffer}
+\subsection{meaning}
+\meaningsc[1]{buffer}
+
+\section{tikz again}
+\foreachsc[before={\begin{tikzpicture}},after={\end{tikzpicture}},sep={\\[10pt]}]{tikz}
\end{document}
\end{scontents}
% \iffalse
@@ -1340,24 +1431,25 @@ seventies that the \NSA\ has known that for 40 years.\par
\usepackage{scontents}
\pagestyle{empty}
\begin{document}
-\begin{scontents}[store-env=a]
-Something for a
+\begin{scontents}[store-env=main]
+Something for main A.
\end{scontents}
-\begin{scontents}[store-env=a]
-Something for b
+\begin{scontents}[store-env=main]
+Something for \verb|main B|.
\end{scontents}
-\begin{scontents}[store-env=a]
-Something with no label
+\begin{scontents}[store-env=other]
+Something for \verb|other|.
\end{scontents}
\textbf{Let's print them}
-This is a: \getstored[1]{a}\par
-This is b: \getstored[2]{a}
+This is first stored in main: \getstored[1]{main}\par
+This is second stored in main: \getstored[2]{main}\par
+This is stored in other: \getstored[1]{other}
-\textbf{Print all of them}\par
+\textbf{Print all of stored in main}\par
\foreachsc[sep={\\[10pt]}]{a}
\end{document}
\end{scontents}
@@ -1405,7 +1497,7 @@ This is from the verbatim environment:
% \textattachfile[color=0 0 1]{scexamp5.ltx}{\faFile*[regular]}.
% \lstinputlisting[language=scontents-doc,numbers=left]{scexamp5.ltx}
%
-% \subsection{Customization of verbatimsc}
+% \subsection{Customization of \texttt{verbatimsc}}
%
% \subsubsection*{Example 6}
%
@@ -1541,7 +1633,7 @@ and more.+
%<*example>
% \fi
\begin{scontents}[write-out=scexamp8.ltx]
-% need --shell-escape
+% need -shell-escape
\documentclass{article}
\usepackage{scontents}
\makeatletter
@@ -1604,9 +1696,15 @@ No tab
% \begin{description}[font=\small\sffamily,wide=0pt,style=multiline,leftmargin=\descrwidth,nosep,noitemsep]
% \item [\fileversion{} (ctan), \filedate]
% \begin{itemize}
+% \item The |verbatimsc| environment was rewritten.
+% \item Minor adjustments in documentation.
+% \end{itemize}
+% \item [v1.6 (ctan), 2019-10-26]
+% \begin{itemize}
% \item The internal behavior of |\getstored| has been modified.
% \item The internal behavior of |\foreachsc| has been modified.
% \item Corrected file extension for \hologo{ConTeXt}.
+% \item Remove spurious warning.
% \end{itemize}
% \item [v1.5 (ctan), 2019-10-24]
% \begin{itemize}
@@ -1661,6 +1759,11 @@ No tab
% \addtocontents{toc}{\protect\setcounter{tocdepth}{2}}
% \cleardoublepage
% \phantomsection
+% \indexprologue{
+% The italic numbers denote the pages where the corresponding entry is
+% described, the numbers underlined and all others indicate the line on
+% which they are implemented in the package code.
+% }
% \printindex
% }
%
@@ -1677,10 +1780,10 @@ No tab
%
% Now we define some common macros to hold the package date and version:
% \begin{macrocode}
-%<loader>\def\ScontentsFileDate{2019-10-26}%
-%<core>\def\ScontentsCoreFileDate{2019-10-26}%
+%<loader>\def\ScontentsFileDate{2019-10-29}%
+%<core>\def\ScontentsCoreFileDate{2019-10-29}%
%<*loader>
-\def\ScontentsFileVersion{1.6}%
+\def\ScontentsFileVersion{1.7}%
\def\ScontentsFileDescription{Stores LaTeX contents in memory or files}%
% \end{macrocode}
%
@@ -1708,7 +1811,7 @@ No tab
% \end{macrocode}
% The Plain and \hologo{ConTeXt} loaders are similar (probably because I don't
% know how to make a proper \hologo{ConTeXt} module :-). We define a
-% \LaTeX{}-style ver@scontents.sty macro with version info (just in case):
+% \LaTeX{}-style §\ver@scontents.sty§ macro with version info (just in case):
% \begin{macrocode}
%<*!latex>
%<context>\writestatus{loading}{User Module scontents v\ScontentsFileVersion}
@@ -2208,7 +2311,7 @@ No tab
%
% First we check if the \mymeta{key} is an integer using \cs{int_to_roman:n}.
% If it is, we check that the value passed to the key is blank
-% (otherwise something odd as |1=1| might have been used). If everything
+% (otherwise something odd as §1=1§ might have been used). If everything
% is correct, then set the value of the integer which holds the \mymeta{index}.
% Otherwise raise an error about an \emph{unknown} option.
%
@@ -2311,7 +2414,7 @@ No tab
% \end{macrocode}
%
% Now that the compatibility layer is defined, we can finally load \pkg{xparse}.
-% \pkg{xparse} expects to be loaded with \cs{ExplSyntaxOff} (not much harm would
+% \pkg{xparse} expects to be loaded with §\ExplSyntaxOff§ (not much harm would
% be done otherwise, but just to be on the safe side).
%
% Within \pkg{xparse} a §\RequirePackage{expl3}§ is done. We can ignore that since
@@ -2319,7 +2422,7 @@ No tab
% we do that test too to ensure that \pkg{xparse} is compatible with the current
% running version of \pkg{expl3}. The following §\ProvidesExplPackage§ simply
% defines §\ver@xparse.sty§ for any other package that might uset it, and then
-% does \cs{ExplSyntaxOn}. At the end of the package, \pkg{xparse} parses (heh)
+% does §\ExplSyntaxOn§. At the end of the package, \pkg{xparse} parses (heh)
% the package options. Since we don't have those in non-\LaTeX{} formats, they are
% ignored. Okay, so load \pkg{xparse}:
% \begin{macrocode}
@@ -2334,7 +2437,7 @@ No tab
%</loader&!latex>
%<*core>
% \end{macrocode}
-% (actually we don't need to do \cs{ExplSyntaxOn} there because we don't have
+% (actually we don't need to do §\ExplSyntaxOn§ there because we don't have
% \LaTeX{}'s full package loading mechanism, so the \pkg{expl3} syntax remains
% active after \pkg{xparse} is loaded, but it doesn't harm either).
%
@@ -2405,7 +2508,7 @@ No tab
%
% \begin{macro}{\@@_store_to_seq:NN}
% The \cs{@@_store_to_seq:NN} writes the recorded contents
-% in |#1| to the log and stores it in |#2|.
+% in §#1§ to the log and stores it in §#2§.
%
% \begin{macrocode}
\cs_new_protected:Npn \@@_store_to_seq:NN #1#2
@@ -2580,16 +2683,16 @@ No tab
% \@@_remove_leading_nl:w,
% }
% This is the main macro to collect the contents of a verbatim environment.
-% The macro starts a group, opens the output file, if necessary, sets verbatim
-% catcodes, and then issues §^^M§ (set equal to \cs{@@_ret:w}) to read the
-% environment line by line until reaching its end. The output token list will
-% be appended with an active §^^J§ character and the line just read, and this
-% line is written to the output file, if any. At the end of the environment
-% the output file is closed (if it was open), and the output token list is
-% smuggled out of the verbatim group. A leading §^^J§ is removed from the
-% token list using \cs{@@_remove_leading_nl:n} (which expects an active §^^J§
-% token at the head of the token list; a low level \hologo{TeX} error is raised
-% otherwise).
+% The macro starts a group, opens the \mymeta{output file}, if necessary,
+% sets verbatim catcodes, and then issues §^^M§ (set equal to \cs{@@_ret:w})
+% to read the environment line by line until reaching its end. The output
+% token list will be appended with an active §^^J§ character and the line
+% just read, and this line is written to the output file, if any. At the end
+% of the environment the \mymeta{output file} is closed (if it was open),
+% and the output token list is smuggled out of the verbatim group. A leading
+% §^^J§ is removed from the token list using \cs{@@_remove_leading_nl:n}
+% (which expects an active §^^J§ token at the head of the token list; a low
+% level \hologo{TeX} error is raised otherwise).
%
% \begin{macrocode}
\cs_new_protected:Npn \@@_file_tl_write_start:n #1
@@ -2788,14 +2891,19 @@ No tab
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[int]{\verbatim,\endverbatim}
+% \begin{macro}[int]{\verbatimsc,\endverbatimsc}
% In Plain we emulate \LaTeX's \env{verbatim} environment.
% \begin{macrocode}
%<*plain>
\bool_new:N \l_@@_temp_bool
-\cs_new_protected:Npn \verbatim
- { \@@_verbatim_aux: \frenchspacing \@@_vobeyspaces: \@@_xverb: }
-\cs_new_protected:Npn \@@_verbatim_aux:
+\cs_new_protected:Npn \verbatimsc
+ {
+ \group_begin:
+ \@@_verbatimsc_aux: \frenchspacing \@@_vobeyspaces: \@@_xverb:
+ }
+\cs_new_protected:Npn \endverbatimsc
+ { \group_end: }
+\cs_new_protected:Npn \@@_verbatimsc_aux:
{
\skip_vertical:N \parskip
\int_set:Nn \parindent { 0pt }
@@ -2837,8 +2945,8 @@ No tab
% \end{macro}
%
% \begin{macro}[int]{\dospecials}
-% \pkg{xparse} also requires \LaTeX's \cs{dospecials}. In case it doesn't
-% exist (at the time \pkg{scontents} is loaded) we define \cs{dospecials}
+% \pkg{xparse} also requires \LaTeX's §\dospecials§. In case it doesn't
+% exist (at the time \pkg{scontents} is loaded) we define §\dospecials§
% to use the \cs{l_char_special_seq}.
% \begin{macrocode}
%<*!latex>
@@ -2999,9 +3107,6 @@ No tab
%
% \subsection{The command \cs{typestored}}
%
-% This implementation is an adaptation taken from answer by Phelype Oleinik
-% in (\url{https://tex.stackexchange.com/a/497651/7832}).
-%
% \begin{macro}{\typestored,\@@_verb_print:N,\@@_xverb:w,verbatimsc}
% The §\typestored§ commands fetches a buffer from memory, prints it
% to the log file, and then calls \cs{@@_verb_print:N}.
@@ -3070,6 +3175,7 @@ No tab
}
%</core>
%<*loader>
+%<*!context>
\use:x
{
\cs_new_protected:Npn \exp_not:N \@@_xverb:w
@@ -3078,17 +3184,15 @@ No tab
%<plain> { ##1 \exp_not:N \endverbatimsc }
%<context> { ##1 \exp_not:N \stopverbatimsc }
}
-%<*!context>
+%</!context>
+%<*latex>
\NewDocumentEnvironment { verbatimsc } { }
{
-%<plain> \group_begin:
-%<latex> \cs_set_eq:cN { @xverbatim } \@@_xverb:
+ \cs_set_eq:cN { @xverbatim } \@@_xverb:
\verbatim
}
- {
-%<plain> \group_end:
- }
-%</!context>
+ { }
+%</latex>
%<context>\definetyping[verbatimsc]
%</loader>
%<*core>
@@ -3110,8 +3214,8 @@ No tab
%
% \begin{macro}{\@@_do_noligs:N}
% \cs{@@_do_noligs:N} is an alternative definition for \LaTeXe's
-% \cs{do@noligs} which makes sure to not consume following space
-% tokens. The \LaTeXe{} version ends with \cs{char}|`#1|, which
+% §\do@noligs§ which makes sure to not consume following space
+% tokens. The \LaTeXe{} version ends with §\char`#1§, which
% leaves \TeX{} still looking for an \mymeta{optional~space}.
% This version uses \cs{char_generate:nn} to ensure that doesn't
% happen.
@@ -3137,7 +3241,7 @@ No tab
% }
% Shortcut definitions for common catcode changes.
% The §^^L§ needs a special treatment in non-\LaTeX{} mode
-% because in Plain\,\TeX{} it is an \cs{outer} token.
+% because in Plain\,\TeX{} it is an §\outer§ token.
% \begin{macrocode}
\cs_new_protected:Npn \@@_set_active_eq:NN #1
{
diff --git a/macros/latex/contrib/scontents/scontents.ins b/macros/latex/contrib/scontents/scontents.ins
index 760aea2951..6c761fe6b0 100644
--- a/macros/latex/contrib/scontents/scontents.ins
+++ b/macros/latex/contrib/scontents/scontents.ins
@@ -33,11 +33,11 @@ and the derived files scontents.sty,
\declarepreamble\context
\string\module
[ file=t-scontents,
- version=1.6,
+ version=1.7,
title=\string\CONTEXT\ User Module,
subtitle=Storing Contents,
author=Pablo González,
- date=2019-10-26,
+ date=2019-10-29,
copyright=Pablo González,
email=pablgonz@educarchile.cl,
license=LPPL]
diff --git a/macros/latex/contrib/scontents/scontents.pdf b/macros/latex/contrib/scontents/scontents.pdf
index 55eb50773f..958da1dcc6 100644
--- a/macros/latex/contrib/scontents/scontents.pdf
+++ b/macros/latex/contrib/scontents/scontents.pdf
Binary files differ
diff --git a/macros/luatex/latex/luabidi/doc/test.tex b/macros/luatex/latex/luabidi/doc/luabidi-test-arabmaths.tex
index 1b51109ad4..1b51109ad4 100644
--- a/macros/luatex/latex/luabidi/doc/test.tex
+++ b/macros/luatex/latex/luabidi/doc/luabidi-test-arabmaths.tex
diff --git a/macros/luatex/latex/luabidi/doc/luabidi.pdf b/macros/luatex/latex/luabidi/doc/luabidi.pdf
new file mode 100644
index 0000000000..8e31b11622
--- /dev/null
+++ b/macros/luatex/latex/luabidi/doc/luabidi.pdf
Binary files differ
diff --git a/macros/luatex/latex/luabidi/doc/luabidi.tex b/macros/luatex/latex/luabidi/doc/luabidi.tex
new file mode 100644
index 0000000000..3dc17fe720
--- /dev/null
+++ b/macros/luatex/latex/luabidi/doc/luabidi.tex
@@ -0,0 +1,237 @@
+% !TeX spellcheck = en_US
+% !TeX TS-program = lualatex
+\documentclass[11pt]{ltxdoc}
+\usepackage{color}
+\usepackage{xspace,fancyvrb,booktabs}
+\usepackage[neverdecrease]{paralist}
+\definecolor{myblue}{rgb}{0.02,0.04,0.48}
+\definecolor{lightblue}{rgb}{0.61,.8,.8}
+\definecolor{myred}{rgb}{0.65,0.04,0.07}
+\usepackage[
+unicode=true,
+bookmarks=true,
+colorlinks=true,
+linkcolor=myblue,
+urlcolor=myblue,
+citecolor=myblue,
+hyperindex=false,
+hyperfootnotes=false,
+pdftitle={luabidi: Bidirectional typesetting in LuaLaTeX},
+pdfauthor={V Khalighi, A Reutenauer, J Spitzmüller},
+pdfkeywords={luatex, lualatex, multilingual, bidi}
+]{hyperref}
+\usepackage{metalogo}
+%\let\XeTeX\undefined
+%\let\XeLaTeX\undefined
+\usepackage{polyglossia}
+\usepackage{luabidi}
+
+\setmainlanguage{english}
+\usepackage[protrusion]{microtype}
+\newcommand*\Cmd[1]{\cmd{#1}\DescribeMacro{#1}\xspace}
+\newcommand*{\cscmd}[1]{\texttt{\textbackslash #1}}
+\newcommand*\pkg[1]{\textsf{\color{myblue}#1}}
+\newcommand*\file[1]{\texttt{\color{myblue}#1}}
+\newcommand*\TR[1]{\textcolor{myred}{#1}}
+\newcommand*\TX[1]{\hyperref[#1]{\textcolor{myred}{#1}}}
+\newcommand*\TB[1]{\textcolor{myblue}{\bf #1}}
+\newcommand*\TA[1]{\textsc{\color{myblue}#1}}
+\newcommand*\link[1]{\href{#1}{#1}}
+\def\eg{\textit{e.g.,}\xspace}
+\def\ie{\textit{i.e.,}\xspace}
+\def\ca{\textit{ca.}\@\xspace}
+\def\Eg{\textit{E.g.,}\xspace}
+\def\Ie{\textit{I.e.,}\xspace}
+\def\etc{\@ifnextchar.{\textit{etc}}{\textit{etc.}\@\xspace}}
+
+%% Sidenotes << copied from fontspec.dtx
+\newcommand\new[1]{%
+ \edef\thisversion{#1}%
+ \ifhmode\unskip~\fi{\ifx\thisversion\fileversion\color{blue}\else\color[gray]{0.5}\fi
+ $\leftarrow$}%
+ \marginpar{\centering
+ \small\ifx\thisversion\fileversion\color{blue}\else\color[gray]{0.5}\fi
+ \textsf{#1}}}
+\newcommand\displaycmd[2]{%
+ \\\DescribeMacro{#2}\centerline{\cmd{#1}}}
+\renewenvironment{itemize}{\begin{compactitem}[\char"2023]}%[{\fontspec{DejaVu Sans}\char"25BB}]}%
+ {\end{compactitem}}
+
+\def\condbreak#1{%
+ \vskip 0pt plus #1\pagebreak[3]\vskip 0pt plus -#1\relax}
+
+\newcommand*\lbd{\pkg{luabidi}}
+\newcommand*\Lbd{\pkg{Luabidi}}
+
+%% fontspec declarations:
+\setmainfont{Linux Libertine O}
+\setsansfont{Linux Biolinum O}
+\setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono}
+
+\linespread{1.05}
+\frenchspacing
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+% COMMENT THE NEXT LINE TO INCLUDE THE CODE
+\AtBeginDocument{\OnlyDescription}
+
+
+\begin{document}
+\hyphenation{Kha-li-ghi Reu-ten-auer}
+\GetFileInfo{luabidi.sty}
+
+\title{\lbd\\\color{myblue}Bidirectional typesetting in \LuaLaTeX}
+
+\date{\color{myblue}\filedate \qquad \fileversion\\
+ \footnotesize (\textsc{pdf} file generated on \today)}
+
+\author{\TA{Vafa Khalighi} \and \TA{Arthur Reutenauer}\thanks{%
+ Current maintainer. Please submit bug reports and feature requests to \protect\url{https://github.com/bidi-tex/luabidi/issues}.}
+ \and \TA{Jürgen Spitzmüller}}
+
+\maketitle
+
+\DeleteShortVerb{\|}
+\MakeShortVerb{\¦}
+
+\tableofcontents
+
+\condbreak{2\baselineskip}
+\section{Objectives}
+\Lbd\ is an attempt to provide bidirectional writing support for the \LuaTeX\ engine in the same vein as the \pkg{bidi} package\footnote{%
+See \url{https://ctan.org/pkg/bidi}.} enables bidirectional writing with \XeTeX. The most prominent user of this package is \pkg{polyglossia}\footnote{%
+See \url{https://ctan.org/pkg/polyglossia}.} which uses \lbd\ with RTL languages and \LuaTeX\ output (as opposed to \pkg{bidi} with \XeTeX). Note, however, that \lbd\ is much more limited than \textsf{bidi}. Currently, only a very basic
+subset of the latter's features is supported.
+
+\section{Package Options}
+
+\begin{description}
+ \item[\TB{arabmaths}] By default, \lbd\ generates left-to-right maths. If you would like to have right-to-left maths, use this option.
+ \item[\TB{textwidthfootnoterule}] expands the footnote rule to the whole text width.
+ \item[\TB{autofootnoterule}] sets the footnote rule right or left aligned, depending on the direction of the first footnote
+ that follows the rule (\ie that comes on the current page).
+\end{description}
+
+\section{User Commands}
+
+\subsection{Main Text Direction}
+
+By default, the main directionality of the document is left-to-right. To change it to right-to-left, use the switch
+
+\begin{quote}
+ \Cmd\setRTLmain
+\end{quote}
+%
+This is advisable if your document consists mainly of right-to-left text.
+
+\subsection{Paragraph Text Direction}
+
+To change directionality for paragraphs, you can use the following switches:
+\begin{description}
+ \item[\cmd{\setRTL}]\DescribeMacro{\setRTL} (alias: \Cmd{\setRL}, \Cmd{\unsetLTR}) changes paragraph direction to right-to-left.
+ \item[\cmd{\setLTR}]\DescribeMacro{\setLTR} (alias: \Cmd{\setLR}, \Cmd{\unsetRTL}) changes paragraph direction to left-to-right.
+\end{description}
+%
+\condbreak{2\baselineskip}
+Alternatively,\DescribeMacro{RTL}\DescribeMacro{LTR} you can also use the environments
+
+\begin{quote}
+ \begin{verbatim}
+ \begin{RTL}
+ ...
+ \end{RTL}
+ \end{verbatim}
+\end{quote}
+%
+or
+
+\begin{quote}
+ \begin{verbatim}
+ \begin{LTR}
+ ...
+ \end{LTR}
+ \end{verbatim}
+\end{quote}
+
+\subsection{Inline Text Direction}
+
+To change directionality for text chunks inside paragraphs, use
+\begin{description}
+ \item[\cmd\RLE\{...\}]\DescribeMacro{\RLE} (alias: \Cmd\RL) changes the directionality locally to right-to-left.
+ \item[\cmd\LRE\{...\}]\DescribeMacro{\LRE} (alias: \Cmd\LR) changes the directionality locally to left-to-right.
+\end{description}
+
+\subsection{Footnotes}
+
+\subsubsection{Horizontal Footnote Position}
+
+\Lbd\ provides two additional footnote commands in addition to standard \cmd{\footnote}:
+\Cmd{\RTLfootnote}\new{v0.5} and \Cmd{\LTRfootnote}\new{v0.5}.
+The standard \cmd{\footnote} command thereby places the footnote always on the side that is currently the origin of direction:
+on the left side of the page in LTR paragraphs and on the right in RTL paragraphs.
+
+\cmd{\LTRfootnote}, in contrast, always places the footnote on the left side, notwithstanding the current
+directionality. \cmd{\RTLfootnote} always places it on the right side. Like \cmd{\footnote}, \cmd{\RTLfootnote}
+and \cmd{\LTRfootnote} have an optional argument to customize the number.
+
+
+\subsubsection{Footnote Rule Length and Position}
+
+By default, the placement of the footnote rule depends on the main text directionality:
+
+\begin{itemize}
+ \item In default mode (\ie if \cmd{\setRTLmain} is not used), the footnote rule is always set left-aligned (as usual in LTR documents).
+ \item If the main direction is RTL (\ie if \cmd{\setRTLmain} is used), the footnote rule is always set right-aligned (as usual in RTL documents)
+\end{itemize}
+%
+However, with the switch \Cmd{\leftfootnoterule}\new{v0.5}, all subsequent footnote rules are always placed on the left.
+Likewise, \Cmd{\rightfootnoterule}\new{v0.5} causes all subsequent footnote rules to be always placed on the right.
+
+The switch \Cmd{\autofootnoterule}\new{v0.5} and the corresponding package option advise \lbd\ to automatically determine the rule position,
+depending on the directionality of the first footnote on the page. Note that this automatic can fail with footnotes at page boundaries
+that differ in directionality from the first footnote on the page. You can work around such cases by switching to \cmd{\rightfootnoterule}
+or \cmd{\leftfootnoterule} on these pages.
+
+If you want a footnote rule that spans the whole text width, you can use the switch \Cmd{\textwidth\-footnoterule}\new{v0.5}
+or the respective package option.
+
+The length of left and right footnote rules can be adjusted via
+
+\begin{quote}
+ ¦\setlength\footenoterulewidth{⟨length⟩}¦\DescribeMacro{\footenoterulewidth}
+\end{quote}
+%
+The predefined ¦⟨length⟩¦ is ¦0.4\columnwidth¦.
+
+
+
+\section{Commands for Package Authors}
+
+The following tests are provided to be used in packages:
+
+\begin{description}
+ \item[\cscmd{if@RTL}]\DescribeMacro{\if@RTL} determines whether the current paragraph direction is right-to-left.
+ \item[\cscmd{if@RTLmain}]\DescribeMacro{\if@RTLmain} determines whether the main direction is right-to-left.
+\end{description}
+%
+The following macros are provided:
+\begin{description}
+ \item[\cscmd{@ensure@RTL\{...\}}]\DescribeMacro{\@ensure@RTL} Ensure that the argument is typeset RTL.
+ \item[\cscmd{@ensure@LTR\{...\}}]\DescribeMacro{\@ensure@LTR} Ensure that the argument is typeset LTR.
+ \item[\cscmd{@ensure@dir\{...\}}]\DescribeMacro{\@ensure@dir} (alias: \cmd{\@ensure@maindir\{...\}}\DescribeMacro{\@ensure@maindir}) If used in RTL mode, the argument is put inside \cmd{\RLE}, if used in LTR mode, the argument is output as is.
+ \item[\cscmd{hboxR\{...\}}]\DescribeMacro{\hboxR}\new{v0.5} Puts its argument in a RTL \cmd{\hbox}.
+\end{description}
+
+\section{Revision Log}
+
+\begin{description}
+ \item[v. 0.5 (2019/10/27)] Add \cmd{\RTLfootnote}, \cmd{\LTRfootnote}, and \cmd{\hboxR}; fix \texttt{autofootnoterule} option; add \cmd{\autofootnoterule},
+ \cmd{\leftfootnoterule}, \cmd{\rightfootnoterule} and \cmd{\textwidthfootnoterule}; add manual.
+ \item[v. 0.4 (2019/08/24)] Fix \cmd{\@ensure@RTL}.
+ \item[v. 0.3 (2019/07/10)] Fix compatibility with recent \LuaTeX\ (this version was never released to CTAN).
+ \item[v. 0.2 (2013/05/27)] Fix additional files.
+ \item[v. 0.1 (2009/04/01)] Initial release.
+\end{description}
+
+\end{document}
diff --git a/macros/luatex/latex/luabidi/tex/arabmaths.tex b/macros/luatex/latex/luabidi/tex/arabmaths.tex
deleted file mode 100644
index e125dce795..0000000000
--- a/macros/luatex/latex/luabidi/tex/arabmaths.tex
+++ /dev/null
@@ -1,2 +0,0 @@
-\mathdir TRT
-\def\@eqnnum{{\normalfont \normalcolor \textdir TLT ({\textdir TRT\theequation})}}
diff --git a/macros/luatex/latex/luabidi/tex/autofootnoterule.tex b/macros/luatex/latex/luabidi/tex/autofootnoterule.tex
deleted file mode 100644
index f770694652..0000000000
--- a/macros/luatex/latex/luabidi/tex/autofootnoterule.tex
+++ /dev/null
@@ -1,116 +0,0 @@
-\ifx \CatEscape\undefined
- \chardef\CatEscape=0
- \chardef\CatOpen=1
- \chardef\CatClose=2
- \chardef\CatIgnore=9
- \chardef\CatLetter=11
- \chardef\CatOther=12
- \chardef\CatActive=13 % is defined in Plain already
-
- \chardef\CatUsCode=\catcode`\_
-\fi
-
-\catcode`\_=\CatLetter % top level macro file
-
-
-\def\l@fn{%
- \hbox to \columnwidth
- {\pagedir TLT\vbox{\kern -3\p@
- \hrule width .4\columnwidth \kern2.6\p@}\hfil}}
-\def\r@fn{%
- \hrule width .4\columnwidth\kern 2.6\p@}
-
-
-\def\@makefnmark{\hbox{$^{\hbox{\scriptsize\@thefnmark}}\m@th$}}
-
-
-\def\leftfootnoterule{\global\def\footnoterule{\l@fn}}
-\def\rightfootnoterule{\global\def\footnoterule{\r@fn}}
-\leftfootnoterule
-
-%%% \beginprog
-\newread\old_foot_file
-\newwrite\foot_file
-\def\foot_file_name{\jobname.fot\relax}
-\def\init_footnote{%
- \openin\old_foot_file\foot_file_name
- \ifeof\old_foot_file \closein\old_foot_file
- \else \closein\old_foot_file
- \read_foot_file
- \fi
- \immediate\openout\foot_file\foot_file_name
- \immediate\write\foot_file{\relax}%
- \global\let\init_footnote\relax
- }
-
-\newcount\foot_name_no % for generating footnote mark names
-
-
-
-
-
-\newcount\autofootnote
-\def\fnpp_next_footnote{%
- \init_footnote
- \global\advance\foot_name_no\@ne
- \global\advance\c@footnote\@ne
- \edef\do_write{%
- \immediate\write\foot_file{%
- \string\advance\autofootnote\@ne
- \string\expandafter\xdef
- \string\csname\space f@\number\foot_name_no \endcsname{%
- \string\number\autofootnote
- }%
- }%
- }%
- \do_write
- \global\autofootnote 0\csname f@\number\foot_name_no \endcsname \relax
- }
-
-\def\read_foot_file{%
- \begingroup
- \catcode`\@\CatLetter \catcode`\^^M\CatIgnore
- \input \foot_file_name
- \endgroup
- }
-
-\let\fnpp_orig_outputpage=\@outputpage
-\def\@outputpage{%
- \ifx \init_footnote\relax
- \immediate\write\foot_file{\autofootnote\z@}%
- \fi
- \fnpp_orig_outputpage
- }
-
-\let\FnppOrigFootnote=\footnote % save original bindings
-\let\FnppOrigFootnotemark=\footnotemark
-
-\def\footnote{%
- \@ifnextchar[% % ] (Emacs)
- \@xfootnote
- {\fnpp_next_footnote \ifnum\autofootnote=1\rightfootnoterule\fi \@xfootnote[\the\c@footnote] %
-}%
- }
-\def\footnotemark{%
- \@ifnextchar[% % ] (Emacs)
- \@xfootnotemark
- {\fnpp_next_footnote \ifnum\autofootnote=1\rightfootnoterule\fi \@xfootnotemark[\the\c@footnote]}%
- }
-
-
-
-
-\def\footnotemarkLR{%
- \@ifnextchar[% % ] (Emacs)
- \@xfootnotemark
- {\fnpp_next_footnote \ifnum\autofootnote=1\leftfootnoterule\fi\@xfootnotemark[\the\c@footnote]}%
- }
-
-
-\def\Footnote#1{%
-\begingroup
-\footnotemarkLR%
-\renewcommand{\thefootnote}{\@arabic\c@footnote}%
-\pardir TLT \textdir TLT\footnotetext{#1}%
-\endgroup
-}
diff --git a/macros/luatex/latex/luabidi/tex/luabidi-arabmaths.def b/macros/luatex/latex/luabidi/tex/luabidi-arabmaths.def
new file mode 100644
index 0000000000..8e2eaf3028
--- /dev/null
+++ b/macros/luatex/latex/luabidi/tex/luabidi-arabmaths.def
@@ -0,0 +1,11 @@
+%% This file is luabidi-arabmaths.def
+%% This is part of the luabidi package
+%%
+%% Copyright © 2009 Vafa Khalighi, 2013--2019 Arthur Reutenauer, 2019 Jürgen Spitzmüller
+%%
+%%%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+
+\mathdir TRT
+\def\@eqnnum{{\normalfont \normalcolor \textdir TLT ({\textdir TRT\theequation})}}
diff --git a/macros/luatex/latex/luabidi/tex/luabidi-autofootnoterule.def b/macros/luatex/latex/luabidi/tex/luabidi-autofootnoterule.def
new file mode 100644
index 0000000000..a9f0cbe21f
--- /dev/null
+++ b/macros/luatex/latex/luabidi/tex/luabidi-autofootnoterule.def
@@ -0,0 +1,72 @@
+%% This file is luabidi-autofootnoterule.def
+%% This is part of the luabidi package
+%%
+%% Copyright © 2009 Vafa Khalighi, 2013--2019 Arthur Reutenauer, 2019 Jürgen Spitzmüller
+%%
+%%%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+
+
+%
+% Determine first footnote on current page
+%
+
+\RequirePackage{perpage}
+\newcounter{pagefnt}
+\setcounter{pagefnt}{0}
+\MakePerPage[0]{pagefnt}
+
+
+%
+% Footnote redefinitions
+%
+
+% Save original definitions
+\let\FnppOrigFootnote=\footnote
+\let\FnppOrigFootnotemark=\footnotemark
+
+% Default: left-aligned rule
+\leftfootnoterule
+
+% \footnote
+\def\footnote{%
+ \@ifnextchar[% % ] (Editor)
+ \@xfootnote
+ {\stepcounter\@mpfn\stepcounter{pagefnt}%
+ \ifnum\value{pagefnt}=0%
+ \if@RTL%
+ \rightfootnoterule%
+ \else%
+ \leftfootnoterule%
+ \fi%
+ \fi%
+ \@xfootnote[\the\c@footnote]%
+ }%
+}
+
+% \RTLfootnote
+\def\footnotemarkRL{%
+ \@ifnextchar[% % ] (Editor)
+ \@xfootnotemark
+ {\stepcounter\@mpfn\stepcounter{pagefnt}%
+ \ifnum\value{pagefnt}=0%
+ \rightfootnoterule%
+ \fi%
+ \@xfootnotemark[\the\c@footnote]%
+ }%
+}
+
+% \LTRfootnote
+\def\footnotemarkLR{%
+ \@ifnextchar[% % ] (Editor)
+ \@xfootnotemark
+ {\stepcounter\@mpfn\stepcounter{pagefnt}%
+ \ifnum\value{pagefnt}=0%
+ \leftfootnoterule%
+ \fi%
+ \@xfootnotemark[\the\c@footnote]%
+ }%
+}
+
+% Finis
diff --git a/macros/luatex/latex/luabidi/tex/luabidi-footnotes.def b/macros/luatex/latex/luabidi/tex/luabidi-footnotes.def
new file mode 100644
index 0000000000..db185e2578
--- /dev/null
+++ b/macros/luatex/latex/luabidi/tex/luabidi-footnotes.def
@@ -0,0 +1,76 @@
+%% This file is luabidi-footnotes.def
+%% This is part of the luabidi package
+%%
+%% Copyright © 2009 Vafa Khalighi, 2013--2019 Arthur Reutenauer, 2019 Jürgen Spitzmüller
+%%
+%%%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+
+%
+% Footnotes
+%
+
+% These are defined in polyglossia. Provide simple fallbacks
+\providecommand*\localnumeral{\@ifstar\@@localnumeral\@localnumeral}
+
+\providecommand*\@localnumeral[1]{#1}
+\providecommand*\@@localnumeral[1]{%
+ \protect\@arabic\csuse{c@#1}%
+}
+
+\let\footnotemarkLR\footnotemark
+\let\footnotemarkRL\footnotemark
+
+\providecommand\LTRfootnote[2][]{%
+ \begingroup
+ \ifx#1\\\\\footnotemarkLR
+ \renewcommand{\thefootnote}{\localnumeral*{footnote}}%
+ \else%
+ \footnotemarkLR[#1]%
+ \renewcommand{\thefootnote}{\localnumeral{#1}}%
+ \fi
+ \pardir TLT \textdir TLT\footnotetext{#2}%
+ \endgroup
+}
+
+\providecommand\RTLfootnote[2][]{%
+ \begingroup
+ \ifx#1\\\\\footnotemarkRL%
+ \renewcommand{\thefootnote}{\localnumeral*{footnote}}%
+ \else%
+ \footnotemarkRL[#1]%
+ \renewcommand{\thefootnote}{\localnumeral{#1}}%
+ \fi
+ \pardir TRT \textdir TRT\footnotetext{#2}%
+ \endgroup
+}
+
+% backwards compatibility
+\def\Footnote#1{\LTRfootnote{#1}}
+
+%
+% Footnote rules
+%
+
+% adjustable rule length
+\newlength\footnoterulewidth
+\setlength\footnoterulewidth{.4\columnwidth}
+
+% The left, right and full width rules
+\def\luabidi@left@fn{%
+ \hbox to \columnwidth
+ {\pagedir TLT\textdir TLT\vbox{\kern -3\p@
+ \hrule\@width\footnoterulewidth\kern2.6\p@}\hfil}}
+\def\luabidi@right@fn{%
+ \pagedir TRT\textdir TRT\hrule\@width\footnoterulewidth\kern2.6\p@}
+\def\luabidi@textwidth@fn{%
+ \kern-3\p@\hrule\@width\textwidth\kern2.6\p@}
+
+% switches for the rule position
+\def\leftfootnoterule{\global\def\footnoterule{\luabidi@left@fn}}
+\def\rightfootnoterule{\global\def\footnoterule{\luabidi@right@fn}}
+\def\textwidthfootnoterule{\global\def\footnoterule{\luabidi@textwidth@fn}}
+\def\autofootnoterule{\luabidi@autofootnoteruletrue}
+
+% Finis
diff --git a/macros/luatex/latex/luabidi/tex/luabidi.sty b/macros/luatex/latex/luabidi/tex/luabidi.sty
index abc1d2a936..4277a1f173 100644
--- a/macros/luatex/latex/luabidi/tex/luabidi.sty
+++ b/macros/luatex/latex/luabidi/tex/luabidi.sty
@@ -1,4 +1,5 @@
%% This file is luabidi.sty
+%% This is part of the luabidi package
%%
%% Copyright © 2009 Vafa Khalighi, 2013--2019 Arthur Reutenauer, 2019 Jürgen Spitzmüller
%%
@@ -6,11 +7,30 @@
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luabidi}[2019/08/24 v0.4
+\ProvidesPackage{luabidi}[2019/10/27 v0.5
Bidirectional typesetting in LuaTeX]
+
+\RequirePackage{etoolbox}
+
+%
+% Package options
+%
+
+\DeclareOption{arabmaths}{\input{luabidi-arabmaths.def}}
+\newif\ifluabidi@autofootnoterule
+\DeclareOption{autofootnoterule}{\luabidi@autofootnoteruletrue}
+\newif\ifluabidi@textwidthfootnoterule
+\DeclareOption{textwidthfootnoterule}{\luabidi@textwidthfootnoteruletrue}
+\ProcessOptions
+
+%
+% General command and switches
+%
+
\newif\if@RTL
\newif\if@RTLmain
-\def\setRTLmain{\pagedir TRT \bodydir TRT \pardir TRT \textdir TRT}
+\@RTLmainfalse
+\def\setRTLmain{\@RTLmaintrue\pagedir TRT \bodydir TRT \pardir TRT \textdir TRT}
\def\setRTL{\@RTLtrue\pardir TRT \textdir TRT}
\let\setRL=\setRTL
\def\setLTR{\@RTLfalse\pardir TLT \textdir TLT}
@@ -25,9 +45,6 @@
\def\@ensure@LTR#1{\if@RTL\LRE{#1}\else{#1}\fi}
\def\@ensure@dir#1{\if@RTL\RLE{#1}\else{#1}\fi}
\let\@ensure@maindir=\@ensuredir
-\@RTLmainfalse
-\DeclareOption{arabmaths}{\input{arabmaths}}
-\DeclareOption{textwidthfootnoterule}{\input{textwidthfootnoterule}}
\let\n@xt=\
\DeclareRobustCommand*\LRE{\protect\pLRE}
\def\pLRE{\protect\afterassignment\moreLRE \let\n@xt= }
@@ -39,18 +56,25 @@
\def\moreRLE{\bracetext \aftergroup\unsetRTL \setRTL\@RTLtrue}
\let\LR=\LRE
\let\RL=\RLE
+\def\hboxR#1{\hbox{\RL{#1}}}
-\def\Footnote#1{%
-\begingroup
-\footnotemark
-\renewcommand{\thefootnote}{\@arabic\c@footnote}%
-\pardir TLT \textdir TLT\footnotetext{#1}%
-\endgroup
-}
+%
+% Footnotes
+%
-\DeclareOption{autofootnoterule}{\input{autofootnoterule}}
+\input{luabidi-footnotes.def}
+\ifluabidi@textwidthfootnoterule
+ \textwidthfootnoterule
+\fi
+% This needs to be loaded late because of the switch
+\AtEndPreamble{%
+ \makeatletter
+ \ifluabidi@autofootnoterule
+ \input{luabidi-autofootnoterule.def}
+ \fi
+ \makeatother
+}
-\ProcessOptions
\endinput
diff --git a/macros/luatex/latex/luabidi/tex/textwidthfootnoterule.tex b/macros/luatex/latex/luabidi/tex/textwidthfootnoterule.tex
deleted file mode 100644
index 7fc71e0cef..0000000000
--- a/macros/luatex/latex/luabidi/tex/textwidthfootnoterule.tex
+++ /dev/null
@@ -1,2 +0,0 @@
-\def\footnoterule{\kern-3\p@
- \hrule \@width \textwidth \kern 2.6\p@}