diff options
author | Karl Berry <karl@freefriends.org> | 2019-11-15 21:41:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-11-15 21:41:34 +0000 |
commit | 6024de648c5e4b1bcb3630cecc307ca55db9ae8e (patch) | |
tree | d9c6878e5900d0c9ea4de20694e550b88ef0ad8d /Master/texmf-dist/source | |
parent | 7ebe75c756258ce417125e376f199df4fd5b47a9 (diff) |
polyglossia (15nov19)
git-svn-id: svn://tug.org/texlive/trunk@52808 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx | 5011 |
1 files changed, 3941 insertions, 1070 deletions
diff --git a/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx b/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx index ee43f033825..fe48e7e23e5 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.45 ¦ + ¦ THE POLYGLOSSIA PACKAGE v1.46 ¦ ¦ ¦ ¦ Modern multilingual typesetting ¦ ¦ with XeLaTeX and LuaLaTeX ¦ @@ -20,8 +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 75 different languages, some of which in different regional, -national or scriptal varieties. +includes support for 79 different languages, some of which in different +regional or national varieties, or using a different writing system. Polyglossia makes it possible to automate the following tasks: @@ -44,23 +44,19 @@ Polyglossia makes it possible to automate the following tasks: LICENSE -Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2019 Arthur Reutenauer +Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2019 Arthur Reutenauer, +Copyright (c) 2019 Bastien Roucariès, 2019 Jürgen Spitzmüller -Polyglossia is placed under the terms of the LaTeX Project Public Licence -(LPPL), either version 1.3, or, at your option, any later version. See -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. +Except where otherwise noted, Polyglossia is placed under the terms of the MIT licence +(https://opensource.org/licenses/MIT). BUGS 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. +This is more efficient than contacting the maintainer by email as it allows me +to track the issues and follow progress. %</README> %<*internal> \fi @@ -104,18 +100,29 @@ issues and follow progress. \endpostamble \let\MetaPrefix\DoubleperCent \askforoverwritefalse +\generate{\file{gloss-acadien.ldf}{\from{polyglossia.dtx}{gloss-acadien.ldf}}} +\generate{\file{gloss-afrikaans.ldf}{\from{polyglossia.dtx}{gloss-afrikaans.ldf}}} \generate{\file{gloss-albanian.ldf}{\from{polyglossia.dtx}{gloss-albanian.ldf}}} +\generate{\file{gloss-american.ldf}{\from{polyglossia.dtx}{gloss-american.ldf}}} \generate{\file{gloss-amharic.ldf}{\from{polyglossia.dtx}{gloss-amharic.ldf}}} \generate{\file{gloss-arabic.ldf}{\from{polyglossia.dtx}{gloss-arabic.ldf}}} \generate{\file{gloss-armenian.ldf}{\from{polyglossia.dtx}{gloss-armenian.ldf}}} \generate{\file{gloss-asturian.ldf}{\from{polyglossia.dtx}{gloss-asturian.ldf}}} +\generate{\file{gloss-australian.ldf}{\from{polyglossia.dtx}{gloss-australian.ldf}}} +\generate{\file{gloss-austrian.ldf}{\from{polyglossia.dtx}{gloss-austrian.ldf}}} +\generate{\file{gloss-bahasa.ldf}{\from{polyglossia.dtx}{gloss-bahasa.ldf}}} \generate{\file{gloss-bahasai.ldf}{\from{polyglossia.dtx}{gloss-bahasai.ldf}}} \generate{\file{gloss-bahasam.ldf}{\from{polyglossia.dtx}{gloss-bahasam.ldf}}} \generate{\file{gloss-basque.ldf}{\from{polyglossia.dtx}{gloss-basque.ldf}}} +\generate{\file{gloss-belarusian.ldf}{\from{polyglossia.dtx}{gloss-belarusian.ldf}}} \generate{\file{gloss-bengali.ldf}{\from{polyglossia.dtx}{gloss-bengali.ldf}}} +\generate{\file{gloss-bosnian.ldf}{\from{polyglossia.dtx}{gloss-bosnian.ldf}}} \generate{\file{gloss-brazil.ldf}{\from{polyglossia.dtx}{gloss-brazil.ldf}}} \generate{\file{gloss-breton.ldf}{\from{polyglossia.dtx}{gloss-breton.ldf}}} +\generate{\file{gloss-british.ldf}{\from{polyglossia.dtx}{gloss-british.ldf}}} \generate{\file{gloss-bulgarian.ldf}{\from{polyglossia.dtx}{gloss-bulgarian.ldf}}} +\generate{\file{gloss-canadian.ldf}{\from{polyglossia.dtx}{gloss-canadian.ldf}}} +\generate{\file{gloss-canadien.ldf}{\from{polyglossia.dtx}{gloss-canadien.ldf}}} \generate{\file{gloss-catalan.ldf}{\from{polyglossia.dtx}{gloss-catalan.ldf}}} \generate{\file{gloss-coptic.ldf}{\from{polyglossia.dtx}{gloss-coptic.ldf}}} \generate{\file{gloss-croatian.ldf}{\from{polyglossia.dtx}{gloss-croatian.ldf}}} @@ -133,7 +140,9 @@ issues and follow progress. \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-georgian.ldf}{\from{polyglossia.dtx}{gloss-georgian.ldf}}} \generate{\file{gloss-german.ldf}{\from{polyglossia.dtx}{gloss-german.ldf}}} +\generate{\file{gloss-germanb.ldf}{\from{polyglossia.dtx}{gloss-germanb.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}}} @@ -150,8 +159,12 @@ issues and follow progress. \generate{\file{gloss-lao.ldf}{\from{polyglossia.dtx}{gloss-lao.ldf}}} \generate{\file{gloss-latex.ldf}{\from{polyglossia.dtx}{gloss-latex.ldf}}} \generate{\file{gloss-latin.ldf}{\from{polyglossia.dtx}{gloss-latin.ldf}}} +\generate{\file{gloss-latinclassic.ldf}{\from{polyglossia.dtx}{gloss-latinclassic.ldf}}} +\generate{\file{gloss-latinecclesiastic.ldf}{\from{polyglossia.dtx}{gloss-latinecclesiastic.ldf}}} +\generate{\file{gloss-latinmedieval.ldf}{\from{polyglossia.dtx}{gloss-latinmedieval.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-lowersorbian.ldf}{\from{polyglossia.dtx}{gloss-lowersorbian.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}}} @@ -159,14 +172,19 @@ issues and follow progress. \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-naustrian.ldf}{\from{polyglossia.dtx}{gloss-naustrian.ldf}}} +\generate{\file{gloss-newzealand.ldf}{\from{polyglossia.dtx}{gloss-newzealand.ldf}}} +\generate{\file{gloss-ngerman.ldf}{\from{polyglossia.dtx}{gloss-ngerman.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-nswissgerman.ldf}{\from{polyglossia.dtx}{gloss-nswissgerman.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-polutonikogreek.ldf}{\from{polyglossia.dtx}{gloss-polutonikogreek.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}}} @@ -177,11 +195,15 @@ issues and follow progress. \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-serbianc.ldf}{\from{polyglossia.dtx}{gloss-serbianc.ldf}}} \generate{\file{gloss-slovak.ldf}{\from{polyglossia.dtx}{gloss-slovak.ldf}}} +\generate{\file{gloss-slovene.ldf}{\from{polyglossia.dtx}{gloss-slovene.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-spanishmx.ldf}{\from{polyglossia.dtx}{gloss-spanishmx.ldf}}} \generate{\file{gloss-swedish.ldf}{\from{polyglossia.dtx}{gloss-swedish.ldf}}} +\generate{\file{gloss-swissgerman.ldf}{\from{polyglossia.dtx}{gloss-swissgerman.ldf}}} \generate{\file{gloss-syriac.ldf}{\from{polyglossia.dtx}{gloss-syriac.ldf}}} \generate{\file{gloss-tamil.ldf}{\from{polyglossia.dtx}{gloss-tamil.ldf}}} \generate{\file{gloss-telugu.ldf}{\from{polyglossia.dtx}{gloss-telugu.ldf}}} @@ -190,6 +212,7 @@ issues and follow progress. \generate{\file{gloss-turkish.ldf}{\from{polyglossia.dtx}{gloss-turkish.ldf}}} \generate{\file{gloss-turkmen.ldf}{\from{polyglossia.dtx}{gloss-turkmen.ldf}}} \generate{\file{gloss-ukrainian.ldf}{\from{polyglossia.dtx}{gloss-ukrainian.ldf}}} +\generate{\file{gloss-uppersorbian.ldf}{\from{polyglossia.dtx}{gloss-uppersorbian.ldf}}} \generate{\file{gloss-urdu.ldf}{\from{polyglossia.dtx}{gloss-urdu.ldf}}} \generate{\file{gloss-usorbian.ldf}{\from{polyglossia.dtx}{gloss-usorbian.ldf}}} \generate{\file{gloss-vietnamese.ldf}{\from{polyglossia.dtx}{gloss-vietnamese.ldf}}} @@ -200,8 +223,11 @@ issues and follow progress. \generate{\file{farsidigits.map}{\from{polyglossia.dtx}{farsidigits.map}}} \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-french.lua}{\from{polyglossia.dtx}{polyglossia-french.lua}}} \generate{\file{polyglossia-korean.lua}{\from{polyglossia.dtx}{polyglossia-korean.lua}}} +\generate{\file{polyglossia-latin.lua}{\from{polyglossia.dtx}{polyglossia-latin.lua}}} +\generate{\file{polyglossia-punct.lua}{\from{polyglossia.dtx}{polyglossia-punct.lua}}} +\generate{\file{polyglossia-sanskrit.lua}{\from{polyglossia.dtx}{polyglossia-sanskrit.lua}}} \generate{\file{polyglossia-tibt.lua}{\from{polyglossia.dtx}{polyglossia-tibt.lua}}} \generate{\file{polyglossia.lua}{\from{polyglossia.dtx}{polyglossia.lua}}} \let\MetaPrefix\DoubleperCent @@ -225,6 +251,7 @@ issues and follow progress. \usepackage{color} \usepackage{xspace,fancyvrb,booktabs} \usepackage[neverdecrease]{paralist} +\usepackage[format=hang,labelfont=bf,labelsep=period]{caption} \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} @@ -247,7 +274,7 @@ issues and follow progress. \usepackage[babelshorthands]{polyglossia} \usepackage{farsical} \setmainlanguage[variant=british,ordinalmonthday=false]{english} -\setotherlanguages{arabic,armenian,hebrew,syriac,greek,russian,serbian,catalan} +\setotherlanguages{arabic,armenian,hebrew,syriac,greek,russian,serbian,catalan,georgian} \usepackage[protrusion]{microtype} \newcommand*\Cmd[1]{\cmd{#1}\DescribeMacro{#1}\xspace} \newcommand*\pkg[1]{\textsf{\color{myblue}#1}} @@ -298,6 +325,7 @@ issues and follow progress. \newfontfamily\armenianfont[Script=Armenian]{DejaVu Sans} \newfontfamily\syriacfont[Script=Syriac]{Serto Jerusalem} \newfontfamily\hebrewfont[Script=Hebrew]{Ezra SIL} +\newfontfamily\georgianfont{DejaVu Serif} \linespread{1.05} \frenchspacing @@ -334,6 +362,8 @@ issues and follow progress. % \maketitle % \tableofcontents % +% \condbreak{4\baselineskip} +% % % \DeleteShortVerb{\|} % \MakeShortVerb{\¦} @@ -364,8 +394,8 @@ issues and follow progress. % calendars are supported). % \item For languages that have their own numbering system, modifying the formatting % of numbers appropriately (this also includes redefining the alphabetic sequence -% for non-Latin alphabets).\footnote{ % -% For the Arabic script this is now done by the bundled package \pkg{arabicnumbers}.} +% for non-Latin alphabets).\footnote{% +% This is done by bundled sub-packages such as \pkg{arabicnumbers}.} % \item Ensuring proper directionality if the document contains languages % that are written from right to left (via the package \pkg{bidi}, % available separately). @@ -414,48 +444,47 @@ issues and follow progress. % \subsection{Supported languages} % % Table~\ref{tab:lang} lists all languages currently supported. -% Those in red have specific options and/or commands +% Those in \TR{red} have specific options and/or commands % that are explained in section \ref{specific} below. % % \begin{table}[ht]\centering -% \label{tab:lang} -% ^^A Produced with tools/insert-language-list.rb -- JS, 2019-10-18 -% ^^A Edited by hand -- JS, 2019-10-18 +% \caption{\label{tab:lang}Languages currently supported in \pkg{polyglossia}} +% ^^A Produced with tools/insert-language-list.rb -- JS, 2019-11-01 +% ^^A Edited by hand -- JS, 2019-11-01 % \begin{tabular}{lllll} % \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}\\ +% \TX{afrikaans} & danish & \TX{hungarian} & marathi & \TX{slovenian} \\ +% albanian & divehi & icelandic & \TX{mongolian} & \TX{sorbian} \\ +% amharic & \TX{dutch} & interlingua & nko & \TX{spanish} \\ +% \TX{arabic} & \TX{english} & \TX{italian} & \TX{norwegian} & swedish \\ +% \TX{armenian} & \TX{esperanto} & japanese & occitan & \TX{syriac} \\ +% asturian & estonian & kannada & \TX{persian} & tamil \\ +% basque & \TX{finnish} & khmer & piedmontese & telugu \\ +% \TX{belarusian} & \TX{french} & \TX{korean} & polish & \TX{thai} \\ +% \TX{bengali} & friulian & \TX{kurdish} & \TX{portuguese} & \TX{tibetan} \\ +% bosnian & \TX{gaelic} & \TX{lao} & romanian & turkish \\ +% breton & galician & \TX{latin} & romansh & turkmen \\ +% bulgarian & \TX{georgian} & latvian & \TX{russian} & \TX{ukrainian} \\ +% \TX{catalan} & \TX{german} & lithuanian & \TX{sami} & urdu \\ +% coptic & \TX{greek} & macedonian & \TX{sanskrit} & vietnamese \\ +% croatian & \TX{hebrew} & \TX{malay} & \TX{serbian} & \TX{welsh} \\ +% \TX{czech} & \TX{hindi} & malayalam & \TX{slovak} & \\ % \bottomrule % \end{tabular} % -% -% \caption{Languages currently supported in \pkg{polyglossia}} % \end{table} % % \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.} +% port the package \pkg{ethiop}; 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, +% Version 1.2\new{v1.2.0} introduced Armenian, Occitan, Bengali, % 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. +% Version 1.43\new{v1.43} brought basic support for Japanese (this +% is considered experimental, 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}, @@ -465,67 +494,83 @@ issues and follow progress. % \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. +% compatibility reasons. +% Version 1.46\new{v1.46} introduces support for Afrikaans, Belarusian, Bosnian and Georgian. % % -% \subsection{Relation to Babel languages} +% \subsection{Relation to and use of Babel language names} % % 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. +% \pkg{polyglossia} differentiates language varieties via language options (\eg \emph{english}, ¦variant=american¦). % -% Furthermore, \pkg{babel} uses sometimes abbreviations for language names (\eg\emph{bahasam} for Bahasa Malayu) as well +% Furthermore, \pkg{babel} sometimes uses abbreviated 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).} +% Please refer to table~\ref{tab:bbllang} for the differing language names in both packages. % % \begin{table} -% \label{tab:bbllang} +% \caption{\label{tab:bbllang}Babel-polyglossia language name matching} +% +% \begin{minipage}[t]{1\columnwidth} +% \small\centering % \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 \\ +% acadien & french & variant=acadian \\ +% american & english & variant=american [\emph{default}] \\ +% australian & english & variant=australian \\ +% austrian & german & variant=austrian, spelling=old \\ +% bahasa & malay & variant=indonesian [\emph{default}] \\ +% bahasam & malay & variant=malaysian \\ +% brazil & portuguese & variant=brazilian \\ +% british & english & variant=british \\ +% canadian & english & variant=canadian \\ +% canadien & french & variant=canadian \\ +% farsi & persian & \\ +% friulan & friulian & \\ +% german\footnote{Due to the name conflict only available in \pkg{polyglossia} as \emph{germanb} (which is a \pkg{babel} synonym).} +% & german & spelling=old \\ +% irish & gaelic & variant=irish [\emph{default}] \\ +% kurmanji & kurdish & variant=kurmanji \\ +% latin.classic\footnote{Available in \pkg{polyglossia} as \emph{latinclassic} (as dots are invalid in command names).} +% & latin & variant=classic \\ +% latin.ecclesiastic\footnote{Available in \pkg{polyglossia} as \emph{latinecclesiastic} (as dots are invalid in command names).} +% & latin & variant=ecclesiastic \\ +% latin.medieval\footnote{Available in \pkg{polyglossia} as \emph{latinmedieval} (as dots are invalid in command names).} +% & latin & variant=medieval \\ +% lowersorbian & sorbian & variant=lower \\ +% magyar & hungarian & \\ +% naustrian & german & variant=austrian \\ +% newzealand & english & variant=newzealand \\ +% ngerman & german & variant=german [\emph{default}] \\ +% norsk & norwegian & variant=bokmal \\ +% nswissgerman & german & variant=swiss \\ +% nynorsk & norwegian & variant=nynorsk [\emph{default}] \\ +% polutonikogreek & greek & variant=polytonic \\ +% portuges & portuguese & variant=portuguese [\emph{default}] \\ +% samin & sami & \\ +% scottish & gaelic & variant=scottish \\ +% serbianc & serbian & script=Cyrillic \\ +% slovene & slovenian & \\ +% spanishmx & spanish & variant=mexican \\ +% swissgerman & german & variant=swiss, spelling=old \\ +% uppersorbian & sorbian & variant=upper \\ % \bottomrule % \end{tabular} +% \end{minipage} % -% \caption{Babel-polyglossia language name matching} % \end{table} % +% For convenience reasons, \pkg{polyglossia} also supports the use of babel names\new{v1.46} (for the few justified +% exceptions, please refer to the notes in table~\ref{tab:bbllang}). +% The babel names listed in table~\ref{tab:bbllang} can be used instead of the corresponding polyglossia +% name\slash options in \cmd\setdefaultlanguage\ and \cmd\setotherlanguage\ as well as in the \pkg{polyglossia} and +% \pkg{babel} language switching commands\slash environments documented in section~\ref{sec:langcmds} and +% \ref{sec:babelcmds} (\eg \cmd\textaustrian\ is synonymous to \cmd{\textgerman[variant=austrian,spelling=old]}). +% However, unless you have special reasons, we strongly encourage you to use the \pkg{polyglossia} names. +% % % \subsection{Global options} % @@ -533,65 +578,75 @@ issues and follow progress. % % \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}. +% shorthands whenever available. Currently shorthands are implemented for +% Afrikaans, Belarusian, Catalan, Czech, Dutch, Finnish, Georgian, German, +% Italian, Latin, Mongolian, Russian, and Slovak. 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}\label{languageswitching} % -% \subsection{Recommended commands} +% \subsection{Recommended commands}\label{sec:langcmds} % For each activated language the command % \cmd{\text⟨lang⟩[⟨options⟩]\{…\}} \DescribeMacro{\text⟨lang⟩} +% (as well as the synonymous \DescribeMacro{\textlang}% +% \cmd{\textlang[⟨options⟩]\{⟨lang⟩\}\{…\}}\new{1.46}) % becomes available for short insertions of text in that language. -% For example ¦\textrussian{\today}¦ yields \textrussian{\today} -% This command switches to the correct hyphenation patterns, it activates +% For example ¦\textrussian{\today}¦ and ¦\textlang{russian}{\today}¦ yield \textrussian{\today} +% The commands switch to the correct hyphenation patterns, they activate % 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. +% punctuation in French), and they translate the date when using ¦\today¦. +% They do not, however, translate so-called \textit{caption strings},\ie % ``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. +% is meant for longer passages of text. It behaves slightly different than the \cmd{\text⟨lang⟩} and +% \cmd\textlang\ commands: It does everything the latter do, 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 commands, 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}: % % \begin{Verbatim}[formatcom=\color{myblue}] -% \begin{greek}[variant=ancient] -% μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος οὐλομένην, ἣ μυρί' Ἀχαιοῖς ἄλγε' -% ἔθηκε, πολλὰς δ' ἰφθίμους ψυχὰς Ἄϊδι προί̈αψεν ἡρώων, αὐτοὺς δὲ ἑλώρια -% τεῦχε κύνεσσιν οἰωνοῖσί τε πᾶσι, Διὸς δ' ἐτελείετο βουλή, ἐξ οὗ δὴ τὰ -% πρῶτα διαστήτην ἐρίσαντε Ἀτρεί̈δης τε ἄναξ ἀνδρῶν καὶ δῖος Ἀχιλλεύς. -% \end{greek} +% \begin{quote} +% \begin{greek}[variant=ancient] +% μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος οὐλομένην, ἣ μυρί' Ἀχαιοῖς +% ἄλγε' ἔθηκε, πολλὰς δ' ἰφθίμους ψυχὰς Ἄϊδι προί̈αψεν ἡρώων, +% αὐτοὺς δὲ ἑλώρια τεῦχε κύνεσσιν οἰωνοῖσί τε πᾶσι, Διὸς δ' +% ἐτελείετο βουλή, ἐξ οὗ δὴ τὰ πρῶτα διαστήτην ἐρίσαντε Ἀτρεί̈δης +% τε ἄναξ ἀνδρῶν καὶ δῖος Ἀχιλλεύς. +% \end{greek} +% \end{quote} % \end{Verbatim} % +% \vspace{-.5\baselineskip} +% +% \begin{quote} % \begin{greek}[variant=ancient] % μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος οὐλομένην, ἣ μυρί' Ἀχαιοῖς ἄλγε' ἔθηκε, % πολλὰς δ' ἰφθίμους ψυχὰς Ἄϊδι προί̈αψεν ἡρώων, αὐτοὺς δὲ ἑλώρια τεῦχε κύνεσσιν % οἰωνοῖσί τε πᾶσι, Διὸς δ' ἐτελείετο βουλή, ἐξ οὗ δὴ τὰ πρῶτα διαστήτην ἐρίσαντε % Ἀτρεί̈δης τε ἄναξ ἀνδρῶν καὶ δῖος Ἀχιλλεύς. % \end{greek} -% \bigskip +% \end{quote} % % \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. % -% \subsection{Babel commands} +% \subsection{Babel commands}\label{sec:babelcmds} % 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. @@ -605,7 +660,7 @@ issues and follow progress. % ¦\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 +% environment are identical with the use of the ¦\text⟨lang⟩¦ or ¦\textlang¦ 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}, @@ -614,12 +669,13 @@ issues and follow progress. % % \subsection{Other commands} % The following commands are probably of lesser interest to the end user, but -% ought to be mentioned here. +% ought to be mentioned here.\footnote{Note that these commands require polyglossia +% language names; they do not support language\slash babel aliases.} % \begin{itemize} -% \item \Cmd\selectbackgroundlanguage: this selects the global font setup and -% the numbering definitions for the default language. +% \item \DescribeMacro{\selectbackgroundlanguage}\cmd{\selectbackgroundlanguage\{⟨lang⟩\}}: +% this selects the global font setup and the numbering definitions for the default language. % -% \item \Cmd\resetdefaultlanguage\ (experimental): +% \item \DescribeMacro{\resetdefaultlanguage}\cmd{\resetdefaultlanguage[⟨options⟩]\{⟨lang⟩\}} (experimental): % completely switches the default language % to another one in the middle of a document: \textit{this may have adverse effects}! % @@ -630,9 +686,34 @@ issues and follow progress. % % \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. +% \item \Cmd\latinAlph: Representation of counter as a upper-case letter: 1 = A, 2 = B, etc. % \end{itemize} % +% +% \subsection{Setting up alias commands} +% +% By means of the macro +% \displaycmd{\setlanguagealias[⟨options⟩]\{⟨language⟩\}\{⟨alias⟩\}}{\setlanguagealias}\new{v1.46} +% you can define alias commands for specific language (variants). \Eg +% +% \begin{quote} +% \begin{verbatim} +% \setlanguagealias[variant=austrian]{german}{deAT} +% \end{verbatim} +% \end{quote} +% ^^A +% will define a command \cmd{\textdeAT} as well as an environment ¦{deAT}¦ which will link towards +% the command \cmd{\textgerman[variant=austrian]} and the environment ¦{german}[variant=austrian]¦, +% respectively. The aliases can also be used in the language switching commands described in +% section~\ref{sec:langcmds} and \ref{sec:babelcmds}. +% Note, though, that the usual restrictions for command names apply, so something such as +% ¦de-AT¦ or ¦de_AT¦ will not work since ¦-¦ and ¦_¦ are not allowed in command names. +% +% For the latter case, and for the case where an alias would clash with an existing \cmd{\text⟨...⟩} +% command (\eg ¦\textit¦), a starred version \Cmd{\setlanguagealias*} is provided which does not define +% a \cmd{\text⟨alias⟩} command (but which will set up the alias for everything else, including +% \cmd{\textlang\{⟨alias⟩\}}). +% % \section{Font setup} % % With polyglossia it is possible to associate a specific font with any script or language @@ -641,11 +722,12 @@ issues and follow progress. % For instance, if the default font defined by \cmd\setmainfont\ % does not support Greek, then one can define the font used to display Greek with:\\ % \centerline{ \cmd\newfontfamily\cmd{\greekfont[Script=Greek,⟨…⟩]\{⟨font⟩\}}. } -% Note that polyglossia will use the font thus defined as is. -% for instance if ¦\arabicfont¦ is explicitly defined, then one should take care of -% including the option ¦Script=Arabic¦ in that definition. -% See the \pkg{fontspec} documentation for more information. -% If a specific sans or monospace font is needed for a particular script or language, +% Note that polyglossia will use the font defined as is, so assure to do all necessary settings +% (please refer to the \pkg{fontspec} documentation for details). +% For instance, if ¦\arabicfont¦ is explicitly defined, then the option ¦Script=Arabic¦ should +% be included in that definition. +% +% If a specific sans serif or monospace (`teletype') font is needed for a particular script or language, % it can be defined by means of \new{v1.2.0} % ¦\⟨script⟩fontsf¦\ or ¦\⟨language⟩fontsf¦ and ¦\⟨script⟩fonttt¦\ or ¦\⟨language⟩fonttt¦, respectively. % @@ -674,7 +756,7 @@ issues and follow progress. % \end{Verbatim} % ^^A % These exceptions, however, apply to all languages. In addition to this, \pkg{polyglossia} provides -% the command\new{v.1.45} +% the command\new{v1.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. @@ -695,6 +777,24 @@ issues and follow progress. % % ^^A\subsection{amharic}\label{amharic} % +% \subsection{afrikaans}\label{afikaans} +% \paragraph*{Options:} +% \begin{itemize} +% \item \TB{babelshorthands} = \textit{false} or true. \new{v1.1.1} +% if this is turned on, the following shorthands defined for fine-tuning hyphenation and +% micro-typography of Afrikaans 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} +% \end{itemize} +% % \subsection{arabic}\label{arabic} % \paragraph*{Options:} % \begin{itemize} @@ -726,6 +826,42 @@ issues and follow progress. % \item \TB{numerals}\new{v1.45} = armenian or \textit{arabic} % \end{itemize} % +% \subsection[belarusian]{belarusian\new{v1.46}}\label{belarusian} +% +% \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. +% \item \TB{spelling} = \textit{modern} or classic (=~tarask). With ¦spelling=classic¦, captions and dates +% adhere to the Taraškievica (or Belarusian classical) orthography rather than the standard orthography. +% \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 ¦\textbelarusian{\Asbuk{page}}¦ produces \textrussian{\Asbuk{page}}. +% \item \Cmd\asbuk: same in lowercase +% \end{itemize} +% % \subsection[bengali]{bengali\new{v1.2.0}}\label{bengali} % \paragraph*{Options:} % \begin{itemize} @@ -756,25 +892,25 @@ issues and follow progress. % \begin{shorthands} % \item[¦"=¦] for an explicit hyphen sign which is repeated at the beginning % of the next line when hyphenated, as common in Czech typesetting -% (also see option ¦splithyphens¦). +% (only needed with ¦splithyphens=false¦). % \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} +% \item \TB{splithyphens} = false or \textit{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} +% of the line that follows the hyphenation (\emph{je-/-li}). +% By default, this is done automatically\new{v1.46} (if you are using \LuaTeX, the \pkg{luavlna} package is +% loaded to achieve this). +% Set this option to ¦false¦ to disable the feature. +% \item \TB{vlna} = false or \textit{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. +% must not occur at line ends. +% \pkg{Polyglossia} takes care of this automatically by default\new{v1.46} (if you are using \LuaTeX, the +% \pkg{luavlna} package is loaded to achieve this). +% Set this option to ¦false¦ to disable the feature. % \end{itemize} % % \subsection{dutch}\label{dutch} @@ -835,14 +971,31 @@ issues and follow progress. % \begin{itemize} % \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 +% \item \TB{autospacing} = \textit{true} or false. 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{thincolonspace}\new{v1.46} = true or \textit{false}. Normally, a +% full (non-breaking) interword space is inserted before a colon. Use this +% option if you prefer a thinner space as used before \texttt{;}, \texttt{!}, +% and \texttt{?}. +% \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.} = \textit{true} +% or false. 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. +% \item \TB{frenchitemlabels}\new{v.1.46} = true or \textit{false} (default value = true). If \textit{true}, itemize item labels use em-dashes throughout, +% as common in French typography. +% Note that this option is only functional (by design) if French is the main language. Also, it might interfere with list packages such as \pkg{enumitem}. +% \item \TB{itemlabels}\new{v.1.46} = ¦⟨cmd⟩¦ (default value = ¦\textemdash¦). If \emph{frenchitemlabels} is true, you can customize here the used item label of all levels. +% \item \TB{itemlabeli}\new{v.1.46} = ¦⟨cmd⟩¦ (default value = ¦\textemdash¦). If \emph{frenchitemlabels} is true, you can customize here the used item label of the first level. +% \item \TB{itemlabelii}\new{v.1.46} = ¦⟨cmd⟩¦ (default value = ¦\textemdash¦). If \emph{frenchitemlabels} is true, you can customize here the used item label of the second level. +% \item \TB{itemlabeliii}\new{v.1.46} = ¦⟨cmd⟩¦ (default value = ¦\textemdash¦). If \emph{frenchitemlabels} is true, you can customize here the used item label of the third level. +% \item \TB{itemlabeliv}\new{v.1.46} = ¦⟨cmd⟩¦ (default value = ¦\textemdash¦). If \emph{frenchitemlabels} is true, you can customize here the used item label of the fourth level. % \end{itemize} % \paragraph*{Commands:} % \begin{itemize} @@ -856,6 +1009,34 @@ issues and follow progress. % \item \TB{variant} = \textit{irish} or scottish % \end{itemize} % +% \subsection[georgian]{georgian\new{v1.46}}\label{georgian} +% +% \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 georgian. Uses either Arabic numerals or Georgian +% alphanumerical numbering. +% \item \TB{oldmonthnames} = \textit{true} or false (default: false). Uses traditional Georgian +% month names. +% \end{itemize} +% % \subsection{german}\label{german} % \paragraph*{Options:} % \begin{itemize} @@ -897,8 +1078,9 @@ issues and follow progress. % \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. +% \item\TB{script} = \textit{latin} or blackletter\new{v1.46} (=~fraktur\new{v1.2.0}). +% Setting ¦script=blackletter¦ adapts the captions for typesetting German in blackletter type (using the long s (ſ) +% where appropriate). % \end{itemize} % % \subsection{greek}\label{greek} @@ -939,6 +1121,27 @@ issues and follow progress. % \end{itemize} % % \subsection{hungarian}\label{hungarian} +% \paragraph*{Options:} +% \begin{itemize} +% \item \TB{swapstrings} = \textit{all}, captions, headings, headers, hheaders or none\new{v1.46} +% +% In Hungarian, some caption strings need to be in a different order than in other languages +% (\eg \emph{1. fejezet} instead of \emph{Chapter 1}). By default, \pkg{polyglossia} tries hard to +% provide the correct order for different classes and packages (standard classes, \pkg{KOMA-script}, +% \pkg{memoir}, and \pkg{titlesec} package should work, as well as \pkg{fancyhdr} and \pkg{caption}). +% However, since the definition of these strings is not standardized, the redefinitions might not work +% and even interfere badly if you use specific classes or packages that redefine the respective strings +% themselves. In this case, you can disable some or all changes. +% The possibilities are: +% \begin{itemize} +% \item ¦all¦: Redefine figure and table captions, part and chapter headings, and running headers (=~default setting) +% \item ¦captions¦: Redefine figure and table captions only +% \item ¦headings¦: Redefine part and chapter headings only +% \item ¦headers¦: Redefine running headers only +% \item ¦hheaders¦: Redefine part and chapter headings as well as running headers +% \item ¦none¦: Do not redefine anything +% \end{itemize} +% \end{itemize} % \paragraph*{Commands:} % \begin{itemize} % \item \Cmd\ontoday\ (= \Cmd\ondatehungarian): special form of \cmd\today\ which produces a slightly different @@ -973,7 +1176,6 @@ issues and follow progress. % \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} @@ -982,9 +1184,10 @@ issues and follow progress. % \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) +% ^^A \item \TB{locale} (not yet implemented) +% ^^A \item \TB{calendar} (not yet implemented) % \end{itemize} +% \condbreak{2\baselineskip} % \paragraph*{Commands:} % \begin{itemize} % \item \Cmd\ontoday: special form of \cmd\today\ which produces a slightly different @@ -1001,9 +1204,152 @@ issues and follow progress. % % \subsection{latin}\label{latin} % \paragraph*{Options:} -% \begin{itemize} -% \item \TB{variant} = classic, medieval or \textit{modern} -% \end{itemize} +% \begin{itemize} +% \item \TB{variant} = classic, medieval, \emph{modern}, or ecclesiastic\new{v.1.46} +% +% These variants refer to different spelling conventions. The ¦classic¦ +% and the ¦medieval¦ variant do not use the letters \emph{U} and +% \emph{v}, but only \emph{V} and \emph{u}. This concerns predefined terms like +% month names as well as the behaviour of the \cmd\MakeUppercase\ and the +% \cmd\MakeLowercase\ command. The ¦medieval¦ and the +% ¦ecclesiastic¦ variant use the ligatures \emph{\ae} and \emph{\oe}. +% See table \ref{tab:latin-spelling} for examples. +% +% Furthermore, the \texttt{ecclesiastic} variant takes care for a punctuation +% spacing similar to French, but with smaller spaces, as provided for +% PDF\TeX\ by the \pkg{ecclesiastic} package. +% \begin{table} +% \centering +% \caption{\label{tab:latin-spelling}Spelling differences between the Latin +% language variants.\newline The capitalization of month names and the use of +% \emph{i/j} may be affected by the \texttt{capitalizemonth} and the +% \texttt{usej} option.} +% \begin{tabular}{llll} +% \toprule +% \textbf{classic} & \textbf{medieval} & \textbf{modern} & \textbf{ecclesiastic} \\ +% \midrule +% Ianuarii & Ianuarii & Ianuarii & ianuarii \\ +% Nouembris & Nouembris & Novembris & novembris \\ +% Praefatio & Præfatio & Praefatio & Præfatio \\ +% \addlinespace\multicolumn{4}{@{}l}{\cmd{\MakeUppercase\{Iulius\}} yields:} \\ +% IVLIVS & IVLIVS & IULIUS & IULIUS \\ +% \bottomrule +% \end{tabular} +% \end{table} +% \item \TB{hyphenation}\new{v.1.46} = classic, modern, or liturgical +% +% There are three different sets of hyphenation patterns for Latin. Separate +% documention for them is available on the +% Internet.\footnote{\url{https://github.com/gregorio-project/hyphen-la/blob/master/doc/README.md\#hyphenation-styles}} +% Each of the four variants mentioned above has its default set of hyphenation +% patterns as indicated by table \ref{tab:latin-hyphenation}. Use the +% ¦hyphenation¦ option if the default style does not fit your needs. +% Note that the liturgical hyphenation patterns are the default of none of the +% language variants. To use them, you have to say +% ¦hyphenation=liturgical¦ in any case. +% \begin{table} +% \caption{\label{tab:latin-hyphenation}Latin default hyphenation styles} +% \centering +% \begin{tabular}{ll} +% \toprule +% \textbf{Language variant} & \textbf{Default hyphenation style} \\ +% \midrule +% classic & classic \\ +% medieval & modern \\ +% modern & modern \\ +% ecclesiastic & modern \\ +% \bottomrule +% \end{tabular} +% \end{table} +% \item \TB{ecclesiasticfootnotes}\new{v.1.46} = true or \emph{false} +% +% Use footnotes as provided by the \pkg{ecclesiastic} package, which typesets +% footnotes with ordinary instead of superior numbers and without indentation. +% As many ecclesiastic documents and liturgical books use footnotes that are +% very similar to the ordinary \LaTeX\ ones, we do not use this footnote style +% as default even for the ¦ecclesiastic¦ variant. +% +% Note that this option is only possible if Latin is the main language of your +% document. +% \item \TB{usej}\new{v.1.46} = true or \emph{false} +% +% Use \emph{J/j} in predefined terms. The letter \emph{j} is not of ancient +% origin. In early modern times, it was used to distinguish the consonantic +% \emph{i} from the vocalic~\emph{i}. Nowadays, the use of \emph{j} has +% disappeared from most Latin publications. So ¦false¦ is the default +% value for all four language variants. Use this option if you prefer +% \emph{Januarii} and \emph{Maji} to \emph{Ianuarii} and \emph{Maii}. +% \item \TB{capitalizemonth}\new{v.1.46} = true or false +% +% Capitalize the month name when printing dates (using the \cmd\today\ +% command). Traditionally, month names are capitalized. However, in recent +% liturgical books they are lowercase. So ¦true¦ is the default value for +% the variants ¦classic¦, ¦medieval¦, and ¦modern¦, +% whereas ¦false¦ is the default value for the ¦ecclesiastic¦ +% variant. +% \item \TB{babelshorthands} = true or \emph{false} +% +% Enable the following shorthands inherited from \pkg{babel-latin} and the +% \pkg{ecclesiastic} package. +% \begin{shorthands} +% \item[¦"<¦] for « (left guillemet) +% \item[¦">¦] for » (right guillemet) +% \item[¦"¦] If no other shorthand applies, ¦"¦ before any letter +% character defines an optional break point allowing further break points +% within the same word (as opposed to the \cmd\- command). +% \item[¦"|¦] the same as ¦"¦, but also possible before non-letter +% characters +% \item[¦'a¦] for á (a with acute), also available for é, í, ó, ú, ý, ǽ, and +% \'œ +% \item[¦'A¦] for Á (A with acute), also available for É, Í, Ó, Ú, \'V, Ý, Ǽ, +% and \'Œ +% \end{shorthands} +% The following shorthands are only available for the ¦medieval¦ and the +% ¦ecclesiastic¦ variant. +% \begin{shorthands} +% \item[¦"ae¦] for æ (ae ligature), also available for œ +% \item[¦"Ae¦] for Æ (AE ligature), also available for Œ +% \item[¦"AE¦] for Æ (AE ligature), also available for Œ +% \item[¦'ae¦] for ǽ (ae ligature with acute), also available for \'œ +% \item[¦'Ae¦] for Ǽ (AE ligature with acute), also available for \'Œ +% \item[¦'AE¦] for Ǽ (AE ligature with acute), also available for \'Œ +% \end{shorthands} +% \item \TB{prosodicshorthands}\new{v.1.46} = true or \emph{false} +% +% Enable shorthands for prosodic marks (macrons and breves) very similiar to +% those provided by \pkg{babel-latin} using the ¦withprosodicmarks¦ +% modifier. +% +% Note that the active ¦=¦ character used for macrons will cause problems with +% commands using \texttt{key=value} interfaces, \eg +% ¦\includegraphics[scale=2]{...}¦. Use \cmd{\shorthandoff\{=\}} before +% such commands (and \cmd{\shorthandon\{=\}} thereafter) within every +% environment with prosodic shorthands enabled. +% +% The following shorthands are available. +% \begin{shorthands} +% \item[¦=a¦] for ā (a with macron), also available for ē, ī, ō, ū, and ȳ +% \item[¦=A¦] for Ā (A with macron), also available for Ē, Ī, Ō, Ū, V̄, and Ȳ. +% Note that a macron above the letter V is only displayed if your font +% supports the Unicode character ¦0304¦ (\emph{combining macron}). +% \item[¦=ae¦] for a͞e (ae diphthong with macron), also available for a͞u, e͞u, +% and o͞e. Note that macrons above diphthongs are only displayed if your font +% supports the Unicode character ¦035E¦ (\emph{combining double +% macron}). +% \item[¦=Ae¦] for A͞e (Ae diphthong with macron), also available for A͞u, E͞u, +% and O͞e. +% \item[¦=AE¦] for A͞E (AE diphthong with macron), also available for A͞U, E͞U, +% and O͞E. +% \item[¦\textasciicircum a¦] for ă (a with breve), also available for ĕ, ĭ, +% ŏ, ŭ, and y̆. Note that a breve above the letter y is only displayed if +% your font supports the Unicode character ¦0306¦ (\emph{combining +% breve}). +% \item[¦\textasciicircum A¦] Ă (A with breve), also available for Ĕ, Ĭ, Ŏ, +% Ŭ, V̆, and Y̆. Note that breves above the letters V and Y are only displayed +% if your font supports the Unicode character ¦0306¦ (\emph{combining +% breve}). +% \end{shorthands} +% \end{itemize} % % \subsection{malay}\label{malay} % \paragraph*{Options:} @@ -1043,7 +1389,7 @@ issues and follow progress. % \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}}. +% \eg ¦\textmongolian{\Asbuk{page}}¦ produces \textrussian{\Asbuk{page}}. % \item \Cmd\asbuk: same in lowercase % \end{itemize} % @@ -1059,8 +1405,8 @@ issues and follow progress. % \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) +% ^^A \item \TB{locale} (not yet implemented) +% ^^A \item \TB{calendar} (not yet implemented) % \end{itemize} % \paragraph*{Commands:} % \begin{itemize} @@ -1096,6 +1442,9 @@ issues and follow progress. % ^^A \item[¦"<¦] for French left double quotes (looks like <<). % ^^A \item[¦">¦] for French right double quotes (looks like >>). % \end{shorthands} +% \item \TB{indentfirst}\new{v1.46} = \textit{true} or false. By default, all paragraphs are indented in Russian, +% also those after a chapter or section heading. If this option is false, the latter paragraphs +% are not indented, as normal in \LaTeX. % \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. @@ -1115,17 +1464,17 @@ issues and follow progress. % \subsection{sanskrit}\label{sanskrit} % \paragraph*{Options:} % \begin{itemize} -% \item \TB{Script} = \textit{Devanagari}\new{v1.0.2}, Gujarati, Malayalam, Bengali, Kannada, +% \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. +% 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 +% \item \TB{numerals} = \textit{Devanagari}\new{v1.45} or Western % \end{itemize} % % \subsection{serbian}\label{serbian} % \paragraph*{Options:} % \begin{itemize} -% \item \TB{Script} = \textit{Cyrillic} or Latin. Will likely go to a variant. +% \item \TB{script} = \textit{Cyrillic} or Latin. % \item \TB{numerals} = \textit{arabic} or cyrillic. Uses either Arabic numerals or Cyrillic % alphanumerical numbering. % \end{itemize} @@ -1138,6 +1487,44 @@ issues and follow progress. % \end{itemize} % % +% \subsection{slovak}\label{slovak} +% +% \paragraph*{Options:} +% \begin{itemize} +% \item \TB{babelshorthands} = \textit{false} or true. \new{v1.46} +% if this is turned on, the following shorthands for Slovak 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 Slovak typesetting +% (only needed with ¦splithyphens=false¦). +% \item[¦"|¦] disables a ligature at this position. +% \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for +% cases where the hyphen should stick at the following syllable. +% \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). +% \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[¦"‘¦] for Slovak left double quotes (looks like ,,). +% \item[¦"’¦] for Slovak right double quotes (looks like “). +% \item[¦">¦] for Slovak left double guillemets (looks like >>). +% \item[¦"<¦] for Slovak right double guillemets (looks like <<). +% \end{shorthands} +% \item \TB{splithyphens} = \textit{false} or true. \new{v1.46} +% According to Slovak 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}). +% By default, this is done automatically (if you are using \LuaTeX, the \pkg{luavlna} package is +% loaded to achieve this). +% Set this option to ¦false¦ to disable the feature. +% \item \TB{vlna} = \textit{false} or true. \new{v1.46} +% According to Slovak typesetting conventions, single-letter words (non-syllable prepositions) +% must not occur at line ends. +% \pkg{Polyglossia} takes care of this automatically by default (if you are using \LuaTeX, the +% \pkg{luavlna} package is loaded to achieve this). +% Set this option to ¦false¦ to disable the feature. +% \end{itemize} +% % \subsection{slovenian}\label{slovenian} % \paragraph*{Options:} % \begin{itemize} @@ -1156,6 +1543,35 @@ issues and follow progress. % \item \Cmd\oldtoday: outputs the current date using traditional Sorbian month names, even if \TB{olddate} is false. % \end{itemize} % +% \subsection{spanish}\label{spanish} +% \paragraph*{Options:} +% \begin{itemize} +% \item \TB{variant} = \textit{spanish} or mexican.\new{v1.46} +% \item \TB{spanishoperators} = all, accented, spaced or none or \textit{false} (default value = all).\new{v1.46} +% Determines of and how math operators are localized to Spanish. +% \begin{itemize} +% \item ¦accented¦ causes some math operators to use accents where usual in Spanish (\emph{lím}, +% \emph{lím\,sup}, \emph{lím\,inf}, \emph{máx}, \emph{mín}, \emph{ínf}, \emph{mód}). +% \item ¦spaced¦ causes some math operators to use spaces where usual in Spanish (\emph{arc\,cos}, +% \emph{arc\,sen}, \emph{arc\,tg}). +% \item ¦all¦ activates ¦accented¦ and ¦spaced¦ and furthermore provides Spanish localizations of +% ¦\sin¦ (\emph{sen}), ¦\tan¦ (\emph{tg}), ¦\sinh¦ (\emph{senh}), and ¦\tanh¦ (\emph{tgh}). +% \item ¦none¦ does no localization at all (default setting). +% \end{itemize} +% \end{itemize} +% \paragraph*{\color{black}Commands:}\new{v1.46} +% \begin{itemize} +% \item \Cmd\arcsen: alias to ¦\arcsin¦ (\pkg{babel} compatibility) +% \item \Cmd\arctg: alias to ¦\arctan¦ (\pkg{babel} compatibility) +% \item \Cmd\sen: alias to ¦\sin¦ (\pkg{babel} compatibility) +% \item \Cmd\senh: alias to ¦\sinh¦ (\pkg{babel} compatibility) +% \item \Cmd\tg: alias to ¦\tan¦ (\pkg{babel} compatibility) +% \item \Cmd\tgh: alias to ¦\tanh¦ (\pkg{babel} compatibility) +% \item \Cmd\spanishoperator: allows you to define further localized operators. For instance, ¦\spanishoperator{cotg}¦ +% defines a command ¦\cotg¦ that outputs \emph{cotg} in math. The optional argument of the command lets you specify the +% spelling, if needed, \eg ¦\spanishoperator[arc\,ctg]{arcctg}¦. +% \end{itemize} +% % \subsection{syriac}\label{syriac} % \paragraph*{Options:} % \begin{itemize} @@ -1352,6 +1768,9 @@ issues and follow progress. % \item \Cmd\armeniannumeral produces Armenian alphabetic numbering. % Example: ¦\armeniannumeral{1863}¦ yields \textarmenian{\armeniannumeral{1863}}. % +% \item \Cmd\georgiannumeral produces Georgian alphabetic numbering.\\ +% Example: ¦\georgiannumeral{1863}¦ yields \textgeorgian{\georgiannumeral{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}}. @@ -1505,7 +1924,7 @@ issues and follow progress. % by other people. I take this opportunity to thank the following individuals, % 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{Boris Lavva} and others for its Hebrew support), \TA{Alexej Kryukov} (\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 @@ -1525,12 +1944,26 @@ issues and follow progress. % 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 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 \TA{Claudio Beccari}, the indefatigable champion of -% Romance languages, and beyond! +% \section{More acknowledgements (by the current development team)} +% Many thanks to all the people who have contributed bugfixes and new features to \pkg{polyglossia} +% since we took over. +% In alphabetical order: \TA{Ignas Anikevicius}, \TA{Sina Ahmadi}, \TA{Wouter Bolsterlee}, \TA{Christian Buhtz}, +% \TA{Zgarbul Andrey}, \TA{Oleg Domanov}, \TA{Philipp Gesang}, \TA{Kevin Godby}, \TA{Enrico Gregorio}, +% \TA{Khaled Hosny}, \TA{Najib Idrissi}, user \TA{julroy67}, \TA{Dohyun Kim}, \TA{Phil Kime}, \TA{Mike Kroutikov}, +% \TA{Ivan Kokan}, \TA{Caleb Maclennan}, \TA{José Mancera}, \TA{Yevgen Pogribnyi}, \TA{Maïeul Rouquette}, +% \TA{Elie Roux}, \TA{Hugo Roy}, \TA{Guy Rutenberg}, \TA{Philipp Stephani}, \TA{Keno Wehr}, \TA{Dominik Wujastyk}, +% \TA{Sertaç Ö. Yıldız}, \TA{Maksim Zholudev}, \TA{Yan Zhou}, and \TA{Stefan Zlatinov}. +% Their respective contributions can be identified from the contributor statistics on +% \href{https://github.com/reutenauer/polyglossia/graphs/contributors}{GitHub}. +% +% Among the ones who sent contributions directly to us we would like to especially thank +% \TA{Claudio Beccari}, the indefatigable champion of Romance languages, and beyond! Furthermore, +% kudos go to \TA{Moritz Wemheuer} (of \pkg{biblatex}) who has helped a lot to improve \pkg{polyglossia} interaction +% with \pkg{biblatex} and \pkg{csquotes}. +% +% Not at least, we are very grateful for all bug reports and feature enhancement requests we received from +% the numerous users we cannot list all here (but again, you can find all names on \href{https://github.com/reutenauer/polyglossia/issues?utf8=%E2%9C%93&q=is%3Aissue}{GitHub}). +% Please go on with that, you are keeping \pkg{polyglossia} running! % % % @@ -1538,6 +1971,115 @@ issues and follow progress. % \StopEventually{} % \section{Implementation} % \iffalse +%<*gloss-acadien.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-acadien.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for canadian (acadian) french] + +% We provide this as a babel alias + +\xpg@load@master@language{french} + +% \end{macrocode} +% \iffalse +%</gloss-acadien.ldf> +%<*gloss-afrikaans.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-afrikaans.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-afrikaans.ldf}[polyglossia: module for afrikaans] + +\PolyglossiaSetup{afrikaans}{ + hyphennames={afrikaans,dutch}, + hyphenmins={2,2}, + langtag=AFK, + frenchspacing=true, + fontsetup=true, +} + +\define@boolkey{afrikaans}[afrikaans@]{babelshorthands}[true]{} + +\ifsystem@babelshorthands + \setkeys{afrikaans}{babelshorthands=true} +\else + \setkeys{afrikaans}{babelshorthands=false} +\fi + +\ifcsundef{initiate@active@char}{% + \input{babelsh.def}% + \initiate@active@char{"}% + \shorthandoff{"}% +}{} + +\def\afrikaans@shorthands{% + \bbl@activate{"}% + \def\language@group{afrikaans}% + \declare@shorthand{afrikaans}{"-}{\nobreak-\bbl@allowhyphens} + \declare@shorthand{afrikaans}{"~}{\textormath{\leavevmode\hbox{-}}{-}} + \declare@shorthand{afrikaans}{"|}{% + \textormath{\discretionary{-}{}{\kern.03em}}{}} + \declare@shorthand{afrikaans}{""}{\hskip\z@skip} + \declare@shorthand{afrikaans}{"/}{\textormath + {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}% + \def\-{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}% +} + +\def\noafrikaans@shorthands{% + \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}% +} + +\def\captionsafrikaans{% + \def\prefacename{Voorwoord}% + \def\refname{Verwysings}% + \def\abstractname{Samevatting}% + \def\bibname{Bibliografie}% + \def\chaptername{Hoofstuk}% + \def\appendixname{Bylae}% + \def\contentsname{Inhoudsopgawe}% + \def\listfigurename{Lys van figure}% + \def\listtablename{Lys van tabelle}% + \def\indexname{Inhoud}% + \def\figurename{Figuur}% + \def\tablename{Tabel}% + \def\partname{Deel}% + \def\enclname{Bylae(n)}% + \def\ccname{a.\,a.}% + \def\headtoname{Aan}% + \def\pagename{Bladsy}% + \def\seename{sien}% + \def\alsoname{sien ook}% + \def\proofname{Bewys}% +% \def\glossaryname{}% +} + +\def\dateafrikaans{% + \def\today{\number\day~\ifcase\month\or + Januarie\or Februarie\or Maart\or April\or Mei\or Junie\or + Julie\or Augustus\or September\or Oktober\or November\or + Desember\fi + \space \number\year}% +} + +\def\noextras@afrikaans{% + \noafrikaans@shorthands% +} + +\def\blockextras@afrikaans{% + \ifafrikaans@babelshorthands\afrikaans@shorthands\fi% +} + +\def\inlineextras@afrikaans{% + \ifafrikaans@babelshorthands\afrikaans@shorthands\fi% +} + +% \end{macrocode} +% \iffalse +%</gloss-afrikaans.ldf> %<*gloss-albanian.ldf> % \fi % \clearpage @@ -1587,6 +2129,21 @@ issues and follow progress. % \end{macrocode} % \iffalse %</gloss-albanian.ldf> +%<*gloss-american.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-american.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-american.ldf}[polyglossia: module for american english] + +% We provide this as a babel alias + +\xpg@load@master@language{english} + +% \end{macrocode} +% \iffalse +%</gloss-american.ldf> %<*gloss-amharic.ldf> % \fi % \clearpage @@ -1950,9 +2507,8 @@ and may look very wrong.} \def\arabicnumber#1{% \ifeastern@numerals - \arabicdigits{\number#1}% + \@ensure@dir{\arabicdigits{\number#1}}% \else - %%\RL{\protect\reset@font\number#1}% \number#1% \fi} @@ -2261,6 +2817,51 @@ and may look very wrong.} % \end{macrocode} % \iffalse %</gloss-asturian.ldf> +%<*gloss-australian.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-australian.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-australian.ldf}[polyglossia: module for australian english] + +% We provide this as a babel alias + +\xpg@load@master@language{english} + +% \end{macrocode} +% \iffalse +%</gloss-australian.ldf> +%<*gloss-austrian.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-austrian.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for austrian german (old spelling)] + +% We provide this as a babel alias + +\xpg@load@master@language{german} + +% \end{macrocode} +% \iffalse +%</gloss-austrian.ldf> +%<*gloss-bahasa.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-bahasa.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-kurmanji.ldf}[polyglossia: module for kurmanji kurdish] + +% We provide this as a babel alias + +\xpg@load@master@language{kurdish} + +% \end{macrocode} +% \iffalse +%</gloss-bahasa.ldf> %<*gloss-bahasai.ldf> % \fi % \clearpage @@ -2272,20 +2873,7 @@ and may look very wrong.} % 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=Indonesian, - langtag=IND, - hyphennames={indonesian,indon,bahasai,bahasa,bahasam,malay,melayu}, - hyphenmins={2,2}, - fontsetup=true} - -\let\captionsbahasai\captionsmalay@indonesian -\let\datebahasai\datemalay@indonesian - -\DefineFormatHijriDate{bahasai}{% - \number\value{Hijriday}\space\hijrimonthmalay@indonesian{\value{Hijrimonth}}\space\number\value{Hijriyear}} +\xpg@load@master@language{malay} % \end{macrocode} % \iffalse @@ -2298,23 +2886,10 @@ and may look very wrong.} % \begin{macrocode} \ProvidesFile{gloss-bahasam.ldf}[polyglossia: module for bahasa melayu] -% 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=Malay, - langtag=MLY, - hyphennames={malay,melayu,bahasam,bahasa,bahasai,indonesian,indon}, - hyphenmins={2,2}, - fontsetup=true} - -\let\captionsbahasam\captionsmalay@malay -\let\datebahasam\datemalay@malay +% We only provide this gloss for babel compatibility. Since bahasam is +% a malay variety, we use 'malay' with variant 'malaysian' now. -\DefineFormatHijriDate{bahasam}{% - \number\value{Hijriday}\space\hijrimonthmalay@malay{\value{Hijrimonth}}\space\number\value{Hijriyear}} +\xpg@load@master@language{malay} % \end{macrocode} % \iffalse @@ -2368,6 +2943,285 @@ and may look very wrong.} % \end{macrocode} % \iffalse %</gloss-basque.ldf> +%<*gloss-belarusian.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-belarusian.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-belarusian.ldf}[polyglossia: module for belarusian] + +\RequirePackage{xpg-cyrillicnumbers} + +\PolyglossiaSetup{belarusian}{ + script=Cyrillic, + scripttag=cyrl, + langtag=BEL, + hyphennames={belarusian}, + hyphenmins={2,2}, + frenchspacing=true, + fontsetup, + localnumeral=belarusiannumerals, + Localnumeral=Belarusiannumerals +} + +\def\belarusian@spelling{modern} +\define@choicekey*+{belarusian}{spelling}[\val\nr]{modern,classic,tarask}[modern]{% + \ifcase\nr\relax + % modern: + \def\belarusian@spelling{modern} + \or + % classic: + \def\belarusian@spelling{tarask} + \or + % tarask: + \def\belarusian@spelling{tarask} + \fi +}{\xpg@warning{Unknown Belarusian spelling `#1'}} + +\newif\ifcyrillic@numerals +\define@key{belarusian}{numerals}[arabic]{% + \ifstrequal{#1}{cyrillic}% + {\cyrillic@numeralstrue}% + {\cyrillic@numeralsfalse}% +} + +\define@boolkey{belarusian}[belarusian@]{babelshorthands}[false]{} + +\setkeys{belarusian}{numerals} + +\ifsystem@babelshorthands + \setkeys{belarusian}{babelshorthands=true} +\else + \setkeys{belarusian}{babelshorthands=false} +\fi + +\ifcsundef{initiate@active@char}{% + \input{babelsh.def}% + \initiate@active@char{"}% + \shorthandoff{"}% +}{} + +\def\belarusian@shorthands{% + \bbl@activate{"}% + \def\language@group{belarusian}% + \declare@shorthand{belarusian}{"`}{„}% + \declare@shorthand{belarusian}{"'}{“}% + \declare@shorthand{belarusian}{"<}{«}% + \declare@shorthand{belarusian}{">}{»}% + \declare@shorthand{belarusian}{""}{\hskip\z@skip}% + \declare@shorthand{belarusian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}% + \declare@shorthand{belarusian}{"=}{\nobreak-\hskip\z@skip}% + \declare@shorthand{belarusian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}% + \declare@shorthand{belarusian}{"-}{% + \def\belarusian@sh@tmp{% + \if\belarusian@sh@next-\expandafter\belarusian@sh@emdash% + \else\expandafter\belarusian@sh@hyphen\fi% + }% + \futurelet\belarusian@sh@next\belarusian@sh@tmp% + }% + \def\belarusian@sh@hyphen{% + \nobreak\-\bbl@allowhyphens}% + \def\belarusian@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{belarusian}{",}{\nobreak\hskip.2em\ignorespaces}% +} + +\def\nobelarusian@shorthands{% + \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}% +} + +% Taken from babel-belarusian +\def\captionsbelarusian@modern{% + \def\prefacename{Прадмова}% + \def\refname{Спіс літаратуры}% + \def\abstractname{Анатацыя}% + \def\bibname{Літаратура}% + \def\chaptername{Глава}% + \def\appendixname{Дадатак}% + \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\glossaryname{Слоўнік тэрмінаў}% + \def\acronymname{Абрэвіятуры}% + \def\lstlistingname{Лістынг}% + \def\lstlistlistingname{Лістынгі}% + \def\notesname{Нататкі}% +} + +\def\captionsbelarusian@tarask{% + \def\prefacename{Прадмова}% + \def\refname{Сьпіс літаратуры}% + \def\abstractname{Анатацыя}% + \def\bibname{Літаратура}% + \def\chaptername{Глава}% + \def\appendixname{Дадатак}% + \def\contentsname{Зьмест}% + \let\tocname=\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\glossaryname{Слоўнік тэрмінаў}% + \def\acronymname{Абрэвіятуры}% + \def\lstlistingname{Лістынг}% + \def\lstlistlistingname{Лістынгі}% + \def\nomname{Азначэньні}% + \def\notesname{Нататкі}% +} + +\def\captionsbelarusian{% + \csuse{captionsbelarusian@\belarusian@spelling}% +} + +\def\datebelarusian@modern{% + \def\today{\number\day~\ifcase\month\or + студзеня\or + лютага\or + сакавіка\or + красавіка\or + мая\or + чэрвеня\or + ліпеня\or + жніўня\or + верасня\or + кастрычніка\or + лістапада\or + снежня\fi + \space \number\year~г.}% +} + +\def\datebelarusian@tarask{% + \def\today{\number\day~\ifcase\month\or% + студзеня\or + лютага\or + сакавіка\or + красавіка\or + траўня\or + чэрвеня\or + ліпеня\or + жніўня\or + верасьня\or + кастрычніка\or + лістапада\or + сьнежня\fi% + \space \number\year~г.}% +} + +\def\datebelarusian{% + \csuse{datebelarusian@\belarusian@spelling}% +} + +\newcommand{\belarusiannumerals}[2]{\belarusiannumber{#2}} +\newcommand{\Belarusiannumerals}[2]{\Belarusiannumber{#2}} + +\def\belarusiannumber#1{% + \ifcyrillic@numerals + \cyr@alph{#1}% + \else + \number#1% + \fi% +} + +\def\Belarusiannumber#1{% + \ifcyrillic@numerals + \cyr@Alph{#1}% + \else + \number#1% + \fi% +} + +\let\belarusiannumeral=\belarusiannumber +\let\Belarusiannumeral=\Belarusiannumber + +\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\belarusian@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}{belarusian@Alph}\fi} + +%\def\belarusian@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}{belarusian@alph}\fi} + +\def\belarusian@numbers{% + \let\latin@alph\@alph + \let\latin@Alph\@Alph + \ifcyrillic@numerals% + \def\belarusian@alph##1{\expandafter\belarusiannumeral\expandafter{\the##1}}% + \def\belarusian@Alph##1{\expandafter\belarusiannumeral\expandafter{\the##1}}% + \let\@alph\belarusian@alph% + \let\@Alph\belarusian@Alph% + \fi +} + +\def\nobelarusian@numbers{% + \let\@alph\latin@alph% + \let\@Alph\latin@Alph% +} + +\def\noextras@belarusian{% + \ifcyrillic@numerals\nobelarusian@numbers\fi% + \nobelarusian@shorthands% +} + +\def\blockextras@belarusian{% + \ifcyrillic@numerals\belarusian@numbers\fi% + \ifbelarusian@babelshorthands\belarusian@shorthands\fi% +} + +\def\inlineextras@belarusian{% + \ifbelarusian@babelshorthands\belarusian@shorthands\fi% +} + +% \end{macrocode} +% \iffalse +%</gloss-belarusian.ldf> %<*gloss-bengali.ldf> % \fi % \clearpage @@ -2523,6 +3377,60 @@ and may look very wrong.} % \end{macrocode} % \iffalse %</gloss-bengali.ldf> +%<*gloss-bosnian.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-bosnian.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-bosnian.ldf}[polyglossia: module for bosnian] + +\PolyglossiaSetup{bosnian}{ + langtag=BOS, + hyphennames={bosnian,croatian}, + hyphenmins={2,2}, % adapted from gloss-croatian + frenchspacing=true, % adapted from gloss-croatian + indentfirst=false, % adapted from gloss-croatian + fontsetup=true +} + +% TODO: Add script=Cyrillic + +% from babel-bosnian +\def\captionsbosnian{% + \def\prefacename{Predgovor}% + \def\refname{Literatura}% + \def\abstractname{Sažetak}% + \def\bibname{Bibliografija}% + \def\chaptername{Poglavlje}% + \def\appendixname{Dodatak}% + \def\contentsname{Sadržaj}% + \def\listfigurename{Popis slika}% + \def\listtablename{Popis tablica}% + \def\indexname{Indeks}% + \def\figurename{Slika}% + \def\tablename{Tablica}% + \def\partname{Dio}% + \def\enclname{Prilozi}% + \def\ccname{Kopija}% + \def\headtoname{Prima}% + \def\pagename{Stranica}% + \def\seename{Vidjeti}% + \def\alsoname{Također vidjeti}% + \def\proofname{Dokaz}% + \def\glossaryname{Rječnik}% +} + +\def\datebosnian{% + \def\today{\number\day.~\ifcase\month\or + januar\or februar\or mart\or april\or maj\or + juni\or juli\or august\or septembar\or oktobar\or novembar\or + decembar\fi \space \number\year.~}% +} + +% \end{macrocode} +% \iffalse +%</gloss-bosnian.ldf> %<*gloss-brazil.ldf> % \fi % \clearpage @@ -2535,24 +3443,8 @@ and may look very wrong.} % '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} +\xpg@load@master@language{portuguese} -\PolyglossiaSetup{brazil}{ - language=Brazilian Portuguese, - langtag=PTG, - hyphennames={brazil,portuguese,portuges}, - hyphenmins={2,3}, - fontsetup=true, -} - -\let\captionsportuges\captionsportuguese@brazil -\let\dateportuges\dateportuguese@brazil - % \end{macrocode} % \iffalse %</gloss-brazil.ldf> @@ -2655,6 +3547,21 @@ and may look very wrong.} % \end{macrocode} % \iffalse %</gloss-breton.ldf> +%<*gloss-british.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-british.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for british english] + +% We provide this as a babel alias + +\xpg@load@master@language{english} + +% \end{macrocode} +% \iffalse +%</gloss-british.ldf> %<*gloss-bulgarian.ldf> % \fi % \clearpage @@ -2747,6 +3654,36 @@ and may look very wrong.} % \end{macrocode} % \iffalse %</gloss-bulgarian.ldf> +%<*gloss-canadian.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-canadian.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-canadian.ldf}[polyglossia: module for canadian english] + +% We provide this as a babel alias + +\xpg@load@master@language{english} + +% \end{macrocode} +% \iffalse +%</gloss-canadian.ldf> +%<*gloss-canadien.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-canadien.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for canadian french] + +% We provide this as a babel alias + +\xpg@load@master@language{french} + +% \end{macrocode} +% \iffalse +%</gloss-canadien.ldf> %<*gloss-catalan.ldf> % \fi % \clearpage @@ -3022,12 +3959,18 @@ and may look very wrong.} fontsetup=true, } +\ifluatex + \RequirePackage{luavlna} +\fi + \define@boolkey{czech}[czech@]{babelshorthands}[true]{} \define@boolkey{czech}[czech@]{splithyphens}[true]{} \define@boolkey{czech}[czech@]{vlna}[true]{} +\setkeys{czech}{splithyphens,vlna} + \ifsystem@babelshorthands \setkeys{czech}{babelshorthands=true} \else @@ -3085,8 +4028,7 @@ and may look very wrong.} \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} + \AfterPreamble{\enablesplithyphens{czech}}% \else \XeTeXinterchartokenstate=1 \XeTeXcharclass `\- \czech@hyphen @@ -3097,7 +4039,9 @@ and may look very wrong.} } \def\noczech@hyphens{% - \ifxetex + \ifluatex + \AfterPreamble{\disablesplithyphens{czech}}% + \else \XeTeXcharclass `\- \z@ \fi% } @@ -3106,8 +4050,7 @@ and may look very wrong.} % 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} + \preventsingleon \else % Code taken and adapted from xevlna.sty \XeTeXinterchartokenstate=1 @@ -3151,6 +4094,7 @@ and may look very wrong.} \def\noczech@vlna{% \ifluatex + \preventsingleoff \else \XeTeXcharclass`\(\z@ \XeTeXcharclass`\[\z@ @@ -3218,14 +4162,14 @@ and may look very wrong.} \def\blockextras@czech{% \ifczech@babelshorthands\czech@shorthands\fi% - \ifczech@vlna\czech@vlna\fi% - \ifczech@splithyphens\czech@hyphens\fi% + \ifczech@vlna\czech@vlna\else\noczech@vlna\fi% + \ifczech@splithyphens\czech@hyphens\else\noczech@hyhens\fi% } \def\inlineextras@czech{% \ifczech@babelshorthands\czech@shorthands\fi% - \ifczech@vlna\czech@vlna\fi% - \ifczech@splithyphens\czech@hyphens\fi% + \ifczech@vlna\czech@vlna\else\noczech@vlna\fi% + \ifczech@splithyphens\czech@hyphens\else\noczech@hyhens\fi% } % \end{macrocode} @@ -3412,11 +4356,15 @@ and may look very wrong.} \def\alsoname{zie ook}% \def\proofname{Bewijs}% \def\glossaryname{Verklarende woordenlijst}% +} + +\def\datedutch{% \def\today{\number\day~\ifcase\month% \or januari\or februari\or maart\or april\or mei\or juni\or juli\or augustus\or september\or oktober\or november\or december\fi - \space \number\year}} + \space \number\year}% +} \def\noextras@dutch{% \nodutch@shorthands% @@ -3440,6 +4388,7 @@ and may look very wrong.} % \subsection{gloss-english.ldf} % \begin{macrocode} \ProvidesFile{gloss-english.ldf}[polyglossia: module for english] + \PolyglossiaSetup{english}{ hyphennames={english,american,usenglish,USenglish}, hyphenmins={2,3}, @@ -3447,6 +4396,13 @@ and may look very wrong.} fontsetup=true, } +% Babel aliases +\setlanguagealias[variant=us]{english}{american} +\setlanguagealias[variant=australian]{english}{australian} +\setlanguagealias[variant=british]{english}{british} +\setlanguagealias[variant=canadian]{english}{canadian} +\setlanguagealias[variant=newzealand]{english}{newzealand} + \providebool{british@hyphen} \providebool{english@ordinalmonthday} \providebool{british@dateformat} @@ -3741,41 +4697,7 @@ and may look very wrong.} % 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, - localnumeral=farsinumerals -} - -\define@key{farsi}{numerals}[eastern]{% - \setkeys{persian}{numerals=#1}} - -\define@key{farsi}{abjadjimnotail}[true]{% - \setkeys{persian}{abjadjimnotail=#1}} - -\define@key{farsi}{locale}[default]{% - \setkeys{persian}{locale=#1}} - -\setkeys{farsi}{locale,numerals} - -%\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}}}} - -\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 +\xpg@load@master@language{persian} % \end{macrocode} % \iffalse @@ -3889,6 +4811,10 @@ and may look very wrong.} hyphenmins={2,2}, fontsetup=true} +% Babel aliases +\setlanguagealias[variant=acadian]{french}{acadien} +\setlanguagealias[variant=canadian]{french}{canadien} + \def\french@variant{french} \define@choicekey*+{french}{variant}[\val\nr]{french,canadian,acadian}[french]{% \ifcase\nr\relax @@ -3899,17 +4825,17 @@ and may look very wrong.} \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}% + {\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}% + {\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'}} @@ -3920,8 +4846,7 @@ and may look very wrong.} }% \ifluatex - \newluatexattribute\xpg@frpt % - \directlua{polyglossia.load_frpt()}% + \directlua{require('polyglossia-french')}% \else \newXeTeXintercharclass\french@openbrackets % ( ] { \newXeTeXintercharclass\french@closebrackets % ( ] { @@ -3962,6 +4887,10 @@ and may look very wrong.} \define@boolkey{french}[french@]{autospaceguillemets}[true]{} \french@autospaceguillemetstrue +\newif\iffrench@thincolonspace +\define@boolkey{french}[french@]{thincolonspace}[true]{} +\french@thincolonspacefalse + % Backwards compatibility \define@boolkey{french}[french@]{automaticspacesaroundguillemets}[true]{% \iffrench@automaticspacesaroundguillemets @@ -3988,6 +4917,51 @@ and may look very wrong.} \fi } +% Configuration of item labels +\def\french@itemi{\textemdash} +\def\french@itemii{\textemdash} +\def\french@itemiii{\textemdash} +\def\french@itemiv{\textemdash} + +\define@key{french}{itemlabels}[\textemdash]{% + \def\french@itemi{#1} + \def\french@itemii{#1} + \def\french@itemiii{#1} + \def\french@itemiv{#1} +} + +\define@key{french}{itemlabeli}[\textemdash]{% + \def\french@itemi{#1} +} + +\define@key{french}{itemlabelii}[\textemdash]{% + \def\french@itemii{#1} +} + +\define@key{french}{itemlabeliii}[\textemdash]{% + \def\french@itemiii{#1} +} + +\define@key{french}{itemlabeliv}[\textemdash]{% + \def\french@itemiv{#1} +} + +\define@boolkey{french}[french@]{frenchitemlabels}[true]{% + \AfterPreamble{% + \ifdefstring{\xpg@main@language}{french}{% + \iffrench@frenchitemlabels + \renewcommand{\labelitemi}{\french@itemi}% + \renewcommand{\labelitemii}{\french@itemii}% + \renewcommand{\labelitemiii}{\french@itemiii}% + \renewcommand{\labelitemiv}{\french@itemiv}% + \else + \let\@makefntext\xpg@orig@makefntext + \fi + }{\xpg@warning{Option 'frenchitemlabels' only supported if French is main language!}}% + }% +} + + \def\french@fontsetup{% \unless\iffrench@autospacetypewriter \let\ttfamily\french@ttfamilyFB @@ -3999,11 +4973,24 @@ and may look very wrong.} \let\ttfamily\french@ttfamilyORI } +\def\xpg@french@thinsp{\kern 0.5\fontdimen2\font} + \def\french@punctuation{% \lccode"2019="2019 \ifluatex - \xpg@frpt=1\relax % - \directlua{polyglossia.activate_frpt()}% + \iffrench@thincolonspace + \iffrench@autospaceguillemets + \directlua{polyglossia.activate_french_punct(true, true)}% + \else + \directlua{polyglossia.activate_french_punct(true, false)}% + \fi + \else + \iffrench@autospaceguillemets + \directlua{polyglossia.activate_french_punct(false, true)}% + \else + \directlua{polyglossia.activate_french_punct(false, false)}% + \fi + \fi \else \XeTeXinterchartokenstate=1 \XeTeXcharclass `\! \french@punctthin @@ -4013,50 +5000,53 @@ and may look very wrong.} \XeTeXcharclass `\⁈ \french@punctthin \XeTeXcharclass `\⁉ \french@punctthin \XeTeXcharclass `\; \french@punctthin - \XeTeXcharclass `\: \french@punctthick + \iffrench@thincolonspace + \XeTeXcharclass `\: \french@punctthin + \else + \XeTeXcharclass `\: \french@punctthick + \fi \XeTeXcharclass `\« \french@punctguillstart \XeTeXcharclass `\» \french@punctguillend \XeTeXcharclass `\‹ \french@punctguillstart \XeTeXcharclass `\› \french@punctguillend \XeTeXcharclass `\( \french@openbrackets \XeTeXcharclass `\) \french@closebrackets - \XeTeXcharclass `\] \french@openbrackets - \XeTeXcharclass `\[ \french@closebrackets + \XeTeXcharclass `\[ \french@openbrackets + \XeTeXcharclass `\] \french@closebrackets \XeTeXcharclass `\{ \french@openbrackets \XeTeXcharclass `\} \french@closebrackets - \XeTeXinterchartoks \z@ \french@punctthin = {\thinspace}% + \XeTeXcharclass `\⟨ \french@openbrackets + \XeTeXcharclass `\⟩ \french@closebrackets + \XeTeXinterchartoks \z@ \french@punctthin = {\xpg@french@thinsp}% \XeTeXinterchartoks \z@ \french@punctthick = {\nobreakspace}% - \XeTeXinterchartoks \xpg@boundaryclass \french@punctthin = {\xpg@unskip\thinspace}% + \XeTeXinterchartoks \xpg@boundaryclass \french@punctthin = {\xpg@unskip\xpg@french@thinsp}% \XeTeXinterchartoks \xpg@boundaryclass \french@punctthick = {\xpg@unskip\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}% " »" -> "\,»" + \let\xpg@french@guillspace\xpg@french@thinsp% + \XeTeXinterchartoks \french@punctguillstart \z@ = {\xpg@french@guillspace}% "«a" -> "«\,a" + % \XeTeXinterchartoks \z@ \french@punctguillstart = {\nobreakspace}% "a«" unchanged? + % \XeTeXinterchartoks \french@punctguillend \z@ = {\nobreakspace}% "»a" unchanged? + \XeTeXinterchartoks \z@ \french@punctguillend = {\xpg@french@guillspace}% "a»" -> "a\,»" + \XeTeXinterchartoks \french@punctguillstart \xpg@boundaryclass = {\xpg@french@guillspace\ignorespaces}% "« " -> "«\," + \XeTeXinterchartoks \xpg@boundaryclass \french@punctguillend = {\xpg@unskip\xpg@french@guillspace}% " »" -> "\,»" + \XeTeXinterchartoks \french@closebrackets \french@punctguillend = {\xpg@french@guillspace}% ")»" -> ")\,»" + \else + \def\xpg@french@guillspace{}% \fi - \XeTeXinterchartoks \french@punctguillend \french@punctthin = {\thinspace}% "»;" -> "»\,;" + \XeTeXinterchartoks \french@punctguillend \french@punctthin = {\xpg@french@thinsp}% "»;" -> "»\,;" \XeTeXinterchartoks \french@punctguillend \french@punctthick = {\nobreakspace}% "»:" -> "» :" - \XeTeXinterchartoks \french@punctthin \french@punctguillend = {\thinspace}% "?»" -> "?\,»" + \XeTeXinterchartoks \french@punctthin \french@punctguillend = {\xpg@french@thinsp}% "?»" -> "?\,»" \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 = {\thinspace}% ")?" -> ")\,?" + \XeTeXinterchartoks \french@closebrackets \french@punctthin = {\xpg@french@thinsp}% ")?" -> ")\,?" \XeTeXinterchartoks \french@closebrackets \french@punctthick = {\nobreakspace}% "):" -> ") :" \fi - } +} \def\nofrench@punctuation{% \lccode"2019=\z@ \ifluatex - \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 - % the language to something else, and thus call the following line. This means - % that, at then end of the paragraph, the function won't be in the callback, - % so the beginning of the paragraph won't be processed by it. - %\directlua{polyglossia.desactivate_frpt()} + \directlua{polyglossia.deactivate_french_punct()}% \else \XeTeXcharclass `\! \z@ \XeTeXcharclass `\? \z@ @@ -4070,9 +5060,17 @@ and may look very wrong.} \XeTeXcharclass `\» \z@ \XeTeXcharclass `\‹ \z@ \XeTeXcharclass `\› \z@ + \XeTeXcharclass `\( \z@ + \XeTeXcharclass `\) \z@ + \XeTeXcharclass `\[ \z@ + \XeTeXcharclass `\] \z@ + \XeTeXcharclass `\{ \z@ + \XeTeXcharclass `\} \z@ + \XeTeXcharclass `\⟨ \z@ + \XeTeXcharclass `\⟩ \z@ \XeTeXinterchartokenstate=0 \fi - } +} \def\captionsfrench{% \def\refname{Références}% @@ -4102,7 +5100,7 @@ and may look very wrong.} \def\ccname{Copie à }% \def\headtoname{}% \def\proofname{Démonstration}% - } +} \def\datefrench{% \def\today{\ifx\ier\undefined\def\ier{er}\fi @@ -4172,23 +5170,7 @@ and may look very wrong.} % 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 +\xpg@load@master@language{friulian} % \end{macrocode} % \iffalse @@ -4212,6 +5194,9 @@ and may look very wrong.} frenchspacing=true, } +% Babel and backwards compat. alias +\setlanguagealias{friulian}{friulan} + \def\captionsfriulian{% \def\prefacename{Prefazion}% \def\refname{Riferiments}% @@ -4285,6 +5270,10 @@ and may look very wrong.} fontsetup=true, } +% Babel aliases +\setlanguagealias[variant=irish]{gaelic}{irish} +\setlanguagealias[variant=scottish]{gaelic}{scottish} + \def\gaelic@variant{irish} \define@choicekey*+{gaelic}{variant}[\val\nr]{irish,scottish}[irish]{% \ifcase\nr\relax @@ -4431,6 +5420,239 @@ and may look very wrong.} % \end{macrocode} % \iffalse %</gloss-galician.ldf> +%<*gloss-georgian.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-georgian.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-georgian.ldf}[polyglossia: module for georgian] + +\PolyglossiaSetup{georgian}{ + script=Georgian, + scripttag=geor, + langtag=KAT, + hyphennames={georgian}, + fontsetup=true, + localnumeral=georgiannumerals +} + +\newif\ifgeorgian@numerals +\define@key{georgian}{numerals}[arabic]{% + \ifstrequal{#1}{georgian}% + {\georgian@numeralstrue}% + {\georgian@numeralsfalse}% +} + +\define@boolkey{georgian}[georgian@]{babelshorthands}[true]{} + +\define@boolkey{georgian}[georgian@]{oldmonthnames}[true]{} + +\ifsystem@babelshorthands + \setkeys{georgian}{babelshorthands=true} +\else + \setkeys{georgian}{babelshorthands=false} +\fi + +\ifcsundef{initiate@active@char}{% + \input{babelsh.def}% + \initiate@active@char{"}% + \shorthandoff{"}% +}{} + +\def\georgian@shorthands{% + \bbl@activate{"}% + \def\language@group{georgian}% + \declare@shorthand{georgian}{"`}{„}% + \declare@shorthand{georgian}{"'}{“}% + \declare@shorthand{georgian}{"<}{«}% + \declare@shorthand{georgian}{">}{»}% + \declare@shorthand{georgian}{""}{\hskip\z@skip}% + \declare@shorthand{georgian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}% + \declare@shorthand{georgian}{"=}{\nobreak-\hskip\z@skip}% + \declare@shorthand{georgian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}% + \declare@shorthand{georgian}{"-}{% + \def\georgian@sh@tmp{% + \if\georgian@sh@next-\expandafter\georgian@sh@emdash% + \else\expandafter\georgian@sh@hyphen\fi% + }% + \futurelet\georgian@sh@next\georgian@sh@tmp}% + \def\georgian@sh@hyphen{% + \nobreak\-\bbl@allowhyphens}% + \def\georgian@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{georgian}{",}{\nobreak\hskip.2em\ignorespaces}% +} + +\def\nogeorgian@shorthands{% + \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}% +} + +\def\captionsgeorgian{% + \def\prefacename{წინასიტყვაობა}% + \def\refname{ლიტერატურა}% + \def\abstractname{ანოტაცია}% + \def\bibname{ლიტერატურა}% + \def\chaptername{თავი}% + \def\appendixname{დანართი}% + \@ifundefined{thechapter} + {\def\contentsname{შინაარსი}}% + {\def\contentsname{შინაარსი}}% + \let\tocname=\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\glossaryname{ტერმინები}% +}% + +\def\dategeorgian{% + \def\today{\number\day~\ifcase\month\or + იანვარი\or + თებერვალი\or + მარტი\or + აპრილი\or + მაისი\or + ივნისი\or + ივლისი\or + აგვისტო\or + სექტემბერი\or + ოქტომბერი\or + ნოემბერი\or + დეკემბერი\fi + \space \number\year~წ.}% + \ifgeorgian@oldmonthnames + \dategeorgian@old% + \fi +} + +\def\dategeorgian@old{% + \def\today{\number\day~\ifcase\month\or + აპნისი\or + სურწყუნისი\or + მირკანი\or + იგრიკა\or + ვარდობისთვე\or + თიბათვე\or + მკათათვე\or + მარიამობისთვე\or + ახალწლისა ენკენისთვე\or + ღვინობისთვე\or + გიორგობისთვე\or + ქრისტეშობისთვე\fi + \space \number\year~წ.}% +} + +\def\georgian@numbers{% + \ifgeorgian@numerals% + \def\georgian@alph##1{\expandafter\georgiannumeral\expandafter{\the##1}}% + \let\@alph\georgian@@alph% + \fi +} + +\def\nogeorgian@numbers{% + \let\@alph\latin@alph% + \let\georgian@alph\@undefined% +} + +\def\georgian@globalnumbers{% + \ifgeorgian@numerals + \let\@arabic\georgiannumber% + \renewcommand\thefootnote{\localnumeral*{footnote}}% + \renewcommand\theequation{\localnumeral*{equation}}% + \fi +} + +% Store original definition +\let\xpg@save@arabic\@arabic + +\def\nogeorgian@globalnumbers{ + \let\@arabic\xpg@save@arabic% +} + +\newcommand{\georgiannumerals}[2]{% + \ifgeorgian@numerals + \georgiannumber{#2}% + \else + #2% + \fi% +} + +\protected\def\georgiannumber#1{\expandafter\@georgiannumber\expandafter{\number#1}} +\def\@georgiannumber#1{% + \ifnum#1<\@ne\space\geor@ill@value{#1}% + \else + \ifnum#1<10\expandafter\geor@num@i\number#1% + \else + \ifnum#1<100\expandafter\geor@num@ii\number#1% + \else + \ifnum#1<\@m\expandafter\geor@num@iii\number#1% + \else + \ifnum#1<\@M\expandafter\geor@num@iv\number#1% + \else + \space\geor@ill@value{#1}% + \fi + \fi + \fi + \fi + \fi +} + +\let\georgiannumeral=\georgiannumber +\def\geor@num@i#1{% 1--9 + \ifcase#1\or ა\or ბ\or გ\or დ\or ე\or ვ\or ზ\or ჱ\or თ\fi} +\def\geor@num@ii#1{% 10--90 + \ifcase#1\or ი\or კ\or ლ\or მ\or ნ\or ჲ\or ო\or პ\or ჟ\fi + \geor@num@i} +\def\geor@num@iii#1{% 100--900 + \ifcase#1\or რ\or ს\or ტ\or ჳ\or ფ\or ქ\or ღ\or ყ\or შ\fi + \geor@num@ii} +\def\geor@num@iv#1{% 1000--9000 + \ifcase#1\or ჩ\or ც\or ძ\or წ\or ჭ\or ხ\or ჴ\or ჯ\or ჰ\fi + \geor@num@iii} +\def\geor@ill@value#1{\xpg@warning{Illegal value (#1) for Georgian numeral}[$#1$]} + +\def\noextras@georgian{% + \ifgeorgian@numerals\nogeorgian@numbers\fi% + \nogeorgian@shorthands% +} + +\def\blockextras@georgian{% + \ifgeorgian@numerals\georgian@numbers\fi% + \ifgeorgian@babelshorthands\georgian@shorthands\fi% +} + +\def\inlineextras@georgian{% + \ifgeorgian@babelshorthands\georgian@shorthands\fi% +} + +% \end{macrocode} +% \iffalse +%</gloss-georgian.ldf> %<*gloss-german.ldf> % \fi % \clearpage @@ -4438,6 +5660,7 @@ and may look very wrong.} % \subsection{gloss-german.ldf} % \begin{macrocode} \ProvidesFile{gloss-german.ldf}[polyglossia: module for german] + \PolyglossiaSetup{german}{ hyphenmins={2,2}, frenchspacing=true, @@ -4446,6 +5669,14 @@ and may look very wrong.} babelname=ngerman } +% Babel aliases +\setlanguagealias[variant=austrian,spelling=old]{german}{austrian} +\setlanguagealias[variant=austrian,spelling=new]{german}{naustrian} +\setlanguagealias[variant=german,spelling=old]{german}{germanb} +\setlanguagealias[variant=german,spelling=new]{german}{ngerman} +\setlanguagealias[variant=swiss,spelling=old]{german}{swissgerman} +\setlanguagealias[variant=swiss,spelling=new]{german}{nswissgerman} + \newif\if@german@oldspelling \@german@oldspellingfalse \define@choicekey*+{german}{spelling}[\val\nr]{new,old,1901}[new]{% @@ -4504,21 +5735,26 @@ and may look very wrong.} \else \if@swiss@locale \SetLanguageKeys{german}{babelname=nswissgerman}% - \fi + \else \if@austrian@locale \SetLanguageKeys{german}{babelname=naustrian}% - \fi + \else + \SetLanguageKeys{german}{babelname=ngerman}% + \fi\fi \fi } -\newif\if@german@fraktur -\define@choicekey*+{german}{script}[\val\nr]{latin,fraktur}[latin]{% +\newif\if@german@blackletter +\define@choicekey*+{german}{script}[\val\nr]{latin,blackletter,fraktur}[latin]{% \ifcase\nr\relax % latin: - \@german@frakturfalse% + \@german@blackletterfalse% + \or + % blackletter: + \@german@blacklettertrue% \or % fraktur: - \@german@frakturtrue% + \@german@blacklettertrue% \fi \xpg@info{Option: German, script=\val}% }{\xpg@warning{Unknown German script `#1'}} @@ -4626,7 +5862,7 @@ and may look very wrong.} } %%Strings for Fraktur contributed by Gerrit <z0idberg . gmx . de> -\def\captions@german@fraktur{% +\def\captions@german@blackletter{% \captions@german% \def\abstractname{Zuſammenfaſſung}% \def\seename{ſiehe}% @@ -4634,7 +5870,7 @@ and may look very wrong.} \def\glossaryname{Gloſſar}% } -\def\date@german@fraktur{% +\def\date@german@blackletter{% \def\today{\number\day.% \space \ifcase\month% \or\if@austrian@locale Jänner\else Januar\fi\or Februar\or März\or% @@ -4644,13 +5880,13 @@ and may look very wrong.} } \def\captionsgerman{% - \if@german@fraktur\captions@german@fraktur\else\captions@german\fi + \if@german@blackletter\captions@german@blackletter\else\captions@german\fi \if@austrian@locale\captions@german@austrian\fi \if@swiss@locale\captions@german@swiss\fi } \def\dategerman{% - \if@german@fraktur\date@german@fraktur\else\date@german\fi + \if@german@blackletter\date@german@blackletter\else\date@german\fi } \def\german@language{% @@ -4692,6 +5928,21 @@ and may look very wrong.} % \end{macrocode} % \iffalse %</gloss-german.ldf> +%<*gloss-germanb.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-germanb.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-germanb.ldf}[polyglossia: module for german (old spelling)] + +% We provide this as a babel alias + +\xpg@load@master@language{german} + +% \end{macrocode} +% \iffalse +%</gloss-germanb.ldf> %<*gloss-greek.ldf> % \fi % \clearpage @@ -4699,6 +5950,7 @@ and may look very wrong.} % \subsection{gloss-greek.ldf} % \begin{macrocode} \ProvidesFile{gloss-greek.ldf}[polyglossia: module for greek] + \PolyglossiaSetup{greek}{ script=Greek, scripttag=grek, @@ -4711,6 +5963,9 @@ and may look very wrong.} %TODO localalph={greek@alph,greek@Alph} } +% Babel aliases +\setlanguagealias[variant=polytonic]{greek}{polutonikogreek} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% The code in this file was initially adapted from the antomega %% module for greek. Currently large parts of it derive from the @@ -5366,7 +6621,7 @@ and may look very wrong.} \PolyglossiaSetup{hungarian}{ babelname=magyar, - hyphennames={magyar,hungarian}, + hyphennames={hungarian,magyar}, langtag=HUN, hyphenmins={2,2}, fontsetup=true, @@ -5374,6 +6629,49 @@ and may look very wrong.} \frenchspacing +% Babel and backwards compat. alias +\setlanguagealias{hungarian}{magyar} + +\newif\if@hungarian@swapcaptions +\newif\if@hungarian@swapheadings +\newif\if@hungarian@swapheaders +\define@choicekey*+{hungarian}{swapstrings}[\val\nr]{all,captions,headings,headers,hheaders,none}[all]{% + \ifcase\nr\relax + % all: + \@hungarian@swapcaptionstrue% + \@hungarian@swapheadingstrue% + \@hungarian@swapheaderstrue% + \or + % captions: + \@hungarian@swapcaptionstrue% + \@hungarian@swapheadingsfalse% + \@hungarian@swapheadersfalse% + \or + % headings: + \@hungarian@swapcaptionsfalse% + \@hungarian@swapheadingstrue% + \@hungarian@swapheadersfalse% + \or + % headers: + \@hungarian@swapcaptionsfalse% + \@hungarian@swapheadingsfalse% + \@hungarian@swapheaderstrue% + \or + % hheaders: + \@hungarian@swapcaptionsfalse% + \@hungarian@swapheadingstrue% + \@hungarian@swapheaderstrue% + \or + % none: + \@hungarian@swapcaptionsfalse% + \@hungarian@swapheadingsfalse% + \@hungarian@swapheadersfalse% + \fi + \xpg@info{Option: Hungarian, swapstrings=\val}% +}{\xpg@warning{Unknown Hungarian swapstrings value `#1'}} + +\setkeys{hungarian}{swapstrings} + \def\captionshungarian{% \def\refname{Hivatkozások}% \def\abstractname{Kivonat}% @@ -5421,25 +6719,188 @@ and may look very wrong.} 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} + \let\ontoday\ondatehungarian% + \let\ondatemagyar\ondatehungarian% +} -% change 'táblázat x.x' to 'x.x. táblázat' -\def\xpg@hungarian@fnum@table{\thetable.~\tablename} +% Save original capsformats \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\hungarian@capsformat{% + % + % Change captions + \if@hungarian@swapcaptions + % change 'ábra x.x' to 'x.x. ábra' + \def\fnum@figure{\thefigure.~\figurename} + % + % change 'táblázat x.x' to 'x.x. táblázat' + \def\fnum@table{\thetable.~\tablename} + \fi + % + % change chapter and part headings + \if@hungarian@swapheadings + % With titlesec + \ifdefined\titleformat% + \ifdefined\@part% + \let\xpg@save@part@format\@part% + \patchcmd{\@part}% + {\partname\nobreakspace\thepart}% + {\thepart.\nobreakspace\partname}% + {}% + {\xpg@warning{Failed to patch part for Hungarian}}% + \fi% + \ifdefined\chapter% + \titleformat\chapter[display]% + {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6} + {\thechapter.\space\@chapapp}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit} + \fi% + \else% (not \ifdefined\titleformat) + % With KOMA + \ifdefined\sectionformat% + \ifdefined\partformat% + \let\xpg@save@part@format\partformat% + \renewcommand{\partformat}{\thepart.~\partname}% + \fi% + \ifdefined\chapterformat% + \let\xpg@save@chap@format\chapterformat% + \renewcommand{\chapterformat}{\mbox{\thechapter\autodot% + \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}% + \fi% + \else% (not \ifdefined\sectionformat) + % With memoir + \ifdefined\@memptsize% + \ifdefined\@makechapterhead% + \let\xpg@save@chap@format\@makechapterhead% + \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}% + {\printchapternum.\chapternamenum\printchaptername}% + {}% + {\xpg@warning{Failed to patch chapter for Hungarian}}% + \fi% + \ifdefined\@part% + \let\xpg@save@part@format\@part% + \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}% + {\printpartnum.\partnamenum\printpartname}% + {}% + {\xpg@warning{Failed to patch part for Hungarian}}% + \fi% + \else% (not \ifdefined\@memptsize) + % With standard classes + \ifdefined\@makechapterhead% + \let\xpg@save@chap@format\@makechapterhead% + \patchcmd{\@makechapterhead}% + {\@chapapp\space \thechapter}% + {\thechapter.\space \@chapapp}% + {}% + {\xpg@warning{Failed to patch chapter for Hungarian}}% + \fi% + \ifdefined\@part% + \let\xpg@save@part@format\@part% + \patchcmd{\@part}% + {\partname\nobreakspace\thepart}% + {\thepart.\nobreakspace\partname}% + {}% + {\xpg@warning{Failed to patch part for Hungarian}}% + \fi% (end \ifdefined\@part) + \fi% (end \ifdefined\@memptsize) + \fi% (end \ifdefined\sectionformat) + \fi% (end \ifdefined\titleformat) + \fi% (end \if@hungarian@swapheadings) + % + % Change running headers + \if@hungarian@swapheaders + \ifdefined\chapterformat% + % With KOMA + \let\xpg@save@chaptermark@format\chaptermarkformat% + \renewcommand*\chaptermarkformat{% + \thechapter\autodot\ \IfChapterUsesPrefixLine{\chapapp\enskip}{}} + \else% (not \ifdefined\chapterformat) + \ifdefined\@memptsize% + % With memoir + \let\xpg@save@chaptermark@format\chaptermark% + \renewcommand*\chaptermark[1]{% + \markboth{\memUChead{% + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \thechapter.\ \@chapapp\ % + \fi + \fi + ##1}}{}}% + \else% (not \ifdefined\@memptsize) + % With standard classes + \ifdefined\chaptermark% + \let\xpg@save@chaptermark@format\chaptermark% + \patchcmd{\chaptermark}% + {\@chapapp\ \thechapter.}% + {\thechapter.\ \@chapapp}% + {}% + {\xpg@warning{Failed to patch chaptermark for Hungarian}}% + \fi% (end \ifdefined\chaptermark) + \fi% (end \ifdefined\@memptsize) + \fi% (end \ifdefined\chapterformat) + \fi% (end \if@hungarian@swapheaders) +} + +\def\nohungarian@capsformat{% + % + % Reset changes of \hungarian@capsformat + \let\fnum@table\xpg@save@fnum@table% + \let\fnum@figure\xpg@save@fnum@figure% + % + % Reset chapter and part heading + \ifdefined\titleformat% + % With titlesec + \ifdefined\xpg@save@part@format + \let\@part\xpg@save@part@format + \fi% + \ifdefined\chapter + \titleformat\chapter[display]% + {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6} + {\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit} + \fi% + \else% (not \ifdefined\titleformat) + \ifdefined\sectionformat% + % With KOMA + \ifdefined\xpg@save@part@format + \let\partformat\xpg@save@part@format + \fi% + \ifdefined\xpg@save@chap@format + \let\chapterformat\xpg@save@chap@format + \fi% + \else% + % With memoir and standard classes + \ifdefined\xpg@save@part@format + \let\@part\xpg@save@part@format + \fi% + \ifdefined\xpg@save@chap@format + \let\@makechapterhead\xpg@save@chap@format + \fi% + \fi% (end \ifdefined\sectionformat) + \fi% (end \ifdefined\titleformat) + % + % Reset headers + \ifdefined\chaptermarkformat% + % With KOMA + \ifdefined\xpg@save@chaptermark@format + \let\chaptermarkformat\xpg@save@chaptermark@format% + \fi + \else% + \ifdefined\chaptermark% + % With memoir and standard classes + \ifdefined\xpg@save@chaptermark@format + \let\chaptermark\xpg@save@chaptermark@format% + \fi + \fi% (end \ifdefined\chaptermark) + \fi% (end \ifdefined\chapterformat) +} + \def\blockextras@hungarian{% - \let\fnum@table\xpg@hungarian@fnum@table - \let\fnum@figure\xpg@hungarian@fnum@figure + \hungarian@capsformat% } \def\noextras@hungarian{% - \let\fnum@table\xpg@save@fnum@table - \let\fnum@figure\xpg@save@fnum@figure - \let\ontoday\@undefined + \nohungarian@capsformat% + \let\ontoday\@undefined% } % \end{macrocode} @@ -5556,17 +7017,7 @@ and may look very wrong.} % 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, -} - -\let\captionsirish\captionsgaelic@irish -\let\dateirish\dategaelic@irish +\xpg@load@master@language{gaelic} % \end{macrocode} % \iffalse @@ -6445,6 +7896,9 @@ and may look very wrong.} localnumeral=kurdishnumerals } +% Babel aliases +\setlanguagealias[variant=kurmanji]{kurdish}{kurmanji} + \newif\if@kurdish@kurmanji \def\kurdish@variant{sorani} \define@choicekey*+{kurdish}{variant}[\val\nr]{sorani,kurmanji}[sorani]{% @@ -6966,301 +8420,910 @@ and may look very wrong.} % % \subsection{gloss-latin.ldf} % \begin{macrocode} -%% -%% This is file `gloss-latin.ldf', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% gloss-latin.dtx (with options: `lamodern') -%% ------------------------------------------------------------------ -%% 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-latin.ldf} - [2016/09/10 v.1.03 Latin support from polyglossia] -%% +\ProvidesFile{gloss-latin.ldf}[polyglossia: module for Latin v.2.0 2019-10-28] +\ExplSyntaxOn -\PolyglossiaSetup{latin}{% - hyphennames={latin}, - hyphenmins={2,2}, - langtag=LAT, - frenchspacing=true, - fontsetup=true, -} -\def\classicuclccodes{\lccode`\V=`\u \uccode`\u=`\V} -\def\noclassicuclccodes{\lccode`\V=`\v \uccode`\u=`\U} -\def\tmp@modern{modern} -\def\tmp@medieval{medieval} -\unless\ifluatex - \def\tmp@classic{classic} - \def\tmp@liturgical{liturgical} -\fi -\newif\ifmedieval\medievalfalse -\newif\ifclassic\classicfalse -\define@boolkey{latin}[latin@]{ecclesiastic}[true]{} +\PolyglossiaSetup {latin} + { + hyphennames = {latin}, + hyphenmins = {2,2}, + frenchspacing = true, + fontsetup = true, + langtag = LAT + } -\let\latin@variant\l@latin -\ifluatex - \ifcsname l@latin\endcsname\xpg@set@language@luatex@ii{latin}\fi -\fi -\def\captionslatin{\latincaptions}% -\def\datelatin{\latindate}% -\define@key{latin}{variant}[modern]{% -\def\@tempa{#1}% -\ifx\@tempa\tmp@medieval - \ifluatex - \ifcsname l@latin\endcsname\xpg@set@language@luatex@ii{latin}\fi - \fi - \let\latin@variant\l@latin - \xpg@set@language@luatex@ii{latin} - \medievaltrue \classictrue - \xpg@info{Option: Medieval Latin}% -\else - \ifx\@tempa\tmp@classic - \unless\ifluatex - \unless\ifcsname l@classiclatin\endcsname - \xpg@nopatterns{Classic Latin}% - \adddialect\l@classiclatin\l@latin - \let\latin@variant\l@latin - \else - \let\latin@variant\l@classiclatin - \fi - \fi - \medievalfalse\classictrue - \xpg@info{Option: Classic Latin}% - \else - \ifx\@tempa\tmp@liturgical\unless\ifluatex - \unless\ifcsname l@liturgicallatin\endcsname - \xpg@nopatterns{Liturgical Latin}% - \adddialect\l@liturgicallatin\l@latin - \def\latin@variant{\l@latin}% - \else - \let\latin@variant\l@liturgicallatin - \fi - \medievaltrue\classicfalse - \xpg@info{Option: Liturgical Latin}\fi - \else - \ifx\@tempa\tmp@modern - \let\latin@variant\l@latin - \ifluatex\xpg@set@language@luatex@ii{latin}\fi - \xpg@info{Option: Modern Latin}% - \else - \def\latin@variant{\l@nohyphenation}% - \PackageWarning{polyglossia}{% - *******************\MessageBreak - No hyphenation set for \@tempa - *******************\MessageBreak - }{}% - \fi - \fi - \fi -\fi -} +% Babel aliases +\setlanguagealias[variant=classic]{latin}{latinclassic} +\setlanguagealias[variant=ecclesiastic]{latin}{latinecclesiastic} +\setlanguagealias[variant=medieval]{latin}{latinmedieval} -\def\latin@language{\language=\latin@variant}% -\ifluatex - \PackageWarning{polyglossia}{\MessageBreak\MessageBreak - *****************\MessageBreak - The ecclesiastic option is not active\MessageBreak - when typesetting with LuaLaTeX\MessageBreak - *****************\MessageBreak - \MessageBreak}{} - \else - \def\ecclesiasticlatin@punctuation{% - \def\xpg@unskip{\ifhmode\ifdim\lastskip>\z@\unskip\fi\fi} - \lccode\string"2019=\string"2019 - \newXeTeXintercharclass\ecclesiasticlatin@punctthin - \newXeTeXintercharclass\ecclesiasticlatin@punctguillstart - \newXeTeXintercharclass\ecclesiasticlatin@punctguillend - \XeTeXinterchartokenstate=1 - \XeTeXcharclass `\! \ecclesiasticlatin@punctthin - \XeTeXcharclass `\? \ecclesiasticlatin@punctthin - \XeTeXcharclass `\; \ecclesiasticlatin@punctthin - \XeTeXcharclass `\: \ecclesiasticlatin@punctthin - \XeTeXcharclass `\« \ecclesiasticlatin@punctguillstart - \XeTeXcharclass `\» \ecclesiasticlatin@punctguillend - \XeTeXinterchartoks \z@ \ecclesiasticlatin@punctthin = {\penalty\@M - \hskip.2\fontdimen2\font \@plus\z@\@minus\z@}% - \XeTeXinterchartoks 255 \ecclesiasticlatin@punctthin = {\xpg@unskip} - \XeTeXinterchartoks \ecclesiasticlatin@punctguillstart \z@ = {\penalty\@M - \hskip.2\fontdimen2\font \@plus\z@\@minus\z@\ignorespaces} - \XeTeXinterchartoks \z@ \ecclesiasticlatin@punctguillend = {\xpg@unskip - \penalty\@M\hskip.2\fontdimen2\font \@plus\z@\@minus\z@} - } - \def\noecclesiasticlatin@punctuation{% - \lccode\string"2019=\z@ +%%%%% Variables and commands concerning spelling + +\bool_new:N \l_polyglossia_latin_use_j_bool +\bool_new:N \l_polyglossia_latin_use_v_bool +\bool_new:N \l_polyglossia_latin_use_digraphs_bool +\bool_new:N \l_polyglossia_latin_capitalize_month_bool + +\cs_new:Npn \polyglossia_latin_classical_character_codes: + { + \char_set_lccode:nn {`\V} {`\u} + \char_set_uccode:nn {`\u} {`\V} + \char_set_uccode:nn {`\ú} {`\V} + \char_set_uccode:nn {`\ū} {`\V} + \char_set_uccode:nn {`\ŭ} {`\V} + } + +\cs_new:Npn \polyglossia_latin_modern_character_codes: + { + \char_set_lccode:nn {`\V} {`\v} + \char_set_uccode:nn {`\u} {`\U} + \char_set_uccode:nn {`\ú} {`\Ú} + \char_set_uccode:nn {`\ū} {`\Ū} + \char_set_uccode:nn {`\ŭ} {`\Ŭ} + } + + +%%%%% Messages and commands concerning hyphenation + +\msg_new:nnn {polyglossia} {latin / missing modern patterns} + { + No~hyphenation~patterns~were~found~for~Latin~\msg_line_context:.~ + I~will~not~hyphenate~Latin~words. + } + +\msg_new:nnn {polyglossia} {latin / missing patterns} + { + The~"#1"~hyphenation~patterns~were~not~found~\msg_line_context:.~ + I~will~use~the~patterns~for~modern~Latin~instead. + } + +\cs_new:Npn \polyglossia_latin_use_modern_patterns: + { + \xpg@ifdefined {latin} + { + \def \latin@language + { + \polyglossia@setup@language@patterns {latin} + } + } + { + \msg_warning:nn {polyglossia} {latin / missing modern patterns} + \adddialect \l@latin \l@nohyphenation + } + } + +\cs_new:Npn \polyglossia_latin_set_patterns:n #1 +% #1 may be "classiclatin" or "liturgicallatin" + { + \xpg@ifdefined {#1} + { + \def \latin@language + { + \polyglossia@setup@language@patterns {#1} + } + } + { + \xpg@ifdefined {latin} + { + \msg_warning:nnn {polyglossia} {latin / missing patterns} {#1} + \adddialect \l@ #1 \l@latin + \polyglossia_latin_use_modern_patterns: + } + { + \msg_warning:nn {polyglossia} {latin / missing modern patterns} + \adddialect \l@ #1 \l@nohyphenation + } + } + } + + +%%%%% Settings for the spacing of the punctuation for ecclesiastical Latin + +\bool_new:N \g_polyglossia_latin_punctuation_spacing_bool + +\sys_if_engine_luatex:TF + { + \directlua { require('polyglossia-latin') } + } + { + \newXeTeXintercharclass \g_polyglossia_latin_punctuation_class + \newXeTeXintercharclass \g_polyglossia_latin_opening_guillemet_class + \newXeTeXintercharclass \g_polyglossia_latin_closing_guillemet_class + \newXeTeXintercharclass \g_polyglossia_latin_opening_bracket_class + \newXeTeXintercharclass \g_polyglossia_latin_closing_bracket_class + + \cs_new:Npn \polyglossia_latin_insert_punctuation_space: + { + \nobreak + \skip_horizontal:n { 0.08333 \fontdimen6 \font } % 1/12 quad + } + \cs_new:Npn \polyglossia_latin_replace_preceding_space: + { + \dim_compare:nNnT {\lastskip} > {\c_zero_dim} {\unskip} + \polyglossia_latin_insert_punctuation_space: + } + \cs_new:Npn \polyglossia_latin_replace_following_space: + { + \polyglossia_latin_insert_punctuation_space: + \ignorespaces + } + } + +\cs_new:Npn \polyglossia_latin_punctuation_spacing: + { + \sys_if_engine_luatex:TF + { + \directlua { polyglossia.activate_latin_punct() } + } + { + \XeTeXinterchartokenstate = 1 + \XeTeXcharclass `\! \g_polyglossia_latin_punctuation_class + \XeTeXcharclass `\? \g_polyglossia_latin_punctuation_class + \XeTeXcharclass `\‼ \g_polyglossia_latin_punctuation_class + \XeTeXcharclass `\⁇ \g_polyglossia_latin_punctuation_class + \XeTeXcharclass `\⁈ \g_polyglossia_latin_punctuation_class + \XeTeXcharclass `\⁉ \g_polyglossia_latin_punctuation_class + \XeTeXcharclass `\; \g_polyglossia_latin_punctuation_class + \XeTeXcharclass `\: \g_polyglossia_latin_punctuation_class + \XeTeXcharclass `\« \g_polyglossia_latin_opening_guillemet_class + \XeTeXcharclass `\» \g_polyglossia_latin_closing_guillemet_class + \XeTeXcharclass `\‹ \g_polyglossia_latin_opening_guillemet_class + \XeTeXcharclass `\› \g_polyglossia_latin_closing_guillemet_class + \XeTeXcharclass `\( \g_polyglossia_latin_opening_bracket_class + \XeTeXcharclass `\) \g_polyglossia_latin_closing_bracket_class + \XeTeXcharclass `\[ \g_polyglossia_latin_opening_bracket_class + \XeTeXcharclass `\] \g_polyglossia_latin_closing_bracket_class + \XeTeXcharclass `\{ \g_polyglossia_latin_opening_bracket_class + \XeTeXcharclass `\} \g_polyglossia_latin_closing_bracket_class + \XeTeXcharclass `\⟨ \g_polyglossia_latin_opening_bracket_class + \XeTeXcharclass `\⟩ \g_polyglossia_latin_closing_bracket_class + + % punctuation followed by a closing guillemet + \XeTeXinterchartoks \g_polyglossia_latin_punctuation_class \g_polyglossia_latin_closing_guillemet_class = + { + \polyglossia_latin_insert_punctuation_space: + } + % closing bracket followed by punctuation + \XeTeXinterchartoks \g_polyglossia_latin_closing_bracket_class \g_polyglossia_latin_punctuation_class = + { + \polyglossia_latin_insert_punctuation_space: + } + % closing bracket followed by a closing guillemet + \XeTeXinterchartoks \g_polyglossia_latin_closing_bracket_class \g_polyglossia_latin_closing_guillemet_class = + { + \polyglossia_latin_insert_punctuation_space: + } + % opening guillemet followed by a space + \XeTeXinterchartoks \g_polyglossia_latin_opening_guillemet_class \xpg@boundaryclass = + { + \polyglossia_latin_replace_following_space: + } + % opening guillemet followed by an ordinary character + \XeTeXinterchartoks \g_polyglossia_latin_opening_guillemet_class \z@ = + { + \polyglossia_latin_insert_punctuation_space: + } + % closing guillemet followed by punctuation + \XeTeXinterchartoks \g_polyglossia_latin_closing_guillemet_class \g_polyglossia_latin_punctuation_class = + { + \polyglossia_latin_insert_punctuation_space: + } + % space followed by punctuation + \XeTeXinterchartoks \xpg@boundaryclass \g_polyglossia_latin_punctuation_class = + { + \polyglossia_latin_replace_preceding_space: + } + % space followed by closing guillemet + \XeTeXinterchartoks \xpg@boundaryclass \g_polyglossia_latin_closing_guillemet_class = + { + \polyglossia_latin_replace_preceding_space: + } + % ordinary character followed by punctuation + \XeTeXinterchartoks \z@ \g_polyglossia_latin_punctuation_class = + { + \polyglossia_latin_insert_punctuation_space: + } + % ordinary character followed by closing guillemet + \XeTeXinterchartoks \z@ \g_polyglossia_latin_closing_guillemet_class = + { + \polyglossia_latin_insert_punctuation_space: + } + } + } + +\cs_new:Npn \polyglossia_latin_no_punctuation_spacing: + { + \sys_if_engine_luatex:TF + { + \directlua { polyglossia.deactivate_latin_punct() } + } + { \XeTeXcharclass `\! \z@ \XeTeXcharclass `\? \z@ + \XeTeXcharclass `\‼ \z@ + \XeTeXcharclass `\⁇ \z@ + \XeTeXcharclass `\⁈ \z@ + \XeTeXcharclass `\⁉ \z@ \XeTeXcharclass `\; \z@ \XeTeXcharclass `\: \z@ \XeTeXcharclass `\« \z@ \XeTeXcharclass `\» \z@ - \XeTeXinterchartokenstate=0 + \XeTeXcharclass `\‹ \z@ + \XeTeXcharclass `\› \z@ + \XeTeXcharclass `\( \z@ + \XeTeXcharclass `\) \z@ + \XeTeXcharclass `\[ \z@ + \XeTeXcharclass `\] \z@ + \XeTeXcharclass `\{ \z@ + \XeTeXcharclass `\} \z@ + \XeTeXcharclass `\⟨ \z@ + \XeTeXcharclass `\⟩ \z@ + \XeTeXinterchartokenstate = 0 } - \let\latin@original@makefntext\@makefntext - \newcommand\latin@ecclesiastic@makefntext[1]{% - \parindent 1em \noindent - \latin@Makefnmark{\enspace #1}} - \newcommand\latin@Makefnmark{\hbox{\normalfont\@thefnmark.}} -\fi -\setkeys{latin}{variant,ecclesiastic=false} -\def\latincaptions{% - \def\prefacename{\ifmedieval Præfatio\else Praefatio\fi}% - \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\latindate{% - \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 - \ifclassic Nouembris\else Novembris\fi - \or Decembris\fi% - \space \uppercase\expandafter{\romannumeral\year}}} -%%%%%%%%% Latin shorthands -\define@boolkey{latin}[latin@]{babelshorthands}[true]{} +%%%%% Messages and commands concerning footnotes + +\cs_if_exist:NT \@makefntext + { + \cs_set_eq:NN \polyglossia_latin_original_footnote:n \@makefntext + } + +% This is the footnote style as defined by the "ecclesiastic" package. +\cs_new:Npn \polyglossia_latin_variant_footnote:n #1 + { + \parindent 1em + \noindent + \hbox { \normalfont \@thefnmark . } + \enspace #1 + } + +\msg_new:nnn {polyglossia} {latin / ineffective footnote option} + { + The~option~"ecclesiasticfootnotes"~is~ineffective~\msg_line_context: + \c_space_tl as~Latin~is~not~the~main~language. + } + +\cs_new:Npn \polyglossia_latin_apply_footnote_option: + { + \str_if_eq:VnTF \xpg@main@language {latin} + { + \cs_if_exist:NT \@makefntext + { + \iflatin@ecclesiasticfootnotes + \let \@makefntext \polyglossia_latin_variant_footnote:n + \else + \let \@makefntext \polyglossia_latin_original_footnote:n + \fi + } + } + { + \msg_warning:nn {polyglossia} {latin / ineffective footnote option} + } + } + +\define@boolkey {latin} [latin@] {ecclesiasticfootnotes} [true] + { + \token_if_eq_meaning:NNTF \@onlypreamble \@notprerr + { + % within the document + \polyglossia_latin_apply_footnote_option: + } + { + % within the preamble + % The application of the option has to be postponed as the main + % language may be undefined when the option is called. + \AtBeginDocument { \polyglossia_latin_apply_footnote_option: } + } + } + + +%%%%% Language variants: classic, medieval, modern, and ecclesiastic + +\msg_new:nnn {polyglossia} {latin / language variant} + { + Activating~Latin~language~variant~"#1"~\msg_line_context:. + } + +\msg_new:nnn {polyglossia} {latin / illegal language variant} + { + The~Latin~language~variant~"#1"~is~undefined~\msg_line_context:. + } + +\cs_new:Npn \polyglossia_latin_classic_settings: + { + \bool_set_false:N \l_polyglossia_latin_use_j_bool + \bool_set_false:N \l_polyglossia_latin_use_v_bool + \bool_set_false:N \l_polyglossia_latin_use_digraphs_bool + \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool + \bool_set_false:N \l_polyglossia_latin_punctuation_spacing_bool + \SetLanguageKeys {latin} { babelname = latin.classic } + \polyglossia_latin_set_patterns:n {classiclatin} + } + +\cs_new:Npn \polyglossia_latin_medieval_settings: + { + \bool_set_false:N \l_polyglossia_latin_use_j_bool + \bool_set_false:N \l_polyglossia_latin_use_v_bool + \bool_set_true:N \l_polyglossia_latin_use_digraphs_bool + \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool + \bool_set_false:N \l_polyglossia_latin_punctuation_spacing_bool + \SetLanguageKeys {latin} { babelname = latin.medieval } + \polyglossia_latin_use_modern_patterns: + } + +\cs_new:Npn \polyglossia_latin_modern_settings: + { + \bool_set_false:N \l_polyglossia_latin_use_j_bool + \bool_set_true:N \l_polyglossia_latin_use_v_bool + \bool_set_false:N \l_polyglossia_latin_use_digraphs_bool + \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool + \bool_set_false:N \l_polyglossia_latin_punctuation_spacing_bool + \SetLanguageKeys {latin} { babelname = latin } + \polyglossia_latin_use_modern_patterns: + } + +\cs_new:Npn \polyglossia_latin_ecclesiastic_settings: + { + \bool_set_false:N \l_polyglossia_latin_use_j_bool + \bool_set_true:N \l_polyglossia_latin_use_v_bool + \bool_set_true:N \l_polyglossia_latin_use_digraphs_bool + \bool_set_false:N \l_polyglossia_latin_capitalize_month_bool + \bool_set_true:N \l_polyglossia_latin_punctuation_spacing_bool + \SetLanguageKeys {latin} { babelname = latin.ecclesiastic } + \polyglossia_latin_use_modern_patterns: + } + +\define@key{latin}{variant} + { + \str_case:nnF {#1} + { + {classic} + { + \msg_info:nnn {polyglossia} {latin / language variant} {classic} + \polyglossia_latin_classic_settings: + } + {medieval} + { + \msg_info:nnn {polyglossia} {latin / language variant} {medieval} + \polyglossia_latin_medieval_settings: + } + {modern} + { + \msg_info:nnn {polyglossia} {latin / language variant} {modern} + \polyglossia_latin_modern_settings: + } + {ecclesiastic} + { + \msg_info:nnn {polyglossia} {latin / language variant} {ecclesiastic} + \polyglossia_latin_ecclesiastic_settings: + } + } + { + \msg_warning:nnn {polyglossia} {latin / illegal language variant} {#1} + } + } + + +%%%%% Boolean options concerning spelling + +\define@boolkey{latin}[latin@]{usej}[true] + { + \iflatin@usej + \bool_set_true:N \l_polyglossia_latin_use_j_bool + \else + \bool_set_false:N \l_polyglossia_latin_use_j_bool + \fi + } + +\define@boolkey{latin}[latin@]{capitalizemonth}[true] + { + \iflatin@capitalizemonth + \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool + \else + \bool_set_false:N \l_polyglossia_latin_capitalize_month_bool + \fi + } + + +%%%%% Hyphenation variants: classic, liturgical, and modern + +\msg_new:nnn {polyglossia} {latin / hyphenation variant} + { + Activating~hyphenation~patterns~for~#1~Latin~\msg_line_context:. + } + +\msg_new:nnn {polyglossia} {latin / illegal hyphenation variant} + { + The~Latin~hyphenation~variant~"#1"~is~undefined~\msg_line_context:. + } + +\define@key{latin}{hyphenation} + { + \str_case:nnTF {#1} + { + {classic} { \polyglossia_latin_set_patterns:n {classiclatin} } + {liturgical} { \polyglossia_latin_set_patterns:n {liturgicallatin} } + {modern} { \polyglossia_latin_use_modern_patterns: } + } + { + \msg_info:nnn {polyglossia} {latin / hyphenation variant} {#1} + } + { + \msg_warning:nnn {polyglossia} {latin / illegal hyphenation variant} {#1} + } + } + + +%%%%% Latin captions and date + +\def \captionslatin + { + \def \prefacename + { + \bool_if:NTF \l_polyglossia_latin_use_digraphs_bool {Præfatio} {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} + } + +\cs_new:Npn \polyglossia_latin_month_name: + { + \str_set:Nx \l_tmpa_str + { + \int_case:nn { \month } + { + {1} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {januarii} {ianuarii} } + {2} {februarii} + {3} {martii} + {4} {aprilis} + {5} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {maji} {maii} } + {6} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {junii} {iunii} } + {7} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {julii} {iulii} } + {8} {augusti} + {9} {septembris} + {10} {octobris} + {11} { \bool_if:NTF \l_polyglossia_latin_use_v_bool {novembris} {nouembris} } + {12} {decembris} + } + } + \bool_if:NTF \l_polyglossia_latin_capitalize_month_bool + { + \tl_mixed_case:n { \l_tmpa_str } + } + { + \str_use:N \l_tmpa_str + } + } + +\def \datelatin + { + \def \today + { + \int_to_Roman:n { \day } + \c_space_tl + \polyglossia_latin_month_name: + \c_space_tl + \int_to_Roman:n { \year } + } + } + + +%%%%% Latin shorthands + +\define@boolkey{latin}[latin@]{babelshorthands}[true] + { + } + +\define@boolkey{latin}[latin@]{prosodicshorthands}[true] + { + } \ifsystem@babelshorthands \setkeys{latin}{babelshorthands=true} \else \setkeys{latin}{babelshorthands=false} \fi -\ifcsundef{initiate@active@char}{% -\input{babelsh.def}% -\initiate@active@char{"}% -\initiate@active@char{'}% -}{} -\def\latin@shorthands{% - \def\language@group{latin}% - \bbl@activate{"}% - \declare@shorthand{latin}{"}{\relax - \ifmmode - \def\xpgla@nextdq{''}% - \else - \def\xpgla@nextdq{\futurelet\xpgla@temp\xpgla@cwm}% - \fi - \xpgla@nextdq}% - \bbl@activate{'}% - \declare@shorthand{latin}{'}{\relax - \ifmmode - \def\xpgla@nextsq{'}% - \else - \def\xpgla@nextsq{\futurelet\xpgla@temp@A\xpgla@putacute}% - \fi - \xpgla@nextsq}% -} -\def\xpgla@allowhyphens{\bbl@allowhyphens - \discretionary{-}{}{}\bbl@allowhyphens} -\newcommand*{\xpgla@cwm}{\let\xpgla@@nextdq\relax - \ifcat\noexpand\xpgla@temp a% - \let\xpgla@@nextdq\xpgla@allowhyphens - \else - \ifx\xpgla@temp\ae - \let\xpgla@@nextdq\xpgla@allowhyphens - \else - \ifx\xpgla@temp\oe - \let\xpgla@@nextdq\xpgla@allowhyphens + +\ExplSyntaxOff % babelsh.def does not support expl3 syntax +\ifcsundef{initiate@active@char}{\input{babelsh.def}}{} +\ExplSyntaxOn + +\initiate@active@char {"} +\initiate@active@char {'} +\initiate@active@char {^} +\initiate@active@char {=} + +\shorthandoff {"} +\shorthandoff {'} +\shorthandoff {^} +\shorthandoff {=} + +% The active '=' character may cause problems with key=value interfaces. +% We have to make sure here that no problems can occur outside a Latin +% prosodic shorthand environment. + +\protected@write \@auxout { } { \shorthandoff {=} } % for the aux file + +\AtBeginDocument + { + \str_if_eq:VnTF \xpg@main@language {latin} + { + \iflatin@prosodicshorthands \else - \if\noexpand\xpgla@temp\string|% - \def\xpgla@@nextdq{\xpgla@allowhyphens\@gobble}% - \fi + \shorthandoff {=} \fi + } + { + % The following command should not be called if the main language + % defines a '=' shorthand. However, there are no languages besides + % Latin defining such a shorthand in polyglossia. + \shorthandoff {=} + } + } + +\cs_new:Npn \polyglossia_latin_shorthands: + { + \def \language@group {latin} + \bbl@activate {"} + \declare@shorthand {latin} {"} + { + \mode_if_math:TF + { + \token_to_str:N " + } + { + \polyglossia_latin_apply_quotemark:N + } + } + \bbl@activate {'} + \declare@shorthand {latin} {'} + { + \mode_if_math:TF + { + \active@math@prime % defined in "latex.ltx" + } + { + \polyglossia_latin_put_acute:N + } + } + } + +\cs_new:Npn \polyglossia_latin_prosodic_shorthands: + { + \def \language@group {latin} + % The '=' shorthand is normally turned off to avoid problems with key=value + % interfaces. We turn it on here to enable prosodic shorthands. + \shorthandon {=} + \bbl@activate {=} + \declare@shorthand {latin} {=} + { + \mode_if_math:TF + { + \token_to_str:N = + } + { + \polyglossia_latin_put_macron:N + } + } + \bbl@activate {^} + \declare@shorthand {latin} {^} + { + \mode_if_math:TF + { + \token_to_str:N ^ + } + { + \polyglossia_latin_put_breve:N + } + } + } + +\cs_new:Npn \polyglossia_latin_apply_quotemark:N #1 + { + \str_case:nnF {#1} + { + {A} { \polyglossia_latin_digraph_shorthand:Nnn E { Æ } + { + \polyglossia_latin_digraph_shorthand:Nnn e { Æ } + { + \polyglossia_latin_allow_hyphens: A + } + } + } + {a} { \polyglossia_latin_digraph_shorthand:Nnn e { æ } + { + \polyglossia_latin_allow_hyphens: a + } + } + {O} { \polyglossia_latin_digraph_shorthand:Nnn E { Œ } + { + \polyglossia_latin_digraph_shorthand:Nnn e { Œ } + { + \polyglossia_latin_allow_hyphens: O + } + } + } + {o} { \polyglossia_latin_digraph_shorthand:Nnn e { œ } + { + \polyglossia_latin_allow_hyphens: o + } + } + {|} { \polyglossia_latin_allow_hyphens: } + {<} { « } + {>} { » } + } + { + \token_if_letter:NTF #1 { \polyglossia_latin_allow_hyphens: #1 } + { + \token_if_eq_meaning:NNTF #1 \AE { \polyglossia_latin_allow_hyphens: #1 } + { + \token_if_eq_meaning:NNTF #1 \ae { \polyglossia_latin_allow_hyphens: #1 } + { + \token_if_eq_meaning:NNTF #1 \OE { \polyglossia_latin_allow_hyphens: #1 } + { + \token_if_eq_meaning:NNTF #1 \oe { \polyglossia_latin_allow_hyphens: #1 } + { + \token_to_str:N " + #1 + } + } + } + } + } + } + } + +\cs_new:Npn \polyglossia_latin_put_acute:N #1 + { + \str_case:nnF {#1} + { + {A} { \polyglossia_latin_digraph_shorthand:Nnn E { Ǽ } + { + \polyglossia_latin_digraph_shorthand:Nnn e { Ǽ } { Á } + } + } + {a} { \polyglossia_latin_digraph_shorthand:Nnn e { ǽ } { á } } + {E} { É } + {e} { é } + {I} { Í } + {i} { í } + {O} { \polyglossia_latin_digraph_shorthand:Nnn E { \'Œ } + { + \polyglossia_latin_digraph_shorthand:Nnn e { \'Œ } { Ó } + } + } + {o} { \polyglossia_latin_digraph_shorthand:Nnn e { \'œ } { ó } } + {U} { Ú } + {u} { ú } + {V} { \' V } % V may be a vowel, but lowercase v is never used as a vowel. + {Y} { Ý } + {y} { ý } + {Æ} { Ǽ } + {æ} { ǽ } + {Œ} { \'Œ } + {œ} { \'œ } + } + { + \token_if_eq_meaning:NNTF #1 \AE { Ǽ } + { + \token_if_eq_meaning:NNTF #1 \ae { ǽ } + { + \token_if_eq_meaning:NNTF #1 \OE { \'Œ } + { + \token_if_eq_meaning:NNTF #1 \oe { \'œ } + { + \token_to_str:N ' + #1 + } + } + } + } + } + } + +\cs_new:Npn \polyglossia_latin_put_macron:N #1 + { + \str_case:nnF {#1} + { + {A} { \polyglossia_latin_diphthong_macron:NNn AE + { + \polyglossia_latin_diphthong_macron:NNn Ae + { + \polyglossia_latin_diphthong_macron:NNn AU + { + \polyglossia_latin_diphthong_macron:NNn Au { Ā } + } + } + } + } + {a} { \polyglossia_latin_diphthong_macron:NNn ae + { + \polyglossia_latin_diphthong_macron:NNn au { ā } + } + } + {E} { \polyglossia_latin_diphthong_macron:NNn EU + { + \polyglossia_latin_diphthong_macron:NNn Eu { Ē } + } + } + {e} { \polyglossia_latin_diphthong_macron:NNn eu { ē } } + {I} { Ī } + {i} { ī } + {O} { \polyglossia_latin_diphthong_macron:NNn OE + { + \polyglossia_latin_diphthong_macron:NNn Oe { Ō } + } + } + {o} { \polyglossia_latin_diphthong_macron:NNn oe { ō } } + {U} { Ū } + {u} { ū } + {V} { \= V } % V may be a vowel, but lowercase v is never used as a vowel. + {Y} { Ȳ } + {y} { ȳ } + } + { + \token_to_str:N = + #1 + } + } + +\cs_new:Npn \polyglossia_latin_put_breve:N #1 + { + \str_case:nnF {#1} + { + {A} { Ă } + {a} { ă } + {E} { Ĕ } + {e} { ĕ } + {I} { Ĭ } + {i} { ĭ } + {O} { Ŏ } + {o} { ŏ } + {U} { Ŭ } + {u} { ŭ } + {V} { \u{V} } % V may be a vowel, but lowercase v is never used as a vowel. + {Y} { \u{Y} } + {y} { \u{y} } + } + { + \token_to_str:N ^ + #1 + } + } + + +\cs_new:Npn \polyglossia_latin_allow_hyphens: + { + \bbl@allowhyphens + \discretionary {-} {} {} + \bbl@allowhyphens + } + +\cs_new:Npn \polyglossia_latin_digraph_shorthand:Nnn #1#2#3 +% #1: second letter of digraph (E or e) +% #2: digraph character +% #3: non-digraph code + { + \bool_if:NTF \l_polyglossia_latin_use_digraphs_bool + { + \peek_meaning_remove:NTF #1 {#2} {#3} + } + { + #3 + } + } + +\cs_new:Npn \polyglossia_latin_diphthong_macron:NNn #1#2#3 +% #1: first character of diphthong +% #2: second character of diphthong +% #3: non-diphthong code + { + \peek_meaning:NTF #2 { #1 \char "35E \relax } {#3} % U+35E: combining double macron + } + +\cs_new:Npn \polyglossia_latin_no_shorthands: + { + \bbl@deactivate {"} + \bbl@deactivate {'} + \bbl@deactivate {=} + \bbl@deactivate {^} + % The active '=' character may cause problems with key=value interfaces. + % We have to make sure here that no problems can occur outside a Latin + % prosodic shorthand environment. + \shorthandoff {=} + } + + +%%%%% Further settings + +\let \xpgla@savedvalues \empty + +\AtEndPreamble + { + \edef \xpgla@savedvalues + { + \clubpenalty = \the \clubpenalty \space + \@clubpenalty = \the \@clubpenalty \space + \widowpenalty = \the \widowpenalty \space + \finalhyphendemerits = \the \finalhyphendemerits + } + } + +\def \noextras@latin + { + \polyglossia_latin_no_shorthands: + \xpgla@savedvalues + \polyglossia_latin_no_punctuation_spacing: + \polyglossia_latin_modern_character_codes: + } + +\cs_new:Npn \polyglossia_latin_inline_extras: + { + \bool_if:NF \l_polyglossia_latin_use_v_bool + { + \polyglossia_latin_classical_character_codes: + } + \bool_if:NT \l_polyglossia_latin_punctuation_spacing_bool + { + \polyglossia_latin_punctuation_spacing: + } + \iflatin@babelshorthands + \polyglossia_latin_shorthands: \fi - \fi - \xpgla@@nextdq}% -\def\xpgla@putacute#1{\let\xpgla@nextsq\relax% -\if a\xpgla@temp@A - æ\kern-0.175em^^^^0301\kern0.175em\xpgla@allowhyphens -\else -\if o\xpgla@temp@A - œ\kern-0.175em^^^^0301\kern0.175em\xpgla@allowhyphens -\else - \if æ\xpgla@temp@A - æ^^^^0301% - \else - \if œ\xpgla@temp@A - œ^^^^0301% - \else - \string'% + \iflatin@prosodicshorthands + \polyglossia_latin_prosodic_shorthands: \fi - \fi -\fi -\fi}% + } -\def\nolatin@shorthands{% - \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}% - \@ifundefined{initiate@active@char}{}{\bbl@deactivate{'}}% -} +\def \blockextras@latin + { + % The following four values were overtaken from the Italian language module. + % It is unclear why they were chosen. + \clubpenalty = 3000 + \@clubpenalty = 3000 + \widowpenalty = 3000 + \finalhyphendemerits = 50000000 + \polyglossia_latin_inline_extras: + } -\let\xpgla@savedvalues\empty -\AtEndPreamble{% - \edef\xpgla@savedvalues{% - \clubpenalty=\the\clubpenalty\space - \@clubpenalty=\the\@clubpenalty\space - \widowpenalty=\the\widowpenalty\space - \finalhyphendemerits=\the\finalhyphendemerits} -} -\def\noextras@latin{% - \lccode\string"2019=\z@ - \nolatin@shorthands - \xpgla@savedvalues - \noclassicuclccodes - \iflatin@ecclesiastic - \unless\ifluatex\noecclesiasticlatin@punctuation - \let\@makefntext\latin@original@makefntext\fi - \fi -} +\def \inlineextras@latin + { + \polyglossia_latin_inline_extras: + } -\def\blockextras@latin{% - \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 - \fi -} -\def\inlineextras@latin{% - \lccode\string"2019=\string"2019 - \ifclassic\classicuclccodes\fi - \iflatin@babelshorthands\latin@shorthands\fi - \iflatin@ecclesiastic - \unless\ifluatex\ecclesiasticlatin@punctuation - \let\@makefntext\latin@ecclesiastic@makefntext\fi - \fi -} +%% Default settings + +\polyglossia_latin_modern_settings: + +\ExplSyntaxOff + %% Copyright (C) Claudio Beccari 2013-2016 -%% Copyright (C) Élie Roux 2016 -%% +%% Copyright (C) Élie Roux 2016-2019 +%% Copyright (C) Keno Wehr 2019 +%% %% 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 @@ -7268,10 +9331,10 @@ and may look very wrong.} %% 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 @@ -7284,6 +9347,51 @@ and may look very wrong.} % \end{macrocode} % \iffalse %</gloss-latin.ldf> +%<*gloss-latinclassic.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-latinclassic.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-latinclassic.ldf}[polyglossia: module for classic latin] + +% We provide this as a babel alias + +\xpg@load@master@language{latin} + +% \end{macrocode} +% \iffalse +%</gloss-latinclassic.ldf> +%<*gloss-latinecclesiastic.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-latinecclesiastic.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-latinecclesiastic.ldf}[polyglossia: module for ecclesiastic latin] + +% We provide this as a babel alias + +\xpg@load@master@language{latin} + +% \end{macrocode} +% \iffalse +%</gloss-latinecclesiastic.ldf> +%<*gloss-latinmedieval.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-latinmedieval.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-latinmedieval.ldf}[polyglossia: module for medieval latin] + +% We provide this as a babel alias + +\xpg@load@master@language{latin} + +% \end{macrocode} +% \iffalse +%</gloss-latinmedieval.ldf> %<*gloss-latvian.ldf> % \fi % \clearpage @@ -7406,6 +9514,21 @@ and may look very wrong.} % \end{macrocode} % \iffalse %</gloss-lithuanian.ldf> +%<*gloss-lowersorbian.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-lowersorbian.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-lowersorbian.ldf}[polyglossia: module for lower sorbian] + +% We provide this as a babel alias + +\xpg@load@master@language{sorbian} + +% \end{macrocode} +% \iffalse +%</gloss-lowersorbian.ldf> %<*gloss-lsorbian.ldf> % \fi % \clearpage @@ -7417,19 +9540,7 @@ and may look very wrong.} % 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, -} - -\let\captionslsorbian\captionssorbian@lsorbian -\let\datelsorbian\datesorbian@lsorbian +\xpg@load@master@language{sorbian} % \end{macrocode} % \iffalse @@ -7535,20 +9646,7 @@ and may look very wrong.} % We only provide this gloss for babel compatibility. -\input{gloss-hungarian.ldf} - -\PolyglossiaSetup{magyar}{ - hyphennames={magyar,hungarian}, - langtag=HUN, - hyphenmins={2,2}, - fontsetup=true, -} - -\let\captionsmagyar\captionshungarian -\let\datemagyar\datehungarian -\let\ondatemagyar\ondatehungarian -\let\blockextras@magyar\blockextras@hungarian -\let\noextras@magyar\noextras@hungarian +\xpg@load@master@language{hungarian} % \end{macrocode} % \iffalse @@ -7570,6 +9668,13 @@ and may look very wrong.} hyphenmins={2,2}, fontsetup=true} +% Babel aliases +\setlanguagealias[variant=indonesian]{malay}{bahasai} +\setlanguagealias[variant=malaysian]{malay}{bahasa} + +% Backwards compat. alias +\setlanguagealias[variant=malaysian]{malay}{bahasam} + \providebool{malay@melayu} \malay@melayufalse \def\malay@variant{malay} @@ -7902,7 +10007,7 @@ and may look very wrong.} % \begin{macrocode} \ProvidesFile{gloss-mongolian.ldf}[polyglossia: module for mongolian] -\RequirePackage{cyrillicnumbers} +\RequirePackage{xpg-cyrillicnumbers} \PolyglossiaSetup{mongolian}{ script=Cyrillic, @@ -8095,6 +10200,51 @@ and may look very wrong.} % \end{macrocode} % \iffalse %</gloss-mongolian.ldf> +%<*gloss-naustrian.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-naustrian.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-naustrian.ldf}[polyglossia: module for austrian german (current spelling)] + +% We provide this as a babel alias + +\xpg@load@master@language{german} + +% \end{macrocode} +% \iffalse +%</gloss-naustrian.ldf> +%<*gloss-newzealand.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-newzealand.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-newzealand.ldf}[polyglossia: module for newzealand english] + +% We provide this as a babel alias + +\xpg@load@master@language{english} + +% \end{macrocode} +% \iffalse +%</gloss-newzealand.ldf> +%<*gloss-ngerman.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-ngerman.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-ngerman.ldf}[polyglossia: module for german (current spelling)] + +% We provide this as a babel alias + +\xpg@load@master@language{german} + +% \end{macrocode} +% \iffalse +%</gloss-ngerman.ldf> %<*gloss-nko.ldf> % \fi % \clearpage @@ -8198,18 +10348,7 @@ and may look very wrong.} % 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, -} - -\let\captionsnorsk\captionsnorwegian@norsk -\let\datenorsk\datenorwegian@norsk +\xpg@load@master@language{norwegian} % \end{macrocode} % \iffalse @@ -8229,6 +10368,10 @@ and may look very wrong.} fontsetup=false, } +% Babel and backwards compat. aliases +\setlanguagealias[variant=bokmal]{norwegian}{norsk} +\setlanguagealias[variant=nynorsk]{norwegian}{nynorsk} + \def\norwegian@variant{nynorsk} \define@choicekey*+{norwegian}{variant}[\val\nr]{nynorsk,bokmal}[nynorsk]{% \ifcase\nr\relax @@ -8325,6 +10468,21 @@ and may look very wrong.} % \end{macrocode} % \iffalse %</gloss-norwegian.ldf> +%<*gloss-nswissgerman.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-nswissgerman.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-nswissgerman.ldf}[polyglossia: module for swiss german (current spelling)] + +% We provide this as a babel alias + +\xpg@load@master@language{german} + +% \end{macrocode} +% \iffalse +%</gloss-nswissgerman.ldf> %<*gloss-nynorsk.ldf> % \fi % \clearpage @@ -8336,18 +10494,7 @@ and may look very wrong.} % 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, -} - -\let\captionsnorsk\captionsnorwegian@nynorsk -\let\datenorsk\datenorwegian@nynorsk +\xpg@load@master@language{norwegian} % \end{macrocode} % \iffalse @@ -8550,6 +10697,9 @@ and may look very wrong.} localnumeral=farsinumerals } +% Babel and backwards compat. alias +\setlanguagealias{persian}{farsi} + \newif\if@western@numerals \def\tmp@western{western} \define@key{persian}{numerals}[eastern]{% @@ -8855,35 +11005,35 @@ and may look very wrong.} % \end{macrocode} % \iffalse %</gloss-polish.ldf> +%<*gloss-polutonikogreek.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-polutonikogreek.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-polutonikogreek.ldf}[polyglossia: module for polytonic greek] + +% We provide this as a babel alias + +\xpg@load@master@language{greek} + +% \end{macrocode} +% \iffalse +%</gloss-polutonikogreek.ldf> %<*gloss-portuges.ldf> % \fi % \clearpage % % \subsection{gloss-portuges.ldf} % \begin{macrocode} -\ProvidesFile{gloss-portuges.ldf}[polyglossia: module for portuguese (DEPRECATED!)] +\ProvidesFile{gloss-portuges.ldf}[polyglossia: module for portuguese] % We only provide this gloss for backwards compatibility. The name % 'portuges' was selected in accordance with babel (which probably % introduced it in 8.3 filename times). Since polyglossia uses full % English language names, we use 'portuguese' now. -% FIXME: Once we support babel aliases (#112) this gloss can go. - -\xpg@warning{The language name 'portuges' is deprectated.\MessageBreak - Please use 'portuguese' instead.} - -\input{gloss-portuguese.ldf} - -\PolyglossiaSetup{portuges}{ - hyphennames={portuges,portuguese}, - hyphenmins={2,3}, - langtag=PTG, - fontsetup=true, -} - -\let\captionsportuges\captionsportuguese@portuges -\let\dateportuges\dateportuguese@portuges +\xpg@load@master@language{portuguese} % \end{macrocode} % \iffalse @@ -8895,6 +11045,7 @@ and may look very wrong.} % \subsection{gloss-portuguese.ldf} % \begin{macrocode} \ProvidesFile{gloss-portuguese.ldf}[polyglossia: module for portuguese] + \PolyglossiaSetup{portuguese}{ babelname=portuges, hyphennames={portuges,portuguese}, @@ -8903,11 +11054,16 @@ and may look very wrong.} fontsetup=true, } +% Babel aliases +\setlanguagealias[variant=portuguese]{portuguese}{portuges} +\setlanguagealias[variant=brazilian]{portuguese}{brazil} + \def\portuguese@variant{portuges} \define@choicekey*+{portuguese}{variant}[\val\nr]{portuguese,brazilian}[portuguese]{% \ifcase\nr\relax % portuguese: \def\portuguese@variant{portuges}% + \SetLanguageKeys{portuguese}{babelname=portuges}% \or % brazilian: \def\portuguese@variant{brazil}% @@ -9109,7 +11265,7 @@ and may look very wrong.} % \begin{macrocode} \ProvidesFile{gloss-russian.ldf}[polyglossia: module for russian] -\RequirePackage{cyrillicnumbers} +\RequirePackage{xpg-cyrillicnumbers} \PolyglossiaSetup{russian}{ script=Cyrillic, @@ -9118,6 +11274,7 @@ and may look very wrong.} hyphennames={russian}, hyphenmins={2,2}, frenchspacing=true, + indentfirst=true, fontsetup, localnumeral=russiannumerals, Localnumeral=Russiannumerals @@ -9145,6 +11302,14 @@ and may look very wrong.} {\cyrillic@numeralsfalse}% } +\define@boolkey{russian}[russian@]{indentfirst}{ + \ifrussian@indentfirst + \SetLanguageKeys{russian}{indentfirst=true} + \else + \SetLanguageKeys{russian}{indentfirst=false} + \fi +} + \define@boolkey{russian}[russian@]{babelshorthands}[false]{} \setkeys{russian}{spelling,numerals} @@ -9454,6 +11619,10 @@ and may look very wrong.} fontsetup=true, } +% Babel and backwards compat. alias +\setlanguagealias{sami}{samin} +%\setlanguagealias[variant=northern]{sami}{samin} + % TODO: Add other Sami varieties \def\sami@variant{northern} %\define@choicekey*+{sami}{variant}[\val\nr]{northern}[nothern]{% @@ -9540,18 +11709,7 @@ and may look very wrong.} % 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 +\xpg@load@master@language{sami} % \end{macrocode} % \iffalse @@ -9588,6 +11746,8 @@ and may look very wrong.} }% } +\define@key{sanskrit}{script}[Devanagari]{\setkeys{sanskrit}{Script=#1}} + \def\fontsetup@sanskrit@Devanagari{% \SetLanguageKeys{sanskrit}{scripttag=deva,script=Devanagari} \xpg@fontsetup@nonlatin{sanskrit}} @@ -9612,16 +11772,20 @@ and may look very wrong.} \setkeys{sanskrit}{Script} %sets the default for Devanagari -\def\tmp@western{Western} + \newif\ifsanskrit@devanagari@numerals \sanskrit@devanagari@numeralstrue +\define@choicekey*+{sanskrit}{numerals}[\val\nr]{Devanagari,Western}[Devanagari]{% + \ifcase\nr\relax + % Devanagari: + \sanskrit@devanagari@numeralstrue% + \or + % Western: + \sanskrit@devanagari@numeralsfalse% + \fi + \xpg@info{Option: Sanskrit, numerals=\val}% +}{\xpg@warning{Unknown Sanskrit numeral `#1'}} -\define@key{sanskrit}{numerals}[Devanagari]{% - \def\@tmpa{#1}% - \ifx\@tmpa\tmp@western - \sanskrit@devanagari@numeralsfalse - \fi% -} \newcommand{\sanskritnumerals}[2]{\sanskritnumber{#2}} @@ -9633,34 +11797,45 @@ and may look very wrong.} \fi% } -% FIXME: Support LuaTeX -\ifxetex - \newXeTeXintercharclass\sanskrit@punctthin % ! ? ; : danda double_danda +\ifluatex + \directlua{require('polyglossia-sanskrit')}% +\else + \newXeTeXintercharclass\sanskrit@punctthin % ! ? ‼ ⁇ ⁈ ⁉ : ; danda double_danda \fi \def\sanskrit@punctthinspace{{\unskip\thinspace}} \def\sanskrit@punctuation{% - % FIXME: Support LuaTeX - \ifxetex + \ifluatex + \directlua{polyglossia.activate_sanskrit_punct()}% + \else \XeTeXinterchartokenstate=1% \XeTeXcharclass `\! \sanskrit@punctthin \XeTeXcharclass `\? \sanskrit@punctthin - \XeTeXcharclass `\; \sanskrit@punctthin + \XeTeXcharclass `\‼ \sanskrit@punctthin + \XeTeXcharclass `\⁇ \sanskrit@punctthin + \XeTeXcharclass `\⁈ \sanskrit@punctthin + \XeTeXcharclass `\⁉ \sanskrit@punctthin \XeTeXcharclass `\: \sanskrit@punctthin - \XeTeXcharclass `\। \sanskrit@punctthin - \XeTeXcharclass `\॥ \sanskrit@punctthin + \XeTeXcharclass `\; \sanskrit@punctthin + \XeTeXcharclass `\। \sanskrit@punctthin % danda, U+0964 + \XeTeXcharclass `\॥ \sanskrit@punctthin % double danda, U+0965 \XeTeXinterchartoks \z@ \sanskrit@punctthin = \sanskrit@punctthinspace \fi } \def\nosanskrit@punctuation{% - % FIXME: Support LuaTeX - \ifxetex + \ifluatex + \directlua{polyglossia.deactivate_sanskrit_punct()}% + \else \XeTeXcharclass `\! \z@ \XeTeXcharclass `\? \z@ - \XeTeXcharclass `\; \z@ + \XeTeXcharclass `\‼ \z@ + \XeTeXcharclass `\⁇ \z@ + \XeTeXcharclass `\⁈ \z@ + \XeTeXcharclass `\⁉ \z@ \XeTeXcharclass `\: \z@ + \XeTeXcharclass `\; \z@ \XeTeXcharclass `\। \z@ \XeTeXcharclass `\॥ \z@ \XeTeXinterchartokenstate=0% @@ -9689,17 +11864,7 @@ and may look very wrong.} % 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, -} - -\let\captionsscottish\captionsgaelic@scottish -\let\datescottish\dategaelic@scottish +\xpg@load@master@language{gaelic} % \end{macrocode} % \iffalse @@ -9716,7 +11881,7 @@ and may look very wrong.} %% same thing for all languages that have a "script" key ! %% BETTER APPROACH: see gloss-sanskrit! -\RequirePackage{cyrillicnumbers} +\RequirePackage{xpg-cyrillicnumbers} \PolyglossiaSetup{serbian}{ langtag=SRB, @@ -9729,25 +11894,27 @@ and may look very wrong.} %TODO localalph } +% Babel aliases +\setlanguagealias[script=Cyrillic]{serbian}{serbianc} + \newif\if@serbian@cyr +\define@choicekey*+{serbian}{Script}[\val\nr]{cyrillic,latin}[cyrillic]{% + \ifcase\nr\relax + % cyrillic: + \@serbian@cyrtrue + \SetLanguageKeys{serbian}{scripttag=cyrl,script=Cyrillic,babelname=serbianc} + \xpg@fontsetup@nonlatin{serbian}% + \or + % latin: + \@serbian@cyrfalse + \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??? + \fi + \xpg@info{Option: Serbian, script=\val}% +}{\xpg@warning{Unknown Serbian script `#1'}} -\define@key{serbian}{Script}[Cyrillic]{% - \ifstrequal{#1}{Cyrillic}% - {\@serbian@cyrtrue - \SetLanguageKeys{serbian}{scripttag=cyrl,script=Cyrillic,babelname=serbianc} - \xpg@fontsetup@nonlatin{serbian}% - }% - {\ifstrequal{#1}{Latin}% - {\@serbian@cyrfalse - \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"}}% - }% -} \define@key{serbian}{script}[Cyrillic]{\setkeys{serbian}{Script=#1}} \newif\ifserbian@numerals @@ -9910,6 +12077,21 @@ and may look very wrong.} % \end{macrocode} % \iffalse %</gloss-serbian.ldf> +%<*gloss-serbianc.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-serbianc.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-serbianc.ldf}[polyglossia: module for serbian (cyrillic)] + +% We provide this as a babel alias + +\xpg@load@master@language{serbian} + +% \end{macrocode} +% \iffalse +%</gloss-serbianc.ldf> %<*gloss-slovak.ldf> % \fi % \clearpage @@ -9925,6 +12107,176 @@ and may look very wrong.} fontsetup=true, } +\ifluatex + \RequirePackage{luavlna} +\fi + +\define@boolkey{slovak}[slovak@]{babelshorthands}[true]{} + +\define@boolkey{slovak}[slovak@]{splithyphens}[true]{} + +\define@boolkey{slovak}[slovak@]{vlna}[true]{} + +\setkeys{slovak}{splithyphens,vlna} + +\ifsystem@babelshorthands + \setkeys{slovak}{babelshorthands=true} +\else + \setkeys{slovak}{babelshorthands=false} +\fi + +\ifcsundef{initiate@active@char}{% + \input{babelsh.def}% + \initiate@active@char{"}% + \shorthandoff{"}% +}{} + +\def\slovak@@splhyphen#1{% + \kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}% + \nobreak\hskip\z@% +} + +\def\slovak@splhyphen{% + \slovak@@splhyphen{-}% +} + +\def\slovak@shorthands{% + \bbl@activate{"}% + \def\language@group{slovak}% + \declare@shorthand{slovak}{"=}{\slovak@splhyphen}% + \declare@shorthand{slovak}{""}{\hskip\z@skip}% + \declare@shorthand{slovak}{"~}{\textormath{\leavevmode\hbox{-}}{-}}% + \declare@shorthand{slovak}{"-}{\nobreak\-\bbl@allowhyphens}% + \declare@shorthand{slovak}{"|}{% + \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}% + \bbl@allowhyphens}{}% + }% + \declare@shorthand{slovak}{"/}{\textormath + {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}% + \declare@shorthand{slovak}{"`}{„}% + \declare@shorthand{slovak}{"'}{“}% + \declare@shorthand{slovak}{"<}{«}% + \declare@shorthand{slovak}{">}{»}% +} + +\def\noslovak@shorthands{% + \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}% +} + +\ifxetex + % splithyphens + \newXeTeXintercharclass\slovak@hyphen % - + % vlna + \newXeTeXintercharclass\slovak@openpunctuation + \newXeTeXintercharclass\slovak@nonsyllabicpreposition + \ifdefined\e@alloc@intercharclass@top + \chardef\slovak@boundary=\e@alloc@intercharclass@top + \else + \ifdefined\XeTeXinterwordspaceshaping + \chardef\slovak@boundary=4095 % + \def\newXeTeXintercharclass{% + \e@alloc\XeTeXcharclass\chardef + \xe@alloc@intercharclass\m@ne\@ucharclass@boundary} + \else + \chardef\slovak@boundary=255 + \fi + \fi +\fi + +\def\slovak@hyphens{% + \ifluatex + \AfterPreamble{\enablesplithyphens{slovak}}% + \else + \XeTeXinterchartokenstate=1 + \XeTeXcharclass `\- \slovak@hyphen + \XeTeXinterchartoks \z@ \slovak@hyphen = {\slovak@@splhyphen}% "-" -> "\slovak@@splhyphen-" + % necessary if used together with vlna: + \XeTeXinterchartoks \slovak@nonsyllabicpreposition \slovak@hyphen = {\slovak@@splhyphen}% "-" -> "\slovak@@splhyphen-" + \fi% +} + +\def\noslovak@hyphens{% + \ifluatex + \AfterPreamble{\disablesplithyphens{slovak}}% + \else + \XeTeXcharclass `\- \z@ + \fi% +} + +% Add nonbreakable space after single-letter word to +% prevent them to land at the end of a line +\def\slovak@vlna{% + \ifluatex + \preventsingleon + \else + % Code taken and adapted from xevlna.sty + \XeTeXinterchartokenstate=1 + \XeTeXcharclass `\( \slovak@openpunctuation + \XeTeXcharclass `\[ \slovak@openpunctuation + \XeTeXcharclass `\„ \slovak@openpunctuation + \XeTeXcharclass `\» \slovak@openpunctuation + \XeTeXcharclass `\K \slovak@nonsyllabicpreposition + \XeTeXcharclass `\k \slovak@nonsyllabicpreposition + \XeTeXcharclass `\S \slovak@nonsyllabicpreposition + \XeTeXcharclass `\s \slovak@nonsyllabicpreposition + \XeTeXcharclass `\V \slovak@nonsyllabicpreposition + \XeTeXcharclass `\v \slovak@nonsyllabicpreposition + \XeTeXcharclass `\Z \slovak@nonsyllabicpreposition + \XeTeXcharclass `\z \slovak@nonsyllabicpreposition + \XeTeXcharclass `\O \slovak@nonsyllabicpreposition + \XeTeXcharclass `\o \slovak@nonsyllabicpreposition + \XeTeXcharclass `\U \slovak@nonsyllabicpreposition + \XeTeXcharclass `\u \slovak@nonsyllabicpreposition + \XeTeXcharclass `\A \slovak@nonsyllabicpreposition + \XeTeXcharclass `\a \slovak@nonsyllabicpreposition + \XeTeXcharclass `\I \slovak@nonsyllabicpreposition + \XeTeXcharclass `\i \slovak@nonsyllabicpreposition + \XeTeXinterchartoks \slovak@boundary \slovak@nonsyllabicpreposition {\slovak@interchartoks} + \XeTeXinterchartoks \slovak@openpunctuation \slovak@nonsyllabicpreposition {\slovak@interchartoks} + \def\slovak@nointerchartoks{\let\slovak@interchartoks\slovak@PreCSpreposition} + \def\slovak@PreCSpreposition{\def\next{}% + \ifnum\catcode`\ =10 % nothing will be done in verbatim + \ifmmode % nothing in math + \else + \let\slovak@interchartoks\slovak@nointerchartoks + \let\next\slovak@ExamineCSpreposition + \fi \fi + \next% + } + \def\slovak@ExamineCSpreposition ##1{##1\futurelet\next\slovak@ProcessCSpreposition} + \def\slovak@ProcessCSpreposition{\ifx\next\slovak@XeTeXspace\nobreak\fi} + \futurelet\slovak@XeTeXspace{ }\slovak@nointerchartoks + \fi +} + +\def\noslovak@vlna{% + \ifluatex + \preventsingleoff + \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\captionsslovak{% \def\refname{Referencie}% \def\abstractname{Abstrakt}% @@ -9948,7 +12300,7 @@ and may look very wrong.} \def\headtoname{Pre}% was komu \def\proofname{Dôkaz}% \def\glossaryname{Slovník}% - } +} \def\dateslovak{% \def\today{\number\day.~\ifcase\month\or @@ -9956,11 +12308,45 @@ and may look very wrong.} júna\or júla\or augusta\or septembra\or októbra\or novembra\or decembra\fi \space \number\year}% - } +} + +\def\noextras@slovak{% + \noslovak@shorthands% + \noslovak@hyphens% + \noslovak@vlna% + \ifxetex\XeTeXinterchartokenstate=0\fi% +} + +\def\blockextras@slovak{% + \ifslovak@babelshorthands\slovak@shorthands\fi% + \ifslovak@vlna\slovak@vlna\else\noslovak@vlna\fi% + \ifslovak@splithyphens\slovak@hyphens\else\noslovak@hyhens\fi% +} + +\def\inlineextras@slovak{% + \ifslovak@babelshorthands\slovak@shorthands\fi% + \ifslovak@vlna\slovak@vlna\else\noslovak@vlna\fi% + \ifslovak@splithyphens\slovak@hyphens\else\noslovak@hyhens\fi% +} % \end{macrocode} % \iffalse %</gloss-slovak.ldf> +%<*gloss-slovene.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-slovene.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-slovene.ldf}[polyglossia: module for slovenian] + +% We provide this as a babel alias + +\xpg@load@master@language{slovenian} + +% \end{macrocode} +% \iffalse +%</gloss-slovene.ldf> %<*gloss-slovenian.ldf> % \fi % \clearpage @@ -9977,6 +12363,9 @@ and may look very wrong.} fontsetup=true, } +% Babel aliases +\setlanguagealias{slovenian}{slovene} + \providebool{slovenian@localalph} \define@boolkey{slovenian}[slovenian@]{localalph}[false]{% \def\@tmpa{#1}% @@ -10057,6 +12446,14 @@ and may look very wrong.} fontsetup=true, } +% Backwards compat. aliases +\setlanguagealias[variant=lower]{sorbian}{lsorbian} +\setlanguagealias[variant=upper]{sorbian}{usorbian} + +% Babel aliases +\setlanguagealias[variant=lower]{sorbian}{lowersorbian} +\setlanguagealias[variant=upper]{sorbian}{uppersorbian} + \def\sorbian@variant{usorbian} \define@choicekey*+{sorbian}{variant}[\val\nr]{upper,lower}[upper]{% \ifcase\nr\relax @@ -10221,6 +12618,7 @@ and may look very wrong.} % \subsection{gloss-spanish.ldf} % \begin{macrocode} \ProvidesFile{gloss-spanish.ldf}[polyglossia: module for spanish] + \PolyglossiaSetup{spanish}{ hyphennames={spanish}, hyphenmins={2,2}, @@ -10228,6 +12626,152 @@ and may look very wrong.} frenchspacing=true, indentfirst=true, fontsetup=true, + babelname=spanish +} + +% Babel aliases +\setlanguagealias[variant=mexican]{spanish}{spanishmx} + +\newif\if@spanish@mexico +\@spanish@mexicofalse +\define@choicekey*+{spanish}{variant}[\val\nr]{spanish,mexican}[spanish]{% + \ifcase\nr\relax + % spanish: + \@spanish@mexicofalse% + \SetLanguageKeys{spanish}{babelname=spanish}% + \or + % mexican: + \@spanish@mexicotrue% + \SetLanguageKeys{spanish}{babelname=spanishmx}% + \fi + \xpg@info{Option: spanish, variant=\val}% +}{\xpg@warning{Unknown spanish variant `#1'}} + +% Localized math operators à la babel +\newif\ifspanish@accentedoperators +\newif\ifspanish@spacedoperators +\newif\ifspanish@locoperators + +\define@choicekey*+{spanish}{spanishoperators}[\val\nr]{all,accented,spaced,none}[all]{% + \ifcase\nr\relax + % all: + \spanish@locoperatorstrue% + \spanish@accentedoperatorstrue% + \spanish@spacedoperatorstrue% + \or + % accented: + \spanish@locoperatorsfalse% + \spanish@accentedoperatorstrue% + \spanish@spacedoperatorsfalse% + \or + % spaced: + \spanish@locoperatorsfalse% + \spanish@accentedoperatorsfalse% + \spanish@spacedoperatorstrue% + \or + % none: + \spanish@locoperatorsfalse% + \spanish@accentedoperatorsfalse% + \spanish@spacedoperatorsfalse% + \fi + \xpg@info{Option: Spanish, spanishoperators=\val}% +}{\xpg@warning{Unknown spanishoperators value `#1'}} + +\let\xpg@save@lim\lim +\let\xpg@save@limsup\limsup +\let\xpg@save@liminf\liminf +\let\xpg@save@max\max +\let\xpg@save@min\min +\let\xpg@save@inf\inf +\let\xpg@save@bmod\bmod +\let\xpg@save@pmod\pmod + +\def\spanish@accentedoperators{% + \DeclareRobustCommand\lim{\mathop{\operator@font lím}}% + \DeclareRobustCommand\limsup{\mathop{\operator@font lím\,sup}}% + \DeclareRobustCommand\liminf{\mathop{\operator@font lím\,inf}}% + \DeclareRobustCommand\max{\mathop{\operator@font máx}}% + \DeclareRobustCommand\min{\mathop{\operator@font mín}}% + \DeclareRobustCommand\inf{\mathop{\operator@font ínf}}% + \DeclareRobustCommand\bmod{% + \nonscript\mskip-\medmuskip\mkern5mu% + \mathbin{\operator@font mód}\penalty900\mkern5mu% + \nonscript\mskip-\medmuskip}% + \@ifundefined{@amsmath@err}% + {\DeclareRobustCommand\pmod[1]{% + \allowbreak\mkern18mu({\operator@font mód}\,\,##1)}}% + {\let\xpg@save@mod\mod + \DeclareRobustCommand\mod[1]{\allowbreak\if@display\mkern18mu + \else\mkern12mu\fi{\operator@font mód}\,\,##1}% + \DeclareRobustCommand\pmod[1]{\pod{{\operator@font mód}% + \mkern6mu##1}}}% +} + +\def\nospanish@accentedoperators{% + \let\lim\xpg@save@lim% + \let\limsup\xpg@save@limsup% + \let\liminf\xpg@save@liminf% + \let\max\xpg@save@max% + \let\min\xpg@save@min% + \let\inf\xpg@save@inf% + \let\bmod\xpg@save@bmod% + \let\pmod\xpg@save@pmod% + \@ifundefined{@amsmath@err}{}{\let\mod\xpg@save@mod}% +} + +\let\xpg@save@arccos\arccos +\let\xpg@save@arcsin\arcsin +\let\xpg@save@arctan\arctan +\let\arcsen\arcsin +\let\arctg\arctan + + +\def\spanish@spacedoperators{% + \DeclareRobustCommand\arccos{\mathop{\operator@font arc\,cos}\nolimits}% + \DeclareRobustCommand\arcsin{\mathop{\operator@font arc\,sen}\nolimits}% + \DeclareRobustCommand\arctan{\mathop{\operator@font arc\,tg}\nolimits}% +} + +\def\nospanish@spacedoperators{% + \let\arccos\xpg@save@arccos% + \let\arcsen\arcsin% + \let\arctg\arctan% +} + + +\let\xpg@save@sin\sin +\let\xpg@save@tan\tan +\let\xpg@save@sinh\sinh +\let\xpg@save@tanh\tanh +\let\sen\sin +\let\tg\tan +\let\senh\sinh +\let\tgh\tanh + +\def\spanish@locoperators{% + \DeclareRobustCommand\sin{\mathop{\operator@font sen}\nolimits}% + \DeclareRobustCommand\tan{\mathop{\operator@font tg}\nolimits}% + \DeclareRobustCommand\sinh{\mathop{\operator@font senh}\nolimits}% + \DeclareRobustCommand\tanh{\mathop{\operator@font tgh}\nolimits}% +} + +\def\nospanish@locoperators{% + \let\sen\xpg@save@sin% + \let\tg\xpg@save@tan% + \let\sinh\xpg@save@sinh% + \let\tanh\xpg@save@tanh% + \let\sen\relax% + \let\tg\relax% + \let\senh\relax% + \let\tgh\relax% +} + +\newcommand*\spanishoperator[2][]{% + \ifx#1\\\\ + \protected@csxdef{#2}{\mathop{\operator@font #2}\nolimits}% + \else + \protected@csxdef{#2}{\mathop{\operator@font #1}\nolimits}% + \fi } \def\captionsspanish{% @@ -10252,18 +12796,58 @@ and may look very wrong.} \def\alsoname{véase también}% \def\proofname{Prueba}% \def\glossaryname{Glosario}% - } + \if@spanish@mexico + \captionsspanish@mexico% + \fi% +} + +\def\captionsspanish@mexico{% + \def\tablename{Tabla}% +} \def\datespanish{% \def\today{\number\day~de~\ifcase\month\or enero\or febrero\or marzo\or abril\or mayo\or junio\or julio\or agosto\or septiembre\or octubre\or noviembre\or diciembre\fi\space de~\number\year}% - } +} + +\def\noextras@spanish{% + \nospanish@accentedoperators% + \nospanish@spacedoperators% + \nospanish@locoperators% +} + +\def\blockextras@spanish{% + \ifspanish@accentedoperators\spanish@accentedoperators\fi% + \ifspanish@spacedoperators\spanish@spacedoperators\fi% + \ifspanish@locoperators\spanish@locoperators\fi% +} + +\def\inlineextras@spanish{% + \ifspanish@accentedoperators\spanish@accentedoperators\fi% + \ifspanish@spacedoperators\spanish@spacedoperators\fi% + \ifspanish@locoperators\spanish@locoperators\fi% +} % \end{macrocode} % \iffalse %</gloss-spanish.ldf> +%<*gloss-spanishmx.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-spanishmx.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-spanishmx.ldf}[polyglossia: module for mexican spanish] + +% We provide this as a babel alias + +\xpg@load@master@language{spanish} + +% \end{macrocode} +% \iffalse +%</gloss-spanishmx.ldf> %<*gloss-swedish.ldf> % \fi % \clearpage @@ -10321,6 +12905,21 @@ and may look very wrong.} % \end{macrocode} % \iffalse %</gloss-swedish.ldf> +%<*gloss-swissgerman.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-swissgerman.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-swissgerman.ldf}[polyglossia: module for swiss german (old spelling)] + +% We provide this as a babel alias + +\xpg@load@master@language{german} + +% \end{macrocode} +% \iffalse +%</gloss-swissgerman.ldf> %<*gloss-syriac.ldf> % \fi % \clearpage @@ -11352,6 +13951,21 @@ and may look very wrong.} % \end{macrocode} % \iffalse %</gloss-ukrainian.ldf> +%<*gloss-uppersorbian.ldf> +% \fi +% \clearpage +% +% \subsection{gloss-uppersorbian.ldf} +% \begin{macrocode} +\ProvidesFile{gloss-uppersorbian.ldf}[polyglossia: module for upper sorbian] + +% We provide this as a babel alias + +\xpg@load@master@language{sorbian} + +% \end{macrocode} +% \iffalse +%</gloss-uppersorbian.ldf> %<*gloss-urdu.ldf> % \fi % \clearpage @@ -11518,19 +14132,7 @@ and may look very wrong.} % 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, -} - -\let\captionsusorbian\captionssorbian@usorbian -\let\dateusorbian\datesorbian@usorbian +\xpg@load@master@language{sorbian} % \end{macrocode} % \iffalse @@ -11796,239 +14398,67 @@ U+0039 <> U+0E59 ; % \end{macrocode} % \iffalse %</thaidigits.map> -%<*polyglossia-frpt.lua> +%<*polyglossia-french.lua> % \fi % \clearpage % -% \subsection{polyglossia-frpt.lua} +% \subsection{polyglossia-french.lua} % \begin{macrocode} -require('polyglossia') -- just in case... - -local add_to_callback = luatexbase.add_to_callback -local remove_from_callback = luatexbase.remove_from_callback -local priority_in_callback = luatexbase.priority_in_callback - -local get_quad = luaotfload.aux.get_quad -- needs luaotfload > 20130516 - -local next, type = next, type - -local nodes, fonts, node = nodes, fonts, node - -local nodecodes = nodes.nodecodes - -local insert_node_before = node.insert_before -local insert_node_after = node.insert_after -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 end_of_math = function (n) - for n in traverse_nodes(math_code, n.next) do - return n - end - end -end - --- node types according to node.types() -local glue_code = nodecodes.glue -local glue_spec_code = nodecodes.glue_spec -local glyph_code = nodecodes.glyph -local penalty_code = nodecodes.penalty -local kern_code = nodecodes.kern +require('polyglossia-punct') --- we make a new node, so that we can copy it later on -local penalty_node = new_node(penalty_code) -penalty_node.penalty = 10000 - -local function get_penalty_node() - return node_copy(penalty_node) +local function set_left_space(lang, char, kern, rubber) + polyglossia.add_left_spaced_character(lang, char, kern, "space", rubber) end --- same for glue node -local kern_node = new_node(kern_code) - -local function get_kern_node(dim) - local n = node_copy(kern_node) - n.kern = dim - return n +local function set_right_space(lang, char, kern, rubber) + polyglossia.add_right_spaced_character(lang, char, kern, "space", rubber) end --- we have here all possible space characters, referenced by their --- unicode slot number, taken from char-def.lua -local space_chars = {[32]=1, [160]=1, [5760]=1, [6158]=1, [8192]=1, [8193]=1, [8194]=1, [8195]=1, - [8196]=1, [8197]=1, [8198]=1, [8199]=1, [8200]=1, [8201]=1, [8202]=1, [8239]=1, [8287]=1, [12288]=1} - --- from nodes-tst.lua, adapted -local function somespace(n,all) - if n then - local id = n.id - if id == glue_code then - return (all or (n.spec.width ~= 0)) and glue_code - elseif id == kern_code then - return (all or (n.kern ~= 0)) and kern_code - elseif id == glyph_code then - if space_chars[n.char] then - return true - else - return false - end - end +local function activate_french_punct(thincolonspace, autospaceguillemets) + -- We need different language tags here to make switching of options possible + -- within a paragraph. + local lang = "french" + if thincolonspace then + lang = lang.."-thincolon" end - return false -end - --- idem -local function somepenalty(n,value) - if n then - local id = n.id - if id == penalty_code then - if value then - return n.penalty == value - else - return true - end - end + if autospaceguillemets then + lang = lang.."-autospace" end - return false -end -local xpgfrptattr = luatexbase.attributes['xpg@frpt'] - -local left=1 -local right=2 -local byte = unicode.utf8.byte - --- Now there is a good question: how do we now, in lua, what a \thinspace is? --- In the LaTeX source (ltspace.dtx) it is defined as: --- \def\thinspace{\kern .16667em }. I see no way of seeing if it has been --- overriden or not... So we stick to this value. -local thinspace = 0.16667 --- thickspace is defined in amsmath.sty as: --- \renewcommand{\;}{\mspace+\thickmuskip{.2777em}}. Same problem as above, we --- stick to this fixed value. -local thickspace = 0.2777 -- 5/18 - -local mappings = { - [byte(':')] = {left, thickspace}, --really? - [byte('!')] = {left, thinspace}, - [byte('?')] = {left, thinspace}, - [byte(';')] = {left, thinspace}, - [byte('‼')] = {left, thinspace}, - [byte('⁇')] = {left, thinspace}, - [byte('⁈')] = {left, thinspace}, - [byte('⁉')] = {left, thinspace}, - [byte('»')] = {left, thinspace}, - [byte('›')] = {left, thinspace}, - [byte('«')] = {right, thinspace}, - [byte('‹')] = {right, thinspace}, - } + polyglossia.activate_punct(lang) + polyglossia.clear_spaced_characters(lang) -local function set_spacings(thinsp, thicksp) - for _, m in pairs(mappings) do - if m[2] == thinspace then - m[2] = thinsp - elseif m[2] == thickspace then - m[2] = thicksp + if thincolonspace then + set_left_space(lang, ':', 0.5) + else + set_left_space(lang, ':', 1, true) -- stretchable and shrinkable space end - end - thickspace = thicksp - thinspace = thinsp -end --- from typo-spa.lua -local function process(head) - local done = false - local start = head - -- head is always begin of par (whatsit), so we have at least two prev nodes - -- penalty followed by glue - while start do - local id = start.id - if id == glyph_code then - local attr = has_attribute(start, xpgfrptattr) - if attr and attr > 0 then - local char = start.char - local map = mappings[char] - --node.unset_attribute(start, xpgfrptattr) -- needed? - if map then - local quad = get_quad(start.font) -- might be optimized - local prev = start.prev - if map[1] == left and prev then - local prevprev = prev.prev - local somespace = somespace(prev,true) - -- TODO: there is a question here: do we override a preceding space or not?... - if somespace then - local somepenalty = somepenalty(prevprev,10000) - if somepenalty then - head = remove_node(head,prev) - head = remove_node(head,prevprev) - else - head = remove_node(head,prev) - end - end - insert_node_before(head,start,get_penalty_node()) - insert_node_before(head,start,get_kern_node(map[2]*quad)) - done = true - end - local next = start.next - if map[1] == right and next then - local nextnext = next.next - local somepenalty = somepenalty(next,10000) - if somepenalty then - local somespace = somespace(nextnext,true) - if somespace then - 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) - end - end - insert_node_after(head,start,get_kern_node(map[2]*quad)) - insert_node_after(head,start,get_penalty_node()) - done = true - end - end - end - elseif id == math_code then - -- warning: this is a feature of luatex > 0.76 - start = end_of_math(start) -- weird, can return nil .. no math end? - end - if start then - start = start.next - end + set_left_space(lang, '!', 0.5) + set_left_space(lang, '?', 0.5) + set_left_space(lang, ';', 0.5) + set_left_space(lang, '‼', 0.5) + set_left_space(lang, '⁇', 0.5) + set_left_space(lang, '⁈', 0.5) + set_left_space(lang, '⁉', 0.5) + + if autospaceguillemets then + set_left_space(lang, '»', 0.5) + set_left_space(lang, '›', 0.5) + set_right_space(lang, '«', 0.5) + set_right_space(lang, '‹', 0.5) end - return head, done -end - -local callback_name = "pre_linebreak_filter" - -local function activate() - if not priority_in_callback (callback_name, "polyglossia-frpt.process") then - add_to_callback(callback_name, process, "polyglossia-frpt.process", 1) - end end -local function desactivate() - if priority_in_callback (callback_name, "polyglossia-frpt.process") then - remove_from_callback(callback_name, "polyglossia-frpt.process") - end +local function deactivate_french_punct() + polyglossia.deactivate_punct() end -polyglossia.activate_frpt = activate -polyglossia.desactivate_frpt = desactivate -polyglossia.set_spacings = set_spacings -polyglossia.thinspace = thinspace -polyglossia.thickspace = thickpace +polyglossia.activate_french_punct = activate_french_punct +polyglossia.deactivate_french_punct = deactivate_french_punct % \end{macrocode} % \iffalse -%</polyglossia-frpt.lua> +%</polyglossia-french.lua> %<*polyglossia-korean.lua> % \fi % \clearpage @@ -12641,6 +15071,399 @@ prepend_to_callback ("hpack_filter", % \end{macrocode} % \iffalse %</polyglossia-korean.lua> +%<*polyglossia-latin.lua> +% \fi +% \clearpage +% +% \subsection{polyglossia-latin.lua} +% \begin{macrocode} +require('polyglossia-punct') + +-- For ecclesiastic Latin (and sometimes for Italian) a very small space is +-- used for the punctuation. The ecclesiastic package uses a space of +-- 0.3\fontdimen2, where \fontdimen2 is a interword space, which is typically +-- between 1/4 and 1/3 of a quad. We choose a half of a \thinspace here. +local hairspace = 0.08333 -- 1/12 + +local function activate_latin_punct() + polyglossia.activate_punct('latin') + polyglossia.clear_spaced_characters('latin') + polyglossia.add_left_spaced_character('latin',':',hairspace,'quad') + polyglossia.add_left_spaced_character('latin','!',hairspace,'quad') + polyglossia.add_left_spaced_character('latin','?',hairspace,'quad') + polyglossia.add_left_spaced_character('latin',';',hairspace,'quad') + polyglossia.add_left_spaced_character('latin','‼',hairspace,'quad') + polyglossia.add_left_spaced_character('latin','⁇',hairspace,'quad') + polyglossia.add_left_spaced_character('latin','⁈',hairspace,'quad') + polyglossia.add_left_spaced_character('latin','⁉',hairspace,'quad') + polyglossia.add_left_spaced_character('latin','»',hairspace,'quad') + polyglossia.add_left_spaced_character('latin','›',hairspace,'quad') + polyglossia.add_right_spaced_character('latin','«',hairspace,'quad') + polyglossia.add_right_spaced_character('latin','‹',hairspace,'quad') +end + +local function deactivate_latin_punct() + polyglossia.deactivate_punct() +end + +polyglossia.activate_latin_punct = activate_latin_punct +polyglossia.deactivate_latin_punct = deactivate_latin_punct +% \end{macrocode} +% \iffalse +%</polyglossia-latin.lua> +%<*polyglossia-punct.lua> +% \fi +% \clearpage +% +% \subsection{polyglossia-punct.lua} +% \begin{macrocode} +require('polyglossia') -- just in case... + +local add_to_callback = luatexbase.add_to_callback +local remove_from_callback = luatexbase.remove_from_callback +local priority_in_callback = luatexbase.priority_in_callback +local new_attribute = luatexbase.new_attribute + +local node = node + +local insert_node_before = node.insert_before +local insert_node_after = node.insert_after +local remove_node = node.remove +local has_attribute = node.has_attribute +local node_copy = node.copy +local new_node = node.new +local end_of_math = node.end_of_math +local getnext = node.getnext +local getprev = node.getprev + +-- node types according to node.types() +local glue_code = node.id"glue" +local glyph_code = node.id"glyph" +local penalty_code = node.id"penalty" +local kern_code = node.id"kern" +local math_code = node.id"math" + +-- we need some node subtypes +local userkern = 1 +local userskip = 0 +local removable_skip = { + [0] = true, -- userskip + [13] = true, -- spaceskip + [14] = true, -- xspaceskip +} + +-- we make a new node, so that we can copy it later on +local kern_node = new_node(kern_code) +kern_node.subtype = userkern -- this kern can be removed later on + +local function get_kern_node(dim) + local n = node_copy(kern_node) + n.kern = dim + return n +end + +local glue_node = new_node(glue_code) +glue_node.subtype = userskip + +local function get_glue_node(dim, stretch, shrink) + local n = node_copy(glue_node) + n.width = dim + n.stretch = stretch + n.shrink = shrink + return n +end + +local penalty_node = new_node(penalty_code) +penalty_node.penalty = 10000 + +local function get_penalty_node() + return node_copy(penalty_node) +end + +-- we have here all possible space characters, referenced by their unicode slot +-- number, taken from char-def.lua +local space_chars = {[32] = true, [160] = true, [5760] = true, [6158] = true, + [8192] = true, [8193] = true, [8194] = true, [8195] = true, [8196] = true, + [8197] = true, [8198] = true, [8199] = true, [8200] = true, [8201] = true, + [8202] = true, [8239] = true, [8287] = true, [12288] = true} + +-- from nodes-tst.lua, adapted +local function somespace(n) + if n then + local id, subtype = n.id, n.subtype + if id == glue_code then + -- it is dangerous to remove all the type of glue + return removable_skip[subtype] + elseif id == kern_code then + -- remove only user's kern + return subtype == userkern + elseif id == glyph_code then + return space_chars[n.char] + end + end +end + +-- we have here all left bracket characters, referenced by their unicode slot +local left_bracket_chars = {[40] = true, [123] = true, [91] = true, [10216] = true} + +local function someleftbracket(n) + if n then + local id = n.id + if id == glyph_code then + return left_bracket_chars[n.char] + end + end +end + +-- we have here all right bracket characters, referenced by their unicode slot +local right_bracket_chars = {[41] = true, [125] = true, [93] = true, [10217] = true} + +local function somerightbracket(n) + if n then + local id = n.id + if id == glyph_code then + return right_bracket_chars[n.char] + end + end +end + +-- idem +local function somepenalty(n, value) + if n then + local id = n.id + if id == penalty_code then + if value then + return n.penalty == value + else + return true + end + end + end +end + +local punct_attr = new_attribute("polyglossia_punct") + +local lang_id = {} +local lang_counter = 0 +local left_space = {} +local right_space = {} + +local function ensure_lang_id(lang) + if not lang_id[lang] then + lang_counter = lang_counter + 1 + lang_id[lang] = lang_counter + end + return lang_id[lang] +end + +local function clear_spaced_characters(lang) + local id = ensure_lang_id(lang) + left_space[id] = {} + right_space[id] = {} +end + +local function illegal_unit(unit) + if unit then + texio.write_nl('Illegal spacing unit "'..unit..'".') + else + texio.write_nl('Spacing unit is a nil value.') + end +end + +local function add_left_spaced_character(lang, char, kern, unit, rubber) +-- The parameter kern is a number meant as a fraction of the unit. +-- The unit can be "quad" (1em) or "space" (interword space). +-- The parameter rubber is a Boolean value indicating if the inserted space is +-- stretchable and shrinkable (only relevant if the unit is "space"). + local id = ensure_lang_id(lang) + if unit == "quad" or unit == "space" then + left_space[id][char] = {} + left_space[id][char]["kern"] = kern + left_space[id][char]["unit"] = unit + left_space[id][char]["rubber"] = rubber + else + illegal_unit(unit) + end +end + +local function add_right_spaced_character(lang, char, kern, unit, rubber) + local id = ensure_lang_id(lang) + if unit == "quad" or unit == "space" then + right_space[id][char] = {} + right_space[id][char]["kern"] = kern + right_space[id][char]["unit"] = unit + right_space[id][char]["rubber"] = rubber + else + illegal_unit(unit) + end +end + +-- from typo-spa.lua, adapted +local function process(head) + local current = head + while current do + local id = current.id + if id == glyph_code then + local attr = has_attribute(current, punct_attr) + if attr then + local char = utf8.char(current.char) -- requires Lua 5.3 + local leftspace = left_space[attr][char] + local rightspace = right_space[attr][char] + if leftspace or rightspace then + local fontparameters = fonts.hashes.parameters[current.font] + local unit, stretch, shrink, spacing_node + if leftspace then + local prev = getprev(current) + local space_exception = false + if prev then + local prevprev = getprev(prev) + -- do not add space after left (opening) bracket + space_exception = someleftbracket(prev) + if somespace(prev) then + -- TODO: there is a question here: do we override a preceding space or not?... + if somepenalty(prevprev, 10000) then + head = remove_node(head, prevprev) + end + head = remove_node(head, prev) + end + end + if leftspace.unit == "quad" then + unit = fontparameters.quad + spacing_node = get_kern_node(leftspace.kern*unit) + elseif leftspace.unit == "space" then + unit = fontparameters.space + if leftspace.rubber then + stretch = leftspace.kern*fontparameters.space_stretch + shrink = leftspace.kern*fontparameters.space_shrink + spacing_node = get_glue_node(leftspace.kern*unit, stretch, shrink) + head = insert_node_before(head, current, get_penalty_node()) + else + spacing_node = get_kern_node(leftspace.kern*unit) + end + end + if not space_exception then + head = insert_node_before(head, current, spacing_node) + end + end + if rightspace then + local next = getnext(current) + local space_exception = false + if next then + -- do not add space before right (closing) bracket + space_exception = somerightbracket(next) + local nextnext = getnext(next) + if somepenalty(next, 10000) and somespace(nextnext) then + head = remove_node(head, next) + head = remove_node(head, nextnext) + elseif somespace(next) then + head = remove_node(head, next) + end + end + if rightspace.unit == "quad" then + unit = fontparameters.quad + spacing_node = get_kern_node(rightspace.kern*unit) + elseif rightspace.unit == "space" then + unit = fontparameters.space + if rightspace.rubber then + stretch = rightspace.kern*fontparameters.space_stretch + shrink = rightspace.kern*fontparameters.space_shrink + spacing_node = get_glue_node(rightspace.kern*unit, stretch, shrink) + if not space_exception then + head, current = insert_node_after(head, current, get_penalty_node()) + end + else + spacing_node = get_kern_node(rightspace.kern*unit) + end + end + if not space_exception then + head, current = insert_node_after(head, current, spacing_node) + end + end + end + end + elseif id == math_code then + -- warning: this is a feature of luatex > 0.76 + current = end_of_math(current) -- weird, can return nil .. no math end? + end + current = getnext(current) -- no error even if current is nil + end + return head +end + +local function activate(lang) + local id = ensure_lang_id(lang) + -- We set the punctuation attribute to a language id here. This is + -- important to be able to intermix languages with different spacings + -- in one paragraph. + tex.setattribute(punct_attr, id) + for _, callback_name in ipairs{ "pre_linebreak_filter", "hpack_filter" } do + if not priority_in_callback(callback_name, "polyglossia-punct.process") then + add_to_callback(callback_name, process, "polyglossia-punct.process", 1) + end + end +end + +local function deactivate() + tex.setattribute(punct_attr, -0x7FFFFFFF) -- this value means "unset" + -- Though it would make compilation slightly faster, it is not possible to + -- safely uncomment the following lines. Imagine the following case: you + -- start a paragraph by some spaced punctuation text, then, in the same + -- paragraph, you change the language to something else, and thus call the + -- following lines. This means that, at the end of the paragraph, the + -- function won't be in the callback, so the beginning of the paragraph + -- won't be processed by it. + -- if priority_in_callback(callback_name, "polyglossia-punct.process") then + -- remove_from_callback(callback_name, "polyglossia-punct.process") + -- end +end + +polyglossia.activate_punct = activate +polyglossia.deactivate_punct = deactivate +polyglossia.add_left_spaced_character = add_left_spaced_character +polyglossia.add_right_spaced_character = add_right_spaced_character +polyglossia.clear_spaced_characters = clear_spaced_characters +% \end{macrocode} +% \iffalse +%</polyglossia-punct.lua> +%<*polyglossia-sanskrit.lua> +% \fi +% \clearpage +% +% \subsection{polyglossia-sanskrit.lua} +% \begin{macrocode} +require('polyglossia-punct') + +-- How do we now, in Lua, what a \thinspace is? In the LaTeX source (latex.ltx) +-- it is defined as: +-- \def\thinspace{\leavevmode@ifvmode\kern .16667em } +-- I see no way of seeing if it has been overriden or not. So we stick to this +-- value. +local thinspace = 0.16667 -- 1/6 + +local function activate_sanskrit_punct() + polyglossia.activate_punct('sanskrit') + polyglossia.clear_spaced_characters('sanskrit') + polyglossia.add_left_spaced_character('sanskrit','!',thinspace,'quad') + polyglossia.add_left_spaced_character('sanskrit','?',thinspace,'quad') + polyglossia.add_left_spaced_character('sanskrit','‼',thinspace,'quad') + polyglossia.add_left_spaced_character('sanskrit','⁇',thinspace,'quad') + polyglossia.add_left_spaced_character('sanskrit','⁈',thinspace,'quad') + polyglossia.add_left_spaced_character('sanskrit','⁉',thinspace,'quad') + polyglossia.add_left_spaced_character('sanskrit',':',thinspace,'quad') + polyglossia.add_left_spaced_character('sanskrit',';',thinspace,'quad') + polyglossia.add_left_spaced_character('sanskrit','।',thinspace,'quad') -- danda, U+0964 + polyglossia.add_left_spaced_character('sanskrit','॥',thinspace,'quad') -- double danda, U+0965 +end + +local function deactivate_sanskrit_punct() + polyglossia.deactivate_punct() +end + +polyglossia.activate_sanskrit_punct = activate_sanskrit_punct +polyglossia.deactivate_sanskrit_punct = deactivate_sanskrit_punct +% \end{macrocode} +% \iffalse +%</polyglossia-sanskrit.lua> %<*polyglossia-tibt.lua> % \fi % \clearpage @@ -12745,10 +15568,6 @@ polyglossia.desactivate_tibt_eol = desactivate % % \subsection{polyglossia.lua} % \begin{macrocode} -require('luatex-hyphen') - -local luatexhyphen = luatexhyphen -local byte = unicode.utf8.byte local module_name = "polyglossia" local polyglossia_module = { @@ -12763,82 +15582,73 @@ local polyglossia_module = { luatexbase.provides_module(polyglossia_module) -local log_info = function(message) - luatexbase.module_info(module_name, message) +local log_info = function(message, ...) + luatexbase.module_info(module_name, message:format(...)) end -local log_warning = function(message) - luatexbase.module_warning(module_name, message) +local log_warn = function(message, ...) + luatexbase.module_warning(module_name, message:format(...)) end polyglossia = polyglossia or {} local polyglossia = polyglossia --- 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 } - -local newloader_available_languages = dofile(kpse.find_file('language.dat.lua')) --- Suggestion by Dohyun Kim on #129 -local t = { } -for k, v in pairs(newloader_available_languages) do - t[k] = v - for _, vv in pairs(v.synonyms) do - t[vv] = v - end -end -newloader_available_languages = t - -local function loadlang(lang, id) - if luatexhyphen.lookupname(lang) then - luatexhyphen.loadlanguage(lang, id) - end -end - local function select_language(lang, id) - loadlang(lang, id) - polyglossia.current_language = lang + polyglossia.current_language = lang end local function set_default_language(lang, id) - polyglossia.default_language = lang + polyglossia.default_language = lang end +local byte = utf8.codepoint -- use standard module of lua 5.3 + local check_char if luaotfload and luaotfload.aux and luaotfload.aux.font_has_glyph then - local font_has_glyph = luaotfload.aux.font_has_glyph - function check_char(chr) - local codepoint = tonumber(chr) - if not codepoint then codepoint = byte(chr) end - if font_has_glyph(font.current(), codepoint) then - tex.sprint('1') - else - tex.sprint('0') + local font_has_glyph = luaotfload.aux.font_has_glyph + function check_char(chr) + local codepoint = tonumber(chr) or byte(chr) + if font_has_glyph(font.current(), codepoint) then + tex.sprint('1') + else + tex.sprint('0') + end end - end else - local ids = fonts.identifiers or fonts.ids or fonts.hashes.identifiers - function check_char(chr) -- always in current font - local otfdata = ids[font.current()].characters - local codepoint = tonumber(chr) - if not codepoint then codepoint = byte(chr) end - if otfdata and otfdata[codepoint] then - tex.print('1') - else - tex.print('0') - end - end -end - -local function load_frpt() - require('polyglossia-frpt') + function check_char(chr) -- always in current font + local fontid = font.current() + local fontdata = font.getfont(fontid) or font.fonts[fontid] + local chardata = fontdata.characters + local codepoint = tonumber(chr) or byte(chr) + if chardata and chardata[codepoint] then + tex.sprint('1') + else + tex.sprint('0') + end + end end local function load_tibt_eol() require('polyglossia-tibt') end +-- predefined l@nohyphenation or LuaTeX's maximum value for \language +local nohyphid = luatexbase.registernumber'l@nohyphenation' or 16383 + +-- key `nohyphenation` is for .sty file when possibly undefined l@nohyphenation +local newloader_loaded_languages = { nohyphenation = nohyphid } + +local newloader_available_languages = require'language.dat.lua' +-- Suggestion by Dohyun Kim on #129 +local t = { } +for k, v in pairs(newloader_available_languages) do + t[k] = v + for _, vv in pairs(v.synonyms) do + t[vv] = v + end +end +newloader_available_languages = t + -- LaTeX's language register is \count19 local lang_register = 19 @@ -12846,19 +15656,36 @@ local lang_register = 19 local function newloader(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) + local langid = lang.id(loaded_language) + log_info('Language %s already loaded; id is %i', langentry, langid) + return langid else local langdata = newloader_available_languages[langentry] - if langdata and langdata['special'] == 'language0' then return 0 end - if langdata then - local s = "Language data for " .. langentry + + local special = langdata.special + if special then + -- language0 (USenglish) is already included in the format + if special == 'language0' then + return 0 + + -- disabled language should not be used for utf-8 text + elseif special:find'^disabled:' then + log_warn('Hyphenation of language %s %s', langentry, special) + return nohyphid + end + end + + -- language info will be written into the .log file + local s = { "Language data for " .. langentry } for k, v in pairs(langdata) do - s = s .. "\n" .. k .. "\t" .. tostring(v) + if type(v) == 'table' then -- for 'synonyms' + s[#s+1] = k .. "\t" .. table.concat(v,',') + else + s[#s+1] = k .. "\t" .. tostring(v) + end end + log_info(table.concat(s,"\n")) -- -- LaTeX's \newlanguage increases language register (count19), @@ -12880,47 +15707,47 @@ local function newloader(langentry) 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) + local newlangid = math.max(langcnt, langid) -- set language register for possible \newlanguage - tex.setcount('global', lang_register, maxlangid) + tex.setcount('global', lang_register, newlangid) -- 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 - local pattfilepath = kpse.find_file(langdata.patterns) - if pattfilepath then - local pattfile = io.open(pattfilepath) - lang.patterns(langobject, pattfile:read('*all')) - pattfile:close() - end + if langid ~= newlangid then + langobject = lang.new(newlangid) end - if langdata.hyphenation and langdata.hyphenation ~= '' then - local hyphfilepath = kpse.find_file(langdata.hyphenation) - if hyphfilepath then - local hyphfile = io.open(hyphfilepath) - lang.hyphenation(langobject, hyphfile:read('*all')) - hyphfile:close() + + -- load hyphenation patterns and exceptions + for _,v in ipairs{ 'patterns', 'hyphenation' } do + local data = langdata[v] + if data and data ~= '' then + -- cope with comma separated list, such as serbian + for _,vv in ipairs(data:explode',+') do + local filepath = kpse.find_file(vv) + if filepath then + local fh = io.open(filepath) + lang[v](langobject, fh:read'a') + fh:close() + else + log_warn('Hyphenation file %s not found', vv) + end + end end end + newloader_loaded_languages[langentry] = langobject - log_info('Language ' .. langentry .. ' was not yet loaded; created with id ' .. lang.id(langobject)) - return lang.id(langobject) + log_info('Language %s was not yet loaded; created with id %i', + langentry, newlangid) + return newlangid else - log_warning('Language ' .. langentry .. ' not found in language.dat.lua') + log_warn('Language %s not found in language.dat.lua', langentry) return nohyphid end end end -polyglossia.loadlang = loadlang polyglossia.select_language = select_language polyglossia.set_default_language = set_default_language polyglossia.check_char = check_char -polyglossia.load_frpt = load_frpt polyglossia.load_tibt_eol = load_tibt_eol polyglossia.newloader = newloader polyglossia.newloader_loaded_languages = newloader_loaded_languages @@ -12940,7 +15767,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages ¦----------------------------------------------¦ ¦ ¦ - ¦ THE POLYGLOSSIA PACKAGE v1.45 ¦ + ¦ THE POLYGLOSSIA PACKAGE v1.46 ¦ ¦ ¦ ¦ Modern multilingual typesetting ¦ ¦ with XeLaTeX and LuaLaTeX ¦ @@ -12949,8 +15776,8 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages 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 75 different languages, some of which in different regional, -national or scriptal varieties. +includes support for 79 different languages, some of which in different +regional or national varieties, or using a different writing system. Polyglossia makes it possible to automate the following tasks: @@ -12973,25 +15800,69 @@ Polyglossia makes it possible to automate the following tasks: LICENSE -Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2019 Arthur Reutenauer +Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2019 Arthur Reutenauer, +Copyright (c) 2019 Bastien Roucariès, 2019 Jürgen Spitzmüller -Polyglossia is placed under the terms of the LaTeX Project Public Licence -(LPPL), either version 1.3, or, at your option, any later version. See -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. +Except where otherwise noted, Polyglossia is placed under the terms of the MIT licence +(https://opensource.org/licenses/MIT). BUGS 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. +This is more efficient than contacting the maintainer by email as it allows me +to track the issues and follow progress. %</../README> %<*Changelog> +1.46 (15-11-2019) + +New features: + * Add option "indentfirst" to Russian (#78). + * Add options to set and customize French-style itemize item labels to French (#89). + * Polyglossia now understands all babel language names in \setdefaultlanguage, + \setotherlanguage and the language switching commands (#112, #132). + * Add optional localized math operators to Spanish (#123). + * Swap section headings in Hungarian (#344). New option "swapstrings" provides control + over this. + * Introduce macro \setlanguagealias and \setlanguagealias*. + * Introduce language switching command \textlang{lang}{...} (equivalent to \text<lang>, + but also available with \setlanguagealias* which does not define \text<alias>). + * Add support for Afrikaans. + * Add support for Belarusian. + * Add support for Bosnian. + * Add support for Georgian. + * Add Spanish variant "mexican". + * Add babelshorthands as well as options "splithyphens" and "vlna" to Slovak. + * Add Latin language variant "ecclesiastic". + * Add Latin language options "capitalizemonth", "ecclesiasticfootnotes", "hyphenation", + "prosodicshorthands", and "usej". + * Add Latin shorthands for "«", "»", "æ", "Æ", "œ", and "Œ". + * Add French language option "thincolonspace". + +Bug fixes: + * Fix problems with fragile font settings (#24). + * Fix clash of French punctuation spacing with the soul package (#52). + * Re-enable the possibility to pass a macro as main argumente to \setmainlanguage and + \setotherlanguage (#331). + * Fix detection of default \languagevariant (#332). + * Fix LaTeX error with undefined hyphenation pattern (#346). + * Fix some babel shorthand issues by updating the shorthand code from recent babel. + * Fix some problems with French and Latin auto-spacing (#345, #352). + * Fix an expl3 declaration (#348). + +Interface and defaults changes: + * Per TeXLive request, the sub-package cyrillicnumbers.sty has been renamed to + xpg-cyrillicnumbers.sty. + * In Russian, all paragraphs are now indented by default, as common in Russian typography. + The behavior can be opted out by indentfirst=false. + * In Czech, splithyphens and lvna are enabled by default. Also, the option does now work + as well with LuaTeX. + * Changed option name "fraktur" to "blackletter" in German (the former is still available + as an alias). + * In French, high punctuation characters and guillemets are spaced by half an interword + space now instead of a \thinspace (cf. #345). + 1.45 (27-10-2019) New features: @@ -13581,7 +16452,7 @@ Quamquam sermone nativo fungi desinit, cumque nostris diebus perpauci Latine loq مباشرا أو غير مباشر على كثير من اللغات الأخرى في العالم الإسلامي، كالتركية والفارسية والأردية مثلا. -\textfarsi{\bfseries فارسی}\footnote{% +\textlang{farsi}{\bfseries فارسی}\footnote{% از «\LR{\textenglish{\url{http://fa.wikipedia.org/wiki/}}\RL{\ttfamily فارسي}}»} \begin{farsi} یا پارسی، (که دری، فارسی دری، و پارسی دری نیز نامیده میشود) زبانی است که |