summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex
blob: 77c48d2d118f7eb8c224e4eb185ad7ddca61f7b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
% !TeX spellcheck = en_US
% !TeX TS-program = xelatex
\documentclass[11pt]{ltxdoc}
\usepackage{color}
\usepackage{xspace,fancyvrb,booktabs}
\usepackage[neverdecrease]{paralist}
\definecolor{myblue}{rgb}{0.02,0.04,0.48}
\definecolor{lightblue}{rgb}{0.61,.8,.8}
\definecolor{myred}{rgb}{0.65,0.04,0.07}
\usepackage[
    unicode=true,
    bookmarks=true,
    colorlinks=true,
    linkcolor=myblue,
    urlcolor=myblue,
    citecolor=myblue,
    hyperindex=false,
    hyperfootnotes=false,
    pdftitle={Polyglossia: Modern multilingual typesetting with XeLaTeX and LuaLaTeX},
    pdfauthor={F Charette, A Reutenauer, B Roucariès, J Spitzmüller},
    pdfkeywords={xetex, xelatex, luatex, lualatex, multilingual, babel, hyphenation}
    ]{hyperref}
\usepackage{metalogo}
\let\XeTeX\undefined
\let\XeLaTeX\undefined
\usepackage[babelshorthands]{polyglossia}
\usepackage{farsical}
\setmainlanguage[variant=british,ordinalmonthday=false]{english}
\setotherlanguages{arabic,armenian,hebrew,syriac,greek,russian,serbian,catalan}
\usepackage[protrusion]{microtype}
\newcommand*\Cmd[1]{\cmd{#1}\DescribeMacro{#1}\xspace}
\newcommand*\pkg[1]{\textsf{\color{myblue}#1}}
\newcommand*\file[1]{\texttt{\color{myblue}#1}}
\newcommand*\TR[1]{\textcolor{myred}{#1}}
\newcommand*\TX[1]{\hyperref[#1]{\textcolor{myred}{#1}}}
\newcommand*\TB[1]{\textcolor{myblue}{\bf #1}}
\newcommand*\TA[1]{\textsc{\color{myblue}#1}}
\newcommand*\link[1]{\href{#1}{#1}}
\def\eg{\textit{e.g.,}\xspace}
\def\ie{\textit{i.e.,}\xspace}
\def\ca{\textit{ca.}\@\xspace}
\def\Eg{\textit{E.g.,}\xspace}
\def\Ie{\textit{I.e.,}\xspace}
\def\etc{\@ifnextchar.{\textit{etc}}{\textit{etc.}\@\xspace}}

%% Sidenotes  << copied from fontspec.dtx
\newcommand\new[1]{%
  \edef\thisversion{#1}%
  \ifhmode\unskip~\fi{\ifx\thisversion\fileversion\color{blue}\else\color[gray]{0.5}\fi
  $\leftarrow$}%
  \marginpar{\centering
    \small\ifx\thisversion\fileversion\color{blue}\else\color[gray]{0.5}\fi
    \textsf{#1}}}
\newcommand\displaycmd[2]{%
  \\\DescribeMacro{#2}\centerline{\cmd{#1}}}
\renewenvironment{itemize}{\begin{compactitem}[\char"2023]}%[{\fontspec{DejaVu Sans}\char"25BB}]}%
		{\end{compactitem}}
\renewenvironment{enumerate}{\begin{compactenum}}{\end{compactenum}}
\newenvironment{shorthands}{%
	 \begin{list}{}%
	 	{\settowidth{\labelwidth}{MM}%
	 	 \setlength{\leftmargin}{\labelwidth}%
	 	 \addtolength{\leftmargin}{\labelsep}%
	     \renewcommand{\makelabel}[1]{##1\hfil}}}%
	{\end{list}}

% This is to prevent page breaks too short after subsections
\def\condbreak#1{%
	\vskip 0pt plus #1\pagebreak[3]\vskip 0pt plus -#1\relax}
\pretocmd{\subsection}{\condbreak{2\baselineskip}}{}{}

%% fontspec declarations:
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}
\setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono}
\newfontfamily\arabicfont[Script=Arabic]{Amiri}
\newfontfamily\armenianfont[Script=Armenian]{DejaVu Sans}
\newfontfamily\syriacfont[Script=Syriac]{Serto Jerusalem}
\newfontfamily\hebrewfont[Script=Hebrew]{Ezra SIL}

\linespread{1.05}
\frenchspacing
\EnableCrossrefs
\CodelineIndex
\RecordChanges
% COMMENT THE NEXT LINE TO INCLUDE THE CODE
\AtBeginDocument{\OnlyDescription}


\begin{document}
\hyphenation{Kha-li-ghi Reu-ten-auer}
\GetFileInfo{polyglossia.sty}

\title{\textcolor{lightblue}{\Huge\fontspec[LetterSpace=40]{GFS Ambrosia} Πολυγλωσσια}
\\[16pt]
\color{myblue}Polyglossia: Modern multilingual typesetting with \XeLaTeX\ and \LuaLaTeX}
\author{\TA{François Charette} \and \TA{Arthur Reutenauer}\thanks{Current maintainer}
	    \and \TA{Bastien Roucariès} \and \TA{Jürgen Spitzmüller}}
\date{\filedate \qquad \fileversion\\
\footnotesize (\textsc{pdf} file generated on \today)}

\maketitle
\tableofcontents


\DeleteShortVerb{\|}
\MakeShortVerb{\¦}

%\begin{abstract}
%Blablabla
%\end{abstract}


\section{Introduction}

\pkg{Polyglossia} is a package for facilitating multilingual typesetting with
\XeLaTeX\ and (with some exceptions) \LuaLaTeX.  Basically, it
can be used as an alternative to \pkg{babel} for performing the following
tasks automatically:

\begin{enumerate}
\item Loading the appropriate hyphenation patterns.
\item Setting the script and language tags of the current font (if possible and
      available), via the package \pkg{fontspec}.
\item Switching to a font assigned by the user to a particular script or language.
\item Adjusting some typographical conventions according to the current language
      (such as afterindent, frenchindent, spaces before or after punctuation marks,
      etc.).
\item Redefining all document strings (like “chapter”, “figure”, “bibliography”).
\item Adapting the formatting of dates (for non-Gregorian calendars via external
      packages bundled with polyglossia: currently the Hebrew, Islamic and Farsi
      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}.}
\item Ensuring proper directionality if the document contains languages
      that are written from right to left (via the package \pkg{bidi},
      available separately).
\end{enumerate}

Several features of \pkg{babel} that do not make sense in the \XeTeX\ world (like font
encodings, shorthands, etc.) are not supported.
Generally speaking, \pkg{polyglossia} aims to remain as compatible as possible
with the fundamental features of \pkg{babel} while being cleaner, light-weight,
and modern. The package \pkg{antomega} has been very beneficial in our attempt to
reach this objective.

\paragraph{Requirements} The current version of \pkg{polyglossia} makes use of some convenient
macros defined in the \pkg{etoolbox} package by \TA{Philipp Lehmann} and \TA{Joseph Wright}.
Being designed for \XeLaTeX\ and \LuaLaTeX, it obviously also relies on \pkg{fontspec} by
\TA{Will Robertson}. For languages written from right to left, it needs the package \pkg{bidi}
(for \XeTeX) or  \pkg{luabidi} (for \LuaTeX) by \TA{Vafa Khalighi} (\textarabic{وفا خليقي}) and
the \pkg{bidi-tex GitHub Organisation}.
Polyglossia also bundles three packages for calendaric computations (\pkg{hebrewcal},
\pkg{hijrical}, and \pkg{farsical}).


\section{Setting up multilingual documents}

\subsection{Activating languages}

The default language of a document is specified by means of the command
	\displaycmd{\setdefaultlanguage[⟨options⟩]\{⟨lang⟩\}}{\setdefaultlanguage}
(or, equivalently, \Cmd\setmainlanguage).
Secondary languages are specified with
	\displaycmd{\setotherlanguage[⟨options⟩]\{⟨lang⟩\}.}{\setotherlanguage}
All these commands allow you to set language-specific options.\footnote{%
	Section~\ref{specific} documents these options for the respective languages.}
It is also possible to load a series of secondary languages at once (but without options)
using
	\displaycmd{\setotherlanguages\{⟨lang1⟩,⟨lang2⟩,⟨lang3⟩,…\}.}{\setotherlanguages}

All language-specific options can be modified locally by means of the
language-switching commands described in section \ref{languageswitching}.

\paragraph{Note} In general, it is advisable to activate the languages \emph{after} all
packages have been loaded. This is particularly important if you use right-to-left scripts
or languages with babel shorthands.


\subsection{Supported languages}

Table~\ref{tab:lang} lists all languages currently supported.
Those in red have specific options and/or commands
that are explained in section \ref{specific} below.

\begin{table}[ht]\centering
\label{tab:lang}
% Produced with tools/insert-language-list.rb -- JS, 2019-10-18
% Edited by hand -- JS, 2019-10-18
\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}\\
\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.}
Version 1.1.1\new{v1.1.1} added support for Asturian, %\footnote{ Provided by Kevin Godby and Xuacu Saturio.}, 
Lithuanian, %\footnote{ Provided by Kevin Godby and Paulius Sladkevičius.},
and Urdu. %\footnote{ Provided by Kamal Abdali.}
%
Version 1.2\new{v1.2.0} adds support for Armenian, Occitan, Bengali,
Lao, Malayalam, Marathi, Tamil, Telugu, and Turkmen.\footnote{%
  See acknowledgements at the end for due credit to the various contributors.}
Version 1.43\new{v1.43} silently introduced basic support for Japanese. This
is considered experimental, and feedback is appreciated.
In version 1.45\new{v1.45}, support for Kurdish and Mongolian as well as some new
variants (Canadian French and English) have been added. Furthermore,  for consistency reasons, some language have
been renamed (\emph{farsi}\textrightarrow\emph{persian}, \emph{friulan}\textrightarrow\emph{friulian},
\emph{magyar}\textrightarrow\emph{hungarian}, \emph{portuges}\textrightarrow\emph{portuguese},
\emph{samin}\textrightarrow\emph{sami}) or merged (\emph{bahasai}\slash\emph{bahasam}\textrightarrow\emph{malay},
\emph{brazil}\slash\emph{portuges}\textrightarrow\emph{portuguese},
\emph{lsorbian}\slash\emph{usorbian}\textrightarrow\emph{sorbian},
\emph{irish}\slash\emph{scottish}\textrightarrow\emph{gaelic},
\emph{norsk}\slash\emph{nynorsk}\textrightarrow\emph{norwegian}). The old names are still supported for backwards
compatibility reasons, but they might not give access to newer language features.


\subsection{Relation to Babel languages}

If you are familiar with the \pkg{babel} package, you will note that \pkg{polyglossia}'s language naming
slightly differs. Whereas \pkg{babel} has a unique name for each language variety (\eg\emph{american} and \emph{british}),
\pkg{polyglossia} differentiates language varieties via language options.

Furthermore, \pkg{babel} uses sometimes abbreviations for language names (\eg\emph{bahasam} for Bahasa Malayu) as well
as endonyms, \ie language names coming from the designated languages (such as \emph{bahasa}, \emph{canadien} or \emph{magyar}).
As opposed to this, \pkg{polyglossia} always uses spelled-out (lower-cased) English language names.

Table~\ref{tab:bbllang} lists the language names that differ in both packages. \pkg{Babel} names marked in red can also be used
in \pkg{polyglossia} as an alias.\footnote{This is for historical reasons, since earlier versions of \pkg{polyglossia} used
	those names as well. Note, however, that you need to use the matching language switching commands, then, as
    well, \eg \cmd\textportuges\ with \emph{portuges} (rather than \cmd\textportuguese).}

\begin{table}
\label{tab:bbllang}
\begin{tabular}{lll}
\toprule 
\textbf{Babel name} & \textbf{Polyglossia name} & \textbf{Polyglossia options}\tabularnewline
\midrule
acadien         & french     & variant=acadian                \\
american        & english    & \emph{(default)}               \\
australian      & english    & variant=australian             \\
austrian        & german     & variant=austrian, spelling=old \\
bahasa          & malay      & \emph{(default)}               \\
\TR{bahasam}    & malay      & variant=malaysian              \\
\TR{brazil}     & portuguese & variant=brazilian              \\
british         & english    & variant=british                \\
canadian        & english    & variant=canadian               \\
canadien        & french     & variant=canadian               \\
\TR{farsi}      & persian    &                                \\
\TR{friulan}    & friulian   &                                \\
german          & german     & spelling=old                   \\
\TR{irish}      & gaelic     & variant=irish                  \\
kurmanji        & kurdish    & variant=kurmanji               \\
lowersorbian    & sorbian    & variant=lower                  \\
\TR{magyar}     & hungarian  &                                \\
naustrian       & german     & variant=austrian               \\
newzealand      & english    & variant=newzealand             \\
ngerman         & german     & \emph{(default)}               \\
\TR{norsk}      & norwegian  & variant=bokmal                 \\
nswissgerman    & german     & variant=swiss                  \\
\TR{nynorsk}    & norwegian  & \emph{(default)}               \\
polutonikogreek & greek      & variant=polytonic              \\
\TR{portuges}   & portuguese & \emph{(default)}               \\
\TR{samin}      & sami       &                                \\
\TR{scottish}   & gaelic     & variant=scottish               \\
serbianc        & serbian    & script=Cyrillic                \\
slovene         & slovenian  &                                \\
swissgerman     & german     & variant=swiss, spelling=old    \\
uppersorbian    & sorbian    & variant=upper                  \\
\bottomrule
\end{tabular}
	
\caption{Babel-polyglossia language name matching}
\end{table}


\subsection{Global options}

\pkg{Polyglossia} can be loaded with the following global package options:

\begin{itemize}
	\item \TB{babelshorthands}\new{v1.1.1} globally activates \pkg{babel}
          shorthands whenever available. Currently shorthands are implemented for
          Catalan, Czech, Dutch, Finnish, German, Italian, Mongolian, and Russian.
          Please refer to the respective language descriptions (sec.~\ref{specific}) for details.

    \item \TB{localmarks} redefines the internal \LaTeX\ macros \cmd\markboth\ and \cmd\markright.
          In earlier versions of \pkg{polyglossia},\new{v1.2.0} this option was set by default, but we
          now realize that it causes more problems than it helps, so it is now off by default.
          For backwards-compatibility, the option \TB{nolocalmarks} which used to switch off the previous
          default, and now does nothing, is still available.

    \item \TB{quiet} turns off most info messages and some of the warnings issued by \LaTeX,
          \pkg{fontspec} and \pkg{polyglossia}.
\end{itemize}

\section{Language-switching commands}\label{languageswitching}

\subsection{Recommended commands}
For each activated language the command
\cmd{\text⟨lang⟩[⟨options⟩]\{…\}} \DescribeMacro{\text⟨lang⟩}
becomes available for short insertions of text in that language.
For example ¦\textrussian{\today}¦ yields \textrussian{\today}
This command switches to the correct hyphenation patterns, it activates
some extra features for the selected language (such as extra spacing before
punctuation in French), and it translates the date when using ¦\today¦.
It does not, however, translate so-called \textit{caption strings}, i.\,e.
``chapter'', ``figure'' etc., to the local language (these remain in the main
language).

The\DescribeEnv{⟨lang⟩}\ environment ¦⟨lang⟩¦, which is also available for any activated language,
is meant for longer passages of text. It behaves slightly different than the \cmd{\text⟨lang⟩\{…\}}
command: It does everything the latter does, but additionally, the caption strings are translated
as well, and the language is also passed to auxiliary files, the table of contents and the lists of
figures/tables.
Like the command, the environment provides the possibility of setting language options locally.
For instance the following allows us to quote the beginning
of Homer’s \textit{Iliad}:

\begin{Verbatim}[formatcom=\color{myblue}]
\begin{greek}[variant=ancient]
μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος οὐλομένην, ἣ μυρί' Ἀχαιοῖς ἄλγε'
ἔθηκε, πολλὰς δ' ἰφθίμους ψυχὰς Ἄϊδι προί̈αψεν ἡρώων, αὐτοὺς δὲ ἑλώρια
τεῦχε κύνεσσιν οἰωνοῖσί τε πᾶσι, Διὸς δ' ἐτελείετο βουλή, ἐξ οὗ δὴ τὰ
πρῶτα διαστήτην ἐρίσαντε Ἀτρεί̈δης τε ἄναξ ἀνδρῶν καὶ δῖος Ἀχιλλεύς.
\end{greek}
\end{Verbatim}

\begin{greek}[variant=ancient]
μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος οὐλομένην, ἣ μυρί' Ἀχαιοῖς ἄλγε' ἔθηκε,
πολλὰς δ' ἰφθίμους ψυχὰς Ἄϊδι προί̈αψεν ἡρώων, αὐτοὺς δὲ ἑλώρια τεῦχε κύνεσσιν
οἰωνοῖσί τε πᾶσι, Διὸς δ' ἐτελείετο βουλή, ἐξ οὗ δὴ τὰ πρῶτα διαστήτην ἐρίσαντε
Ἀτρεί̈δης τε ἄναξ ἀνδρῶν καὶ δῖος Ἀχιλλεύς.
\end{greek}
\bigskip

\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}
Some macros defined in \pkg{babel}’s \file{hyphen.cfg} (and thus usually
compiled into the \XeLaTeX\ and \LuaLaTeX\ format) are redefined, but keep a
similar behaviour.
\begin{itemize}
\item \DescribeMacro{\selectlanguage}\cmd{\selectlanguage[⟨options⟩]\{⟨lang⟩\}}
\item \DescribeMacro{\foreignlanguage}\cmd{\foreignlanguage[⟨options⟩]\{⟨lang⟩\}\{…\}}
\item \DescribeEnv{otherlanguage}\cmd{\begin\{otherlanguage\}[⟨options⟩]\{⟨lang⟩\}} \dots{} \cmd{\end\{otherlanguage\}}
\item \DescribeEnv{otherlanguage*}\cmd{\begin\{otherlanguage*\}[⟨options⟩]\{⟨lang⟩\}} \dots{} \cmd{\end\{otherlanguage*\}}
\end{itemize}
%
¦\selectlanguage{⟨lang⟩}¦ and the ¦otherlanguage¦ environment are identical to the
the ¦⟨lang⟩¦ environment, except that ¦\selectlanguage{⟨lang⟩}¦
does not need to be explicitly closed. The command ¦\foreinlanguage{⟨lang⟩}{…}¦ and the ¦otherlanguage*¦
environment are identical with the use of the ¦\text⟨lang⟩¦ command, with the one
notable exception that they do not translate the date with ¦\today¦.

Since the \XeLaTeX\ and \LuaLaTeX\ format incorporate \pkg{babel}’s \file{hyphen.cfg},
the low-level commands for hyphenation and language switching
defined there are also accessible.

\subsection{Other commands}
The following commands are probably of lesser interest to the end user, but
ought to be mentioned here.
\begin{itemize}
\item \Cmd\selectbackgroundlanguage: this selects the global font setup and
	the numbering definitions for the default language.

\item \Cmd\resetdefaultlanguage\ (experimental):
	completely switches the default language
	to another one in the middle of a document: \textit{this may have adverse effects}!

\item \Cmd\normalfontlatin: in an environment where \cmd\normalfont\ has been redefined
	to a non-latin script, this will reset to the font defined with \cmd\setmainfont\ etc.
	In a similar vein, it is possible to use \Cmd\rmfamilylatin, \Cmd\sffamilylatin,
	and \Cmd\ttfamilylatin.

\item \Cmd\latinalph: Representation of counter as a lower-case letter:  1 = a, 2 = b, etc.

\item \Cmd\latinAlph: Representation of counter as a uper-case letter:  1 = A, 2 = B, etc.
\end{itemize}

\section{Font setup}

With polyglossia it is possible to associate a specific font with any script or language
that occurs in the document. That font should always be defined as
¦\⟨script⟩font¦\ or ¦\⟨language⟩font¦.
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,
it can be defined by means of \new{v1.2.0}
¦\⟨script⟩fontsf¦\ or ¦\⟨language⟩fontsf¦ and ¦\⟨script⟩fonttt¦\ or ¦\⟨language⟩fonttt¦, respectively.

Whenever a new language is activated, \pkg{polyglossia} will first check whether
a font has been defined for that language or – for languages in non-Latin scripts –
for the script it uses. If it is not defined, it will use the currently active font
and – in the case of OpenType fonts – will attempt to turn on the appropriate
OpenType tags for the script and language used, in case these are available in
the font, by means of \pkg{fontspec}’s \cmd\addfontfeature. If the current font
does not appear to support the script of that language, an error message is
displayed.

\section{Adapting hyphenation}

\subsection{Hyphenation exceptions}

\TeX\ provides the command ¦\hyphenation{⟨exceptions⟩}¦ to globally define hyphenation exceptions
which override the hyphenation patterns for specified words. The command takes as argument a space-separated
list of words where hyphenation points are marked by a dash (if no dash is used, the respective word is not
hyphenated at all):
\begin{Verbatim}
\hyphenation{%
  po-ly-glos-sia
  LaTeX
}
\end{Verbatim}
%
These exceptions, however, apply to all languages. In addition to this, \pkg{polyglossia} provides
the command\new{v.1.45}
\displaycmd{\pghyphenation[⟨options⟩]\{⟨lang⟩\}\{⟨exceptions⟩\}}{\pghyphenation}
which can be used to define exceptions that only apply to a specific language or language variant,
respectively.

\subsection{Hyphenation disabling}

In some very specific contexts (such as music score creation), \TeX{} hyphenation
is something to avoid as it may cause troubles. \pkg{polyglossia} provides two
functions: \Cmd\disablehyphenation\ and \Cmd\enablehyphenation. Note that if
you select a new language while hyphenation is disabled, it will remain disabled.
If you re-enable it, the hyphenation patterns of the currently selected language
will be activated.

\section{Language-specific options and commands}\label{specific}

This section gives a list of all languages for which options and end-user commands are defined.
The default value of each option is given in italic.

%\subsection{amharic}\label{amharic}

\subsection{arabic}\label{arabic}
\paragraph*{Options:}
	\begin{itemize}
	\item \TB{calendar} = \textit{gregorian} or islamic (= hijri)
	\item \TB{locale} = \textit{default},\footnote{ %
			For Egypt, Sudan, Yemen and the Gulf states.}
		mashriq,\footnote{ %
			For Iraq, Syria, Jordan, Lebanon and Palestine.}
		libya, algeria, tunisia, morocco, or mauritania.
		This setting influences the spelling of the month names for the Gregorian calendar,
		as well as the form of the numerals (unless overriden by the following option).
	\item \TB{numerals} = \textit{mashriq} or maghrib
		(the latter is the default when locale = algeria, tunisia or morocco)
  \item \TB{abjadjimnotail} = \textit{false} or true. \new{v1.0.3}
    Set this to true if you want the \textit{abjad} form of the number three to be \textarabic{ج‍} – as in the manuscript tradition – instead of the modern usage \textarabic{ج}.
	\end{itemize}
\paragraph*{Commands:}
	\begin{itemize}
	\item \Cmd\abjad and \Cmd\abjadmaghribi (see section \ref{abjad})
  \item \Cmd\aemph to emphasize text with ¦\overline¦.\new{v1.2.0}
    ¦\textarabic{\aemph{اب}}¦ yields \textarabic{\aemph{اب}}.
    This command is also available for Farsi, Urdu, etc.
	\end{itemize}

\subsection{armenian}\label{armenian}
\paragraph*{Options:}
\begin{itemize}
	\item \TB{variant}\new{v1.45} = eastern or \textit{western}
	\item \TB{numerals}\new{v1.45} = armenian or \textit{arabic}
\end{itemize}

\subsection[bengali]{bengali\new{v1.2.0}}\label{bengali}
\paragraph*{Options:}
	\begin{itemize}
		\item \TB{numerals} = Western, Bengali or \textit{Devanagari}
		\item \TB{changecounternumbering} = true or \textit{false} (use specified
			numerals for headings and page numbers)
	\end{itemize}

\subsection{catalan}\label{catalan}
\paragraph*{Options:}
\begin{itemize}
  \item \TB{babelshorthands} = \textit{false} or true. \new{v1.1.1}
    Activates the shorthands \texttt{"l} and \texttt{"L} to type geminated l’s.
\end{itemize}

\paragraph*{Commands:}
\begin{itemize}
  \item \Cmd{\l.l} and \Cmd{\L.L}\new{v1.1.1} can be used to type a geminated l, as in \textit{co\l.laborar},
        similar to \pkg{babel} (the glyph U+00B7 MIDDLE DOT is used as a geminating sign).
\end{itemize}

\subsection{czech}\label{czech}

\paragraph*{Options:}
\begin{itemize}
	\item \TB{babelshorthands} = \textit{false} or true. \new{v1.45}
	if this is turned on, the following shorthands for Czech are activated:
	\begin{shorthands}
		\item[¦"=¦] for an explicit hyphen sign which is repeated at the beginning
		            of the next line when hyphenated, as common in Czech typesetting
		            (also see option ¦splithyphens¦).
		\item[¦"‘¦] for Czech left double quotes (looks like ,,).
		\item[¦"’¦] for Czech right double quotes (looks like “).
		\item[¦">¦] for Czech left double guillemets (looks like >>).
		\item[¦"<¦] for Czech right double guillemets (looks like <<).
	\end{shorthands}
	\item \TB{splithyphens} = \textit{false} or true. \new{v1.45}
	      According to Czech typesetting conventions, if a word with a hard hyphen (such as \emph{je-li})
	      is hyphenated at this hyphen, a second hyphenation character is to be inserted at the beginning
	      of the line that follows the hyphenation (\emph{je-/-li}).\\
          If this option is true, this is done automatically (so the shorthand ¦"=¦ is not needed).
          Note, however, that the option is only available for \XeTeX. If you are using \LuaTeX,
          load the \pkg{luavlna} package to the same effect.
    \item \TB{vlna} = \textit{false} or true. \new{v1.45}
         According to Czech typesetting conventions, single-letter words (non-syllable prepositions)
         must not occur at line ends.\\
         If this option is true, this is taken care of. Note, however, that the option
         is only available for \XeTeX. If you are using \LuaTeX, load the \pkg{luavlna} package
         to the same effect.
\end{itemize}

\subsection{dutch}\label{dutch}
\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 Dutch words are activated:
		\begin{shorthands}
		\item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
			        in the hyphenation patterns (as opposed to ¦\-¦ in default \TeX).
		\item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
			        cases where the hyphen should stick at the following syllable.
		\item[¦"|¦] disables a ligature at this position.
		\item[¦""¦] allows for a line break at this position (without hyphenation sign).
		\item[¦"/¦] a slash that allows for a subsequent line break. As opposed to ¦\slash¦,
		            hyphenation at the breakpoints preset in the hyphenation patterns is still allowed.
		\end{shorthands}
        In addition, the macro \Cmd\- is redefined to allow hyphens in the rest of the word (equivalent to ¦"-¦).
\end{itemize}

\subsection{english}\label{english}
\paragraph*{Options:}
	\begin{itemize}
	\item \TB{variant} = \textit{american} (= us), usmax (same as ‘american’ but with additional hyphenation patterns),
	british (= uk), australian, canadian\new{v1.45} or newzealand
	\item \TB{ordinalmonthday} = true/\textit{false} (true by default only when variant = british)
	\end{itemize}

\subsection{esperanto}\label{esperanto}
\paragraph*{Commands:}
	\begin{itemize}
	\item \Cmd\hodiau\ and \Cmd\hodiaun are special forms of \cmd\today. The former produces the date in Esperanto
	      preceded by the article (\emph{la}), which is the most common date format.
	      The latter produces the same date format in accusative case.
	\end{itemize}

\subsection{finnish}\label{finnish}
\paragraph*{Options:}
\begin{itemize}
  \item \TB{babelshorthands} = \textit{false} or true. \new{v1.45}
		if this is turned on, the following shorthands for fine-tuning hyphenation and micro-typography
		of Finnish words are activated:
		\begin{shorthands}
		\item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
                    in the hyphenation patterns (as opposed to ¦\-¦).
        \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
                    cases where the hyphen should stick at the following syllable.
        \item[¦"|¦] disables a ligature at this position.
        \item[¦""¦] allows for a line break at this position (without hyphenation sign).
        \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to ¦\slash¦,
                  hyphenation at the breakpoints preset in the hyphenation patterns is still allowed.
		\end{shorthands}
\end{itemize}

\subsection{french}\label{french}
\paragraph*{Options:}
	\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
		of extra spacing around punctuation and quotation marks (guillemets). By default, polyglossia adds these spaces automatically, so you don't need
		to enter them. This options allows you to switch this feature off globally.
		\item \TB{autospaceguillemets}\footnote{Up to version 1.44, the option was called \textit{automaticspacesaroundguillemets}. For backards compatibility reasons, the more verbose old option is still supported.} = true or \textit{false} (default value = true). If you only want to disable the automatic addition of spacing after opening and before closing guillemets (and not at punctuation), set this to \textit{false}. Note
		that the more general option \textit{autospacing} overrides this.
		\item \TB{autospacetypewriter}\footnote{Babel's syntax \textit{OriginalTypewriter} is also supported.}\new{1.45} = true or \textit{false} (default value = true). By default, automatic spacing is disabled in typewriter font. If this is enabled, spacing in typewriter context is the same as with roman and sans serif font, depending on the \textit{autospacing} and \textit{autospaceguillemets} settings (note that this was the default up to v.~1.44).	
		\item \TB{frenchfootnote} = true or \textit{false} (default value = true). If \textit{true}, footnotes start with a non-superscripted number followed by a dot, as common in French typography. Note that this might interfere with the specific footnote handling of classes or packages.
		Also note that this option is only functional (by design) if French is the main language.
	\end{itemize}
\paragraph*{Commands:}
\begin{itemize}
	\item \Cmd\NoAutoSpacing\new{v1.45} disables automatic spacing around punctuation and quotation marks in all following text. The command can also be used locally if braces are used for grouping: ¦{\NoAutoSpacing foo:bar}¦
	\item \Cmd\AutoSpacing\new{v1.45} enables automatic spacing around punctuation and quotation marks in all following text. The command can also be used locally if braces are used for grouping: ¦{\AutoSpacing regarde!}¦
\end{itemize}

\subsection[gaelic]{gaelic\new{v1.45}}\label{gaelic}
\paragraph*{Options:}
\begin{itemize}
	\item \TB{variant} = \textit{irish} or scottish
\end{itemize}

\subsection{german}\label{german}
\paragraph*{Options:}
	\begin{itemize}
	\item\TB{variant} = \textit{german}, austrian or swiss.\new{v1.33.4}
		Setting variant=austrian or variant=swiss uses some lexical variants.
		With spelling=old, variant=swiss furthermore loads specific hyphenation
		patterns.
	\item \TB{spelling} = \textit{new} (= 1996) or old (= 1901):
		indicates whether hyphenation patterns for traditional (1901) or reformed
		(1996) orthography should be used. The latter is the default.
	\item \TB{latesthyphen} = \textit{false} or true: if this option is set to true,
		the latest (experimental) hyphenation patterns ‘(n)german-x-latest’
		will be loaded instead of ‘german’ or ‘ngerman’. NB: This is based on
		the file \texttt{language.dat} that comes with \TeX Live 2008 and later.
	\item\TB{babelshorthands} = \textit{false} or true: \new{v1.0.3}
		if this is turned on, all shorthands defined in \pkg{babel}
		for fine-tuning hyphenation and micro-typography of German words are activated.
		\begin{shorthands}
		\item[¦"ck¦] for ¦ck¦ to be hyphenated as ¦k-k¦ (1901 spelling).
		\item[¦"ff¦] for ¦ff¦ to be hyphenated as ¦ff-f¦ (1901 spelling); this is also available
		           for the letters l, m, n, p, r and t.
		\item[¦"|¦] disables a ligature at this position (\eg ¦Auf"|lage¦).
		\item[¦"=¦] for an explicit hyphen with a breakpoint, allowing for hyphenation at the
		           other points preset in the hyphenation patterns (as opposed to plain ¦-¦).
		\item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
		           cases where the hyphen should stick at the following syllable,\eg ¦bergauf und "~ab¦.
		\item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
		           in the hyphenation patterns (as opposed to ¦\-¦).
		\item[¦""¦] allows for a line break at this position (without hyphenation sign); 
		           \eg ¦(pseudo"~)""wissenschaftlich¦.
		\item[¦"/¦] a slash that allows for a subsequent line break. As opposed to ¦\slash¦, hyphenation at the breakpoints
		           preset in the hyphenation patterns is still allowed.
		\end{shorthands}

		There are also four shorthands for quotation signs:
		\begin{shorthands}
		\item[¦"`¦] for German left double quotes („)
		\item[¦"'¦] for German right double quotes (“)
		\item[¦"<¦] for French left double quotes («)
		\item[¦">¦] for French right double quotes (»).
		\end{shorthands}
	\item\TB{script} = \textit{latin} or fraktur.\new{v1.2.0}
		Setting script=fraktur modifies the captions for typesetting German in Fraktur.
	\end{itemize}

\subsection{greek}\label{greek}
\paragraph*{Options:}
	\begin{itemize}
	\item \TB{variant} = \textit{monotonic} (= mono), polytonic (= poly), or ancient
	\item \TB{numerals} = \textit{greek} or arabic
	\item \TB{attic} = \textit{false}/true
	\end{itemize}
\paragraph*{Commands:}
	\begin{itemize}
	\item \Cmd\Greeknumber and \Cmd\greeknumber \ (see section \ref{abjad}).
	\item The command \Cmd\atticnumeral (= \Cmd\atticnum) (activated with
	  the option ¦attic=true¦), displays numbers using the acrophonic
          numbering system (defined in the Unicode range
	  \textsf{U+10140–U+10174}).\footnote{ %
	  	See the documentation of the \pkg{xgreek} package for more details.}
	\end{itemize}

\subsection{hebrew}\label{hebrew}
\paragraph*{Options:}
	\begin{itemize}
	\item \TB{numerals} = hebrew or \textit{arabic}
	\item \TB{calendar} = hebrew or \textit{gregorian}
	\item \TB{marcheshvan} = true or \textit{false} (default value = true). If true, the second month of the civil year will be output as \texthebrew{מרחשון} (Marcheshvan)
	rather than \texthebrew{חשון} (Heshvan), which is the default.
	\end{itemize}
\paragraph*{Commands:}
	\begin{itemize}
	\item \Cmd\hebrewnumeral\ (= \Cmd\hebrewalph) (see section \ref{abjad}).
  \item \Cmd\aemph (see section \ref{arabic}).
	\end{itemize}

\subsection[hindi]{hindi\new{v1.2.0}}\label{hindi}
\paragraph*{Options:}
	\begin{itemize}
    \item \TB{numerals} = Western or \textit{Devanagari}
	\end{itemize}

\subsection{hungarian}\label{hungarian}
\paragraph*{Commands:}
\begin{itemize}
	\item \Cmd\ontoday\ (= \Cmd\ondatehungarian): special form of \cmd\today\ which produces a slightly different
	date format as used in prepositional phrases (such as ‘on February 10th’) in Hungarian.
\end{itemize}

\subsection{italian}\label{italian}
\paragraph*{Options:}
\begin{itemize}
  \item \TB{babelshorthands} = \textit{false} or true. \new{v1.2.0cc}% TODO: check version
  Activates the ¦"¦ character as a switch to perform etymological
  hyphenation when followed by a letter. Furthermore, the following shorthands are activated:
  \begin{shorthands}
  	\item[¦""¦] double raised open quotes (the Italian keyboard misses the backtick).
  	\item[¦"<¦] open guillemet (looks like <<).
  	\item[¦">¦] closing guillemet (looks like >>).
  	\item[¦"/¦] a slash that allows for a subsequent line break. As opposed to ¦\slash¦,
               hyphenation at the breakpoints preset in the hyphenation patterns is still allowed.
  	\item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
               in the hyphenation patterns (as opposed to ¦\-¦).
  \end{shorthands}
\end{itemize}

\subsection[korean]{korean\new{v1.40.0}}\label{korean}
\paragraph*{Options:}
  \begin{itemize}
  \item \TB{variant} = \textit{plain}, classic or modern:
    for spacing before/after CJK punctuations.
    `classic' is suitable for text with no interword spaces,
    `modern' for text with interword spaces.
  \item \TB{captions} = \textit{hangul} or hanja
  \end{itemize}

\subsection[kurdish]{kurdish\new{v1.45}}\label{kurdish}
Kurdish support includes Sorani Kurdish and Kurmanji Kurdish, both in either Arabic or Latin script.

\paragraph*{Options:}
\begin{itemize}
	\item \TB{variant} = kurmanji or \textit{sorani}
	\item \TB{script} = Arabic or Latin. Defaults are ¦Arabic¦ for Sorani and ¦Latin¦ for Kurmanji.
	\item \TB{numerals} = western or eastern. Defaults are ¦western¦ for Latin and ¦eastern¦ for Arabic script, depending on the selection above.
	\item \TB{abjadjimnotail} = \textit{false} or true.
	Set this to true if you want the \textit{abjad} form of the number three to be \textarabic{ج‍} – as in the manuscript tradition – instead of the modern usage \textarabic{ج}.
	\item \TB{locale} (not yet implemented)
	\item \TB{calendar} (not yet implemented)
\end{itemize}
\paragraph*{Commands:}
\begin{itemize}
	\item \Cmd\ontoday: special form of \cmd\today\ which produces a slightly different
	date format as used in prepositional phrases (as in ‘on February 10th’). Only available for Latin script.
	\item \Cmd\abjad (see section \ref{abjad})
	\item \Cmd\aemph (see section \ref{arabic})
\end{itemize}

\subsection[lao]{lao\new{v1.2.0}}\label{lao}
\paragraph*{Options:}
	\begin{itemize}
	\item \TB{numerals} = lao or \textit{arabic}
	\end{itemize}

\subsection{latin}\label{latin}
\paragraph*{Options:}
	\begin{itemize}
	\item \TB{variant} = classic, medieval or \textit{modern}
	\end{itemize}

\subsection{malay}\label{malay}
\paragraph*{Options:}
\begin{itemize}
	\item \TB{variant}\new{v1.45} = \textit{indonesian} (=~bahasai in \pkg{babel}) or
	malaysian (=~bahasam in \pkg{babel})
\end{itemize}

\subsection[mongolian]{mongolian\new{v1.45}}\label{mongolian}
Currently, only the Khalkha variety in Cyrillic script is supported.

\paragraph*{Options:}
\begin{itemize}
	\item \TB{babelshorthands} = \textit{false} or true.
	If this is turned on, the following shorthands are activated:
	\begin{shorthands}
        \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
		           in the hyphenation patterns (as opposed to ¦\-¦).
		\item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
		           cases where the hyphen should stick at the following syllable.
		\item[¦"|¦] disables a ligature at this position.
		\item[¦""¦] allows for a line break at this position (without hyphenation sign).
		\item[¦"---¦] Cyrillic emdash in plain text.
		\item[¦"--~¦] Cyrillic emdash in compound names (surnames).
		\item[¦"--*¦] Cyrillic emdash for denoting direct speech.
		\item[¦",¦] thinspace for initials with a breakpoint in following surname.
		\item[¦"‘¦] for German left double quotes (looks like ,,).
		\item[¦"’¦] for German right double quotes (looks like “).
		\item[¦"<¦] for French left double quotes (looks like <<).
		\item[¦">¦] for French right double quotes (looks like >>).
	\end{shorthands}
	\item \TB{numerals} = \textit{arabic} or cyrillic. Uses either Arabic numerals or Cyrillic
	alphanumerical numbering.
\end{itemize}
%
\paragraph*{Commands:}
\begin{itemize}
	\item \Cmd\Asbuk: produces uppercased Cyrillic alphanumerals, for
	environments such as ¦enumerate¦. The command takes a counter as argument,
	\eg ¦\textrussian{\Asbuk{page}}¦ produces \textrussian{\Asbuk{page}}.
	\item \Cmd\asbuk: same in lowercase
\end{itemize}

\subsection{norwegian}\label{norwegian}
\paragraph*{Options:}
\begin{itemize}
	\item \TB{variant}\new{v1.45} = bokmal (=~`norsk' in \pkg{babel}) or \textit{nynorsk}
\end{itemize}

\subsection{persian}\label{persian}
\paragraph*{Options:}
\begin{itemize}
	\item \TB{numerals} = western or \textit{eastern}
	\item \TB{abjadjimnotail} = \textit{false} or true. \new{v1.0.3}
	Set this to true if you want the \textit{abjad} form of the number three to be \textarabic{ج‍} – as in the manuscript tradition – instead of the modern usage \textarabic{ج}.
	\item \TB{locale} (not yet implemented)
	\item \TB{calendar} (not yet implemented)
\end{itemize}
\paragraph*{Commands:}
\begin{itemize}
	\item \Cmd\abjad (see section \ref{abjad})
	\item \Cmd\aemph (see section \ref{arabic}).
\end{itemize}

\subsection{portuguese}\label{portuguese}
\paragraph*{Options:}
\begin{itemize}
	\item \TB{variant}\new{v1.45} = brazilian or \textit{portuguese}
\end{itemize}

\subsection{russian}\label{russian}
\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.
% These are commented out in gloss-russian
%		\item[¦",¦] thinspace for initials with a breakpoint in following surname.
%		\item[¦"‘¦] for German left double quotes (looks like ,,).
%		\item[¦"’¦] for German right double quotes (looks like “).
%		\item[¦"<¦] for French left double quotes (looks like <<).
%		\item[¦">¦] for French right double quotes (looks like >>).
	\end{shorthands}
	\item \TB{spelling} = \textit{modern} or old (for captions and date only, not for hyphenation)
	\item \TB{numerals} = \textit{arabic} or cyrillic. Uses either Arabic numerals or Cyrillic
	alphanumerical numbering.
	\end{itemize}
%
\paragraph*{Commands:}
	\begin{itemize}
	\item \Cmd\Asbuk: produces uppercased Cyrillic alphanumerals, for
	environments such as ¦enumerate¦. The command takes a counter as argument,
	\eg ¦\textrussian{\Asbuk{page}}¦ produces \textrussian{\Asbuk{page}}.
	\item \Cmd\asbuk: same in lowercase
	\end{itemize}

\subsection[sami]{sami\new{v1.45}}\label{sami}
Currently support for Sami is limited to Northern Sami.

\subsection{sanskrit}\label{sanskrit}
\paragraph*{Options:}
	\begin{itemize}
	\item \TB{Script} = \textit{Devanagari}\new{v1.0.2}, Gujarati, Malayalam, Bengali, Kannada,
	Telugu or Latin.
	The value is passed to \pkg{fontspec} in cases where the respective ¦\<script>font¦ is not defined.
	This can be useful if you typeset Sanskrit texts in scripts other than Devanagari.
	\item \TB{Numerals} = \textit{Devanagari}\new{v1.45} or Western
	\end{itemize}
 
\subsection{serbian}\label{serbian}
\paragraph*{Options:}
	\begin{itemize}
	\item \TB{Script} = \textit{Cyrillic} or Latin. Will likely go to a variant.
	\item \TB{numerals} = \textit{arabic} or cyrillic. Uses either Arabic numerals or Cyrillic
	      alphanumerical numbering.
	\end{itemize}
\paragraph*{Commands:}
\begin{itemize}
	\item \Cmd\Asbuk: produces uppercased Cyrillic alphanumerals, for
	environments such as ¦enumerate¦. The command takes a counter as argument,\\
	Example: ¦\textserbian[numerals=cyrillic]{\Asbuk{page}}¦ produces \textserbian[numerals=cyrillic]{\Asbuk{page}}.
	\item \Cmd\asbuk: same in lowercase
\end{itemize}


\subsection{slovenian}\label{slovenian}
\paragraph*{Options:}
	\begin{itemize}
	\item \TB{localalph} = true or \textit{false}
	\end{itemize}

\subsection{sorbian}\label{sorbian}
\paragraph*{Options:}
\begin{itemize}
	\item \TB{variant}\new{v1.45} = lower or \textit{upper}
	\item \TB{olddate}\new{v1.45} = true or \textit{false} (default value = true). If true, ¦\today¦
	      will use traditional Sorbian month names (\ie it will be synonymous to ¦\oldtoday¦ below)
\end{itemize}
\paragraph*{Commands:}
\begin{itemize}
	\item \Cmd\oldtoday: outputs the current date using traditional Sorbian month names, even if \TB{olddate} is false.
\end{itemize}

\subsection{syriac}\label{syriac}
\paragraph*{Options:}
	\begin{itemize}
	\item \TB{numerals} = \textit{western} (i.e., 1234567890), eastern
		(for which the Oriental Arabic numerals are used: \textarabic{١٢٣٤٥٦٧٨٩٠}),
		or abjad. \new{v1.0.1}.
	\end{itemize}
\paragraph*{Commands:}
	\begin{itemize}
	\item \Cmd\abjadsyriac (see section \ref{abjad})
  \item \Cmd\aemph (see section \ref{arabic}).
	\end{itemize}

\subsection{thai}\label{thai}
\paragraph*{Options:}
	\begin{itemize}
	\item \TB{numerals} = thai or \textit{arabic}
	\end{itemize}
%
To insert word breaks, you need to use an external processor.
See the documentation to \pkg{thai-latex} and the file \file{testthai.tex}
that comes with this package.

\subsection{tibetan}\label{tibetan}
\paragraph*{Options:}
\begin{itemize}
	\item \TB{numerals} = tibetan or \textit{arabic}
\end{itemize}

\subsection{ukrainian}\label{ukrainian}
\paragraph*{Commands:}
	\begin{itemize}
	\item \Cmd\Asbuk: produces the uppercase Ukrainian alphabet, for
	environments such as ¦enumerate¦
	\item \Cmd\asbuk: same in lowercase
	\end{itemize}

\subsection{welsh}\label{welsh}
\paragraph*{Options:}
	\begin{itemize}
	\item \TB{date} = long or \textit{short}
	\end{itemize}


\section{Modifying or extending captions, date formats and language settings}

\pkg{Polyglossia} uses the following macros to define language-specific captions
(\ie strings such as ``chapter''), date formats and additional language settings
(¦⟨lang⟩¦ is to be replaces with the respective language name):

\begin{itemize}
	\item \Cmd{\captions⟨lang⟩} stores definitions of caption strings
	           (such as, in the case of English, ¦\def\chaptername{Chapter}¦)
	\item \Cmd{\date⟨lang⟩} stores definitions of date formats (usually redefinitions
	           of ¦\today¦, in some cases also definitions of additional date commands)
	\item \Cmd{\blockextras⟨lang⟩} stores macros that are to be executed when the language
              ⟨lang⟩ is activated via ¦\selectlanguage¦ command or the ¦⟨lang⟩¦ environment
	\item \Cmd{\inlineextras⟨lang⟩} stores macros that are to be executed when the language
	          ⟨lang⟩ is activated locally via ¦\text⟨lang⟩¦ command
	\item \Cmd{\noextras⟨lang⟩} stores macros that are to be executed when the language
	          ¦⟨lang⟩¦ is closed 
\end{itemize} 
%
In order to redefine internal macros, we recommend to use the command ¦\gappto¦.
For compatibility with \pkg{babel} the command ¦\addto¦ is also available
to the same effect. For instance, to change the ¦\chaptername¦ for language ¦lingua¦,
you can do this:
\begin{verbatim}
\gappto\captionslingua{\def\chaptername{Caput}}
\end{verbatim}
%
Note that this needs to be done after the respective language has been loaded with
¦\setmainlanguage¦ or ¦\setotherlanguage¦.

Specifically for package authors, analogous commands are provided which are only executed
if a specific language \emph{variety} is used. As opposed to the macros above, these refer
to babel names. Other than that, the function is identical:

\begin{itemize}
	\item \Cmd{\captions@bbl@⟨babelname⟩} 
	\item \Cmd{\date@bbl@⟨babelname⟩}
	\item \Cmd{\blockextras@bbl@⟨babelname⟩}
	\item \Cmd{\inlineextras@bbl@⟨babelname⟩}
	\item \Cmd{\noextras@bbl@⟨babelname⟩} 
\end{itemize}
%
By default, these macros are undefined. If they are defined (\eg by an external package),
they will be executed after their respective ¦⟨lang⟩¦ counterpart and thus can be used to
overwrite definitions of the former. Again, use ¦\gappto¦ to define\slash modify these macros.
For instance, to add a new caption ¦\footnotename¦ to the Swiss variety of German (babel name
¦nswissgerman¦), you can do this:
\begin{verbatim}
\gappto\captions@bbl@nswissgerman{\def\footnotename{Fussnote}}
\end{verbatim}
%
If you do this in a document preamble rather than in a package, you need to embrace the redefinition
by ¦\makeatletter¦ and ¦\makeatother¦ due to the ¦@¦ in the macro names.

\section{Script-specific numbering}

Languages and scripts have specific numbering conventions. Some use decimal digits
(\eg Arabic numerals), some use alphabetic or alphanumerical notation (\eg Roman numbering).
In some cases, different conventions are available (\eg Mashriq or Maghrib numbering
in Arabic script, Arabic or Hebrew [=~alphanumeric] numbering in Hebrew).

If the latter is the case, \pkg{polyglossia} provides language options which allow you to select
or switch to the suitable convention. With the appropriate language option set, \pkg{polyglossia}
will automatically convert the output of internal \LaTeX\ counters to their
localized forms, for instance to display page, chapter and section numbers.

For manual input of numbers, macros are provided. These convert Arabic numeric input to the respective
local decimal digit (see sec.~\ref{sec:decdigit}), alphanumeric representation (see sec.~\ref{abjad})
or whatever is appropriate (see sec.~\ref{sec:localnumber}). The possibilities are described in turn.

\subsection{General localization of numbering}\label{sec:localnumber}

As of 1.45,\new{1.45} \pkg{polyglossia} provides a generic macro \Cmd\localnumeral\ which converts numbers
to the current local form (which might be script-specific decimal digit, an alphabetic numbering or something else).
For instance in an Arabic environment
¦\localnumeral{42}¦ yields \textarabic{\localnumeral{42}}, whereas in an Hebrew environment, it
results in \texthebrew[numerals=hebrew]{\localnumeral{42}} with ¦numerals=hebrew¦, and \texthebrew{\localnumeral{42}}
with ¦numerals=arabic¦. Note that, as opposed to the various ¦digits¦ macros (described in sec.~\ref{sec:decdigit}),
the argument of ¦\localnumeral¦ must consist of numbers only.

For\new{1.45} the conversion of counters, the starred version \Cmd{\localnumeral*} is provided. This takes a counter as argument.
For instance in an Arabic environment ¦\localnumeral*{page}¦ yields \textarabic{\localnumeral*{page}}.

For scripts with alphanumeric numbering, the variants \Cmd{\Localnumeral} and \Cmd{\Localnumeral*} provide the uppercased 
versions.\medskip

\noindent All these macros provide the following options:

\begin{itemize}
	\item \TB{lang} =\DescribeMacro{[lang=]}\ \textit{local}, main, or <language>.\\
	Output number in the local form of the currently active language for ¦local¦, the main language of the document for ¦main¦,
    and any (loaded) language for ¦<language>¦ (\eg ¦\localnumeral[lang=arabic]{42}}¦).
\end{itemize}

\subsection{Non-Western decimal digits}\label{sec:decdigit}

In addition\new{v1.1.1} to the generic macros described above, \pkg{polyglossia} provides language-specific conversion macros
which can be used if the generic ones do not suit the need.\footnote{%
A third method are so-called TECKit fontmappings.
Those can be activated with the \pkg{fontspec} ¦Mapping¦ option,
using ¦arabicdigits¦, ¦farsidigits¦ or ¦thaidigits¦.
For instance if \cmd\arabicfont\ is defined with the option ¦Mapping=arabicdigits¦,
typing \cmd{\textarabic\{2010\}} results in \textarabic{٢٠١٠}. Note that this method has some drawbacks, though,
for instance when the value of a counter has to be written and read from auxiliary files.
So please use this with care.}
The macros have the form ¦\<script>digits¦. They convert Arabic numerical input and leave every other input untouched.
In an Arabic context, for instance, ¦\arabicdigits{9182/738543-X}¦ yields \textarabic{\arabicdigits{9182/738543-X}}.

Currently, the following macros are provided:

\begin{itemize}
	\item \Cmd\arabicdigits
	\item \Cmd\bengalidigits
	\item \Cmd\devanagaridigits
	\item \Cmd\farsidigits
	\item \Cmd\kannadadigits
	\item \Cmd\khmerdigits
	\item \Cmd\laodigits
	\item \Cmd\nkodigits
	\item \Cmd\thaidigits
	\item \Cmd\tibetandigits
\end{itemize}


\subsection{Non-Latin alphabetic numbering}\label{abjad}

For languages which use special (non-Latin) alphanumerical notation\footnote{%
	For instance, see \url{http://en.wikipedia.org/wiki/Greek_numerals},
	\url{http://en.wikipedia.org/wiki/Abjad_numerals},
	\url{http://en.wikipedia.org/wiki/Hebrew_numerals},
	and \url{http://en.wikipedia.org/wiki/Syriac_alphabet}.}, dedicated macros are provided.

They work in a similar way than the ¦\<script>digits¦ macros described above: They take Arabic numerical input
and output the respective value in the local alphabetic numbering scheme (most of these macros are equivalent
to ¦\localnumeral¦ and ¦\Localnumeral¦ in the respective context).

The following macros are provided:

\begin{itemize}
    \item \Cmd\abjad outputs Arabic \textit{abjad} numbers according to the Mashriq varieties.
			Example: ¦\abjad{1863}¦ yields \textarabic{\abjad{1863}}.
			
	\item \Cmd\abjadmaghribi outputs Arabic \textit{abjad} numbers according to the Maghrib varieties.
			Example: ¦\abjadmaghribi{1863}¦ yields \textarabic{\abjadmaghribi{1863}}.
			
	\item \Cmd\abjadsyriac outputs Syriac abjad numerals.\footnote{%
				A fine guide to numerals in Syriac can be found at \link{http://www.garzo.co.uk/documents/syriac-numerals.pdf}.}\\
			Example: ¦\abjadsyriac{463}¦ yields \textsyriac{\abjadsyriac{463}}.
	
	\item \Cmd\armeniannumeral produces Armenian alphabetic numbering.
	          Example: ¦\armeniannumeral{1863}¦ yields \textarmenian{\armeniannumeral{1863}}.

	\item \Cmd\greeknumeral produces Greek alphabetic numbering, \Cmd\Greeknumeral outputs uppercased variants.
			Example: ¦\greeknumeral{1863}¦ yields \textgreek{\greeknumeral{1863}},
			¦\Greeknumeral{1863}¦ results in \textgreek{\Greeknumeral{1863}}.

	\item \Cmd\hebrewnumeral, \Cmd\Hebrewnumeral and \Cmd\Hebrewnumeralfinal generate variants of Hebrew alphanumeric numerals.
			The commands behave exactly as they do in \pkg{babel}: ¦\hebrewnumeral¦ outputs the numbers without any decoration,
			¦\Hebrewnumeral¦ adds \textit{gereshayim} before the last letter, ¦\Hebrewnumeralfinal¦ uses in addition the final forms of Hebrew letters.
			Examples:
			¦\hebrewnumeral{1750}¦ yields \texthebrew{\hebrewnumeral{1750}},
			¦\Hebrewnumeral{1750}¦ yields \texthebrew{\Hebrewnumeral{1750}},
			and ¦\Hebrewnumeralfinal{1750}¦ yields \texthebrew{\Hebrewnumeralfinal{1750}}.
	
	\item \Cmd\russiannumeral produces Russian numbering, with uppercased variant (for alphanumerical variant) via \Cmd\Russiannumeral.
	        Depending on the ¦numerals¦ option in the Russian language selection, this is either Arabic digit or Cyrillic
	        alphanumercial output.\\
	        Example: With ¦numerals=latin¦ ¦\russiannumeral{19}¦ yields \textrussian{\russiannumeral{19}},
	        with ¦numerals=cyrillic¦ ¦\russiannumeral{19}¦ results in \textrussian[numerals=cyrillic]{\russiannumeral{19}}.
			
	\item \Cmd\serbiannumeral produces Serbian numbering, with uppercased variant (for alphanumerical variant) via \Cmd\Serbiannumeral.
		    Depending on the ¦numerals¦ option in the Serbian language selection, this is either Arabic digit or Cyrillic
		    alphanumercial output.\\
		    Example: With ¦numerals=latin¦ ¦\serbiannumeral{19}¦ yields \textserbian{\serbiannumeral{19}},
			with ¦numerals=cyrillic¦ ¦\serbiannumeral{19}¦ results in \textserbian[numerals=cyrillic]{\serbiannumeral{19}}.
\end{itemize}


\section{Footnotes in right-to-left context}

With languages that use right-to-left scripts, footnote apparatuses are usually placed at the right side of the page bottom.
Consequently, the footnote rule also is to be placed right. Things get more tricky, though, if right-to-left and left-to-right
scripts are mixed. Then you might want to put the footnotes on some pages left, on some right, or even mix positions on a page.
Thus, footnote handling in right-to-left context sometimes needs manual intervention. This is described in what follows.

\subsection{Horizontal footnote position}

When right-to-left languages are used, the ¦\footnote¦ command becomes sensitive to the text directionality. The footnote is
always placed on the side that is currently the origin of direction: on the left side of the page in LTR paragraphs and
on the right in RTL paragraphs.

For cases where this is not desired, two additional footnote commands are provided: \Cmd\RTLfootnote and \Cmd\LTRfootnote.
¦\LTRfootnote¦ always places the footnote on the left side, notwithstanding the current
directionality. Likewise, ¦\RTLfootnote¦ always places it on the right side. Like ¦\footnote¦, ¦\RTLfootnote¦
and ¦\LTRfootnote¦ provide an optional argument to customize the number.


\subsection{Footnote rule length and position}

The default placement of the footnote rule differs in \XeTeX\ and \LuaTeX\ output (this is due to differences in the \textsf{bidi}
and \textsf{luabidi} packages). With \XeTeX, footnote rules are always placed left, which is often wrong in RTL context.
With \LuaTeX, by contrast, the rule is placed always right if the main language is a right-to-left language, and always left
if the main language is a left-to-right language, which is the right thing in many cases.

In both cases, you can change the default behavior as follows:
\begin{itemize}
	\item Put \Cmd\leftfootnoterule in the preamble to have all rules left-aligned.
	\item Put \Cmd\rightfootnoterule in the preamble to have all rules right-aligned.
	\item Put \Cmd\autofootnoterule in the preamble to have automatic placement depending on the context (see below for elaboration).
	\item Put \Cmd\textwidthfootnoterule in the preamble to have a rule that spans the whole text width.
\end{itemize}
With ¦\autofootnoterule¦, the first footnote on the current page determines the placement. Note that this automatic can fail with
footnotes at page boundaries that differ in directionality from the first footnote on the page. You can work around such cases by switching to ¦\rightfootnoterule¦ or ¦\leftfootnoterule¦ on these pages.

Note also that the rule switches might interfere in bad ways with packages or classes that redefine footnotes themselves. This is also the reason
why ¦\autofootnoterule¦ is not used by default.

\section{Calendars}

\subsection{Hebrew calendar (hebrewcal.sty)}
The package \file{hebrewcal.sty} is almost a verbatim copy of \file{hebcal.sty}
that comes with \pkg{babel}.
The command \Cmd\Hebrewtoday\ formats the current date in the Hebrew calendar
(depending of the current writing direction this will automatically set either
in Hebrew script or in roman transliteration).

\subsection{Islamic calendar (hijrical.sty)}
This package computes dates in the lunar Islamic (Hijra) calendar.\footnote{ %
	It makes use of the arithmetical algorithm in chapter 6 of
	Reingold \& Gershowitz, \textit{Calendrical calculation: the Millenium edition}
	(Cambridge University Press, 2001).\label{reingold}}
It provides two macros for the end-user.
The command
	\displaycmd{\HijriFromGregorian\{⟨year⟩\}\{⟨month⟩\}\{⟨day⟩\}}{\HijriFromGregorian}
sets the counters ¦Hijriday¦, ¦Hijrimonth¦ and ¦Hijriyear¦.
\Cmd\Hijritoday\ formats the Hijri date for the current day.
This command is now locale-aware\new{v1.1.1}: its output will differ depending on the
currently active language. Presently \pkg{polyglossia}’s language definition files
for Arabic, Farsi, Urdu, Turkish and Malay provide a localized version of ¦\Hijritoday¦.
If the formatting macro for the current language is undefined, the Hijri date will be formatted
in Arabic or in roman transliteration, depending of the current writing direction.
You can define a new format or redefine one with the command
  \displaycmd{\DefineHijriDateFormat\{<lang>\}\{<code>\}.}{\DefineHijriDateFormat}

The command ¦\Hijritoday¦ also accepts an optional argument to add or subtract a correction
(in days) to the date computed by the arithmetical algorithm.\footnote{ %
	The Islamic calendar is indeed a purely lunar calendar based on the observation
	of the first visibility of the lunar crescent at the beginning of the lunar month,
	so there can be differences between different localities, as well as between
	civil and religious authorities.}
For instance if ¦\Hijritoday¦ yields the date “7 Rajab 1429” (which is the date that was
displayed on the front page of \href{http://www.aljazeera.net}{aljazeera.net} on
11th July 2008), ¦\Hijritoday[1]¦ would rather print “8 Rajab 1429” (the date
indicated the same day on the site \href{http://www.gulfnews.com}{gulfnews.com}).

\subsection{Farsi (jalālī) calendar (farsical.sty)}
This package is an almost verbatim copy of ¦Arabiftoday.sty¦ (in the \pkg{Arabi} package),
itself a slight modification of ¦ftoday.sty¦ in Farsi\TeX.\footnote{ %
	One day I may rewrite \pkg{farsical} from scratch using the algorithm in
	Reingold \& Gershowitz (ref.~n.~\ref{reingold}).}
Here we have renamed the command \cmd\ftoday\ to
\Cmd\Jalalitoday.
Example: today is \Jalalitoday.


%\section{Varia}

\section{Accessing language information}

The following is specifically relevant to package authors who need information about the languages in use.

In order to get such information, \pkg{polyglossia} provides the following macros:

\begin{itemize}
	\item \Cmd\languagename\ stores the currently active (polyglossia) language name.
	\item \Cmd\mainlanguagename\ stores the (polyglossia) language name of the main document language.
	\item \Cmd\languagevariant\ stores the language variant if set. The macro is empty if no variant has been set.
	\item \Cmd\mainlanguagevariant\ stores the language variant of the main document language if set.
	       The macro is empty if no variant has been set.
	\item \Cmd\babelname\ stores the corresponding name of the currently active language (variant) in \pkg{babel}.
	      This might not only be useful if you want to support both \pkg{babel} and \pkg{polyglossia}, but also
	      since this name is unique for a given language variety (\eg ngerman, german, swissgerman etc.).
	      Note that this macro is also defined for languages that are not supported in \pkg{babel}. In that
	      case, they are equal to the polyglossia language name.
	\item \Cmd\mainbabelname\ analogously stores the name of document's main language (variant) in \pkg{babel}.
\end{itemize}
%
If you want to have a full list of loaded languages/variants, use the following macros:
\begin{itemize}
	\item \Cmd{\xpg@loaded}\ stores a comma-separated list of all loaded languages (polyglossia name)
	\item \Cmd{\xpg@vloaded}\ stores a comma-separated list of all loaded variants
	\item \Cmd{\xpg@bloaded}\ stores a comma-separated list of \pkg{babel} names of all language variants 
\end{itemize}
%
Finally, you can test whether a language is loaded by
\displaycmd{\iflanguageloaded\{⟨lang⟩\}\{⟨true⟩\}\{⟨false⟩\}}{\iflanguageloaded}
where \texttt{⟨lang⟩} is a \pkg{polyglossia} language name, or
\displaycmd{\ifbabellanguageloaded\{⟨lang⟩\}\{⟨true⟩\}\{⟨false⟩\}}{\ifbabellanguageloaded}
where \texttt{⟨lang⟩} is a \pkg{babel} language name.

\section{Acknowledgements (by François Charette)}
\pkg{Polyglossia} is notable for being a recycle box of previous contributions
by other people. I take this opportunity to thank the following individuals,
whose splendid work has made my task almost trivial in comparision: \TA{Johannes
Braams} and the numerous contributors to the \pkg{babel} package (in particular
\TA{Boris Lavva} and others for its Hebrew support), \TA{Alexej Kryuko}v (\pkg{antomega}),
\TA{Will Robertson} (\pkg{fontspec}), \TA{Apostolos Syropoulos} (\pkg{xgreek}), \TA{Youssef Jabri}
(\pkg{arabi}), and \TA{Vafa Khalighi} (\pkg{xepersian} and \pkg{bidi}).
The work of \TA{Mojca Miklavec} and \TA{Arthur Reutenauer} on hyphenation patterns with their package
\pkg{hyph-utf8} is of course invaluable. I should also thank other
individuals for their assistance in supporting specific languages: \TA{Yves Codet}
(Sanskrit), \TA{Zdenĕk Wagner} (Hindi), \TA{Mikhal Oren} (Hebrew), \TA{Sergey Astanin} (Russian),
\TA{Khaled Hosny} (Arabic), \TA{Sertaç Ö. Yıldız} (Turkish), \TA{Kamal Abdali} (Urdu),
and several other members of the \XeTeX\ user community, notably \TA{Enrico Gregorio}, who
has sent me many useful suggestions and corrections and contributed the ¦\newXeTeXintercharclass¦
mechanism in xelatex.ini which is now used by polyglossia.
More recently, \TA{Kevin Godby} of the \href{http://ubuntu-manual.org}{Ubuntu Manual} project has
contributed very useful feedback, bug hunting and, with the help of translators,
new language definition files for Asturian, Lithuanian, Occitan, Bengali, Malayalam, Marathi, Tamil, and Telugu.
It is particularly heartening to realize that this package is used to typeset a widely-read
document in dozens of different languages!
Support for Lao was also added thanks to \TA{Brian Wilson}.
I also thank \TA{Alan Munn} for kindly proof-reading the penultimate version of this documentation.
And of course my gratitude also goes to \TA{Jonathan Kew}, the formidable author of \XeTeX!

\section{More acknowledgements (by Arthur Reutenauer)}
Many thanks to all the people who have contributed bugfixes and new features to
Polyglossia since I took over.  Most of them can be identified from the 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!

\end{document}