diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf')
-rw-r--r-- | Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf | 112 |
1 files changed, 97 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf index 436ac751366..1f03368db65 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf @@ -4,29 +4,33 @@ %% same thing for all languages that have a "script" key ! %% BETTER APPROACH: see gloss-sanskrit! +\RequirePackage{cyrillicnumbers} + \PolyglossiaSetup{serbian}{ langtag=SRB, hyphennames={serbian}, hyphenmins={2,2}, indentfirst=true, - fontsetup=false + fontsetup=false, + localnumeral=serbiannumerals, + Localnumeral=Serbiannumerals %TODO localalph } \newif\if@serbian@cyr -\define@key{serbian}{Script}[Cyrillic]{% TODO FIXDOC: keyname is CHANGED: script -> Script !!! +\define@key{serbian}{Script}[Cyrillic]{% \ifstrequal{#1}{Cyrillic}% {\@serbian@cyrtrue - \setkeys[xpg@setup]{serbian}{script=Cyrillic}% - \def\xpg@scripttag@serbian{cyrl}% + \SetLanguageKeys{serbian}{scripttag=cyrl,script=Cyrillic,babelname=serbianc} \xpg@fontsetup@nonlatin{serbian}% }% {\ifstrequal{#1}{Latin}% {\@serbian@cyrfalse - \xpg@fontsetup@latin{serbian}% - %TODO \def\serbian@language{\language=\l@serbianlat}% - % or should we use Croatian patterns as a fallback for the time being??? + \SetLanguageKeys{serbian}{scripttag=latn,script=Latin} + \xpg@fontsetup@latin{serbian}% + %TODO \def\serbian@language{\language=\l@serbianlat}% + % or should we use Croatian patterns as a fallback for the time being??? }% {\xpg@error{Unknown script `#1' for Serbian language\MessageBreak Valid values are "Cyrillic" and "Latin"}}% @@ -34,15 +38,24 @@ } \define@key{serbian}{script}[Cyrillic]{\setkeys{serbian}{Script=#1}} -\setkeys{serbian}{Script} +\newif\ifserbian@numerals +\define@key{serbian}{numerals}[arabic]{% + \ifstrequal{#1}{latin}{\serbian@numeralsfalse}{% + \ifstrequal{#1}{cyrillic}% + {\serbian@numeralstrue} + {\serbian@numeralsfalse}% + }% +} + +\setkeys{serbian}{Script,numerals} \def\captionsserbian{% \if@serbian@cyr\captionsserbian@cyr\else\captionsserbian@lat\fi - } +} \def\dateserbian{% \if@serbian@cyr\dateserbian@cyr\else\dateserbian@lat\fi - } +} \def\captionsserbian@lat{% \def\refname{Bibliografija}% @@ -71,13 +84,14 @@ \def\headtoname{Prima}% \def\proofname{Dokaz}% \def\glossaryname{Rečnik nepoznatih reči}% - } +} + \def\dateserbian@lat{% \def\today{\number\day .~\ifcase\month\or januar\or februar\or mart\or april\or maj\or jun\or jul\or avgust\or septembar\or oktobar\or novembar\or decembar\fi \space \number\year.}% - } +} \def\captionsserbian@cyr{% \def\refname{Библиографија}% @@ -105,15 +119,84 @@ \def\headtoname{Прима}% \def\proofname{Доказ}% \def\glossaryname{Речник непознатих речи}% - } +} + \def\dateserbian@cyr{% \def\today{\number\day .~\ifcase\month\or јануар\or фебруар\or март\or април\or мај\or јун\or јул\or август\or септембар\or октобар\or новембар\or децембар\fi \space \number\year.}% - } +} + + +\newcommand{\serbiannumerals}[2]{\serbiannumber{#2}} +\newcommand{\Serbiannumerals}[2]{\Serbiannumber{#2}} + +\def\serbiannumber#1{% + \ifserbian@numerals + \cyr@alph{#1}% + \else + \number#1% + \fi +} + +\def\Serbiannumber#1{% + \ifserbian@numerals + \cyr@Alph{#1}% + \else + \number#1% + \fi +} + +\let\serbiannumeral=\serbiannumber +\let\Serbiannumeral=\Serbiannumber + +\def\serbian@numbers{% + \let\latin@alph\@alph + \let\latin@Alph\@Alph + \ifserbian@numerals + \def\serbian@alph##1{\expandafter\serbiannumeral\expandafter{\the##1}}% + \def\serbian@Alph##1{\expandafter\Serbiannumeral\expandafter{\the##1}}% + \let\@alph\serbian@alph% + \let\@Alph\serbian@Alph% + \fi +} + +\def\noserbian@numbers{% + \let\@alph\latin@alph + \let\@Alph\latin@Alph +} + +\def\blockextras@serbian{% + \ifserbian@numerals\serbian@numbers\fi +} + +\def\noextras@serbian{% + \ifserbian@numerals\noserbian@numbers\fi +} + +\def\Asbuk#1{\expandafter\cyr@Alph\csname c@#1\endcsname} + +\def\asbuk#1{\expandafter\cyr@alph\csname c@#1\endcsname} + +% This is a poor man's cyrillic alphanumeric. It just uses the alphabet and +% thus ends at 30. We now use proper cyrillic numbering. +%\def\cyr@Alph#1{\ifcase#1\or +% А\or Б\or В\or Г\or Д\or Ђ\or Е\or Ж\or +% З\or И\or Ј\or К\or Л\or Љ\or М\or Н\or +% Њ\or О\or П\or Р\or С\or Т\or Ћ\or У\or +% Ф\or Х\or Ц\or Ч\or Џ\or Ш\else\xpg@ill@value{#1}{cyr@Alph}\fi} + +%\def\cyr@alph#1{\ifcase#1\or +% а\or б\or в\or г\or д\or ђ\or е\or ж\or +% з\or и\or ј\or к\or л\or љ\or м\or н\or +% њ\or о\or п\or р\or с\or т\or ћ\or у\or +% ф\or х\or ц\or ч\or џ\or ш\else\xpg@ill@value{#1}{cyr@alph}\fi} + + \endinput + % TODO ? stuff from babel \def\sh{\mathop{\operator@font sh}\nolimits} % same as \sinh @@ -132,4 +215,3 @@ \def\Expect{\mathop{\mathsf E\hskip0pt}\nolimits} \def\Variance{\mathop{\mathsf D\hskip0pt}\nolimits} - |