summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-10-28 20:58:49 +0000
committerKarl Berry <karl@freefriends.org>2019-10-28 20:58:49 +0000
commitffd652038baef26fb84de26fce9991a02e875485 (patch)
treec02e3f8fde2e20bb8ba3cc9ab3216e609648e350 /Master/texmf-dist
parentcffa8e2910c5d2a7b6b26032eef37d9e18b8b72d (diff)
polyglossia (28oct19)
git-svn-id: svn://tug.org/texlive/trunk@52555 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/README16
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdfbin84111 -> 83198 bytes
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/example-korean.pdfbin29051 -> 17171 bytes
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/example-thai.pdfbin23283 -> 23360 bytes
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/examples.pdfbin168191 -> 151791 bytes
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdfbin133958 -> 184844 bytes
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex1128
-rw-r--r--Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx7229
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/babel-hebrewalph.def25
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/cyrillicnumbers.sty119
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-albanian.ldf1
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf45
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-armenian.ldf178
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-asturian.ldf1
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-bahasai.ldf45
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-bahasam.ldf55
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-basque.ldf1
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf31
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-brazil.ldf47
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-breton.ldf1
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-bulgarian.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-catalan.ldf7
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-classiclatin.ldf157
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf181
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-danish.ldf6
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-divehi.ldf13
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf6
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf166
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-esperanto.ldf3
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-estonian.ldf1
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf129
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf47
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf172
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-friulan.ldf66
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-friulian.ldf66
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf107
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-galician.ldf1
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf149
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-greek.ldf137
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf49
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf32
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf81
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-icelandic.ldf1
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-interlingua.ldf1
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-irish.ldf42
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-italian.ldf6
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-kannada.ldf9
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-khmer.ldf17
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf606
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf384
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-lao.ldf7
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-latex.ldf33
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf6
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-latvian.ldf1
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-lithuanian.ldf18
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-liturgicallatin.ldf185
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-lsorbian.ldf47
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-macedonian.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-magyar.ldf72
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf171
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf9
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf194
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-nko.ldf48
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-norsk.ldf42
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf104
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-nynorsk.ldf40
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf8
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf151
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-piedmontese.ldf6
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-polish.ldf1
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-portuges.ldf49
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf103
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-romanian.ldf1
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-romansh.ldf1
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf148
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf84
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-samin.ldf49
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf99
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-scottish.ldf42
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf112
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf1
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-slovenian.ldf6
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf166
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf1
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-swedish.ldf1
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-syriac.ldf75
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-thai.ldf15
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-tibetan.ldf18
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf7
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-urdu.ldf40
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-usorbian.ldf48
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf8
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/hebrewcal.sty17
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/polyglossia-frpt.lua16
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/polyglossia-korean.lua603
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua83
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty1801
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/xgreek-fixes.def19
99 files changed, 11079 insertions, 5247 deletions
diff --git a/Master/texmf-dist/doc/latex/polyglossia/README b/Master/texmf-dist/doc/latex/polyglossia/README
index bd15b9aa5dd..531780f8cb1 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/README
+++ b/Master/texmf-dist/doc/latex/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/Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdf b/Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdf
index a40c2f6773e..d73e6263bea 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdf
+++ b/Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/polyglossia/example-korean.pdf b/Master/texmf-dist/doc/latex/polyglossia/example-korean.pdf
index 86e7dd72409..d4fe0ac6935 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/example-korean.pdf
+++ b/Master/texmf-dist/doc/latex/polyglossia/example-korean.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/polyglossia/example-thai.pdf b/Master/texmf-dist/doc/latex/polyglossia/example-thai.pdf
index cfc66a8fb24..5a93b57b50d 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/example-thai.pdf
+++ b/Master/texmf-dist/doc/latex/polyglossia/example-thai.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/polyglossia/examples.pdf b/Master/texmf-dist/doc/latex/polyglossia/examples.pdf
index 69a9d742488..b7565cf400a 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/examples.pdf
+++ b/Master/texmf-dist/doc/latex/polyglossia/examples.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdf b/Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdf
index a276007b8e3..0da109cf9d3 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdf
+++ b/Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex b/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex
index 1fafefd7b22..77c48d2d118 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex
+++ b/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex
@@ -1,11 +1,14 @@
+% !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,
@@ -13,8 +16,8 @@
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}
@@ -23,7 +26,7 @@
\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}}
@@ -31,6 +34,7 @@
\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}
@@ -52,12 +56,25 @@
\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}
@@ -68,14 +85,17 @@
\RecordChanges
% COMMENT THE NEXT LINE TO INCLUDE THE CODE
\AtBeginDocument{\OnlyDescription}
+
+
\begin{document}
-\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)}
@@ -93,8 +113,8 @@
\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:
@@ -126,42 +146,38 @@ with the fundamental features of \pkg{babel} while being cleaner, light-weight,
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!
-%As with \pkg{babel}, \pkg{polyglossia} also allows you to load language definition files
-%as package options. In most cases, option \texttt{⟨lang⟩} will load the file
-%\file{gloss-⟨lang⟩.ldf}. Note however that the \textit{first} language listed in \\
-%\centerline{\cmd{\usepackage[lang1,lang2,…]{polyglossia}}}
-%will be the default language for the document, which
-%is the opposite convention of \pkg{babel}.
-%Note also that this method may not work in some cases, and should be
-%considered 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}
@@ -169,69 +185,156 @@ Table~\ref{tab:lang} lists all languages currently supported.
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}
-% Produced with tools/insert-language-list.rb -- AR, 2015-07-14
-% Edited by hand -- AR 2019-04-04
+% Produced with tools/insert-language-list.rb -- JS, 2019-10-18
+% 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.}
%
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}:
@@ -252,9 +355,30 @@ of Homer’s \textit{Iliad}:
\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}
+%
+¦\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
@@ -268,19 +392,14 @@ ought to be mentioned here.
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}
-%
-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}
@@ -307,14 +426,35 @@ the font, by means of \pkg{fontspec}’s \cmd\addfontfeature. If the current fon
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}
+%
+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}
@@ -324,7 +464,7 @@ The default value of each option is given in italic.
%\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{ %
@@ -339,7 +479,7 @@ The default value of each option is given in italic.
\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}
@@ -347,8 +487,15 @@ The default value of each option is given in italic.
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
@@ -356,70 +503,129 @@ The default value of each option is given in italic.
\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.
@@ -434,39 +640,43 @@ The default value of each option is given in italic.
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
@@ -477,133 +687,274 @@ The default value of each option is given in italic.
\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.
-\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{lao}\label{lao}\new{v1.2.0}
-\textbf{Options}:
+ 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]{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]{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}
+%
+\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.
+% These are commented out in gloss-russian
+% \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{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}:
+%
+\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.
- %TODO \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.
+%
+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¦
@@ -611,80 +962,229 @@ that comes with this package.
\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}
+%
+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}
+%
+Note that this needs to be done after the respective language has been loaded with
+¦\setmainlanguage¦ or ¦\setotherlanguage¦.
-\section{Non-Western decimal digits}
+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:
-Several scripts have their own versions of the decimal digits commonly called
-‘Arabic numerals’. With the appropriate language option set, \pkg{polyglossia}
+\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}
+%
+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}
+%
+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{Script-specific numbering}
+
+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}.}
- %% \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}
+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.
-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}}.
+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}
\subsection{Hebrew calendar (hebrewcal.sty)}
@@ -706,8 +1206,7 @@ sets the counters ¦Hijriday¦, ¦Hijrimonth¦ and ¦Hijriyear¦.
\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
@@ -736,38 +1235,69 @@ Example: today is \Jalalitoday.
%\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}
+%
+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}
+%
+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!
\end{document}
diff --git a/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx b/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx
index f86b06f6d59..ee43f033825 100644
--- a/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx
+++ b/Master/texmf-dist/source/latex/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}}}}
-
-\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}}%
-}
+ \farsinumber{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\farsinumber{\value{Hijriyear}}}}
-\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}
+\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\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
-\def\captionsfriulan{%
+% \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\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}%
@@ -5044,162 +6063,163 @@ and may look very wrong.}
%
% \subsection{gloss-khmer.ldf}
% \begin{macrocode}
-\ProvidesFile{gloss-khmer.ldf}[polyglossia: module for Khmer]
-\PolyglossiaSetup{khmer}{
- script=Khmer,%
- scripttag=khmr,%
- langtag=KHM,%
- hyphennames={nohyphenation},%
- fontsetup=true%
-}
-\newif\if@khmer@numerals
-\def\tmp@khmer{khmer}
-\define@key{khmer}{numerals}[arabic]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@khmer\@khmer@numeralstrue%
- \else\@khmer@numeralsfalse\fi%
-}
-\setkeys{khmer}{numerals}
-\def\captionskhmer{%
- \def\prefacename{អារម្ភកថា}%
- \def\refname{ឯកសារយោង}%
- \def\abstractname{សង្ខេប}%
- \def\bibname{គន្ថនិទ្ទេស}%
- \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{ចម្លងជួន}%
- \def\headtoname{ផ្ញើរទៅ}%
- \def\proofname{សម្រាយ}%
- \def\glossaryname{សទានុក្រម}%
-}
-\def\datekhmer{%
- \def\khmer@month{%
- \ifcase\month\or%
- មករា\or%
- កុម្ភៈ\or%
- មិនា\or%
- មេសា\or%
- ឧសភា\or%
- មិថុនា\or%
- កក្កដា\or%
- សីហា\or%
- កញ្ញា\or%
- តុលា\or%
- វិច្ឆិកា\or%
- ធ្នូ\fi}%
- \def\today{\khmernumber\day\space\khmer@month\space\khmernumber\year}%
-}
-\def\khmerdigits#1{\expandafter\@khmer@digits #1@}
-\def\@khmer@digits#1{%
- \ifx @#1% then terminate
- \else\ifx0#1០%
- \else\ifx1#1១%
- \else\ifx2#1២%
- \else\ifx3#1៣%
- \else\ifx4#1៤%
- \else\ifx5#1៥%
- \else\ifx6#1៦%
- \else\ifx7#1៧%
- \else\ifx8#1៨%
- \else\ifx9#1៩%
- \else#1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \expandafter\@khmer@digits%
- \fi
-}
-\def\khmernumber#1{%
- \if@khmer@numerals%
- \khmerdigits{\number#1}%
- \else%
- \number#1%
- \fi}
-\def\khmer@globalnumbers{%
- \let\orig@arabic\@arabic%
- \let\@arabic\khmernumber%
- \renewcommand{\thefootnote}{\protect\khmernumber{\c@footnote}}%
-}
-\def\nokhmer@globalnumbers{%
- \let\@arabic\orig@arabic%
- \renewcommand\thefootnote{\protect\number{\c@footnote}}%
-}
-\def\thepart{\arabic{part}}
-\def\@khmeralph#1{%
-\ifcase#1%
-\or ក\or ខ\or គ\or ឃ\or ង%
-\or ច\or ឆ\or ជ\or ឈ\or ញ%
-\or ដ\or ឋ\or ឌ\or ឍ\or ណ%
-\or ត\or ថ\or ទ\or ធ\or ន%
-\or ប\or ផ\or ព\or ភ\or ម%
-\or យ\or រ\or ល\or វ\or ស\or ហ\or ឡ\or អ%
-\else\xpg@ill@value{#1}{@khmeralph}\fi}
-\def\khmerAlph#1{\expandafter\@khmerAlph\csname c@#1\endcsname}
-\def\@khmerAlph#1{%
-\ifcase#1%
-\or ក\or ខ\or គ\or ឃ\or ង%
-\or ច\or ឆ\or ជ\or ឈ\or ញ%
-\or ដ\or ឋ\or ឌ\or ឍ\or ណ%
-\or ត\or ថ\or ទ\or ធ\or ន%
-\or ប\or ផ\or ព\or ភ\or ម%
-\or យ\or រ\or ល\or វ\or ស\or ហ\or ឡ\or អ%
-\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%
-}
-\def\blockextras@khmer{%
- \XeTeXlinebreaklocale "kh" %
- \XeTeXlinebreakskip = 0pt plus 1pt minus 1pt
-% \let\orig@baselinestretch\baselinestretch%
-% \renewcommand{\baselinestretch}{1.2}% not work
-}
-\def\noblockextras@khmer{%
- \XeTeXlinebreaklocale "en"%
-% \let\baselinestretch\orig@baselinestretch%
-}
-\@ifclassloaded{beamer}{%
- \usefonttheme{professionalfonts}%
- \def\factname{ស្វ័យសត្យ}%
- \def\lemmaname{បទគន្លិះ}%
- \def\theoremname{ទ្រឹស្ដីបទ}%
- \def\corollaryname{អនុសាធ្យ}%
- \def\problemname{ចំណោទ}%
- \def\solutionname{ដំណោះស្រាយ}%
- \def\definitionname{និយមន័យ}%
- \def\examplename{ឧទាហរណ៏}%
- \uselanguage{khmer}%
- \languagepath{khmer}%
- \deftranslation[to=khmer]{Fact}{\factname}%
- \deftranslation[to=khmer]{Lemma}{\lemmaname}%
- \deftranslation[to=khmer]{Theorem}{\theoremname}%
- \deftranslation[to=khmer]{Corollary}{\corollaryname}%
- \deftranslation[to=khmer]{Problem}{\problemname}%
- \deftranslation[to=khmer]{Solution}{\solutionname}%
- \deftranslation[to=khmer]{Definition}{\definitionname}%
- \deftranslation[to=khmer]{Definitions}{\definitionname}%
- \deftranslation[to=khmer]{Example}{\examplename}%
- \deftranslation[to=khmer]{Examples}{\examplename}%
- \AtEndDocument{\immediate\write\@auxout{\string\@writefile{nav}%
- {\noexpand\headcommand{\noexpand\def\noexpand%
- \inserttotalframenumber{\khmernumber{\the\c@framenumber}}}}}}%
-}{}
+\ProvidesFile{gloss-khmer.ldf}[polyglossia: module for Khmer]
+\PolyglossiaSetup{khmer}{
+ script=Khmer,%
+ scripttag=khmr,%
+ langtag=KHM,%
+ hyphennames={nohyphenation},%
+ fontsetup=true,%
+ localnumeral=khmernumerals%
+}
+\newif\if@khmer@numerals
+\def\tmp@khmer{khmer}
+\define@key{khmer}{numerals}[arabic]{%
+ \def\@tmpa{#1}%
+ \ifx\@tmpa\tmp@khmer\@khmer@numeralstrue%
+ \else\@khmer@numeralsfalse\fi%
+}
+\setkeys{khmer}{numerals}
+\def\captionskhmer{%
+ \def\prefacename{អារម្ភកថា}%
+ \def\refname{ឯកសារយោង}%
+ \def\abstractname{សង្ខេប}%
+ \def\bibname{គន្ថនិទ្ទេស}%
+ \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{ចម្លងជួន}%
+ \def\headtoname{ផ្ញើរទៅ}%
+ \def\proofname{សម្រាយ}%
+ \def\glossaryname{សទានុក្រម}%
+}
+\def\datekhmer{%
+ \def\khmer@month{%
+ \ifcase\month\or%
+ មករា\or%
+ កុម្ភៈ\or%
+ មិនា\or%
+ មេសា\or%
+ ឧសភា\or%
+ មិថុនា\or%
+ កក្កដា\or%
+ សីហា\or%
+ កញ្ញា\or%
+ តុលា\or%
+ វិច្ឆិកា\or%
+ ធ្នូ\fi}%
+ \def\today{\khmernumber\day\space\khmer@month\space\khmernumber\year}%
+}
+\def\khmerdigits#1{\expandafter\@khmer@digits #1@}
+\def\@khmer@digits#1{%
+ \ifx @#1% then terminate
+ \else\ifx0#1០%
+ \else\ifx1#1១%
+ \else\ifx2#1២%
+ \else\ifx3#1៣%
+ \else\ifx4#1៤%
+ \else\ifx5#1៥%
+ \else\ifx6#1៦%
+ \else\ifx7#1៧%
+ \else\ifx8#1៨%
+ \else\ifx9#1៩%
+ \else#1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \expandafter\@khmer@digits%
+ \fi
+}
+
+\newcommand{\khmernumerals}[2]{\khmernumber{#2}}
+
+\def\khmernumber#1{%
+ \if@khmer@numerals%
+ \khmerdigits{\number#1}%
+ \else%
+ \number#1%
+ \fi}
+\def\khmer@globalnumbers{%
+ \let\orig@arabic\@arabic%
+ \let\@arabic\khmernumber%
+ \renewcommand{\thefootnote}{\localnumeral*{footnote}}%
+}
+\def\nokhmer@globalnumbers{%
+ \let\@arabic\orig@arabic%
+}
+\def\thepart{\arabic{part}}
+\def\@khmeralph#1{%
+\ifcase#1%
+\or ក\or ខ\or គ\or ឃ\or ង%
+\or ច\or ឆ\or ជ\or ឈ\or ញ%
+\or ដ\or ឋ\or ឌ\or ឍ\or ណ%
+\or ត\or ថ\or ទ\or ធ\or ន%
+\or ប\or ផ\or ព\or ភ\or ម%
+\or យ\or រ\or ល\or វ\or ស\or ហ\or ឡ\or អ%
+\else\xpg@ill@value{#1}{@khmeralph}\fi}
+\def\khmerAlph#1{\expandafter\@khmerAlph\csname c@#1\endcsname}
+\def\@khmerAlph#1{%
+\ifcase#1%
+\or ក\or ខ\or គ\or ឃ\or ង%
+\or ច\or ឆ\or ជ\or ឈ\or ញ%
+\or ដ\or ឋ\or ឌ\or ឍ\or ណ%
+\or ត\or ថ\or ទ\or ធ\or ន%
+\or ប\or ផ\or ព\or ភ\or ម%
+\or យ\or រ\or ល\or វ\or ស\or ហ\or ឡ\or អ%
+\else\xpg@ill@value{#1}{@khmeralph}\fi}
+\def\khmer@numbers{%
+ \if@khmer@numerals
+ \let\@alph\@khmeralph%
+ \let\@Alph\@khmerAlph%
+ \fi%
+}
+\def\nokhmer@numbers{%
+ \let\@alph\latin@alph%
+ \let\@Alph\latin@Alph%
+}
+\def\blockextras@khmer{%
+ \XeTeXlinebreaklocale "kh" %
+ \XeTeXlinebreakskip = 0pt plus 1pt minus 1pt
+% \let\orig@baselinestretch\baselinestretch%
+% \renewcommand{\baselinestretch}{1.2}% not work
+}
+\def\noblockextras@khmer{%
+ \XeTeXlinebreaklocale "en"%
+% \let\baselinestretch\orig@baselinestretch%
+}
+\@ifclassloaded{beamer}{%
+ \usefonttheme{professionalfonts}%
+ \def\factname{ស្វ័យសត្យ}%
+ \def\lemmaname{បទគន្លិះ}%
+ \def\theoremname{ទ្រឹស្ដីបទ}%
+ \def\corollaryname{អនុសាធ្យ}%
+ \def\problemname{ចំណោទ}%
+ \def\solutionname{ដំណោះស្រាយ}%
+ \def\definitionname{និយមន័យ}%
+ \def\examplename{ឧទាហរណ៏}%
+ \uselanguage{khmer}%
+ \languagepath{khmer}%
+ \deftranslation[to=khmer]{Fact}{\factname}%
+ \deftranslation[to=khmer]{Lemma}{\lemmaname}%
+ \deftranslation[to=khmer]{Theorem}{\theoremname}%
+ \deftranslation[to=khmer]{Corollary}{\corollaryname}%
+ \deftranslation[to=khmer]{Problem}{\problemname}%
+ \deftranslation[to=khmer]{Solution}{\solutionname}%
+ \deftranslation[to=khmer]{Definition}{\definitionname}%
+ \deftranslation[to=khmer]{Definitions}{\definitionname}%
+ \deftranslation[to=khmer]{Example}{\examplename}%
+ \deftranslation[to=khmer]{Examples}{\examplename}%
+ \AtEndDocument{\immediate\write\@auxout{\string\@writefile{nav}%
+ {\noexpand\headcommand{\noexpand\def\noexpand%
+ \inserttotalframenumber{\localnumeral*{framenumber}}}}}}%
+}{}
% \end{macrocode}
% \iffalse
%</gloss-khmer.ldf>
@@ -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\datenorsk{%
+\def\captionsnorwegian{%
+ \csname captionsnorwegian@\norwegian@variant\endcsname%
+}
+
+\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,
}
-\def\captionsportuges{%
+\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\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\dateportuges{%
+\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\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}}
+
+\def\sanskritnumber#1{%
+ \ifsanskrit@devanagari@numerals
+ \devanagaridigits{\number#1}%
+ \else
+ \number#1%
+ \fi%
+}
-\newXeTeXintercharclass\sanskrit@punctthin % ! ? ; : danda double_danda
+% 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/Master/texmf-dist/tex/latex/polyglossia/babel-hebrewalph.def b/Master/texmf-dist/tex/latex/polyglossia/babel-hebrewalph.def
index 3158d7c7a35..b68d98256a1 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/babel-hebrewalph.def
+++ b/Master/texmf-dist/tex/latex/polyglossia/babel-hebrewalph.def
@@ -4,13 +4,22 @@
Adapted from hebrew.ldf (2005/03/30 v2.3h)]
\newif\if@gim@apost % whether we print apostrophes (gereshayim)
\newif\if@gim@final % whether we use final or initial letters
-\newrobustcmd*{\hebrewnumeral}[1] % no apostrophe, no final letters
- {{\@gim@finalfalse\@gim@apostfalse\@hebrew@numeral{#1}}}
-\newrobustcmd*{\Hebrewnumeral}[1] % apostrophe, no final letters
- {{\@gim@finalfalse\@gim@aposttrue\@hebrew@numeral{#1}}}
-\newrobustcmd*{\Hebrewnumeralfinal}[1] % apostrophe, final letters
- {{\@gim@finaltrue\@gim@aposttrue\@hebrew@numeral{#1}}}
-\newcommand*{\@hebrew@numeral}[1]{%
+\newcommand*\hebrewnumeral[1]{%
+ \expandafter\@hebrew@numeral\expandafter{\the\numexpr#1}%
+}
+\newcommand*\Hebrewnumeral[1]{%
+ \expandafter\@Hebrew@numeral\expandafter{\the\numexpr#1}%
+}
+\newcommand*\Hebrewnumeralfinal[1]{%
+ \expandafter\@Hebrew@numeralfinal\expandafter{\the\numexpr#1}%
+}
+\newrobustcmd*{\@hebrew@numeral}[1] % no apostrophe, no final letters
+ {{\@gim@finalfalse\@gim@apostfalse\@hebrew@@numeral{#1}}}
+\newrobustcmd*{\@Hebrew@numeral}[1] % apostrophe, no final letters
+ {{\@gim@finalfalse\@gim@aposttrue\@hebrew@@numeral{#1}}}
+\newrobustcmd*{\@Hebrew@numeralfinal}[1] % apostrophe, final letters
+ {{\@gim@finaltrue\@gim@aposttrue\@hebrew@@numeral{#1}}}
+\newcommand*{\@hebrew@@numeral}[1]{%
\ifnum#1<\z@\space\xpg@warning{Illegal value (#1) for Hebrew numeral}%
\else
\@tempcnta=#1\@tempcntb=#1\relax
@@ -75,5 +84,5 @@
\else#2\if@gim@apost ׳\fi\fi%
\else{\@gim@finalfalse#2}\@gim@prevtrue\fi}
\def\Alphfinal#1{\expandafter\@Alphfinal\csname c@#1\endcsname}%
-\providecommand*{\@Alphfinal}[1]{\protect\Hebrewnumeralfinal{\number#1}}
+\providecommand*{\@Alphfinal}[1]{\Hebrewnumeralfinal{#1}}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/cyrillicnumbers.sty b/Master/texmf-dist/tex/latex/polyglossia/cyrillicnumbers.sty
new file mode 100644
index 00000000000..171ac441568
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/cyrillicnumbers.sty
@@ -0,0 +1,119 @@
+\ProvidesPackage{cyrillicnumbers}
+ [2019/09/13 v0.1 %
+ Formatting of Cyrillic alphabetic numbers]
+
+%% This follows https://en.wikipedia.org/wiki/Cyrillic_numerals
+
+% Numbers are often distinguished from text by centered dots.
+% The commented code does this. We leave it deactivated until
+% we get some expertise.
+\newrobustcmd\cnw@print{}
+\newrobustcmd\cnw@false{%
+ \renewrobustcmd\cnw@print{}}
+\newrobustcmd\cnw@true{%
+% \renewrobustcmd\cnw@print{$\cdot$}%
+}
+\cnw@true
+
+\protected\def\cyr@alph#1{\expandafter\@cyr@alph\expandafter{\number#1}}
+\def\@cyr@alph#1{%
+ \ifnum#1<\@ne\space\cyr@ill@value{#1}%
+ \else
+ \cnw@print
+ \ifnum#1<10\expandafter\cyr@num@i\number#1%
+ \else
+ \ifnum#1<100\expandafter\cyr@num@ii\number#1%
+ \else
+ \ifnum#1<\@m\expandafter\cyr@num@iii\number#1%
+ \else
+ \ifnum#1<\@M\expandafter\cyr@num@iv\number#1%
+ \else
+ \ifnum#1<100000\expandafter\cyr@num@v\number#1%
+ \else
+ \ifnum#1<1000000\expandafter\cyr@num@vi\number#1%
+ \else
+ \space\cyr@ill@value{#1}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+}
+
+\protected\def\cyr@Alph#1{\expandafter\@cyr@Alph\expandafter{\number#1}}
+\def\@cyr@Alph#1{%
+ \ifnum#1<\@ne\space\cyr@ill@value{#1}%
+ \else
+ \cnw@print
+ \ifnum#1<10\expandafter\cyr@Num@i\number#1%
+ \else
+ \ifnum#1<100\expandafter\cyr@Num@ii\number#1%
+ \else
+ \ifnum#1<\@m\expandafter\cyr@Num@iii\number#1%
+ \else
+ \ifnum#1<\@M\expandafter\cyr@Num@iv\number#1%
+ \else
+ \ifnum#1<100000\expandafter\cyr@Num@v\number#1%
+ \else
+ \ifnum#1<1000000\expandafter\cyr@Num@vi\number#1%
+ \else
+ \space\cyr@ill@value{#1}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+}
+
+% Lowercase
+\def\cyr@num@i#1{%
+ \ifcase#1 \or а\or в\or г\or д\or е\or ѕ\or з\or и\or ѳ\fi
+ \ifnum#1=\z@\else\cnw@true\fi\cnw@print}
+\def\cyr@num@ii#1{%
+ \ifcase#1 \or і\or к\or л\or м\or н\or ѯ\or о\or п\or ч\fi
+ \ifnum#1=\z@\else\cnw@true\fi\cyr@num@i}
+\def\cyr@num@iii#1{%
+ \ifcase#1 \or р\or с\or т\or у\or ф\or х\or ѱ\or ѡ\or ц\fi
+ \ifnum#1=\z@\cnw@false\else\cnw@true\fi\cyr@num@ii}
+\def\cyr@num@iv#1{%
+ \ifnum#1=\z@\else ҂\fi
+ \ifcase#1 \or а\or в\or г\or д\or е\or ѕ\or з\or и\or ѳ\fi
+ \cyr@num@iii}
+\def\cyr@num@v#1{%
+ \ifnum#1=\z@\else ҂\fi
+ \ifcase#1 \or і\or к\or л\or м\or н\or ѯ\or о\or п\or ч\fi
+ \cyr@num@iv}
+\def\cyr@Num@vi#1{%
+ \ifnum#1=\z@\else ҂\fi
+ \ifcase#1 \or р\or с\or т\or у\or ф\or х\or ѱ\or ѡ\or ц\fi
+ \cyr@num@v}
+
+% Uppercase
+\def\cyr@Num@i#1{%
+ \ifcase#1 \or А\or В\or Г\or Д\or Е\or Ѕ\or З\or И\or Ѳ\fi
+ \ifnum#1=\z@\else\cnw@true\fi\cnw@print}
+\def\cyr@Num@ii#1{%
+ \ifcase#1 \or І\or К\or Л\or М\or Н\or Ѯ\or О\or П\or Ч\fi
+ \ifnum#1=\z@\else\cnw@true\fi\cyr@Num@i}
+\def\cyr@Num@iii#1{%
+ \ifcase#1 \or Р\or С\or Т\or У\or Ф\or Х\or Ѱ\or Ѡ\or Ц\fi
+ \ifnum#1=\z@\cnw@false\else\cnw@true\fi\cyr@Num@ii}
+\def\cyr@Num@iv#1{%
+ \ifnum#1=\z@\else ҂\fi
+ \ifcase#1 \or А\or В\or Г\or Д\or Е\or Ѕ\or З\or И\or Ѳ\fi
+ \cyr@Num@iii}
+\def\cyr@Num@v#1{%
+ \ifnum#1=\z@\else ҂\fi
+ \ifcase#1 \or І\or К\or Л\or М\or Н\or Ѯ\or О\or П\or Ч\fi
+ \cyr@Num@iv}
+\def\cyr@Num@vi#1{%
+ \ifnum#1=\z@\else ҂\fi
+ \ifcase#1 \or Р\or С\or Т\or У\or Ф\or Х\or Ѱ\or Ѡ\or Ц\fi
+ \cyr@Num@v}
+\def\cyr@ill@value#1{\xpg@warning{Illegal value (#1) for cyr numeral}[$#1$]}
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-albanian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-albanian.ldf
index dcafbad943b..617bdca2755 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-albanian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-albanian.ldf
@@ -2,6 +2,7 @@
\PolyglossiaSetup{albanian}{
hyphennames={albanian},
+ langtag=SQI,
hyphenmins={2,2},
indentfirst=true,
fontsetup=true,
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf
index 72eff1260bb..858719b6a71 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf
@@ -15,9 +15,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
@@ -137,6 +138,9 @@ and may look very wrong.}
\fi%
\fi}}
+
+\newcommand{\arabicnumerals}[2]{\arabicnumber{#2}}
+
\def\arabicnumber#1{%
\ifeastern@numerals
\arabicdigits{\number#1}%
@@ -182,34 +186,39 @@ 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
+}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-armenian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-armenian.ldf
index 2f22748e713..b645a3af818 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-armenian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-armenian.ldf
@@ -6,35 +6,57 @@
langtag=HYE,
hyphennames={armenian},
hyphenmins={2,2},
- fontsetup=true
-}
-
-%\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{%
+ 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\date@western@armenian{%
\def\today{\ifcase\month\or
Յունուար\or
Փետրուար\or
@@ -48,5 +70,101 @@
Հոկտեմբեր\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$]}
+
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-asturian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-asturian.ldf
index b1eb5089331..5c21fde3175 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-asturian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-asturian.ldf
@@ -5,6 +5,7 @@
\PolyglossiaSetup{asturian}{
hyphennames={asturian,catalan},
hyphenmins={2,2},
+ langtag=AST,
frenchspacing=true,
indentfirst=true,
fontsetup=true,
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasai.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasai.ldf
index 28dc408a4ea..aeed3e82ab4 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasai.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasai.ldf
@@ -1,46 +1,21 @@
\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}}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasam.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasam.ldf
index eb5c3749c85..59dce4f9036 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasam.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasam.ldf
@@ -1,54 +1,21 @@
\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}}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-basque.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-basque.ldf
index c6c1d3d1b92..16ee1d3b909 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-basque.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-basque.ldf
@@ -2,6 +2,7 @@
\PolyglossiaSetup{basque}{
hyphennames={basque},
hyphenmins={2,2},
+ langtag=EUQ,
indentfirst=true,
fontsetup=true,
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf
index 31587b0a433..3b2226be3b5 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf
@@ -18,8 +18,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}
@@ -73,7 +73,7 @@ and may look very wrong.}
}
\def\captionsbengali{%
- \def\refname{তথ্যসুত্রসমূহ}%
+ \def\refname{তথ্যসূত্রসমূহ}%
\def\abstractname{সারসংক্ষেপ}%
\def\bibname{তথ্যবিবরণ}%
\def\prefacename{পূর্বকথা}%
@@ -83,8 +83,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{পৃষ্ঠা}%
@@ -99,14 +99,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
@@ -114,6 +114,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}%
@@ -125,8 +127,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}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-brazil.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-brazil.ldf
index 3079e0778d3..9a703e79e08 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-brazil.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-brazil.ldf
@@ -1,40 +1,25 @@
-\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
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-breton.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-breton.ldf
index 5c49542c128..a3d1eee2a12 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-breton.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-breton.ldf
@@ -2,6 +2,7 @@
\PolyglossiaSetup{breton}{
hyphennames={breton},
hyphenmins={2,2},
+ langtag=BRE,
frenchspacing=true,
indentfirst=true,
fontsetup=true,
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bulgarian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bulgarian.ldf
index 4739d9916bf..8f8aef1b727 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bulgarian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bulgarian.ldf
@@ -29,8 +29,6 @@
\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%
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-catalan.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-catalan.ldf
index feba1f98128..6dbd8df9130 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-catalan.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-catalan.ldf
@@ -2,6 +2,7 @@
\PolyglossiaSetup{catalan}{
hyphennames={catalan},
hyphenmins={2,2},
+ langtag=CAT,
frenchspacing=true,
indentfirst=true,
fontsetup=true,
@@ -13,9 +14,11 @@
\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
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-classiclatin.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-classiclatin.ldf
deleted file mode 100644
index 016646a3db2..00000000000
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-classiclatin.ldf
+++ /dev/null
@@ -1,157 +0,0 @@
-%%
-%% 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'.
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf
index 923fc2bb22a..50574e1ddd0 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf
@@ -1,7 +1,9 @@
\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
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf
index 8704aa043be..c4ccb5f869f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf
@@ -1,11 +1,167 @@
\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}%
@@ -29,12 +185,33 @@
\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%
+}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-danish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-danish.ldf
index 282ea8277f6..2de0ae89278 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-danish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-danish.ldf
@@ -2,6 +2,7 @@
\PolyglossiaSetup{danish}{
hyphennames={danish},
hyphenmins={2,3},
+ langtag=DAN,
frenchspacing=true,
fontsetup=true,
}
@@ -25,12 +26,15 @@
\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}
+}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-divehi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-divehi.ldf
index 8685b26c5df..ad5dc56bd4d 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-divehi.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-divehi.ldf
@@ -9,6 +9,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
@@ -40,12 +41,16 @@ 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%
+}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf
index 2633956a9d8..f94a684af92 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf
@@ -2,6 +2,7 @@
\PolyglossiaSetup{dutch}{
hyphennames={dutch},
hyphenmins={2,2},
+ langtag=NLD,
frenchspacing=true,
fontsetup=true,
}
@@ -15,8 +16,9 @@
\fi
\ifcsundef{initiate@active@char}{%
-\input{babelsh.def}%
-\initiate@active@char{"}%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
}{}
\def\dutch@shorthands{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf
index b0699f716d1..9c666b15c49 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf
@@ -2,66 +2,124 @@
\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}%
@@ -101,7 +159,7 @@
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
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-esperanto.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-esperanto.ldf
index e3bc8d31ac4..f3a6bf09911 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-esperanto.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-esperanto.ldf
@@ -2,6 +2,7 @@
\PolyglossiaSetup{esperanto}{
hyphennames={esperanto},
hyphenmins={2,2},
+ langtag=NTO,
fontsetup=true,
%TODO localalph={esperanto@alph,esperanto@Alph}
}
@@ -51,8 +52,6 @@
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%
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-estonian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-estonian.ldf
index e84aa304712..f8df426a94f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-estonian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-estonian.ldf
@@ -2,6 +2,7 @@
\PolyglossiaSetup{estonian}{
hyphennames={estonian},
hyphenmins={2,2},
+ langtag=ETI,
frenchspacing=true,
fontsetup=true,
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf
index f9149badf6e..0c65b37574f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf
@@ -1,131 +1,42 @@
\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}}}}
-
-\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}}%
-}
-
-\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}}%
- }
+ \farsinumber{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\farsinumber{\value{Hijriyear}}}}
-\def\nofarsi@globalnumbers{
- \let\@arabic\orig@arabic%
- \renewcommand\thefootnote{\protect\number{\c@footnote}}%
- }
+\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\blockextras@farsi{%
- \let\@@MakeUppercase\MakeUppercase%
- \def\MakeUppercase##1{##1}%
- }
-\def\noextras@farsi{%
- \let\MakeUppercase\@@MakeUppercase%
- }
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf
index 6b271e531d9..e0c884f9664 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf
@@ -2,10 +2,41 @@
\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ä}%
@@ -29,7 +60,7 @@
\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
@@ -37,6 +68,18 @@
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%
+}
+
\endinput
% TODO ? this is set in babel:
@@ -45,4 +88,4 @@
\babel@savevariable\exhyphenpenalty\exhyphenpenalty=30%
\babel@savevariable\doublehyphendemerits\doublehyphendemerits=5000%
\babel@savevariable\finalhyphendemerits\finalhyphendemerits=5000%
- }
+}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf
index fdffd36cf9d..8cb0731d2df 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf
@@ -3,12 +3,43 @@
\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()}%
@@ -22,36 +53,77 @@
\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@autospaceguillemets
+\define@boolkey{french}[french@]{autospaceguillemets}[true]{}
+\french@autospaceguillemetstrue
-\newif\iffrench@automaticspacesaroundguillemets
+% 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
@@ -73,24 +145,24 @@
\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
}
@@ -98,7 +170,7 @@
\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
@@ -152,6 +224,7 @@
\def\headtoname{}%
\def\proofname{Démonstration}%
}
+
\def\datefrench{%
\def\today{\ifx\ier\undefined\def\ier{er}\fi
\ifnum\day=1\relax 1\ier%
@@ -164,15 +237,30 @@
\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}}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-friulan.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-friulan.ldf
index a753c04e41f..b395c7d4a27 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-friulan.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-friulan.ldf
@@ -1,64 +1,22 @@
\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,
}
-
-\def\captionsfriulan{%
- \def\prefacename{Prefazion}%
- \def\refname{Riferiments}%
- \def\abstractname{Somari}%
- \def\bibname{Bibliografie}%
- \def\chaptername{Cjapitul}%
- \def\appendixname{Zonte}%
- \def\contentsname{Tabele gjenerâl}%
- \def\listfigurename{Liste des figuris}%
- \def\listtablename{Liste des tabelis}%
- \def\indexname{Tabele analitiche}%
- \def\figurename{Figure}%
- \def\tablename{Tabele}%
- \def\partname{Part}%
- \def\enclname{Zonte(is)}%
- \def\ccname{Cun copie a}%
- \def\headtoname{Par}%
- \def\pagename{Pagjine}%
- \def\seename{cjale}%
- \def\alsoname{cjale ancje}%
- \def\proofname{Dimostrazion}%
- \def\glossaryname{Glossari}%
- }
-
-\def\datefriulan{%
- \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%
- \fi\space dal\space\number\year}}
-
-\AtEndPreamble{% the user or the class might define different values
- \edef\xpgfu@savedvalues{%
- \clubpenalty=\the\clubpenalty\space
- \@clubpenalty=\the\@clubpenalty\space
- \widowpenalty=\the\widowpenalty\space
- \finalhyphendemerits=\the\finalhyphendemerits}
-}
-
-
-\def\noextras@friulan{%
- \lccode\string"2019=\z@
-}
-
-\def\blockextras@friulan{%
- \lccode\string"2019=\string"2019
- \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000
- \finalhyphendemerits=50000000
-}
-
-\def\inlineextras@friulan{%
- \lccode\string"2019=\string"2019
-}
+\let\captionsfriulan\captionsfriulian
+\let\datefriulan\datefriulian
+\let\noextras@friulan\noextras@friulian
+\let\blockextras@friulan\blockextras@friulian
+\let\inlineextras@friulan\inlineextras@friulian
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-friulian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-friulian.ldf
new file mode 100644
index 00000000000..87e3705ba56
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-friulian.ldf
@@ -0,0 +1,66 @@
+\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\captionsfriulian{%
+ \def\prefacename{Prefazion}%
+ \def\refname{Riferiments}%
+ \def\abstractname{Somari}%
+ \def\bibname{Bibliografie}%
+ \def\chaptername{Cjapitul}%
+ \def\appendixname{Zonte}%
+ \def\contentsname{Tabele gjenerâl}%
+ \def\listfigurename{Liste des figuris}%
+ \def\listtablename{Liste des tabelis}%
+ \def\indexname{Tabele analitiche}%
+ \def\figurename{Figure}%
+ \def\tablename{Tabele}%
+ \def\partname{Part}%
+ \def\enclname{Zonte(is)}%
+ \def\ccname{Cun copie a}%
+ \def\headtoname{Par}%
+ \def\pagename{Pagjine}%
+ \def\seename{cjale}%
+ \def\alsoname{cjale ancje}%
+ \def\proofname{Dimostrazion}%
+ \def\glossaryname{Glossari}%
+ }
+
+\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%
+ \fi\space dal\space\number\year}}
+
+\AtEndPreamble{% the user or the class might define different values
+ \edef\xpgfu@savedvalues{%
+ \clubpenalty=\the\clubpenalty\space
+ \@clubpenalty=\the\@clubpenalty\space
+ \widowpenalty=\the\widowpenalty\space
+ \finalhyphendemerits=\the\finalhyphendemerits}
+}
+
+
+\def\noextras@friulian{%
+ \lccode\string"2019=\z@
+}
+
+\def\blockextras@friulian{%
+ \lccode\string"2019=\string"2019
+ \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000
+ \finalhyphendemerits=50000000
+}
+
+\def\inlineextras@friulian{%
+ \lccode\string"2019=\string"2019
+}
+
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf
new file mode 100644
index 00000000000..327ce8526d2
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf
@@ -0,0 +1,107 @@
+\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%
+}
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-galician.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-galician.ldf
index 76459f275cd..be4853ebbef 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-galician.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-galician.ldf
@@ -2,6 +2,7 @@
\PolyglossiaSetup{galician}{
hyphennames={galician},
hyphenmins={2,2},
+ langtag=GAL,
indentfirst=true,
fontsetup=true,
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf
index 8cbdeac2157..bf4a690060e 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf
@@ -3,63 +3,86 @@
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]{}
@@ -74,8 +97,9 @@
\fi
\ifcsundef{initiate@active@char}{%
-\input{babelsh.def}%
-\initiate@active@char{"}%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
}{}
\def\german@shorthands{%
@@ -190,43 +214,28 @@
\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{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-greek.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-greek.ldf
index 229688ef5bc..ecef64d772a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-greek.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-greek.ldf
@@ -2,9 +2,12 @@
\PolyglossiaSetup{greek}{
script=Greek,
scripttag=grek,
+ langtag=ELL,
frenchspacing=true,
indentfirst=true,
fontsetup=true,
+ localnumeral=greeknumerals,
+ Localnumeral=Greeknumerals
%TODO localalph={greek@alph,greek@Alph}
}
@@ -16,31 +19,6 @@
% 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}
@@ -48,39 +26,62 @@
\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{Αναφορές}%
@@ -194,8 +195,8 @@
\def\ccname{Κοινοποίησις}%
\def\headtoname{Πρὸς}%
\def\pagename{Σελὶς}%
- \def\seename{ὃρα}%
- \def\alsoname{ὃρα ὡσαύτως}%
+ \def\seename{ὅρα}%
+ \def\alsoname{ὅρα ὡσαύτως}%
\def\proofname{Ἀπόδειξις}%
\def\glossaryname{Γλωσσάριον}%
\def\refname{Ἀναφοραὶ}%
@@ -228,14 +229,18 @@
Δεκεμβρίου\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%
@@ -259,8 +264,31 @@
\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{%
@@ -283,6 +311,27 @@
\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
@@ -326,11 +375,9 @@
\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}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf
index cb6ed7ef2b6..1f366a0f551 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf
@@ -8,14 +8,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
}
@@ -31,16 +31,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)
@@ -100,41 +94,48 @@ 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%
+}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf
index 075d5312811..56ca28f404e 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf
@@ -1,24 +1,18 @@
-% 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%
@@ -32,7 +26,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
@@ -44,6 +40,8 @@ and may look very wrong.}
\hindi@devanagari@numeralsfalse
\fi}
+\newcommand{\hindinumerals}[2]{\hindinumber{#2}}
+
\def\hindinumber#1{%
\ifhindi@devanagari@numerals
\devanagaridigits{\number#1}%
@@ -54,13 +52,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{सूची}%
% सूचक
@@ -68,7 +66,7 @@ and may look very wrong.}
% अनुक्रमणि
\def\listfigurename{चित्रों की सूची}%
\def\listtablename{तालिकाओं की सूची}%
- \def\pagename{पृषठ}%
+ \def\pagename{पृष्ठ}%
\def\partname{खणड}%
\def\prefacename{प्रस्तावना}% प्राक्कथन
\def\refname{हवाले}%
@@ -94,12 +92,16 @@ 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%
}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf
new file mode 100644
index 00000000000..5c990cef896
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf
@@ -0,0 +1,81 @@
+\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
+}
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-icelandic.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-icelandic.ldf
index 2678b4f6129..1520d58472a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-icelandic.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-icelandic.ldf
@@ -2,6 +2,7 @@
\PolyglossiaSetup{icelandic}{
hyphennames={icelandic},
hyphenmins={2,2},
+ langtag=ISL,
fontsetup=true,
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-interlingua.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-interlingua.ldf
index 9e4ca395d6a..4708cf0320b 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-interlingua.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-interlingua.ldf
@@ -2,6 +2,7 @@
\PolyglossiaSetup{interlingua}{
hyphennames={interlingua},
hyphenmins={2,2},
+ langtag=INA,
frenchspacing=true,
indentfirst=true,
fontsetup=true,
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-irish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-irish.ldf
index 23b0b567c30..aa27c3d3455 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-irish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-irish.ldf
@@ -1,42 +1,18 @@
\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
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-italian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-italian.ldf
index 78e2d590488..3d7b02d8951 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-italian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-italian.ldf
@@ -3,6 +3,7 @@
\PolyglossiaSetup{italian}{
hyphennames={italian},
hyphenmins={2,2},
+ langtag=ITA,
frenchspacing=true,
indentfirst=true,
fontsetup=true,
@@ -19,8 +20,9 @@
\fi
\ifcsundef{initiate@active@char}{%
-\input{babelsh.def}%
-\initiate@active@char{"}%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
}{}
\def\italian@shorthands{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-kannada.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-kannada.ldf
index 6362de74d99..0525d6289fd 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-kannada.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-kannada.ldf
@@ -26,10 +26,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
@@ -97,7 +98,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}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-khmer.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-khmer.ldf
index bb57f178a01..00c569c06b1 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-khmer.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-khmer.ldf
@@ -4,7 +4,8 @@
scripttag=khmr,%
langtag=KHM,%
hyphennames={nohyphenation},%
- fontsetup=true%
+ fontsetup=true,%
+ localnumeral=khmernumerals%
}
\newif\if@khmer@numerals
\def\tmp@khmer{khmer}
@@ -71,6 +72,9 @@
\expandafter\@khmer@digits%
\fi
}
+
+\newcommand{\khmernumerals}[2]{\khmernumber{#2}}
+
\def\khmernumber#1{%
\if@khmer@numerals%
\khmerdigits{\number#1}%
@@ -80,11 +84,10 @@
\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{%
@@ -107,16 +110,14 @@
\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" %
@@ -152,6 +153,6 @@
\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}}}}}}%
}{}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf
index 13a4807c5d4..5aefe04dfa3 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf
@@ -5,8 +5,7 @@
scripttag=hang,
language=Korean,
langtag=KOR,
- hyphennames={english,USenglish},
- hyphenmins={2,3},
+ hyphennames={nohyphenation},
frenchspacing=true,
fontsetup=true
}
@@ -27,8 +26,8 @@
\else
\captions@korean@hanja
\fi
- \def\seename{$rightarrow$}%
- \def\alsoname{$Rightarrow$}%
+ \def\seename{$\rightarrow$}%
+ \def\alsoname{$\Rightarrow$}%
}
\def\captions@korean@hangul{%
\def\koreanTHEname{제}%
@@ -94,14 +93,12 @@
}
\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
@@ -135,7 +132,7 @@
\XeTeXinterchartokenstate\z@
\XeTeXlinebreakpenalty\z@
\XeTeXlinebreakskip\z@skip
- \XeTeXlinebreaklocale ""
+ \XeTeXlinebreaklocale "en"
\noextras@korean@common
}
\else % luatex
@@ -155,26 +152,44 @@
\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\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\로{\으 로}
+\def\xpg@reset@josa {\global\let\xpg@josa@zwang\z@}\xpg@reset@josa
+% load lua file for korean
+\directlua{ require "polyglossia-korean" }
+\endinput\fi
+
+% XeTeX
+% user commands for Josa
\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}
@@ -581,553 +596,4 @@
\@tmpa "FF01=\XPGKOcharclassEX % ! FULLWIDTH EXCLAMATION MARK
\@tmpa "FF1F=\XPGKOcharclassEX % ? FULLWIDTH QUESTION MARK
-\endinput\fi % end of XeTeX
-
-% 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
-\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\로{\으 로}
-\def\xpg@reset@josa {\global\let\xpg@josa@zwang\z@}\xpg@reset@josa
-\directlua{
-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")
-local attr_korean = luatexbase.attributes["xpg@attr@korean"]
-local attr_josa = luatexbase.attributes["xpg@attr@autojosa"]
-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
-}
-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
-})
-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
-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 })
-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} },
-}
-local function get_new_penalty (p)
- local penalty = node.new("penalty")
- penalty.penalty = p
- return penalty
-end
-local function get_new_glue (wd, st, sh, sto, sho)
- local glue = node.new("glue")
- glue.width = wd or 0
- glue.stretch = st or 0
- glue.shrink = sh or 0
- glue.stretch_order = sto or 0
- glue.shrink_order = sho or 0
- return glue
-end
-local function get_font_size (fid, space)
- local f = fonts.hashes.identifiers[fid] or font.fonts[fid]
- local size = f and f.parameters
- if space then
- size = size and size.space or 196608
- else
- size = size and size.quad or 655360
- end
- return size/2
-end
-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")
- head, curr = node.insert_before(head, curr, box)
- return head, curr
-end
-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
-local function insert_penalty_glue (head, curr, f, var, x)
- if var == 1 then
- else
- 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
-local function avoid_widow_char (head)
- local curr = node.tail(head)
- while curr do
- if curr.id == glyph_id then
- local c = curr.char or 0
- if not nobr_before[c] or nobr_before[c] == 3 then
- local var = node.has_attribute(curr, attr_korean)
- if var and is_cjk(c) then
- curr = curr.prev
- if curr and curr.id == glue_id then
- curr = curr.prev
- if curr then
- local pv = var == 1 and 500 or 1000
- if curr.id == penalty_id then
- if curr.penalty < pv then curr.penalty = pv end
- else
- node.insert_after(head, curr, get_new_penalty(pv))
- end
- end
- end
- end
- break
- end
- end
- curr = curr.prev
- end
-end
-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)
- 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]
- if var > 0 and intercharclass[cc][nc] then
- head, curr = insert_cjk_penalty_glue(head, curr, f, var, cc, nc, nobr)
- elseif not nobr then
- local cjkn = is_cjk(n)
- if cjkc or cjkn then
- if var > 0 and not (cjkc and cjkn) and not (nobr_before[c] == 0) then
- head, curr = insert_penalty_glue(head, curr, f, var, true)
- elseif lb then
- head, curr = insert_penalty_glue(head, curr, f, var)
- end
- end
- end
- end
- end
- end
- curr = curr.next
- end
- if lb then avoid_widow_char(head) end
- return head
-end
-local josa_table = {
- % 리을, 중성, 종성
- [0xAC00] = {0xC774, 0xAC00, 0xC774}, % 가 = 이, 가, 이
- [0xC740] = {0xC740, 0xB294, 0xC740}, % 은 = 은, 는, 은
- [0xC744] = {0xC744, 0xB97C, 0xC744}, % 을 = 을, 를, 을
- [0xC640] = {0xACFC, 0xC640, 0xACFC}, % 와 = 과, 와, 과
- [0xC73C] = {nil, nil, 0xC73C}, % 으(로) = , , 으
- [0xC774] = {0xC774, nil, 0xC774}, % 이(라) = 이, , 이
-}
-local function josa_char_num (t, c)
- c = c - math.floor(c/10)*10 + 0x30
- return t[c] or 2
-end
-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
- c = c - math.floor(c/28)*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 })
-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.tail(p.head))
- if pc then return pc end
- end
- p = p.prev
- end
-end
-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
-local function reorder_tm (head)
- local curr, tone = node.tail(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
-local prepend_to_callback
-if luatexbase.callbacktypes then
- 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
-else
- prepend_to_callback = function(name, func, desc)
- luatexbase.add_to_callback(name, func, desc, 1)
- end
-end
-prepend_to_callback ("hyphenate",
- function(head)
- local in_callback = luatexbase.in_callback or luatexbase.priority_in_callback
- if in_callback("hyphenate", "polyglossia.disable_hyphenation") then
- return false
- end
- local curr = head
- while curr do
- if curr.id == glyph_id and node.has_attribute(curr, attr_korean) and is_cjk(curr.char or 0) then
- if curr.subtype == 1 then
- curr.subtype = 0
- end
- end
- curr = curr.next
- end
- lang.hyphenate(head)
- end,
- "polyglossia.lang_korean")
-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=tex:tw=0:sw=4:ts=4:expandtab
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf
new file mode 100644
index 00000000000..ca050dea61f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf
@@ -0,0 +1,384 @@
+% 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
+ \SetLanguageKeys{kurdish}{script=Arabic,direction=RL,scripttag=arab,babelname=kurdish}%
+ \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%
+}
+
+\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
+ \fi
+}
+
+%\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%
+}
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-lao.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-lao.ldf
index 9f8cc83df3e..96b5c436cf7 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-lao.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-lao.ldf
@@ -8,9 +8,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
}
@@ -76,6 +78,8 @@ and may look very wrong.}
\fi
}
+\newcommand{\laonumerals}[2]{\laonumber{#2}}
+
\def\laonumber#1{%
\if@lao@numerals
\laodigits{\number#1}%
@@ -86,11 +90,10 @@ 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}}%
}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-latex.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-latex.ldf
new file mode 100644
index 00000000000..2f9e869dd6b
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-latex.ldf
@@ -0,0 +1,33 @@
+\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}%
+}
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf
index 435c43d3f77..3fc7d20ceca 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf
@@ -21,6 +21,7 @@
\PolyglossiaSetup{latin}{%
hyphennames={latin},
hyphenmins={2,2},
+ langtag=LAT,
frenchspacing=true,
fontsetup=true,
}
@@ -51,7 +52,6 @@
\let\latin@variant\l@latin
\xpg@set@language@luatex@ii{latin}
\medievaltrue \classictrue
- \classicuclccodes
\xpg@info{Option: Medieval Latin}%
\else
\ifx\@tempa\tmp@classic
@@ -64,7 +64,7 @@
\let\latin@variant\l@classiclatin
\fi
\fi
- \medievalfalse\classictrue\classicuclccodes
+ \medievalfalse\classictrue
\xpg@info{Option: Classic Latin}%
\else
\ifx\@tempa\tmp@liturgical\unless\ifluatex
@@ -274,6 +274,7 @@
\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
@@ -282,6 +283,7 @@
\def\inlineextras@latin{%
\lccode\string"2019=\string"2019
+ \ifclassic\classicuclccodes\fi
\iflatin@babelshorthands\latin@shorthands\fi
\iflatin@ecclesiastic
\unless\ifluatex\ecclesiasticlatin@punctuation
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-latvian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-latvian.ldf
index 9993cadf4a0..067ee3a921b 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-latvian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-latvian.ldf
@@ -2,6 +2,7 @@
\PolyglossiaSetup{latvian}{
hyphennames={latvian},
hyphenmins={2,2},
+ langtag=LVI,
fontsetup=true,
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-lithuanian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-lithuanian.ldf
index db4c564ce6f..3d8ead44857 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-lithuanian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-lithuanian.ldf
@@ -4,31 +4,33 @@
\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{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-liturgicallatin.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-liturgicallatin.ldf
deleted file mode 100644
index b38f23635dc..00000000000
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-liturgicallatin.ldf
+++ /dev/null
@@ -1,185 +0,0 @@
-%%
-%% 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'.
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-lsorbian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-lsorbian.ldf
index 55b58e3b9f0..c57304b8936 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-lsorbian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-lsorbian.ldf
@@ -1,45 +1,20 @@
\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
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-macedonian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-macedonian.ldf
index a784666abf7..95924c51c5b 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-macedonian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-macedonian.ldf
@@ -28,8 +28,6 @@
\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%
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-magyar.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-magyar.ldf
index ea5f534e7a8..b4b05b6288f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-magyar.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-magyar.ldf
@@ -1,70 +1,20 @@
\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
-
-% change 'táblázat x.x' to 'x.x. táblázat'
-\newcommand{\@magyar@fnum@table}{\thetable.~\tablename}
-\let\fnum@table\@magyar@fnum@table
-
-% change 'ábra x.x' to 'x.x. ábra'
-\newcommand{\@magyar@fnum@figure}{\thefigure.~\figurename}
-\let\fnum@figure\@magyar@fnum@figure
-
-\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}%
- %\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\noextras@magyar{%
- \let\ontoday\@undefined
-}
+\let\captionsmagyar\captionshungarian
+\let\datemagyar\datehungarian
+\let\ondatemagyar\ondatehungarian
+\let\blockextras@magyar\blockextras@hungarian
+\let\noextras@magyar\noextras@hungarian
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf
new file mode 100644
index 00000000000..ce617ab0b91
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf
@@ -0,0 +1,171 @@
+\ProvidesFile{gloss-malay.ldf}[polyglossia: module for malay]
+
+\RequirePackage{hijrical}
+
+\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{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\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}}
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf
index dc1a429be09..645e7275a58 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf
@@ -17,8 +17,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}
@@ -31,6 +31,8 @@ and may look very wrong.}
\marathi@devanagari@numeralsfalse
\fi}
+\newcommand{\marathinumerals}[2]{\marathinumber{#2}}
+
\def\marathinumber#1{%
\ifmarathi@devanagari@numerals
\devanagaridigits{\number#1}%
@@ -47,9 +49,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{भाग}%
@@ -61,6 +63,7 @@ and may look very wrong.}
\def\headtoname{प्रति}%
\def\proofname{सिद्धता}%
\def\glossaryname{स्पष्टीकरणांची यादी}%
+ \def\authorsand{आणि}%
}
\def\datemarathi{%
\def\marathimonth{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf
new file mode 100644
index 00000000000..9f761c3a566
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf
@@ -0,0 +1,194 @@
+\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%
+}
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-nko.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-nko.ldf
index 63a3c0f02d7..f69b4e138d3 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-nko.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-nko.ldf
@@ -2,12 +2,16 @@
\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{ߞߐߡߊߛߙߋ}%
@@ -36,27 +40,27 @@
% ߂߀߁߃ ߞߏ߲ߞߏߜߍ ߕߟߋ߬ ߁߈ (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).
-\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*\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%
+}
+\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
@@ -72,8 +76,8 @@
\or ߞߏ߲ߓߌߕߌ߮%
\or ߣߍߣߍߓߊ%
\or ߞߏ߬ߟߌ߲߬ߞߏߟߌ߲\fi
- \space ߕߟߋ߬
- \space\nkonumber{\day}
+ \space\nkodayprefix{\number\day}
+ \space\nkoday{\day}
}%
}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-norsk.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-norsk.ldf
index 975cd109c7c..7e08546c149 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-norsk.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-norsk.ldf
@@ -1,42 +1,20 @@
-\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{%
- \def\refname{Referanser}%
- \def\abstractname{Sammendrag}%
- \def\bibname{Bibliografi}%
- \def\prefacename{Forord}%
- \def\chaptername{Kapittel}%
- \def\appendixname{Tillegg}%
- \def\contentsname{Innhold}%
- \def\listfigurename{Figurer}%
- \def\listtablename{Tabeller}%
- \def\indexname{Register}%
- \def\figurename{Figur}%
- \def\tablename{Tabell}%
- %\def\thepart{}% <<<
- \def\partname{Del}%
- \def\pagename{Side}%
- \def\seename{Se}%
- \def\alsoname{Se også}%
- \def\enclname{Vedlegg}%
- \def\ccname{Kopi sendt}%
- \def\headtoname{Til}%
- \def\proofname{Bevis}%
- \def\glossaryname{Ordliste}%
- }
-
-\def\datenorsk{%
- \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@norsk
+\let\datenorsk\datenorwegian@norsk
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf
new file mode 100644
index 00000000000..47d5affa74a
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf
@@ -0,0 +1,104 @@
+\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}%
+ \def\prefacename{Forord}%
+ \def\chaptername{Kapittel}%
+ \def\appendixname{Tillegg}%
+ \def\contentsname{Innhold}%
+ \def\listfigurename{Figurer}%
+ \def\listtablename{Tabeller}%
+ \def\indexname{Register}%
+ \def\figurename{Figur}%
+ \def\tablename{Tabell}%
+ %\def\thepart{}% <<<
+ \def\partname{Del}%
+ \def\pagename{Side}%
+ \def\seename{Se}%
+ \def\alsoname{Se også}%
+ \def\enclname{Vedlegg}%
+ \def\ccname{Kopi sendt}%
+ \def\headtoname{Til}%
+ \def\proofname{Bevis}%
+ \def\glossaryname{Ordliste}%
+}
+
+\def\captionsnorwegian{%
+ \csname captionsnorwegian@\norwegian@variant\endcsname%
+}
+
+\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%
+}
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-nynorsk.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-nynorsk.ldf
index 8051d902e16..4b63ab64eae 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-nynorsk.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-nynorsk.ldf
@@ -1,42 +1,20 @@
\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
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf
index 8a14b6efe06..9b505b7010b 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf
@@ -19,6 +19,7 @@
module for Occitan]
\PolyglossiaSetup{occitan}{
hyphennames={occitan},
+ langtag=OCI,
hyphenmins={2,2},
frenchspacing=true,
indentfirst=true,
@@ -31,10 +32,13 @@
\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}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf
new file mode 100644
index 00000000000..a874e3943ec
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf
@@ -0,0 +1,151 @@
+\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
+}
+\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-piedmontese.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-piedmontese.ldf
index 797e72a5209..4474c8a99e2 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-piedmontese.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-piedmontese.ldf
@@ -4,6 +4,7 @@
\PolyglossiaSetup{piedmontese}{
hyphennames={piedmontese},
hyphenmins={2,2},
+ langtag=PMS,
frenchspacing=true,
fontsetup=true,
}
@@ -18,8 +19,9 @@
\fi
\ifcsundef{initiate@active@char}{%
-\input{babelsh.def}%
-\initiate@active@char{"}%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
}{}
\def\piedmontese@shorthands{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-polish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-polish.ldf
index 05b1a9141b6..ef773026692 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-polish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-polish.ldf
@@ -2,6 +2,7 @@
\PolyglossiaSetup{polish}{
hyphennames={polish},
hyphenmins={2,2},
+ langtag=PLK,
frenchspacing=true,
fontsetup=true,
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-portuges.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-portuges.ldf
index 310f958f160..906f3d546c5 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-portuges.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-portuges.ldf
@@ -1,40 +1,25 @@
-\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,
}
-\def\captionsportuges{%
- \def\refname{Referências}%
- \def\abstractname{Resumo}%
- \def\bibname{Bibliografia}%
- \def\prefacename{Prefácio}%
- \def\chaptername{Capítulo}%
- \def\appendixname{Apêndice}%
- \def\contentsname{Conteúdo}%
- \def\listfigurename{Lista de Figuras}%
- \def\listtablename{Lista de Tabelas}%
- \def\indexname{Índice}%
- \def\figurename{Figura}%
- \def\tablename{Tabela}%
- %\def\thepart{}%
- \def\partname{Parte}%
- \def\pagename{Página}%
- \def\seename{ver}%
- \def\alsoname{ver também}%
- \def\enclname{Anexo}%
- \def\ccname{Com cópia a}%
- \def\headtoname{Para}%
- \def\proofname{Demonstração}%
- \def\glossaryname{Glossário}%
- }
-
-\def\dateportuges{%
- \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@portuges
+\let\dateportuges\dateportuguese@portuges
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf
new file mode 100644
index 00000000000..35e7bfae907
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf
@@ -0,0 +1,103 @@
+\ProvidesFile{gloss-portuguese.ldf}[polyglossia: module for portuguese]
+\PolyglossiaSetup{portuguese}{
+ babelname=portuges,
+ hyphennames={portuges,portuguese},
+ hyphenmins={2,3},
+ langtag=PTG,
+ fontsetup=true,
+}
+
+\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}%
+ \def\prefacename{Prefácio}%
+ \def\chaptername{Capítulo}%
+ \def\appendixname{Apêndice}%
+ \def\contentsname{Conteúdo}%
+ \def\listfigurename{Lista de Figuras}%
+ \def\listtablename{Lista de Tabelas}%
+ \def\indexname{Índice}%
+ \def\figurename{Figura}%
+ \def\tablename{Tabela}%
+ \def\partname{Parte}%
+ \def\pagename{Página}%
+ \def\seename{ver}%
+ \def\alsoname{ver também}%
+ \def\enclname{Anexo}%
+ \def\ccname{Com cópia a}%
+ \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\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%
+}
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-romanian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-romanian.ldf
index 43a3d173f35..32077a02e11 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-romanian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-romanian.ldf
@@ -3,6 +3,7 @@
\PolyglossiaSetup{romanian}{
hyphennames={romanian},
hyphenmins={2,2},
+ langtag=ROM,
fontsetup=true,
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-romansh.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-romansh.ldf
index 40d75f47e7b..8557016adef 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-romansh.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-romansh.ldf
@@ -3,6 +3,7 @@
\PolyglossiaSetup{romansh}{%
hyphennames={romansh},
hyphenmins={2,2},
+ langtag=RMS,
indentfirst=true,
fontsetup=true,
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf
index 5d207ff056e..f969aa258d3 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf
@@ -1,4 +1,7 @@
\ProvidesFile{gloss-russian.ldf}[polyglossia: module for russian]
+
+\RequirePackage{cyrillicnumbers}
+
\PolyglossiaSetup{russian}{
script=Cyrillic,
scripttag=cyrl,
@@ -6,22 +9,30 @@
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}%
}
@@ -38,6 +49,7 @@
\ifcsundef{initiate@active@char}{%
\input{babelsh.def}%
\initiate@active@char{"}%
+ \shorthandoff{"}%
}{}
\def\russian@shorthands{%
@@ -53,8 +65,8 @@
\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{%
@@ -73,7 +85,7 @@
\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}%
}
@@ -123,7 +135,8 @@
октября\or
ноября\or
декабря\fi%
- \space \number\year\space г.}}
+ \space \number\year\space г.}%
+}
\def\captionsrussian@old{%
\def\prefacename{Предисловіе}%
@@ -149,7 +162,8 @@
\def\seename{см.}%
\def\alsoname{см.~также}%
\def\proofname{Доказательство}%
-}
+}
+
\def\daterussian@old{%
\def\today{\number\day%
\space\ifcase\month\or%
@@ -165,18 +179,24 @@
октября\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%
@@ -194,27 +214,58 @@
\def\presubsection{}%
\def\presubsubsection{}%
\def\preparagraph{}%
- \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}
+ \def\presubparagraph{}%
+}
+
+\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
}
@@ -227,22 +278,27 @@
\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{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf
new file mode 100644
index 00000000000..e249a2f675d
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf
@@ -0,0 +1,84 @@
+\ProvidesFile{gloss-sami.ldf}[polyglossia: module for sami]
+
+\PolyglossiaSetup{sami}{
+ babelname=samin,
+ hyphennames={samin},
+ hyphenmins={2,2},
+ language={Northern Sami},
+ langtag=NSM,
+ fontsetup=true,
+}
+
+% 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}%
+ \def\prefacename{Ovdasátni}%
+ \def\chaptername{Kapihttal}%
+ \def\appendixname{Čuovus}%
+ \def\contentsname{Sisdoallu}%
+ \def\listfigurename{Govvosat}%
+ \def\listtablename{Tabeallat}%
+ \def\indexname{Registtar}%
+ \def\figurename{Govus}%
+ \def\tablename{Tabealla}%
+ \def\thepart{}%
+ \def\partname{Oassi}%
+ \def\pagename{Siidu}%
+ \def\seename{geahča}%
+ \def\alsoname{geahča maiddái}%
+ \def\enclname{Mielddus}%
+ \def\ccname{Kopia sáddejuvvon}%
+ \def\headtoname{Vuostáiváldi}%
+ \def\proofname{Duođaštus}%
+ \def\glossaryname{Sátnelistu}%
+}
+
+\def\captionssami{%
+ \csname captionssami@\sami@variant\endcsname%
+}
+
+\def\datesami@northern{%
+ \def\today{\ifcase\month\or
+ ođđajagemánu\or
+ guovvamánu\or
+ njukčamánu\or
+ cuoŋománu\or
+ miessemánu\or
+ geassemánu\or
+ suoidnemánu\or
+ borgemánu\or
+ čakčamánu\or
+ golggotmánu\or
+ skábmamánu\or
+ juovlamánu\fi
+ \space\number\day.~b.\space\number\year}%
+}
+
+\def\datesami{%
+ \csname datesami@\sami@variant\endcsname%
+}
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-samin.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-samin.ldf
index e9d834a6489..e91698f4335 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-samin.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-samin.ldf
@@ -1,50 +1,19 @@
\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,
}
-\def\captionssamin{%
- \def\refname{Čujuhusat}%
- \def\abstractname{Čoahkkáigeassu}%
- \def\bibname{Girjjálašvuohta}%
- \def\prefacename{Ovdasátni}%
- \def\chaptername{Kapihttal}%
- \def\appendixname{Čuovus}%
- \def\contentsname{Sisdoallu}%
- \def\listfigurename{Govvosat}%
- \def\listtablename{Tabeallat}%
- \def\indexname{Registtar}%
- \def\figurename{Govus}%
- \def\tablename{Tabealla}%
- \def\thepart{}%
- \def\partname{Oassi}%
- \def\pagename{Siidu}%
- \def\seename{geahča}%
- \def\alsoname{geahča maiddái}%
- \def\enclname{Mielddus}%
- \def\ccname{Kopia sáddejuvvon}%
- \def\headtoname{Vuostáiváldi}%
- \def\proofname{Duođaštus}%
- \def\glossaryname{Sátnelistu}%
- }
-\def\datesamin{%
- \def\today{\ifcase\month\or
- ođđajagemánu\or
- guovvamánu\or
- njukčamánu\or
- cuoŋománu\or
- miessemánu\or
- geassemánu\or
- suoidnemánu\or
- borgemánu\or
- čakčamánu\or
- golggotmánu\or
- skábmamánu\or
- juovlamánu\fi
- \space\number\day.~b.\space\number\year}%
- }
+\let\captionssamin\captionssami@nothern
+\let\datesamin\datesami@nothern
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf
index 3b102d09854..0f988f69fa9 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf
@@ -1,4 +1,11 @@
\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}{
@@ -7,11 +14,10 @@
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}%
@@ -19,65 +25,82 @@
}
\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}}
+
+\def\sanskritnumber#1{%
+ \ifsanskrit@devanagari@numerals
+ \devanagaridigits{\number#1}%
+ \else
+ \number#1%
+ \fi%
+}
-\newXeTeXintercharclass\sanskrit@punctthin % ! ? ; : danda double_danda
+% 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{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-scottish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-scottish.ldf
index 6c76b71076c..14a2388441f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-scottish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-scottish.ldf
@@ -1,44 +1,18 @@
\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
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf
index 436ac751366..1f03368db65 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf
@@ -4,29 +4,33 @@
%% 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"}}%
@@ -34,15 +38,24 @@
}
\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}%
@@ -71,13 +84,14 @@
\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{Библиографија}%
@@ -105,15 +119,84 @@
\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}
+
+
\endinput
+
% TODO ? stuff from babel
\def\sh{\mathop{\operator@font sh}\nolimits} % same as \sinh
@@ -132,4 +215,3 @@
\def\Expect{\mathop{\mathsf E\hskip0pt}\nolimits}
\def\Variance{\mathop{\mathsf D\hskip0pt}\nolimits}
-
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf
index 21a62d65bdf..b6fc910e350 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf
@@ -3,6 +3,7 @@
\PolyglossiaSetup{slovak}{
hyphennames={slovak},
hyphenmins={2,2},
+ langtag=SKY,
fontsetup=true,
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-slovenian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-slovenian.ldf
index 9c32311bd9e..6ddba4cc2f0 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-slovenian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-slovenian.ldf
@@ -2,7 +2,9 @@
\PolyglossiaSetup{slovenian}{
hyphennames={slovenian,slovene},
+ babelname=slovene,
hyphenmins={2,2},
+ langtag=SLV,
fontsetup=true,
}
@@ -60,10 +62,10 @@
\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}
}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf
new file mode 100644
index 00000000000..ea137ea9dd3
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf
@@ -0,0 +1,166 @@
+\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%
+}
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf
index 30d4f7817c5..717202bdfed 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf
@@ -2,6 +2,7 @@
\PolyglossiaSetup{spanish}{
hyphennames={spanish},
hyphenmins={2,2},
+ langtag=ESP,
frenchspacing=true,
indentfirst=true,
fontsetup=true,
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-swedish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-swedish.ldf
index ac1d7160694..f39e65fba81 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-swedish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-swedish.ldf
@@ -3,6 +3,7 @@
\PolyglossiaSetup{swedish}{
hyphennames={swedish},
hyphenmins={2,2},
+ langtag=SVE,
frenchspacing=true,
fontsetup=true,
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-syriac.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-syriac.ldf
index 817a6f29bc9..a977c75f7c5 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-syriac.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-syriac.ldf
@@ -11,9 +11,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
}
@@ -115,18 +117,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}%
@@ -134,31 +149,39 @@ 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%
+}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-thai.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-thai.ldf
index 21cea5c8b17..73cbfc47e5b 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-thai.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-thai.ldf
@@ -17,8 +17,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
}
@@ -84,6 +86,8 @@ and may look very wrong.}
\fi
}
+\newcommand{\thainumerals}[2]{\thainumber{#2}}
+
\def\thainumber#1{%
\if@thai@numerals
\thaidigits{\number#1}%
@@ -106,26 +110,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{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-tibetan.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-tibetan.ldf
index e5702096b73..19d2bf486a1 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-tibetan.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-tibetan.ldf
@@ -8,10 +8,11 @@
\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
@@ -126,29 +127,28 @@
\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{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf
index 726225cad5c..a0d1d3c3fc0 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf
@@ -31,8 +31,9 @@
\fi
\ifcsundef{initiate@active@char}{%
-\input{babelsh.def}%
-\initiate@active@char{"}%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+ \shorthandoff{"}%
}{}
\def\ukrainian@shorthands{%
@@ -151,8 +152,6 @@
ц\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%
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-urdu.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-urdu.ldf
index 31e998dede3..aa54226134a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-urdu.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-urdu.ldf
@@ -16,9 +16,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
@@ -108,37 +108,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%
+}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-usorbian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-usorbian.ldf
index 810354ce1d4..7aa9dd32a80 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-usorbian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-usorbian.ldf
@@ -1,48 +1,20 @@
\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
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf
index 1908554cc2d..686ea18e7ac 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf
@@ -3,6 +3,7 @@
\PolyglossiaSetup{welsh}{
hyphennames={welsh},
hyphenmins={2,3},
+ langtag=WEL,
fontsetup=true,
}
@@ -66,10 +67,11 @@
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}%
- }
+}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/hebrewcal.sty b/Master/texmf-dist/tex/latex/polyglossia/hebrewcal.sty
index bf50422c19b..c56480b3727 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/hebrewcal.sty
+++ b/Master/texmf-dist/tex/latex/polyglossia/hebrewcal.sty
@@ -5,11 +5,15 @@
\ifluatex\RequirePackage{luabidi}\else\RequirePackage{bidi}\fi
\newif\if@xpg@hebrewcal@marcheshvan
+\@xpg@hebrewcal@marcheshvanfalse
+
\DeclareOption{marcheshvan}{\@xpg@hebrewcal@marcheshvantrue}
-\ifx\if@xpg@hebrew@marcheshvan\undefined
- \newif\if@xpg@hebrew@marcheshvan
- \@xpg@hebrew@marcheshvanfalse
-\fi
+
+\@ifundefined{if@xpg@hebrew@marcheshvan}{}{%
+ \if@xpg@hebrew@marcheshvan
+ \@xpg@hebrewcal@marcheshvantrue
+ \fi
+}
%% TODO rewrite this on the basis of Reingold & Dershowitz
%% on the model of hijrical (using calc)
@@ -66,7 +70,7 @@
\ifcase#1%
% nothing for 0
\or תשרי%
- \or\if@xpg@hebrewcal@marcheshvan מרחשון\else\if@xpg@hebrew@marcheshvan מרחשון\else חשון\fi\fi%
+ \or\if@xpg@hebrewcal@marcheshvan מרחשון\else חשון\fi%
\or כסלו%
\or טבת%
\or שבט%
@@ -91,8 +95,7 @@
\ifcase #1%
% nothing for 0
\or Tishrei%
- % \or\if@xpg@hebrewcal@marcheshvan Marcheshvan\else\if@xpg@hebrew@marcheshvan Marcheshvan\else Heshvan\fi\fi%
- \or\if@xpg@hebrewcal@marcheshvan Marcheshvan\else\if@xpg@hebrew@marcheshvan Marcheshvan\else Heshvan\fi\fi%
+ \or\if@xpg@hebrewcal@marcheshvan Marcheshvan\else Heshvan\fi%
\or Kislev%
\or Tebeth%
\or Shebat%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-frpt.lua b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-frpt.lua
index ac265fa06f6..9d0ae235f22 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-frpt.lua
+++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-frpt.lua
@@ -14,15 +14,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
@@ -160,10 +160,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())
@@ -177,13 +177,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))
diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-korean.lua b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-korean.lua
new file mode 100644
index 00000000000..c09ae6d5b74
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-korean.lua
@@ -0,0 +1,603 @@
+--
+-- 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
diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua
index 463b3d2fe3b..e26e7dc6ec8 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua
+++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua
@@ -26,12 +26,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 = { }
@@ -51,26 +50,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
@@ -106,16 +92,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
@@ -123,35 +112,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
@@ -159,11 +172,11 @@ 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
diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty
index 1e77ed1e1f1..4f419e14ddd 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty
+++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{polyglossia}[2019/04/04 v1.44
+\ProvidesPackage{polyglossia}[2019/10/27 v1.45
Alternative to Babel for XeLaTeX and LuaLaTeX]
\RequirePackage{etoolbox}
\RequirePackage{makecmds}
@@ -12,13 +12,24 @@
\RequirePackage{ifluatex}
% For symmetry with ifluatex
\RequirePackage{ifxetex}
+\RequirePackage{expl3}
+\RequirePackage{l3keys2e}
+\RequirePackage{xparse}
+\RequirePackage{filehook}
+
+% correct a bug in tracklang
+\AtBeginOfPackageFile*{tracklang}{
+ \@ifpackagelater{tracklang}{2019/08/30}{}{\global\def\AddTrackedLangage{\AddTrackedLanguage}}
+}
+
+
% fontspec now uses LaTeX3 packages such as expl3, so we need this:
\ExplSyntaxOn
%% This is for compatibility with Babel-aware package:
\cslet{ver@babel.sty}{\@empty} % this "fakes" babel
\def\languageshorthands#1{\relax} %this is for scrlttr2 class
-\AtEndPreamble{\let\bbl@set@language\xpg@set@language} %for biblatex
+\AtEndPreamble{\let\bbl@set@language\xpg@set@language@aux} %for biblatex
\AtEndPreamble{\let\bbl@main@language\xpg@main@language} %for biblatex
\ifluatex
@@ -32,8 +43,39 @@
{\let\xpg@boundaryclass=\e@alloc@intercharclass@top}
% Useful for getting list of loaded languages and variants. Like babel's bbl@loaded
-\let\xpg@loaded\@empty
-\let\xpg@vloaded\@empty
+\let\xpg@loaded\@empty% list of loaded languages (polyglossia name)
+\let\xpg@vloaded\@empty% list of loaded variants
+\let\xpg@bloaded\@empty% list of loaded languages (babel name)
+
+% counter in latin
+\def\latinalph#1{\expandafter\latin@alph\csname c@#1\endcsname}
+\def\latinAlph#1{\expandafter\latin@Alph\csname c@#1\endcsname}
+
+% select language hook
+\cs_new_nopar:Nn \polyglossia@AtBeginDocument@selectlanguage: {}
+% \disablehyphenation hook
+\cs_new_nopar:Nn \polyglossia@AtBeginDocument@hyphenation: {}
+
+% hook to be executed at begin of document
+\cs_new_nopar:Nn \polyglossia@AtBeginDocument: {
+ % save various command
+ \let\latin@alph\@alph % TODO rename when we have the C locale
+ \let\latin@Alph\@Alph % TODO rename when we have the C locale
+ % push to C language gloss
+ \let\polyglossia@Clang@@arabic\@arabic
+ \let\polyglossia@Clang@arabic\arabic
+
+ \xpg@initial@setup
+ % apply \familydefault changes
+ \xpg@set@familydefault
+ % now we have the C locale definition: select the language
+ \polyglossia@AtBeginDocument@selectlanguage:
+ % If hyphenation disabling has been requested in preamble, do it now
+ \polyglossia@AtBeginDocument@hyphenation:
+}
+\AtBeginDocument{
+ \polyglossia@AtBeginDocument:
+}
%% custom message macros
\providecommand*{\xpg@error}[1]{%
@@ -64,6 +106,24 @@
\def\xpg@ill@value#1#2{%
\xpg@warning{Illegal~ value~ (#1)~ for~ #2}}
+% error out if lang is not loaded
+\cs_new_nopar:Nn \polyglossia@error@iflangnotloaded:n
+{
+ \cs_if_exist:cF{#1@loaded}
+ {
+ \xpg@error{language~ #1~ is~ not~ loaded.~ Please~ load~ it~ before~ using~ it.}
+ }
+}
+
+
+% error do not use directly the gloss file
+\msg_new:nnn { polyglossia } { directloadgloss }
+{
+ You~ should~ not~ load~ directly~ the~ gloss~ file~ using~ `\string\usepackage'.
+ You~ must~ use~ `\string\setotherlanguage\{#1\}' or `\string\setmainlanguage\{#1\}'.
+}
+\msg_redirect_name:nnn { polyglossia } { directloadgloss } { critical }
+
%% use macro if defined, else warn that it is not
\def\csuse@warn#1{%
\ifcsundef{#1}{\xpg@warning{ \expandafter\string\csname #1\endcsname\space is~ not~ defined}}%
@@ -75,93 +135,85 @@
%% Used by the language definitions files for right-to-left languages
\def\RequireBidi{%
- \AtBeginDocument{%
- \ifxetex
- \RequirePackage{bidi}
- \else\ifluatex
- \RequirePackage{luabidi}
- \else
- \xpg@warning{You’re running a TeX engine that is not LuaTeX or XeTeX.\MessageBreak
- That is almost guaranteed to cause problems.}
- \fi\fi}}
+ \str_case_e:nnF{\c_sys_engine_str}{
+ {luatex}{\ifx\@onlypreamble\@notprerr\else\RequirePackage{luabidi}\fi}
+ {xetex}{\ifx\@onlypreamble\@notprerr\else\RequirePackage{bidi}\fi}
+ }
+ {
+ \xpg@warning{You’re running a TeX engine that is not LuaTeX or XeTeX.\MessageBreak
+ That is almost guaranteed to cause problems.}
+ }
+}
+
+% (lua)bidi commands to change directionality for paragraphs
+% and inline text.
+% overwritten with correct package
+\cs_new_nopar:Nn{\polyglossia@setpardirection:n}{%
+ \str_case_e:nnTF{#1}{%
+ {LR}{\relax}%
+ {RL}{\xpg@error{right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}}%
+ }%
+ {}%
+ {\xpg@error{Unknown~ language~ direction~ #1 ~(base~ wrapper)}}%
+}
+\cs_new_nopar:Nn{\polyglossia@settextdirection:n}{%
+ \str_case_e:nnTF{#1}{%
+ {LR}{\relax}%
+ {RL}{\xpg@error{right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}}%
+ }%
+ {}%
+ {\xpg@error{Unknown~ language~ direction~ #1 ~(base~ wrapper)}}%
+}
+\AtEndOfPackageFile*{bidi}{%
+ \ExplSyntaxOn%
+ \cs_gset_nopar:Nn{\polyglossia@setpardirection:n}{%
+ \str_case_e:nnTF{#1}{%
+ {LR}{\setLR}%
+ {RL}{\setRL}%
+ }%
+ {}%
+ {\xpg@error{Unknown~ language~ direction~ #1 ~(bidi~ wrapper)}}%
+ }%
+ \cs_gset_nopar:Nn{\polyglossia@settextdirection:n}{%
+ \str_case_e:nnTF{#1}{%
+ {LR}{\LRE}%
+ {RL}{\RLE}%
+ }%
+ {}%
+ {\xpg@error{Unknown~ language~ direction~ #1 ~(bidi~ wrapper)}}%
+ }%
+ \ExplSyntaxOff%
+}
+\AtEndOfPackageFile*{luabidi}{%
+ \ExplSyntaxOn%
+ \cs_gset_nopar:Nn{\polyglossia@setpardirection:n}{%
+ \str_case_e:nnTF{#1}{%
+ {LR}{\setLR}%
+ {RL}{\setRL}%
+ }
+ {}%
+ {\xpg@error{Unknown~ language~ direction~ #1 ~(luabidi~ wrapper)}}%
+ }%
+ \cs_gset_nopar:Nn{\polyglossia@settextdirection:n}{%
+ \str_case_e:nnTF{#1}{%
+ {LR}{\LRE}%
+ {RL}{\RLE}%
+ }
+ {}%
+ {\xpg@error{Unknown~ language~ direction~ #1 ~(luabidi~ wrapper)}}%
+ }%
+ \ExplSyntaxOff%
+}
%% compatibility with babel
\let\addto\gappto% gappto is defined in etoolbox
-%% == Utility macros ==
-%% They are needed because \MakeUppercase and \MakeLowercase are protected,
-%% but we need to change case while defining csnames when setting up fonts for
-%% non-Latin scripts. For instance with "Script=Arabic" we need to lowercase
-%% "Arabic" to create \arabicfont.
-\def\xpg@uppercasefirst#1{\expandafter\xpg@@uppercasefirst #1}
-\def\xpg@@uppercasefirst#1{%
- \if a#1A\else
- \if b#1B\else
- \if c#1C\else
- \if d#1D\else
- \if e#1E\else
- \if f#1F\else
- \if g#1G\else
- \if h#1H\else
- \if i#1I\else
- \if j#1J\else
- \if k#1K\else
- \if l#1L\else
- \if m#1M\else
- \if n#1N\else
- \if o#1O\else
- \if p#1P\else
- \if q#1Q\else
- \if r#1R\else
- \if s#1S\else
- \if t#1T\else
- \if u#1U\else
- \if v#1V\else
- \if w#1W\else
- \if x#1X\else
- \if y#1Y\else
- \if z#1Z\else
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
-}
-
-\def\xpg@lowercasefirst#1{\expandafter\xpg@@lowercasefirst #1}
-\def\xpg@@lowercasefirst#1{%
- \if A#1a\else
- \if B#1b\else
- \if C#1c\else
- \if D#1d\else
- \if E#1e\else
- \if F#1f\else
- \if G#1g\else
- \if H#1h\else
- \if I#1i\else
- \if J#1j\else
- \if K#1k\else
- \if L#1l\else
- \if M#1m\else
- \if N#1n\else
- \if O#1o\else
- \if P#1p\else
- \if Q#1q\else
- \if R#1r\else
- \if S#1s\else
- \if T#1t\else
- \if U#1u\else
- \if V#1v\else
- \if W#1w\else
- \if X#1x\else
- \if Y#1y\else
- \if Z#1z\else
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
-}
-
%% NEW EXPERIMENTAL SETUP INTERFACE FOR GLOSS FILES
%% options currently available:
%% language : the name of the language (as understood by fontspec)
%% hyphennames : the different hyphenation patterns to try (comma separated list)
%%% TODO: if pattern is prefixed by !, then it should be loaded as a fallback, with \xpg@nopatterns@fallback - i.e. with a warning: e.g. sanskrit for hindi, or catalan for asturian. – Also for languages with variants! (English and German, etc.)
%% script : the name of the script (as understood by fontspec) – default is Latin
-%% direction : the direction of the script: LR or RL
%% scripttag : the OpenType tag for the script
%% langtag : the OpenType tag for the language
%% hyphenmins : the hyphenmins for this language (comma-sep list of two integers)
@@ -170,127 +222,529 @@
%% fontsetup : boolean
%% TODO: nouppercase : boolean (for scripts like Arabic, Devanagari, etc which have no concept of uppercase/lowercase)
%% TODO: localalph = {<alph_csname>,<Alph_csname>}
-%% TODO: localnumber = <csname>
+%% TODO: localnumeral = <csname>
%% or even better localdigits = {0123456789} for fully automatic setup
-
\newif\if@xpg@language@really@defined@
\newcommand*\PolyglossiaSetup[2]{%
+ \polyglossia@keys_define_lang:n{#1}%
+ \keys_set:nn { polyglossia / #1 } { #2 }%
+ \prop_log:N{\polyglossia@langsetup}
+ \polyglossia_setup_hyphen:n {#1}
%define booleans etoolbox style and set defaults
%% TODO ? \providetoggle{#1@setup@done}%
- \providetoggle{#1@RL}%
- \providetoggle{#1@latin}\toggletrue{#1@latin}%
- \providetoggle{#1@scriptlangequal}% whether lang and script names are same: e.g. Hebrew, Arabic
- \providebool{#1@fontsetup}%
- \providebool{#1@indentfirst}%
- \providebool{#1@frenchspacing}%
% we initialize these so that we can use \gappto below
\csgdef{init@extras@#1}{}%
\csgdef{init@noextras@#1}{}% we don't use this yet: remove?
- \csgdef{xpg@langname@#1}{\xpg@uppercasefirst{#1}}%
- %needed for docsvlist with hyphennames key:
- \def\do##1{%
- \xpg@check@ifdefined{#1}
- \if@xpg@language@really@defined@\else
- \ifstrequal{#1}{##1}{}%
- {\xpg@ifdefined{##1}%
- {\expandafter\ifx\csname l@##1\endcsname\l@nohyphenation\else\csletcs{l@#1}{l@##1}\xpg@set@language@luatex@iv{##1}\fi}%
- {\csdef{l@##1}{l@nohyphenation}}%
- }%
- \fi
- }%
- %define all keys:
- \xpg@define@keys{#1}%
- \setkeys[xpg@setup]{#1}{#2}%
% here we do the fontsetup:
- \ifbool{#1@fontsetup}%
- {\xpg@fontsetup@auto{#1}}%
- {\xpg@info{Skipping~ automatic~ font~ setup~ for~ language~ #1}}%
+ \polyglossia@lang@autosetupfont:n{#1}
%% TODO? \toggletrue{#1@setup@done}%
% reinit \do
\def\do##1{\setotherlanguage{##1}}%
}
-\def\xpg@first#1,#2{#1}
-\def\xpg@second#1,#2{#2}
-
-\def\xpg@define@keys#1{%
- \define@key[xpg@setup]{#1}{script}{%
- \ifstrequal{##1}{Latin}%
- {\toggletrue{#1@latin}}%
- {\togglefalse{#1@latin}}%
- \csgdef{xpg@scriptname@#1}{##1}%
- \csgdef{xpg@scriptname@#1@lc}{\xpg@lowercasefirst{##1}}}%
- \define@key[xpg@setup]{#1}{scripttag}{%
- \csgdef{xpg@scripttag@#1}{##1}}%
- \define@key[xpg@setup]{#1}{language}{%
- \csgdef{xpg@langname@#1}{##1}}%
- \define@key[xpg@setup]{#1}{langtag}{%
- \csgdef{xpg@langtag@#1}{##1}}%
- \define@key[xpg@setup]{#1}{hyphennames}[{#1}]{%
- \docsvlist{##1}%
- % if l@#1 does not yet exist,
- % we assign it to nohyphenation
- % we do this here in case the hyphennames key was omitted
+% Adjust language key setting after initial setup
+% This is needed, e.g., for languages with varying script
+\DeclareDocumentCommand \SetLanguageKeys { m m }
+{
+ \clist_map_inline:nn { #1 } { \keys_set:nn { polyglossia / ##1 } { #2 } }
+}
+
+
+% setup hyphennames from a str list of hyphen
+\cs_new:Nn \polyglossia_setup_hyphen:n {
+ \exp_args:Nne \clist_set:Nn{\l_tmpa_clist}{\prop_item:Nn \polyglossia@langsetup {#1 / hyphennames}}
+ \providebool{havehyphen}
+ \boolfalse{havehyphen}
+ % for each hyphen in the set until we find one that works
+ \clist_map_inline:Nn \l_tmpa_clist {
+ \ifbool{havehyphen}{}{%
+ % check if language hyphenname is defined
+ \polyglossia@check@ifdefined:NF{#1}{%
+ % if not, first consider nohyphenation
+ \str_if_eq:nnTF{##1}{nohyphenation}
+ {%
+ \cs_gset_eq:cc{l@#1}{l@##1}
+ \global\booltrue{havehyphen}
+ }{%
+ % then test if hyphenation is defined
+ \xpg@ifdefined{##1}{
+ % test if language hyphenation is nohyphenation
+ \cs_if_eq:cNF{l@#1}{\l@nohyphenation}{\global\booltrue{havehyphen}}{%
+ % if false define language to hyphenation if it is not equal...
+ \str_if_eq:nnF{#1}{##1}{\cs_gset_eq:cc{l@#1}{l@##1}}
+ % ...and load
+ \xpg@set@hyphenation@patterns{##1}
+ \global\booltrue{havehyphen}
+ }%
+ }{}%
+ }%
+ }%
+ }%
+ }%
+ % if l@#1 does not yet exist,
+ % we assign it to nohyphenation
+ % we do this here in case and if the hyphennames key was omitted
+ \ifbool{havehyphen}{}{%
\xpg@ifdefined{#1}{}%
- {\xpg@nopatterns{\csname xpg@langname@#1\endcsname}%
- \expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax}%
- \csdef{#1@language}{%
- \ifbool{xpg@hyphenation@disabled}{%
- \xdef\xpg@lastlanguage{\the\csname l@#1\endcsname}%
- }{%
- \ifluatex%
- \xpg@set@language@luatex@iv{#1}%
- \fi%
- \language=\csname l@#1\endcsname%
- }%
+ {
+ \xpg@nopatterns{#1}
+ \expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax
}%
}%
- \define@choicekey+[xpg@setup]{#1}{direction}[\val\nr]{LR,RL}[LR]%
- {\ifcase\nr\relax
- \togglefalse{#1@RL}%
- \or
- \toggletrue{#1@RL}%
- \ifcsundef{RTL}{\ifluatex\RequirePackage{luabidi}\else\RequirePackage{bidi}\fi}{}% FIXME Use \RequireBidi and remove calls in individual gloss files.
- \fi}%
- {\xpg@warning{#1: Invalid value \val\space for key "direction"}}%
- \define@key[xpg@setup]{#1}{hyphenmins}[{2,3}]%
- {\begingroup\edef\x{\endgroup
- \noexpand\setlocalhyphenmins{#1}{\xpg@first##1}{\xpg@second##1}}\x}
- \define@boolkey[xpg@setup]{#1}[#1@]{frenchspacing}[true]{%
- \ifbool{#1@frenchspacing}%
- {\csgappto{init@extras@#1}{\frenchspacing}}%
- {\csgappto{init@extras@#1}{\nonfrenchspacing}}}%
- \define@boolkey[xpg@setup]{#1}[#1@]{indentfirst}[true]{%
- \ifbool{#1@indentfirst}%
- {\csgappto{init@extras@#1}{\french@indent}}%
- {\csgappto{init@extras@#1}{\nofrench@indent}}}%
-% \define@choicekey*+[xpg@setup]{#1}{fontsetup}[\val\nr]{none,custom,auto}[none]%
-% %{\csgdef{#1@fontsetup}{\val}}%
-% {\xpg@fontsetup{\val}{#1}}%
-% {\xpg@warning{Invalid value \val\space for key "fontsetup" in module "#1"}}%
- \define@boolkey[xpg@setup]{#1}[#1@]{fontsetup}[true]{}%
- %TODO assign csnames corr. to localized alph and Alph
- % \define@key[xpg@setup]{#1}{localalph}[{#1@alph,#1@Alph}]{%
- % \cslet{xpg@localalph@#1}{\expandafter\csname\xpg@first##1\endcsname}%
- % \cslet{xpg@localAlph@#1}{\expandafter\csname\xpg@second##1\endcsname}%
- %}%
- %TODO same thing with localdigits
+ \csdef{#1@language}{%
+ \polyglossia@setup@language@patterns{#1}%
+ }%
+ % setup hypenmins
+ \exp_args:NNe \clist_set:Nn \l_tmpa_clist
+ { \prop_item:Nn \polyglossia@langsetup {#1 / hyphenmins} }
+ \cs_if_eq:cNF {l@#1} \l@nohyphenation
+ {
+ \use:x
+ {
+ \exp_not:N \setlocalhyphenmins {#1}
+ { \clist_item:Nn \l_tmpa_clist {1} }
+ { \clist_item:Nn \l_tmpa_clist {2} }
+ }
+ }
+}
+
+\newcommand*\polyglossia@setup@language@patterns[1]{%
+ \ifbool{xpg@hyphenation@disabled}{%
+ \xdef\xpg@lastlanguage{\the\csname l@#1\endcsname}%
+ }{%
+ % first, test if \l@#1 exists
+ % without that, \csname l@#1\endcsname will be defined as \relax
+ \cs_if_exist:cTF {l@#1}
+ {
+ \cs_if_eq:cNTF {l@#1} \l@nohyphenation
+ {
+ \language=\l@nohyphenation
+ }
+ {
+ \xpg@set@hyphenation@patterns{#1}
+ }
+ }
+ {
+ \xpg@set@hyphenation@patterns{#1}
+ }
+ }
+}
+
+\prop_new:N \polyglossia@langsetup
+
+\cs_new_protected:Npn \polyglossia@keys_define_lang:n #1 {
+ \keys_define:nn {polyglossia}{
+ % the script font
+ #1 / script
+ .code:n = {
+ \prop_gput:Nnn{\polyglossia@langsetup}{#1/script}{##1}
+ \prop_gput:Nnx{\polyglossia@langsetup}{#1/lcscript}
+ {\tl_if_empty:nF{##1}{\str_lower_case:n##1}}
+ },
+ #1 / script
+ .value_required:n = true,
+ #1 / script
+ .initial:n = latin,
+ % the opentype script tag
+ #1 / scripttag
+ .code:n = {\prop_gput:Nnn{\polyglossia@langsetup}{#1/scripttag}{##1}},
+ #1 / scripttag
+ .default:n = {},
+ #1 / scripttag
+ .initial:n = {},
+ % the language full name
+ #1 / language
+ .code:n = {\prop_gput:Nnn{\polyglossia@langsetup}{#1/language}{##1}},
+ #1 / language
+ .value_required:n = true,
+ #1 / language
+ .initial:x = {\str_upper_case:n#1},
+ % the language tag
+ #1 / langtag
+ .code:n = {\prop_gput:Nnn{\polyglossia@langsetup}{#1/langtag}{##1}},
+ #1 / langtag
+ .value_required:n = true,
+ #1 / langtag
+ .initial:n = {},
+ % hyphennames
+ #1 / hyphennames
+ .code:n = {
+ \clist_set:Nn{\l_tmpa_clist}{##1}
+ \prop_gput:Nnx{\polyglossia@langsetup}{#1/hyphennames}{\clist_use:Nn \l_tmpa_clist {,}}
+ },
+ #1 / hyphennames
+ .value_required:n = true,
+ #1 / hyphennames
+ .initial:x = {\c_empty_clist},
+ % direction
+ #1 / direction
+ . code:n = {
+ \str_case_e:nnTF{##1}{
+ {LR}{}
+ {RL}{\RequireBidi}
+ }
+ {\prop_gput:Nnn{\polyglossia@langsetup}{#1/direction}{##1}}
+ {\xpg@error{Unknown~ direction~ "##1"~ for~ language~ "#1"}}
+ },
+ #1 / direction
+ .value_required:n = true,
+ #1 / direction
+ .initial:n = {LR},
+ % minimal left and right hyphenation minima using
+ #1 / hyphenmins
+ .code:n = {
+ % check syntax
+ \int_compare:nNnF { \clist_count:n {##1} } = {2}
+ {\xpg@error{hypenmins~should~be~a~list~of~two~entries,~got~"##1"}}
+ % set prop
+ \prop_gput:Nnn \polyglossia@langsetup {#1/hyphenmins} {##1}
+ },
+ #1 / hyphenmins
+ .value_required:n = true,
+ #1 / hyphenmins
+ .initial:n = {2,3},
+ % frenchspacing
+ #1 / frenchspacing
+ .code:n = {
+ \str_case_e:nnTF{##1}{
+ {true}{}
+ {false}{}
+ }
+ {}
+ {\xpg@error{frenchspacing~should~be~true~or~false. Is~ "##1"~ for~ language~ "#1"}}
+ \prop_gput:Nnn{\polyglossia@langsetup}{#1/frenchspacing}{##1}
+ },
+ #1 / frenchspacing
+ .default:n = true,
+ #1 / frenchspacing
+ .initial:n = false,
+ % indent first line
+ #1 / indentfirst
+ .code:n = {
+ \str_case_e:nnTF{##1}{
+ {true}{}
+ {false}{}
+ }
+ {}
+ {\xpg@error{indentfirst~should~be~true~or~false. Is~ "##1"~ for~ language "#1"}}
+ \prop_gput:Nnn{\polyglossia@langsetup}{#1/indentfirst}{##1}
+ },
+ #1 / indentfirst
+ .default:n = true,
+ #1 / indentfirst
+ .initial:n = false,
+ % fontsetup
+ #1 / fontsetup
+ .code:n = {
+ \str_case_e:nnTF{##1}{
+ {true}{}
+ {false}{}
+ }
+ {}
+ {\xpg@error{fontsetup~should~be~true~or~false. Is "##1"~ for~ language~ "#1"}}
+ \prop_gput:Nnn{\polyglossia@langsetup}{#1/fontsetup}{##1}
+ },
+ #1 / fontsetup
+ .default:n = true,
+ #1 / fontsetup
+ .initial:n = false,
+ % environment name
+ #1 / envname
+ .code:n = {
+ \prop_gput:Nnn{\polyglossia@langsetup}{#1/envname}{##1}
+ },
+ #1/ envname.value_required:n = true,
+ #1/ envname.initial:n = {#1},
+ % babel name
+ #1 / babelname
+ .code:n = {
+ \prop_gput:Nnn{\polyglossia@langsetup}{#1/babelname}{##1}
+ },
+ #1/ babelname.value_required:n = true,
+ #1/ babelname.initial:n = {#1},
+ % default numerals
+ #1 / localnumeral
+ . code:n = {
+ \prop_gput:Nnn{\polyglossia@langsetup}{#1/localnumeral}{##1}
+ \prop_gput:Nnn{\polyglossia@langsetup}{#1/Localnumeral}{##1}
+ },
+ #1 / localnumeral.value_required:n = true,
+ #1 / localnumeral.initial:n = {polyglossia@C@localnumeral},
+ % uppercased
+ #1 / Localnumeral
+ . code:n = {
+ \prop_gput:Nnn{\polyglossia@langsetup}{#1/Localnumeral}{##1}
+ },
+ #1 / Localnumeral.value_required:n = true,
+ #1 / Localnumeral.initial:n = {polyglossia@C@localnumeral}
+ }
+}
+
+% TODO move to C module
+\newcommand*{\polyglossia@C@localnumeral}[2]{
+ \polyglossia@Clang@@arabic{#2}
+}
+
+% print using main language
+% #2 is the numeral to print
+% #3 is the mainlanguage (should be expanded)
+% #4 is the current language (should be expanded)
+% #1 is the option list (should be expanded)
+% #5 is the name of the field to use
+\cs_new:Nn \polyglossia_localnumeral_mainlang:nnnnn {
+ \foreignlanguage{#3}{\use:c {\prop_item:Nn \polyglossia@langsetup {#3/#5}} {#1} {#2}}
+}
+
+
+% print using local language
+% #2 is the numeral to print
+% #3 is the mainlanguage (should be expanded)
+% #4 is the current language (should be expanded)
+% #1 is the option list (should be expanded)
+% #5 is the name of the field to use
+\cs_new:Nn \polyglossia_localnumeral_locallang:nnnnn {
+ \use:c {\prop_item:Nn \polyglossia@langsetup {#4/#5}} {#1} {#2}
+}
+
+% this function try to resolve some simple parameter about lang
+% call #2 then branching if found
+% call parameter #3 if not found
+% (use curing)
+\cs_new:Npn \polyglossia_localnumeral_callshortcutorlong:nF #1#2 {
+ \str_case:nnF{#1}{
+ {lang=local}{\polyglossia_localnumeral_locallang:nnnnn}
+ }
+ {#2}
+}
+
+\cs_new:Npn \polyglossia_iii_map_csv_field_split_kv_iii_localnumeral:w #1 = #2 \q_stop {
+ \str_case:nnF{#2}{
+ {local} {\clist_map_break:n{\use_i:nn \polyglossia_localnumeral_locallang:nnnnn }}
+ {default}{\clist_map_break:n{\use_i:nn \polyglossia_localnumeral_locallang:nnnnn }}
+ {*} {\clist_map_break:n{\use_i:nn\polyglossia_localnumeral_mainlang:nnnnn }}
+ {main} {\clist_map_break:n{\use_i:nn\polyglossia_localnumeral_mainlang:nnnnn }}
+ }{
+ \clist_map_break:n{ \use_i_ii:nnn \polyglossia_localnumeral_langlang:nnnnnn {{#2}} }
+ }
+}
+
+
+% call the language
+% #3 is the numeral to print
+% #4 is the mainlanguage (should be expanded)
+% #5 is the current language (should be expanded)
+% #2 is the option list (should be expanded)
+% #6 is the name of the field to use
+% #1 is the language used
+\cs_new:Nn \polyglossia_localnumeral_langlang:nnnnnn {
+ \foreignlanguage{#1}{\use:c {\prop_item:Nn \polyglossia@langsetup {#1/#6}} {#2} {#3}}
+}
+
+
+% check if empty value
+\cs_new:Npn \polyglossia_iii_map_csv_field_split_kv_ii_localnumeral:w #1 #2 = #3 \q_stop {
+ \quark_if_no_value:NTF {#3}
+ {
+ \clist_map_break:n{\use_i:nn \polyglossia_localnumeral_locallang:nnnnn}
+ }
+ {
+ \polyglossia_iii_map_csv_field_split_kv_iii_localnumeral:w #1 \q_stop
+ }
+}
+
+\cs_new:Npn \polyglossia_iii_map_csv_field_split_kv_i_localnumeral:nw #1 #2 = #3 \q_stop {
+ % parse only lang tag
+ \tl_trim_spaces_apply:nN {#2} \str_if_eq:nnT {lang}
+ {
+ % if empty value
+ \quark_if_nil:nTF{#3}
+ {
+ \clist_map_break:n{\use_i:nn \polyglossia_localnumeral_locallang:nnnn}
+ }
+ {
+ % here we know what we have an equal sign
+ \polyglossia_iii_map_csv_field_split_kv_ii_localnumeral:w {#1} #1 \q_no_value \q_stop
+ }
+ }
+}
+
+% map function
+\cs_new:Nn \polyglossia_iii_map_csv_localnumeral:n {
+ % fast case is do nothing is empty
+ \tl_if_empty:nF{#1}
+ {
+ \polyglossia_iii_map_csv_field_split_kv_i_localnumeral:nw {#1} #1 = \q_nil \q_stop
+ }
+}
+
+
+% treat option is empty and option is lang=local
+% #2 number
+% #3 mainlanguage
+% #4 locallanguage
+% #5 field to call
+% #1 option
+% strip space to option
+\cs_new:Nn \polyglossia_iii_localnumeral:nnnnn {
+ \tl_if_blank:nTF{#1}
+ {
+ \polyglossia_localnumeral_mainlang:nnnnn
+ }
+ {
+ \str_if_eq:nnTF{#1}{lang=local}
+ {
+ \polyglossia_localnumeral_locallang:nnnnn
+ }
+ {
+ % use postscript like trick push to stack {#1} {#2} {#3} {#4}
+ \polyglossia_localnumeral_callshortcutorlong:nF {#1}
+ {
+ % same trick here if found we emit \use_i:nn
+ % thus discarding the default choice that is not lang specified thus local
+ \clist_map_function:nN {#1} {\polyglossia_iii_map_csv_localnumeral:n}
+ \polyglossia_localnumeral_locallang:nnnnn
+ }
+ }
+ {#1} {#2} {#3} {#4} {#5}
+ }
+}
+
+
+% internal helper useful for oeee and onnn
+% #1 number
+% #2 mainlanguage
+% #3 locallanguage
+% #4 option
+% #5 field to call
+% strip space to option
+\cs_new:Nn \polyglossia_ii_localnumeral:nnnnn {
+ \tl_trim_spaces_apply:nN {#4} \polyglossia_iii_localnumeral:nnnnn {#1}{#2}{#3}{#5}
+}
+\cs_generate_variant:Nn \polyglossia_ii_localnumeral:nnnnn {
+ eeenn, eeeon, eeeen
+}
+
+% convert the counter to value
+% #1 counter
+% #2 mainlanguage
+% #3 locallanguage
+% #4 option
+\cs_new:Nn \polyglossia_i_localnumeral:nnnnn
+{
+ \polyglossia_ii_localnumeral:eeeen {\int_value:w #1} {#2} {#3} {#4} {#5}
+}
+
+% print number usage \localnumeral[option]{numeral}
+% or \localnumeral*[option]{counter}
+% \Localnumeral[]{numeral} use main language
+% \localnumeral{numeral} use local language
+\NewExpandableDocumentCommand{\localnumeral}{som}
+{
+ \IfBooleanTF{#1}%
+ {% starred: take counter
+ \exp_args:Nc \polyglossia_i_localnumeral:nnnnn {c@#3}
+ {\mainlanguagename} {\languagename} {\IfNoValueTF {#2}{lang=local}{#2}} {localnumeral}
+ }{% unstarred: take number
+ \polyglossia_ii_localnumeral:eeeen {\int_eval:n{#3}}
+ {\mainlanguagename} {\languagename} {\IfNoValueTF {#2}{lang=local}{#2}} {localnumeral}
+ }
}
+% print number usage \Localnumeral[option]{numeral}
+% or \Localnumeral*[option]{counter}
+% \Localnumeral[]{numeral} use main language
+% \localnumeral{numeral} use local language
+\NewExpandableDocumentCommand{\Localnumeral}{som}
+{
+ \IfBooleanTF{#1}%
+ {% starred: take counter
+ \exp_args:Nc \polyglossia_i_localnumeral:nnnnn {c@#3}
+ {\mainlanguagename} {\languagename} {\IfNoValueTF {#2}{lang=local}{#2}} {Localnumeral}
+ }{% unstarred: take number
+ \polyglossia_ii_localnumeral:eeeon {\int_eval:n{#3}}
+ {\mainlanguagename} {\languagename} {\IfNoValueTF {#2}{lang=local}{#2}} {Localnumeral}
+ }
+}
+
+\cs_new_nopar:Nn{\polyglossia@lang@frenchspacing:n}{
+ \prop_get:NnNTF \polyglossia@langsetup {#1/frenchspacing} \l_tmpa_tl
+ {
+ \str_case_e:nnF{\l_tmpa_tl}{
+ {true}{\frenchspacing}
+ {false}{\nonfrenchspacing}
+ }
+ {\xpg@error{frenchspacing~should~be~true~or~false. Is~"\l_tmpa_ttl"~ for~ language~ "#1"}}
+ }
+ {
+ \xpg@error{Could~ not~ retrieve~ key~ frenchspacing~ for~ language~ "#1"}
+ \prop_show:N{\polyglossia@langsetup}
+ }
+}
+
+\cs_new_nopar:Nn{\polyglossia@lang@indentfirst:n}{
+ \prop_get:NnNTF \polyglossia@langsetup {#1/indentfirst} \l_tmpa_tl
+ {
+ \str_case_e:nnF{\l_tmpa_tl}{
+ {true}{\french@indent}
+ {false}{\nofrench@indent}
+ }
+ {\xpg@error{indentfirst~should~be~true~or~false. Is~"\l_tmpa_ttl"~ for~ language~ "#1"}}
+ }
+ {
+ \xpg@error{Could~ not~ retrieve~ key~ indentfirst~ for~ language~ "#1"}
+ \prop_show:N{\polyglossia@langsetup}
+ }
+}
+
+
+\cs_new:Nn{\polyglossia@lang@setpardirection:n}{
+ \prop_get:NnNTF \polyglossia@langsetup {#1/direction} \l_tmpa_tl
+ {
+ \polyglossia@setpardirection:n{\l_tmpa_tl}
+ }
+ {
+ \xpg@error{Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
+ \prop_show:N{\polyglossia@langsetup}
+ }
+}
+
+
+\cs_new:Nn{\polyglossia@lang@settextdirection:nn}{
+ \prop_get:NnNTF \polyglossia@langsetup {#1/direction} \l_tmpa_tl
+ {
+ \polyglossia@settextdirection:n{\l_tmpa_tl}{#2}
+ }
+ {
+ \xpg@error{Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
+ \prop_show:N{\polyglossia@langsetup}
+ }
+}
+
+\AtEndDocument{\prop_log:N{\polyglossia@langsetup}}
\def\xpg@lastlanguage{0}%
\providebool{xpg@hyphenation@disabled}%
\boolfalse{xpg@hyphenation@disabled}
\def\xpg@disablehyphenation{%
+ \ifx\@onlypreamble\@notprerr%
+ \xpg@@disablehyphenation%
+ \else%
+ % if this is used in the preamble, we have to postpone
+ % the execution until the main language has been set (#125).
+ \cs_gset_nopar:Nn \polyglossia@AtBeginDocument@hyphenation: {
+ \xpg@@disablehyphenation%
+ }%
+ \fi%
+}
+
+\def\xpg@@disablehyphenation{%
\ifbool{xpg@hyphenation@disabled}{}{%
\booltrue{xpg@hyphenation@disabled}%
\xdef\xpg@lastlanguage{\the\language}%
- \xpg@set@language@luatex@iv{nohyphenation}
+ % We do not call \xpg@set@hyphenation@patterns here to avoid a warning message.
+ % "nohyphenation" is not listed in language.dat.lua.
\language=\l@nohyphenation%
- \ifluatex %
- \directlua{polyglossia.disable_hyphenation()}%
- \fi %
}%
}
@@ -298,9 +752,6 @@
\ifbool{xpg@hyphenation@disabled}{%
\boolfalse{xpg@hyphenation@disabled}%
\language=\csname xpg@lastlanguage\endcsname%
- \ifluatex %
- \directlua{polyglossia.enable_hyphenation()}%
- \fi %
}{}%
}
@@ -311,151 +762,163 @@
%\def\xpg@fontsetup@none#1{\csgdef{#1@font}{\ifcsdef{#1font}{\csname #1font\endcsname}{}}} %<-- simplistic
%\def\xpg@fontsetup@custom#1{\csuse{#1@font}}
-\def\xpg@fontsetup@auto#1{\iftoggle{#1@latin}%
- {\xpg@fontsetup@latin{#1}}%
- {\xpg@fontsetup@nonlatin{#1}}%
-}
-
-\def\xpg@addfontfeature@lang#1#2{% #1 is langtag, #2 is langname
- % Turkish is a special case: tag can be TRK or TUR
- \edef\tmp@Turkish{Turkish}%
- \edef\tmp@@langname{#2}%
- % \ifstrequal{#2}{Turkish}%
- \ifx\tmp@@langname\tmp@Turkish
- \fontspec_if_language:nTF {TRK}%
- {\addfontfeature{Language=Turkish}}%
- {\fontspec_if_language:nTF {TUR}%
- {\addfontfeature{Language=Turkish}}%
- {}}%
- % else not Turkish
- \else
- \edef\tmp@@langparam{Language=#2}%
- \expandafter\expandafter\expandafter\fontspec_if_language:nTF \expandafter{#1}%
- {\expandafter\expandafter\expandafter\addfontfeature\expandafter{\tmp@@langparam}}%
- {}%
- \fi
+\cs_new:Nn \polyglossia@lang@autosetupfont:n {
+ \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#1/fontsetup}}{true}
+ {
+ \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#1/lcscript}}{latin}%
+ {\xpg@fontsetup@latin{#1}}
+ {\xpg@fontsetup@nonlatin{#1}}
+ }
+ {
+ \xpg@info{Skipping~ automatic~ font~ setup~ for~ language~ #1}
+ }
}
-\def\xpg@addfontfeature@script#1#2{% #1 is scripttag, #2 is scriptname
- \edef\tmp@@scriptparam{Script=#2}%
- \expandafter\expandafter\expandafter\fontspec_if_script:nTF \expandafter{#1}%
- {\expandafter\expandafter\expandafter\addfontfeature\expandafter{\tmp@@scriptparam}}%
- {\xpg@error{The~ current~ roman~ font~ does~ not~ contain~ the~ \expandafter\noexpand#2 ~ script!\MessageBreak
- Please~ define~ \expandafter\string\csname \xpg@lowercasefirst{#2}font\endcsname\space with~ \string\newfontfamily}}%
+
+% add fontfeature Language=#2 to langtag #1
+% do nothing if #1 or #2 is empty
+\cs_new:Nn \polyglossia@addfontfeature@language:nn {
+ \bool_if:nTF{\tl_if_empty_p:n{#1} || \tl_if_empty_p:n{#2}}
+ {
+ % maybe an error ?
+ \xpg@warning{Asking~ to~ add~ empty~ feature~to~ latin~ font~
+ (Language="#2"~ to~ langtag~ "#1")}
+ }
+ {
+ \str_if_eq:nnTF{#2}{Turkish}{
+ \fontspec_if_language:nTF {TRK}%
+ {
+ \addfontfeature{Language=Turkish}
+ }
+ {
+ \fontspec_if_language:nTF {TUR}%
+ {
+ \addfontfeature{Language=Turkish}
+ }{}
+ }
+ }{
+ \fontspec_if_language:nTF{#1}
+ {
+ \addfontfeature{Language=#2}
+ }
+ {}
+ }
+ }
+}
+\cs_generate_variant:Nn \polyglossia@addfontfeature@language:nn { on , no, oo , Vn, nV, VV , xn, nx, xx}
+
+% add fontfeature Script=#2 to scripttag #1
+% do nothing if #1 or #2 is empty
+\cs_new:Nn \polyglossia@addfontfeature@script:nn {
+ \bool_if:nTF{\tl_if_empty_p:n{#1} || \tl_if_empty_p:n{#2}}
+ {
+ % maybe an error ?
+ \xpg@warning{Asking~ to~ add~ empty~ feature~to~ latin~ font
+ (Script="#2"~ to~ scripttag~ "#1")}
+ }
+ {
+ \fontspec_if_script:nTF{#1}
+ {\addfontfeature{Script=#2}}
+ {\xpg@error{
+ The~ current~ latin ~ font~ \l_fontspec_family_tl\space does~ not~ contain~ the~"#2"~ script!\MessageBreak
+ Please~ define~\csname\tl_if_empty:nF{#2}{\str_lower_case:n#2}font\endcsname~
+ with~ \string\newfontfamily\space command
+ }
+ }
+ }
}
+\cs_generate_variant:Nn \polyglossia@addfontfeature@script:nn { on , no, oo , Vn, nV, VV , xn, nx, xx}
\def\xpg@fontsetup@latin#1{%
\begingroup
\csgdef{#1@font@rm}{%
- \ifcsdef{#1font}{\csname #1font\endcsname}%
- {\edef\tmp@langtag{\csuse{xpg@langtag@#1}}%
- \edef\tmp@langname{\csuse{xpg@langname@#1}}%
- \rmfamilylatin%
- \ifcsvoid{xpg@langtag@#1}{}{%
- \ifcsvoid{xpg@langname@#1}{}{%
- \xpg@addfontfeature@lang{\tmp@langtag}{\tmp@langname}}%
- }}}%
+ \cs_if_exist_use:cF{#1font}{
+ \rmfamilylatin
+ \polyglossia@addfontfeature@language:xx{\prop_item:Nn{\polyglossia@langsetup}{#1/langtag}}
+ {\prop_item:Nn{\polyglossia@langsetup}{#1/language}}
+ }
+ }
\csgdef{#1@font@sf}{%
- \ifcsdef{#1fontsf}{\csname #1fontsf\endcsname}%
- {\edef\tmp@langtag{\csuse{xpg@langtag@#1}}%
- \edef\tmp@langname{\csuse{xpg@langname@#1}}%
- \sffamilylatin%
- \ifcsvoid{xpg@langtag@#1}{}{%
- \ifcsvoid{xpg@langname@#1}{}{%
- \xpg@addfontfeature@lang{\tmp@langtag}{\tmp@langname}}%
- }}}%
+ \cs_if_exist_use:cF{#1fontsf}{
+ \sffamilylatin
+ \polyglossia@addfontfeature@language:xx{\prop_item:Nn{\polyglossia@langsetup}{#1/langtag}}
+ {\prop_item:Nn{\polyglossia@langsetup}{#1/language}}
+ }%
+ }%
\csgdef{#1@font@tt}{%
- \ifcsdef{#1fonttt}{\csname #1fonttt\endcsname}%
- {\edef\tmp@langtag{\csuse{xpg@langtag@#1}}%
- \edef\tmp@langname{\csuse{xpg@langname@#1}}%
- \ttfamilylatin%
- \ifcsvoid{xpg@langtag@#1}{}{%
- \ifcsvoid{xpg@langname@#1}{}{%
- \xpg@addfontfeature@lang{\tmp@langtag}{\tmp@langname}}%
- }}}%
+ \cs_if_exist_use:cF{#1fonttt}{
+ \ttfamilylatin
+ \polyglossia@addfontfeature@language:xx{\prop_item:Nn{\polyglossia@langsetup}{#1/langtag}}
+ {\prop_item:Nn{\polyglossia@langsetup}{#1/language}}
+ }%
+ }%
\endgroup
}
\def\xpg@fontsetup@nonlatin#1{%
\begingroup
- \edef\tmp@langname@lc{#1}% eg ukrainian
- \edef\tmp@scriptname@lc{\csuse{xpg@scriptname@#1@lc}}% eg cyrillic
- \ifx\tmp@scriptname@lc\tmp@langname@lc
- \toggletrue{#1@scriptlangequal}%
- \else
- \togglefalse{#1@scriptlangequal}%
- \fi
\csgdef{#1@font@rm}{%
- \ifcsdef{#1font}%
- {\@nameuse{#1font}}%
- {\edef\tmp@scripttag{\csuse{xpg@scripttag@#1}}% eg cyrl
- \edef\tmp@scriptname{\csuse{xpg@scriptname@#1}}% eg Cyrillic
- \edef\tmp@langtag{\csuse{xpg@langtag@#1}}% eg UKR
- \edef\tmp@langname{\csuse{xpg@langname@#1}}% eg Ukrainian
+ \cs_if_exist_use:cF{#1font}
+ {
\providetoggle{#1@use@script@font}%
- \iftoggle{#1@scriptlangequal}%
+ \str_if_eq:nnTF{\prop_item:Nn{\polyglossia@langsetup}{#1/script}}{\prop_item:Nn{\polyglossia@langsetup}{#1/language}}
{\rmfamilylatin}%
- {\expandafter\ifcsname\csuse{xpg@scriptname@#1@lc} font\endcsname% eg \cyrillicfont
- \toggletrue{#1@use@script@font}%
- \expandafter\csname\csuse{xpg@scriptname@#1@lc} font\endcsname
- \else
- \rmfamilylatin
- \fi}
+ {\cs_if_exist_use:cTF{\prop_item:Nn{\polyglossia@langsetup}{#1/lcscript} font}
+ {
+ \toggletrue{#1@use@script@font}%
+ }
+ {
+ \rmfamilylatin
+ }
+ }
\iftoggle{#1@use@script@font}{}{%
- \ifcsvoid{xpg@scripttag@#1}{}{%
- \ifcsvoid{xpg@scriptname@#1}{}{%
- \xpg@addfontfeature@script{\tmp@scripttag}{\tmp@scriptname}}}}%
- \ifcsvoid{xpg@langtag@#1}{}{%
- \ifcsvoid{xpg@langname@#1}{}{%
- \xpg@addfontfeature@lang{\tmp@langtag}{\tmp@langname}}}%
+ \polyglossia@addfontfeature@script:xx{\prop_item:Nn{\polyglossia@langsetup}{#1/scripttag}}
+ {\prop_item:Nn{\polyglossia@langsetup}{#1/script}}
+ }%
+ \polyglossia@addfontfeature@language:xx{\prop_item:Nn{\polyglossia@langsetup}{#1/langtag}}
+ {\prop_item:Nn{\polyglossia@langsetup}{#1/language}}
}}%
\csgdef{#1@font@sf}{%
- \ifcsdef{#1fontsf}%
- {\@nameuse{#1fontsf}}%
- {\edef\tmp@scripttag{\csuse{xpg@scripttag@#1}}% eg cyrl
- \edef\tmp@scriptname{\csuse{xpg@scriptname@#1}}% eg Cyrillic
- \edef\tmp@langtag{\csuse{xpg@langtag@#1}}% eg UKR
- \edef\tmp@langname{\csuse{xpg@langname@#1}}% eg Ukrainian
+ \cs_if_exist_use:cF{#1fontsf}%
+ {
\providetoggle{#1@use@script@fontsf}%
- \iftoggle{#1@scriptlangequal}%
+ \str_if_eq:nnTF{\prop_item:Nn{\polyglossia@langsetup}{#1/script}}{\prop_item:Nn{\polyglossia@langsetup}{#1/language}}
{\sffamilylatin}%
- {\expandafter\ifcsname\csuse{xpg@scriptname@#1@lc} fontsf\endcsname% eg \cyrillicfontsf
- \toggletrue{#1@use@script@fontsf}%
- \expandafter\csname\csuse{xpg@scriptname@#1@lc} fontsf\endcsname
- \else
- \sffamilylatin
- \fi}
+ {\cs_if_exist_use:cTF{\prop_item:Nn{\polyglossia@langsetup}{#1/lcscript} fontsf}
+ {
+ \toggletrue{#1@use@script@fontsf}%
+ }
+ {
+ \sffamilylatin
+ }
+ }
\iftoggle{#1@use@script@fontsf}{}{%
- \ifcsvoid{xpg@scripttag@#1}{}{%
- \ifcsvoid{xpg@scriptname@#1}{}{%
- \xpg@addfontfeature@script{\tmp@scripttag}{\tmp@scriptname}}}}%
- \ifcsvoid{xpg@langtag@#1}{}{%
- \ifcsvoid{xpg@langname@#1}{}{%
- \xpg@addfontfeature@lang{\tmp@langtag}{\tmp@langname}}}%
+ \polyglossia@addfontfeature@script:xx{\prop_item:Nn{\polyglossia@langsetup}{#1/scripttag}}
+ {\prop_item:Nn{\polyglossia@langsetup}{#1/script}}
+ }%
+ \polyglossia@addfontfeature@language:xx{\prop_item:Nn{\polyglossia@langsetup}{#1/langtag}}
+ {\prop_item:Nn{\polyglossia@langsetup}{#1/language}}
}}%
\csgdef{#1@font@tt}{%
- \ifcsdef{#1fonttt}%
- {\@nameuse{#1fonttt}}%
- {\edef\tmp@scripttag{\csuse{xpg@scripttag@#1}}% eg cyrl
- \edef\tmp@scriptname{\csuse{xpg@scriptname@#1}}% eg Cyrillic
- \edef\tmp@langtag{\csuse{xpg@langtag@#1}}% eg UKR
- \edef\tmp@langname{\csuse{xpg@langname@#1}}% eg Ukrainian
+ \cs_if_exist_use:cF{#1fonttt}%
+ {
\providetoggle{#1@use@script@fonttt}%
- \iftoggle{#1@scriptlangequal}%
- {\ttfamilylatin}%
- {\expandafter\ifcsname\csuse{xpg@scriptname@#1@lc} fonttt\endcsname% eg \cyrillicfonttt
- \toggletrue{#1@use@script@fonttt}%
- \expandafter\csname\csuse{xpg@scriptname@#1@lc} fonttt\endcsname
- \else
- \ttfamilylatin
- \fi}
+ \str_if_eq:nnTF{\prop_item:Nn{\polyglossia@langsetup}{#1/script}}{\prop_item:Nn{\polyglossia@langsetup}{#1/language}}
+ {\ttfamilylatin}%
+ {\cs_if_exist_use:cTF{\prop_item:Nn{\polyglossia@langsetup}{#1/lcscript} fonttt}
+ {
+ \toggletrue{#1@use@script@fonttt}%
+ }
+ {
+ \ttfamilylatin
+ }
+ }
\iftoggle{#1@use@script@fonttt}{}{%
- \ifcsvoid{xpg@scripttag@#1}{}{%
- \ifcsvoid{xpg@scriptname@#1}{}{%
- \xpg@addfontfeature@script{\tmp@scripttag}{\tmp@scriptname}}}}%
- \ifcsvoid{xpg@langtag@#1}{}{%
- \ifcsvoid{xpg@langname@#1}{}{%
- \xpg@addfontfeature@lang{\tmp@langtag}{\tmp@langname}}}%
+ \polyglossia@addfontfeature@script:xx{\prop_item:Nn{\polyglossia@langsetup}{#1/scripttag}}
+ {\prop_item:Nn{\polyglossia@langsetup}{#1/script}}
+ }%
+ \polyglossia@addfontfeature@language:xx{\prop_item:Nn{\polyglossia@langsetup}{#1/langtag}}
+ {\prop_item:Nn{\polyglossia@langsetup}{#1/language}}
}}%
\endgroup
}
@@ -464,8 +927,8 @@
%% ensure localization of \markright and \markboth commands
%%% THIS IS NOW DISABLED BY DEFAULT
-\define@boolkey{polyglossia}[xpg@]{localmarks}[false]{%
- \ifbool{xpg@localmarks}{%
+\newcommand{\local@marks}[1]{}
+\def\enable@local@marks{
\xpg@info{Option:~ localmarks}%
\def\local@marks##1{%
\def\markboth####1####2{%
@@ -492,11 +955,8 @@
\def\@markright####1####2####3{\@temptokena{\protect\@@ensure@maindir{####1}}%
\unrestored@protected@xdef\@themark{{\the\@temptokena}%
{\protect\@@ensure@maindir{####3}}}}}%
- }{% else
- \def\local@marks##1{}%
- }%
}
-\setkeys{polyglossia}{localmarks=false}
+
% Easy way out – Arthur, 2012-08-01
\ifcsdef{newXeTeXintercharclass}{%
@@ -504,9 +964,15 @@
\newXeTeXintercharclass\xpg@normalclass %TODO
}{}
+\ifxetex
%% when no patterns are available, we use \l@nohyphenation, assigned to 255
%% (suggestion by Enrico Gregorio)
-\@ifundefined{l@nohyphenation}{\chardef\l@nohyphenation=255 }{}
+ \@ifundefined{l@nohyphenation}{\chardef\l@nohyphenation=255 }{}
+\else\ifluatex
+ \@ifundefined{l@nohyphenation}{\chardef\l@nohyphenation=\directlua{
+ tex.sprint(polyglossia.newloader_loaded_languages.nohyphenation)}\relax
+ }{}
+\fi\fi
%we call this macro when a gloss file is not found for a given language
\def\xpg@nogloss#1{%
@@ -525,85 +991,169 @@
\makeatletter
\input{#1}\catcode`\@=\xpg@atcatcode}
+% try to load a language file
+\cs_new:Nn \polyglossia_load_lang_definition:nn {
+ \file_if_exist:nTF{gloss-#2.ldf}
+ {
+ \xpg@input{gloss-#2.ldf}
+ \setkeys{#2}{#1}
+ }
+ {
+ \xpg@nogloss{#2}
+ }
+}
+
+
+% define environment and command
+\cs_new:Nn \polyglossia@define@language@cmd:n {
+ \exp_args:Ne
+ \newenvironment {\prop_item:Nn{\polyglossia@langsetup}{#1/envname}} [1] []
+ {
+ \begin{otherlanguage}[##1]{#1}
+ }%
+ {
+ \end{otherlanguage}
+ }%
+ \exp_args:Nc \newcommand {text#1} [2][]
+ {%
+ \xpg@textlanguage[##1]{#1}{##2}%
+ }%
+}
+
\newcommand{\setdefaultlanguage}[2][]{%
- \edef\xpg@loaded{#2\ifx\xpg@loaded\@empty\else,\xpg@loaded\fi}%
- \IfFileExists{gloss-#2.ldf}%
- {\ifcsundef{#2@loaded}%
- {\xpg@input{gloss-#2.ldf}%
- \xpg@info{Default~ language~ is~ #2}%
- \def\languagename{#2}%
- \ifluatex %
- \directlua{polyglossia.set_default_language('\luatexluaescapestring{\string#2}')}%
- \fi %
- % This is needed because \arabic is a built-in LaTeX command:
- % so now we have \begin{Arabic}... instead of \begin{arabic}...
- \ifstrequal{#2}{arabic}%
- {\newenvironment{Arabic}[1][]{\begin{otherlanguage}[####1]{arabic}}%
- {\end{otherlanguage}}}%
- {\newenvironment{#2}[1][]{\begin{otherlanguage}[####1]{#2}}%
- {\end{otherlanguage}}}%
- \expandafter\newcommand\csname text#2\endcsname[2][]{%
- \ifcsdef{RTL}%
- {\iftoggle{#2@RL}%
- {\@ensure@RTL{\foreignlanguage[####1]{#2}{####2}}}%
- {\@ensure@LTR{\foreignlanguage[####1]{#2}{####2}}}%
- }% else bidi not loaded
- {\iftoggle{#2@RL}%
- {\xpg@error{Language~ #2~ is~ right-to-left,~ but~ bidi~ package~ was~ not~ loaded!}}%
- {\foreignlanguage[####1]{#2}{####2}}%
- }%
- }%
- \csletcs{local#2}{text#2}%
- \csgdef{#2@loaded}{}%
- \gdef\xpg@main@language{#2}%
- }%
- {\xpg@warning{gloss-#2.ldf~ is~ already~ loaded!}}%:
- %% The following settings are for the default language and script:
- \iftoggle{#2@RL}{\@RTLmaintrue}{}% this tells bidi.sty that the document is RTL
- \AtBeginDocument{%
- \selectlanguage[#1]{#2}%
- \selectbackgroundlanguage{#2}}%
- }%
- %ELSE
- {\xpg@nogloss{#2}}%
+ \ifcsundef{#2@loaded}%
+ {
+ % latex is an internal language, so do not record
+ \ifstrequal{#2}{latex}{}{%
+ \global\edef\xpg@loaded{#2\ifx\xpg@loaded\@empty\else,\xpg@loaded\fi}%
+ \global\edef\xpg@bloaded{\prop_item:Nn{\polyglossia@langsetup}{#2/babelname}%
+ \ifx\xpg@bloaded\@empty\else,\xpg@bloaded\fi}%
+ }%
+ \polyglossia_load_lang_definition:nn{#1}{#2}
+ % define environment and command (except for internal latex language)
+ \ifstrequal{#2}{latex}{}{%
+ \polyglossia@define@language@cmd:n{#2}
+ }%
+ \csgdef{#2@loaded}{}%
+ }
+ {
+ \relax
+ }
+ \gdef\xpg@main@language{#2}%
+ \tl_if_blank:nTF {#1}{\gdef\mainlanguagevariant{}}{%
+ % If the optional argument sets a value for the key “variant”,
+ % store it in \xpg@main@langvariant
+ \clist_map_inline:nn { #1 } {%
+ \xpg@parsevariantkeyvalue##1=@xpg@main@langvariant\relax
+ }%
+ }%
+ % Store babelname of main language (for external packages such as biblatex)
+ \xdef\mainbabelname{\prop_item:Nn{\polyglossia@langsetup}{#2/babelname}}%
+ %% The following settings are for the default language and script
+ % this tells bidi.sty or luabidi.sty that the document is RTL
+ \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#2/direction}}{RL}{%
+ \str_case_e:nnF{\c_sys_engine_str}{%
+ {luatex}{\setRTLmain}
+ {xetex}{\@RTLmaintrue\setnonlatin}
+ }{}%
+ }{}%
+ \cs_gset_nopar:Nn \polyglossia@AtBeginDocument@selectlanguage: {
+ \selectbackgroundlanguage{#2}
+ \selectlanguage[#1]{#2}%
+ }
+ \xpg@info{Default~ language~ is~ #2}%
+ \polyglossia@set@language@name[#1]{#2}%
+ \def\mainlanguagename{#2}
+ % Store babelname of current language (for external packages such as biblatex)
+ \xdef\babelname{\prop_item:Nn{\polyglossia@langsetup}{#2/babelname}}%
+ \ifluatex %
+ \directlua{polyglossia.set_default_language('\luatexluaescapestring{\string#2}')}%
+ \fi %
}
\let\setmainlanguage=\setdefaultlanguage
+\def\mainbabelname{}%
+\def\mainlanguagevariant{}%
+% Store main language variant for external packages
+\define@key{xpg@main@langvariant}{variant}{%
+ \gdef\mainlanguagevariant{#1}%
+}
+
+\def\babelname{}%
+\def\languagevariant{}%
+% Store current language variant for external packages
+\define@key{xpg@set@langvariant}{variant}{%
+ \def\languagevariant{#1}%
+}
+
+\newcommand*\polyglossia@set@language@name[2][]{
+ \def\languagename{#2}%
+ \tl_if_blank:nTF {#1}{%
+ \ifcsundef{#2@gvar}{\def\languagevariant{}}{\def\languagevariant{\csuse{#2@gvar}}}
+ }{%
+ % If the argument sets a value for the key “variant”,
+ % store it in \xpg@set@langvariant
+ \clist_map_inline:nn { #1 } {%
+ \xpg@parsevariantkeyvalue##1=@xpg@set@langvariant\relax
+ }%
+ }%
+}
+
+
\newcommand{\resetdefaultlanguage}[2][]{%
- \ifcsundef{#2@loaded}{%
- \xpg@error{gloss-#2.ldf~ is~ not~ loaded!}}%
- {\csuse{no\xpg@main@language @globalnumbers}% disable globalnumbers of previously defined default language
- \csuse{noextras@\xpg@main@language}%
- \csuse{init@noextras@\xpg@main@language}%
- \def\languagename{#2}%
- \iftoggle{#2@RL}{\@rlmaintrue\@rl@footnotetrue}{}%
- \selectlanguage[#1]{#2}%
- \selectbackgroundlanguage{#2}}}
-
-\expandafter\ifx\familydefault\sfdefault
- \def\familytype{sf}
-\else\expandafter\ifx\familydefault\ttdefault
- \def\familytype{tt}
-\else
- \def\familytype{rm}
-\fi\fi
-% This robustifies the redefinitions of \<xx>family (suggestion by Enrico Gregorio)
-% e.g. to prevent expansion of the \familytype redefinition in auxiliary files
-\csgappto{rmfamily~}{\def\familytype{rm}}
-\csgappto{sffamily~}{\def\familytype{sf}}
-\csgappto{ttfamily~}{\def\familytype{tt}}
+ \polyglossia@error@iflangnotloaded:n{#2}
+ % disable globalnumbers of previously defined default language
+ \csuse{no\xpg@main@language @globalnumbers}
+ \csuse{noextras@\xpg@main@language}%
+ % This is a hook for external packages which want to access variants
+ % via babelname (such as biblatex)
+ \cs_if_exist_use:c{noextras@bbl@\mainbabelname}%
+ \csuse{init@noextras@\xpg@main@language}%
+ \polyglossia@set@language@name[#1]{#2}%
+ \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#2/direction}}{RL}{\@rlmaintrue\@rl@footnotetrue}{}%
+ \selectlanguage[#1]{#2}%
+ \selectbackgroundlanguage{#2}%
+ % Store babelname of current language (for external packages such as biblatex)
+ \xdef\babelname{\prop_item:Nn{\polyglossia@langsetup}{#2/babelname}}%
+}
+
% This saves the normalfont for the latin script since we may change normalfont in other scripts
\let\normalfontlatin=\normalfont%
\let\rmfamilylatin=\rmfamily%
\let\sffamilylatin=\sffamily%
\let\ttfamilylatin=\ttfamily%
+\def\xpg@set@familydefault{%
+ % We need the \edef route here in order
+ % to detect both \renewcommand and \let
+ % changes.
+ \edef\tempa{\familydefault}%
+ \edef\tempb{\sfdefault}%
+ \ifcsequal{tempa}{tempb}%
+ {\def\familytype{sf}}
+ {\edef\tempb{\ttdefault}%
+ \ifcsequal{tempa}{tempb}%
+ {\def\familytype{tt}}
+ {\def\familytype{rm}}}
+ % This robustifies the redefinitions of \<xx>family (suggestion by Enrico Gregorio)
+ % e.g. to prevent expansion of the \familytype redefinition in auxiliary files
+ \csgappto{rmfamily~}{\def\familytype{rm}}
+ \csgappto{sffamily~}{\def\familytype{sf}}
+ \csgappto{ttfamily~}{\def\familytype{tt}}
+ % This (re-)saves the normalfont for the latin script since we may
+ % change normalfont in other scripts
+ \let\normalfontlatin=\normalfont%
+ \let\rmfamilylatin=\rmfamily%
+ \let\sffamilylatin=\sffamily%
+ \let\ttfamilylatin=\ttfamily%
+}
+
\def\resetfontlatin{%
\let\rmfamily=\rmfamilylatin%
\let\sffamily=\sffamilylatin%
\let\ttfamily=\ttfamilylatin%
- \let\normalfont=\normalfontlatin}
+ \global\let\normalfont=\normalfontlatin}
\def\selectfontfamilylatin{%
\def\tmp@tt{tt}\def\tmp@sf{sf}%
@@ -625,7 +1175,9 @@
\letcs{\rmfamily}{#1@font@rm}%
\letcs{\sffamily}{#1@font@sf}%
\letcs{\ttfamily}{#1@font@tt}%
- \gdef\normalfont{\protect\xpg@select@fontfamily{#1}}%
+ \gdef\normalfont{\protect\xpg@select@fontfamily{#1}%
+ \fontseries{\seriesdefault}\selectfont%
+ \fontshape{\shapedefault}\selectfont}%
\gdef\reset@font{\protect\normalfont}%
}
@@ -634,45 +1186,35 @@
\@afterindenttrue}
\def\nofrench@indent{\let\@afterindentfalse\@@fterindentfalse
\@afterindentfalse}
-
\newcommand{\selectbackgroundlanguage}[1]{%
- \iftoggle{#1@latin}{}{\xpg@set@normalfont{#1}}%
- \csuse{#1@globalnumbers}%
- }
+ \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#1/lcscript}}{latin}{}{\xpg@set@normalfont{#1}}%
+ \csuse{#1@globalnumbers}%
+}
\newcommand{\setotherlanguage}[2][]{%
- \edef\xpg@loaded{#2\ifx\xpg@loaded\@empty\else,\xpg@loaded\fi}%
- \IfFileExists{gloss-#2.ldf}%
- {\ifcsundef{#2@loaded}%
- {\xpg@input{gloss-#2.ldf}%
- \setkeys{#2}{#1}%
- \edef\@tmpa{arabic}%
- \edef\@tmpb{#2}%
- \ifx\@tmpb\@tmpa%
- \newenvironment{Arabic}[1][]{\begin{otherlanguage}[####1]{arabic}}%
- {\end{otherlanguage}}%
- \else
- \newenvironment{#2}[1][]{\begin{otherlanguage}[####1]{#2}}%
- {\end{otherlanguage}}%
- \fi
- \expandafter\newcommand\csname text#2\endcsname[2][]{%
- \ifcsdef{RTL}%
- {\iftoggle{#2@RL}%
- {\@ensure@RTL{\foreignlanguage[####1]{#2}{####2}}}%
- {\@ensure@LTR{\foreignlanguage[####1]{#2}{####2}}}%
- }% else bidi not loaded
- {\iftoggle{#2@RL}%
- {\xpg@error{Language~ #2~ is~ right-to-left,~ but~ bidi~ package~ was~ not~ loaded!}}%
- {\foreignlanguage[####1]{#2}{####2}}%
- }%
- }%
- \csletcs{local#2}{text#2}%
- \csgdef{#2@loaded}{}%
- }%
- {\xpg@warning{gloss-#2.ldf~ is~ already~ loaded!}}%
- }%
- %ELSE
- {\xpg@nogloss{#2}}%
+ \ifcsundef{#2@loaded}
+ {
+ \global\edef\xpg@loaded{#2\ifx\xpg@loaded\@empty\else,\xpg@loaded\fi}%
+ \polyglossia_load_lang_definition:nn{#1}{#2}
+ % define environment and command
+ \polyglossia@define@language@cmd:n{#2}
+ \csgdef{#2@loaded}{}%
+ % If a variant is set, store it.
+ \gdef\otherlanguagevariant{}
+ \tl_if_blank:nTF {#1}{}{%
+ % If the optional argument sets a value for the key “variant”,
+ % store it in \xpg@main@langvariant
+ \clist_map_inline:nn { #1 } {%
+ \xpg@parsevariantkeyvalue##1=@xpg@other@langvariant\relax
+ }%
+ }%
+ \csgdef{#2@gvar}{\otherlanguagevariant}%
+ }{}
+}
+
+% Store main language variant for external packages
+\define@key{xpg@other@langvariant}{variant}{%
+ \gdef\otherlanguagevariant{#1}%
}
\newcommand\setotherlanguages[1]{%
@@ -688,145 +1230,332 @@
\lefthyphenmin=\tw@
\righthyphenmin=\thr@@}
-\def\noextrascurrent#1{\csuse{noextras@#1}}
+\def\xpg@initial@setup{%
+ \common@language%
+}
-\def\xpg@initial@setup{\ifcsundef{languagename}{}%
- {\noextrascurrent{\languagename}}%
- \common@language}
+\providecommand{\foreignlanguage}{}
-\AtBeginDocument{\xpg@initial@setup}
+% wrapper for foreignlanguage and otherlanguage*
+\newcommand*\polyglossia@setforeignlanguage[2][]{
+ \select@@language[#1]{#2}
+ % Store babelname of current language (for external packages such as biblatex)
+ \xdef\babelname{\prop_item:Nn{\polyglossia@langsetup}{#2/babelname}}%
+}
-\providecommand{\foreignlanguage}{}
+% joint code of \foreignlanguage, otherlanguage*
+% and \text<lang>
+\newcommand{\xpg@otherlanguage}[2][]
+{%
+ \polyglossia@error@iflangnotloaded:n{#2}
+ \setkeys{#2}{#1}%
+ \polyglossia@setforeignlanguage[#1]{#2}
+ % buggy restoration heure
+ \csuse{inlineextras@#2}%
+ % This is a hook for external packages which want to access variants
+ % via babelname (such as biblatex)
+ \cs_if_exist_use:c{inlineextras@bbl@\babelname}%
+}
-\renewcommand{\foreignlanguage}[3][]{%
- \ifcsundef{#2@loaded}%
- {\xpg@nogloss{#2}}%
- {{\select@@language{#2}%
- \setkeys{#2}{#1}%
- \use@localhyphenmins{#2}%
- \ifbool{#2@frenchspacing}{\frenchspacing}{\nonfrenchspacing}%
- \csuse{inlineextras@#2}%
- #3}%
- }%
+\renewcommand{\foreignlanguage}[3][]
+{%
+ \polyglossia@error@iflangnotloaded:n{#2}
+ \bgroup
+ \xpg@otherlanguage[#1]{#2}%
+ \polyglossia@lang@settextdirection:nn{#2}{#3}%
+ \egroup
}
% otherlanguage* is the environment equivalent of \foreignlanguage
\expandafter\providecommand\csname otherlanguage*\endcsname{}
-\renewenvironment{otherlanguage*}[2][]{%
- \ifcsundef{#2@loaded}%
- {\xpg@nogloss{#2}}%
- {\select@@language{#2}%
- \setkeys{#2}{#1}%
- \use@localhyphenmins{#2}%
- \ifbool{#2@frenchspacing}{\frenchspacing}{\nonfrenchspacing}%
- \csuse{inlineextras@#2}\csuse{date#2}%
- }%
-}{}
+
+\renewenvironment{otherlanguage*}[2][]
+{%
+ \xpg@otherlanguage[#1]{#2}%
+ \polyglossia@lang@settextdirection:nn{#2}\bgroup%
+}
+{\egroup}
+
+% use by \text<lang>. Equivalent to \foreignlanguage,
+% except that dates are localized.
+\newcommand*\xpg@textlanguage[3][]{%
+ \polyglossia@error@iflangnotloaded:n{#2}
+ \bgroup
+ \xpg@otherlanguage[#1]{#2}%
+ \csuse{date#2}%
+ % This is a hook for external packages which want to access variants
+ % via babelname (such as biblatex)
+ \cs_if_exist_use:c{date@bbl@\babelname}%
+ \polyglossia@lang@settextdirection:nn{#2}{#3}%
+ \egroup
+ % Reset the language's/script's font families
+ \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#2/lcscript}}{latin}{}{\resetfontlatin}%
+}
+
+
+% Define language-specific hyphenation exceptions
+\newcommand\pghyphenation[3][]{
+ \bgroup
+ \polyglossia@error@iflangnotloaded:n{#2}
+ \setkeys{#2}{#1}%
+ \select@@language[#1]{#2}%
+ \hyphenation{#3}%
+ \egroup
+}
+
%Hook that other package authors can use
%(for instance biblatex):
\newcommand*{\xpg@hook@setlanguage}{}
-\providecommand{\selectlanguage}{}
-\renewcommand{\selectlanguage}[2][]{%
- \ifcsundef{#2@loaded}%
- {\xpg@nogloss{#2}}%
- {\def\xpg@pop@language{%
- \xpg@set@language{\languagename}%
- \xpg@hook@setlanguage%
- \let\emp@langname\@undefined}%
- \aftergroup\xpg@pop@language%
- % If the optional argument sets a value for the key “variant”, copy it to xpg@langvariant
- \def\do##1{%
- \def\xpg@parsekeyvalue####1=####2\relax{%
- \def\@tmpa{####1}
- \def\@tmpb{variant}
- \ifx\@tmpa\@tmpb\setkeys{xpg@langvariant}{##1}\fi
- }%
- \xpg@parsekeyvalue##1=\relax
- }%
- \docsvlist{#1}
- \setkeys{#2}{#1}%
- \xpg@set@language{#2}%
+\def\xpg@pop@language@i#1#2{%
+ \xpg@set@language@aux[#1]{#2}%
+ \xpg@hook@setlanguage
+ \let\emp@langname\@undefined}
+
+\DeclareDocumentCommand \selectlanguage {s O{} m}
+{%
+ \polyglossia@error@iflangnotloaded:n{#3}
+ \IfBooleanF {#1}
+ {
+ \tl_set:Nx \xpg@pop@language { \exp_not:N \xpg@pop@language@i {#2} {#3} }
+ \group_insert_after:N \xpg@pop@language
+ }
+ \tl_if_blank:nTF {#2}{}{%
+ % If the optional argument sets a value for the key “variant”, copy it to xpg@langvariant
+ \clist_map_inline:nn { #2 } {%
+ \xpg@parsevariantkeyvalue##1=@xpg@langvariant\relax
}%
+ \setkeys{#3}{#2}%
+ }%
+ % The starred variant does not write to the aux
+ \IfBooleanTF#1{%
+ \xpg@set@language@nonaux[#2]{#3}%
+ }{%
+ \xpg@set@language@aux[#2]{#3}%
+ }%
+ \ifluatex%
+ \directlua{polyglossia.select_language('\luatexluaescapestring{\string#3}',
+ \the\csname l@#3\endcsname)}%
+ \fi%
+ \def\xpg@tmp@babelname{\prop_item:Nn{\polyglossia@langsetup}{#3/babelname}}
+ % Store babelname in \xpg@bloaded csv list
+ \ifcsundef{\csname xpg@tmp@babelname\endcsname @bbl@loaded}
+ {
+ \global\edef\xpg@bloaded{\xpg@tmp@babelname%
+ \ifx\xpg@bloaded\@empty\else,\xpg@bloaded\fi}%
+ \csgdef{\csname xpg@tmp@babelname\endcsname @bbl@loaded}{}%
+ }{}
}
-% Save any variant in csv list of variants
+% Helper to get and register "variant" keyval
+\def\xpg@parsevariantkeyvalue#1=#2@#3\relax{%
+ \def\@tmpa{#1}
+ \def\@tmpb{variant}
+ \ifx\@tmpa\@tmpb\setkeys{#3}{#1=#2}\fi
+}%
+
+
+% Append any variant to csv list of variants
\define@key{xpg@langvariant}{variant}{%
- \edef\xpg@vloaded{#1\ifx\xpg@vloaded\@empty\else,\xpg@vloaded\fi}}
+ \edef\xpg@vloaded{#1\ifx\xpg@vloaded\@empty\else,\xpg@vloaded\fi}%
+}
-\newcommand{\xpg@set@language}[1]{%
- \select@language{#1}%
+\prg_set_conditional:Npnn \polyglossia@check@if@lang@loaded:N #1 { p , T , F , TF }{
+ \cs_if_exist:cTF{#1}{
+ \prg_return_true:
+ }{
+ \prg_return_false:
+ }
+}
+
+% Test if language is loaded
+\newcommand*\iflanguageloaded[3]{%
+ \polyglossia@check@if@lang@loaded:NTF{#1@loaded}{#2}{#3}%
+}
+
+% Same for babellanguage is loaded
+\newcommand*\ifbabellanguageloaded[3]{%
+ \polyglossia@check@if@lang@loaded:NTF{#1@bbl@loaded}{#2}{#3}%
+}
+
+\newcommand*{\xpg@set@language@nonaux}[2][]{%
+ \@select@language[#1]{#2}%
+}
+
+
+\newcommand*{\xpg@set@language@aux}[2][]{%
+ % Store babelname of current language (for external packages such as biblatex)
+ \xdef\babelname{\prop_item:Nn{\polyglossia@langsetup}{#2/babelname}}%
+ \@select@language[#1]{#2}%
+ % Write to the aux
\if@filesw%
- \protected@write\@auxout{}{\protect\select@language{#1}}%
- \addtocontents{toc}{\protect\select@language{#1}}%
- \addtocontents{lof}{\protect\select@language{#1}}%
- \addtocontents{lot}{\protect\select@language{#1}}%
+ \ifx#1\\\\%
+ \protected@write\@auxout{}{\protect\selectlanguage*{#2}}%
+ \addtocontents{toc}{\protect\selectlanguage*{#2}}%
+ \addtocontents{lof}{\protect\selectlanguage*{#2}}%
+ \addtocontents{lot}{\protect\selectlanguage*{#2}}%
+ \else
+ \protected@write\@auxout{}{\protect\selectlanguage*[#1]{#2}}%
+ \addtocontents{toc}{\protect\selectlanguage*[#1]{#2}}%
+ \addtocontents{lof}{\protect\selectlanguage*[#1]{#2}}%
+ \addtocontents{lot}{\protect\selectlanguage*[#1]{#2}}%
+ \fi
\fi
}
-\def\xpg@set@language@luatex@iii#1#2{%
- % here we use lu@texhyphen@loaded@\the\language, the same as in babel
- \ifcsdef{bbl@hyphendata@#2}{}{%
- \global\@namedef{bbl@hyphendata@\the\language}{}%
- \directlua{polyglossia.select_language('\luatexluaescapestring{\string#1}', \the\csname l@#1\endcsname)}%
- }
+% Open a group in the aux file. This is to keep
+% nested language options local (see #320)
+\newcommand*{\xpg@set@group@aux}{%
+ \if@filesw%
+ \protected@write\@auxout{}{\bgroup}%
+ \addtocontents{toc}{\bgroup}%
+ \addtocontents{lof}{\bgroup}%
+ \addtocontents{lot}{\bgroup}%
+ \fi
}
-\newcommand\xpg@check@ifdefined[1]{%
- \expandafter\ifx\csname l@#1\endcsname\relax\@xpg@language@really@defined@false\else
- \ifx\csname l@#1\endcsname\l@nohyphenation\@xpg@language@really@defined@false\else
- \@xpg@language@really@defined@true
- \fi
+% Close the group in the aux file
+\newcommand*{\xpg@unset@group@aux}{%
+ \if@filesw%
+ \protected@write\@auxout{}{\egroup}%
+ \addtocontents{toc}{\egroup}%
+ \addtocontents{lof}{\egroup}%
+ \addtocontents{lot}{\egroup}%
\fi
}
+\prg_set_conditional:Npnn \polyglossia@check@ifdefined:N #1 { p , T , F , TF }{
+ \cs_if_exist:cTF {l@#1}
+ {
+ \cs_if_eq:cNTF {l@#1} \l@nohyphenation
+ {
+ \prg_return_false:
+ }
+ {
+ % it's possible that sometimes \csname l@#1\endcsname becomes \relax
+ \cs_if_eq:cNTF {l@#1} \relax
+ { \prg_return_false: }
+ { \prg_return_true: }
+ }
+ }
+ {
+ \prg_return_false:
+ }
+}
+
+\def\polyglossia@luatex@load@lang#1{%
+ % if \l@#1 is not properly defined, call lua function newloader(#1),
+ % and assign the returned number to \l@#1
+ \polyglossia@check@ifdefined:NF {#1}
+ {
+ \expandafter\chardef\csname l@#1\endcsname=
+ \directlua{ tex.sprint(polyglossia.newloader'#1') }\relax
+ }
+}
+
+% This check is also used by biblatex, so don't
+% rename silently.
\newcommand\xpg@ifdefined[3]{%
+ % With luatex, we first need to define \l@#1.
\ifluatex
- \xpg@set@language@luatex@iv{#1}%
+ \polyglossia@luatex@load@lang{#1}%
\fi
- \xpg@check@ifdefined{#1}
- \if@xpg@language@really@defined@#2\else#3\fi
+ \polyglossia@check@ifdefined:NTF{#1}{#2}{#3}%
}%
-\newcommand\xpg@set@language@luatex@iv[1]{%
- \ifluatex
- \xpg@check@ifdefined{#1}%
- \if@xpg@language@really@defined@\else
- \expandafter\chardef\csname l@#1\endcsname=\directlua{tex.sprint(polyglossia.newloader('#1'))}%
- \fi
- \language\directlua{tex.sprint(polyglossia.newloader('#1'))}%
+% Set \bbl@hyphendata@\the\language, which is (lua)babel's
+% hyphenation pattern hook
+% FIXME Clarifiy why/when this is needed.
+\newcommand*\xpg@set@bbl@hyphendata[1]{%
+ \ifluatex%
+ \ifcsdef{bbl@hyphendata@#1}{}{%
+ \global\@namedef{bbl@hyphendata@\the\language}{}%
+ }%
+ \fi%
+}
+
+% Set hyphenation patterns for a given language. This does the right
+% thing both for XeTeX and LuaTeX
+\newcommand*\xpg@set@hyphenation@patterns[1]{%
+ \ifluatex
+ \polyglossia@luatex@load@lang{#1}%
+ \language=\csname l@#1\endcsname
+ \else
+ \ifxetex
+ \language=\csname l@#1\endcsname
+ \else
+ \xpg@warning{You’re~running~a~TeX~engine~that~is~not~LuaTeX~or~XeTeX.\MessageBreak
+ That~is~almost~guaranteed~to~cause~problems.}%
\fi
+ \fi
}
+% FIXME: Remove after gloss-latin (last user) has been rewritten)
\newcommand\xpg@set@language@luatex@ii[1]{%
- \ifluatex %
- \xpg@set@language@luatex@iii{#1}{\expandafter\the\csname l@#1\endcsname}
- \fi %
+ \xpg@set@bbl@hyphendata{\expandafter\the\csname l@#1\endcsname}
}
-\def\select@language#1{%
- \ifluatex %
- \xpg@set@language@luatex@iii{#1}{\the\language}
- \fi %
+
+\newcommand*\@select@language[2][]{
+ % hook for compatibility with biblatex
+ \select@language{#2}
+ \xpg@set@bbl@hyphendata{\the\language}
\xpg@initial@setup%
- \select@@language{#1}%
- \ifcsundef{setRL}{}%
- {\iftoggle{#1@RL}{\setRL}{\setLR}}%
- \csuse{captions#1}%
- \local@marks{#1}%
- \csuse{init@extras@#1}%
- \csuse{blockextras@#1}%
+ \select@@language[#1]{#2}%
+ \polyglossia@lang@setpardirection:n{#2}%
+ \csuse{captions#2}%
+ \csuse{date#2}%
+ % These are hooks for external packages which want to access variants
+ % via babelname (such as biblatex)
+ \cs_if_exist_use:c{captions@bbl@\babelname}%
+ \cs_if_exist_use:c{date@bbl@\babelname}%
+ \local@marks{#2}%
+ \csuse{init@extras@#2}%
+ \polyglossia@lang@indentfirst:n{#2}
+ \csuse{blockextras@#2}%
+ % This is a hook for external packages which want to access variants
+ % via babelname (such as biblatex)
+ \cs_if_exist_use:c{blockextras@bbl@\babelname}%
+ }
+
+% hook for compatibility with biblatex
+\def\select@language#1{}
+
+\def\noextrascurrent#1{%
+ \csuse{noextras@#1}%
+ % This is a hook for external packages which want to access variants
+ % via babelname (such as biblatex)
+ \cs_if_exist_use:c{noextras@bbl@\babelname}
}
% Common code for `\select@language' and `\foreignlanguage'.
-\newcommand{\select@@language}[1]{%
- \edef\languagename{#1}%
- \xpg@select@fontfamily{#1}%
- \csuse@warn{#1@language}%
- \csuse{date#1}%
- \csuse{#1@numbers}%
- \use@localhyphenmins{#1}%
+\newcommand{\select@@language}[2][]{%
+ % disable the extras and number settings of the previous language
+ \ifcsundef{languagename}{}{%
+ \noextrascurrent{\languagename}%
+ \csuse{no\languagename @numbers}%
+ \ifxetex
+ \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{\languagename/direction}}{RL}%
+ {%
+ \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#2/direction}}{RL}%
+ {}% RTL -> RTL
+ {\setlatin}% RTL -> LTR
+ }{%
+ \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#2/direction}}{RL}%
+ {\setnonlatin}% LTR -> RTL
+ {}% LTR -> LTR
+ }%
+ \fi
+ }%
+ \polyglossia@set@language@name[#1]{#2}%
+ % Set the language's/script's font families
+ \str_if_eq:eeTF{\prop_item:Nn{\polyglossia@langsetup}{#2/lcscript}}{latin}{\resetfontlatin}{\xpg@set@normalfont{#2}}%
+ \xpg@select@fontfamily{#2}%
+ \csuse@warn{#2@language}%
+ \csuse{#2@numbers}%
+ \use@localhyphenmins{#2}%
+ \polyglossia@lang@frenchspacing:n{#2}
}
@@ -835,8 +1564,11 @@
\provideenvironment{otherlanguage}{}{}
\renewenvironment{otherlanguage}[2][]
- {\selectlanguage[#1]{#2}}
- {}
+{
+ \xpg@set@group@aux%
+ \selectlanguage[#1]{#2}
+}
+{\xpg@unset@group@aux}
\newcommand{\setlocalhyphenmins}[3]{%
\xpg@ifdefined{#1}{%
@@ -853,25 +1585,76 @@
\ifcsundef{#1hyphenmins}{}%
{\expandafter\expandafter\expandafter\set@hyphenmins\csname #1hyphenmins\endcsname\relax}}
-\define@boolkey{polyglossia}[system@]{babelshorthands}[false]{}
+\AtEndPreamble{%
+ \@ifpackageloaded{bidi}{%
+ \providecommand*{\aemph}[1]{$\overline{\hboxR{#1}}$}%
+ }{}%
+ \@ifpackageloaded{luabidi}{%
+ \providecommand*{\aemph}[1]{$\overline{\hbox{\RL{#1}}}$}%
+ }{}%
+}
+
+
+% keys for main package
+\keys_define:nn { polyglossia } {
+ verbose
+ .bool_set:N = \l_polyglossia_verbose_bool,
+ verbose
+ .default:n = true,
+ % compatibility
+ quiet
+ .meta:n = { verbose = false },
+
+ localmarks
+ .bool_set:N = \l_polyglossia_localmarks_bool,
+ localmarks
+ .default:n = false,
+ % compatibility
+ nolocalmarks
+ .meta:n = { localmarks = false },
+
+ babelshorthands
+ .bool_set:N = \l_polyglossia_babelshorthands_bool,
+ babelshorthands
+ .default:n = true,
+}
+
+\keys_set:nn { polyglossia } {
+ localmarks = false,
+ verbose = true,
+ babelshorthands = false,
+}
-\AtEndPreamble{\@ifpackageloaded{bidi}{\providecommand*{\aemph}[1]{$\overline{\hboxR{#1}}$}}{}}% TODO Make that work for luabidi too.
+% load by default latex
+\setmainlanguage{latex}
+% then process key in order to overwrite
+\ProcessKeysOptions{polyglossia}
-%% Package Options %%
-\DeclareOption{nolocalmarks}{\setkeys{polyglossia}{localmarks=false}}
-\DeclareOption{localmarks}{\setkeys{polyglossia}{localmarks=true}}
-\DeclareOption{babelshorthands}{\setkeys{polyglossia}{babelshorthands=true}}
-\DeclareOption{quiet}{%
+\bool_if:nTF \l_polyglossia_verbose_bool {} {
\gdef\@latex@info#1{\relax}% no latex info
\gdef\@font@info#1{\relax}% no latex font info
\gdef\@font@warning#1{\relax}% no latex font warnings
\gdef\zf@PackageInfo#1{\relax}% no fontspec info
- \gdef\xpg@info#1{\relax}}% no polyglossia info
+ \gdef\xpg@info#1{\relax}% no polyglossia info
+}
+
+\bool_if:nTF \l_polyglossia_localmarks_bool {} {
+ \enable@local@marks{}
+}{}
+
+% compatibility
+\newif\ifsystem@babelshorthands
+\bool_if:nTF \l_polyglossia_babelshorthands_bool {
+ \system@babelshorthandstrue
+}{
+ \system@babelshorthandsfalse
+}
+
%
% FIXME these should also be loaded \AtEndOfPackage !!!
\def\xpg@option#1#2{%
\ifcsundef{xpg@main@language}{\setdefaultlanguage}{\setotherlanguage}%
[#1]{#2}}
\ExplSyntaxOff
-\ProcessOptions*
+
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/xgreek-fixes.def b/Master/texmf-dist/tex/latex/polyglossia/xgreek-fixes.def
index 853bd0831c1..0f1d51f0043 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/xgreek-fixes.def
+++ b/Master/texmf-dist/tex/latex/polyglossia/xgreek-fixes.def
@@ -1,4 +1,17 @@
% the following fixes are taken verbatim from xgreek.sty:
+% \message{Package `xgreek' version 3.0.1 by Apostolos Syropoulos}
+\global\lccode"0370="0371 \global\uccode"0370="0370
+\global\lccode"0371="0371 \global\uccode"0371="0370
+\global\lccode"0372="0373 \global\uccode"0372="0372
+\global\lccode"0373="0373 \global\uccode"0373="0372
+\global\lccode"0376="0377 \global\uccode"0376="0376
+\global\lccode"0377="0377 \global\uccode"0377="0376
+\global\lccode"03FD="037B \global\uccode"03FD="03FD
+\global\lccode"037B="037B \global\uccode"037B="03FD
+\global\lccode"03FE="037C \global\uccode"03FE="03FE
+\global\lccode"037C="037C \global\uccode"037C="03FE
+\global\lccode"03FF="037D \global\uccode"03FF="03FF
+\global\lccode"037D="037D \global\uccode"037D="03FF
\global\lccode"0386="03AC \global\uccode"0386="0391
\global\lccode"0388="03AD \global\uccode"0388="0395
\global\lccode"0389="03AC \global\uccode"0389="0397
@@ -81,8 +94,8 @@
\global\lccode"03DD="03DD \global\uccode"03DD="03DC
\global\lccode"03DE="03DF \global\uccode"03DE="03DE
\global\lccode"03DF="03DF \global\uccode"03DF="03DE
-\global\lccode"03E0="03E1 \global\uccode"03E0="039A
-\global\lccode"03E0="03E1 \global\uccode"03E1="03A1
+\global\lccode"03E0="03E1 \global\uccode"03E0="03E0
+\global\lccode"03E1="03E1 \global\uccode"03E1="03E0
\global\lccode"03F0="03BA \global\uccode"03F0="039A
\global\lccode"03F1="03C1 \global\uccode"03F1="03A1
\global\lccode"03F2="03F2 \global\uccode"03F2="03F9
@@ -287,7 +300,7 @@
\global\lccode"1FE2="1FE2 \global\uccode"1FE2="03AB
\global\lccode"1FE3="1FE3 \global\uccode"1FE3="03AB
\global\lccode"1FE4="1FE4 \global\uccode"1FE4="03A1
-\global\lccode"1FE5="1FE5 \global\uccode"1FE5="1FEC
+\global\lccode"1FE5="1FE5 \global\uccode"1FE5="03A1
\global\lccode"1FE6="1FE6 \global\uccode"1FE6="03A5
\global\lccode"1FE7="1FE7 \global\uccode"1FE7="03AB
\global\lccode"1FE8="1FE0 \global\uccode"1FE8="1FE8