diff options
author | Karl Berry <karl@freefriends.org> | 2022-04-05 22:10:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-04-05 22:10:52 +0000 |
commit | 1d3a41c853f7524663343fd7a7d561848375497a (patch) | |
tree | b5f046c070ef4fc5ed8e7f417b9d4a81b36fe860 /Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf | |
parent | 44c7e92cd62a724d239c17b52359d86abaf22615 (diff) |
polyglossia (27mar22)
git-svn-id: svn://tug.org/texlive/trunk@62940 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf')
-rw-r--r-- | Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf | 95 |
1 files changed, 78 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf index a302431ed13..480c44e817c 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf @@ -11,7 +11,8 @@ langtag=SRB, hyphennames={serbian}, hyphenmins={2,2}, - indentfirst=true, + frenchspacing=true, % Правопис српскога језика, Матица српска, 2010. (измењено и допуњено, четврто издање): т. 188, под Обликовање ступца и пасуса + indentfirst=true, % Правопис српскога језика, Матица српска, 2010. (измењено и допуњено, четврто издање): т. 188, под Обликовање ступца и пасуса fontsetup=false, localnumeral=serbiannumerals, Localnumeral=Serbiannumerals, @@ -27,6 +28,10 @@ % Babel aliases \setlanguagealias[script=Cyrillic]{serbian}{serbianc} +\ifluatex + \RequirePackage{luavlna} +\fi + \newif\if@serbian@cyr \define@choicekey*+{serbian}{Script}[\xpg@val\xpg@nr]{cyrillic,latin}[cyrillic]{% \ifcase\xpg@nr\relax @@ -70,10 +75,12 @@ \xpg@info{Option: Serbian, numerals=\xpg@val}% }{\xpg@warning{Unknown Serbian numerals value `#1'}} +\define@boolkey{serbian}[serbian@]{splithyphens}[true]{} + \setkeys{serbian}{Script,numerals} % Register default options -\xpg@initialize@gloss@options{serbian}{script=Cyrillic,numerals=arabic} +\xpg@initialize@gloss@options{serbian}{script=Cyrillic,numerals=arabic,splithyphens=true} \def\captionsserbian{% \if@serbian@cyr\captionsserbian@cyr\else\captionsserbian@lat\fi @@ -154,9 +161,10 @@ децембар\fi \space \number\year.}% } - -\newcommand{\serbiannumerals}[2]{\serbiannumber{#2}} -\newcommand{\Serbiannumerals}[2]{\Serbiannumber{#2}} +% Use \providecommand here as the ldf file might +% be reloaded via serbianc. +\providecommand{\serbiannumerals}[2]{\serbiannumber{#2}} +\providecommand{\Serbiannumerals}[2]{\Serbiannumber{#2}} \def\serbiannumber#1{% \ifcyrillic@numerals @@ -201,12 +209,65 @@ \let\@Alph\latin@Alph } +\def\serbian@@splhyphen#1{% + \def\serbian@sh@tmp{% + \if\serbian@sh@next-#1% + \else\expandafter\serbian@@@splhyphen{#1}\fi% + }% + \futurelet\serbian@sh@next\serbian@sh@tmp% +} + +\def\serbian@@@splhyphen#1{% + \ifnum\hyphenchar \font>0% + \kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}% + \nobreak\hskip\z@% + \else% + #1% + \fi% +} + +\def\serbian@splhyphen{% + \serbian@@splhyphen{-}% +} + +\ifxetex + % splithyphens + \newXeTeXintercharclass\serbian@hyphen % - + \newXeTeXintercharclass\serbian@nonsyllabicpreposition% +\fi + +\def\serbian@hyphens{% + \ifluatex + \AfterPreamble{\enablesplithyphens{serbian}}% + \else + \XeTeXinterchartokenstate=1 + \XeTeXcharclass `\- \serbian@hyphen + \XeTeXinterchartoks \z@ \serbian@hyphen = {\serbian@@splhyphen}% "-" -> "\serbian@@splhyphen-" + % necessary if used together with vlna: + \XeTeXinterchartoks \serbian@nonsyllabicpreposition \serbian@hyphen = {\serbian@@splhyphen}% "-" -> "\serbian@@splhyphen-" + \fi% +} + +\def\noserbian@hyphens{% + \ifluatex + \AfterPreamble{\disablesplithyphens{serbian}}% + \else + \XeTeXcharclass `\- \z@ + \fi% +} + \def\blockextras@serbian{% - \ifcyrillic@numerals\serbian@numbers\fi + \ifcyrillic@numerals\serbian@numbers\else\noserbian@numbers\fi% + \ifserbian@splithyphens\serbian@hyphens\else\noserbian@hyphens\fi% +} + +\def\inlineextras@serbian{% + \ifserbian@splithyphens\serbian@hyphens\else\noserbian@hyphens\fi% } \def\noextras@serbian{% - \ifcyrillic@numerals\noserbian@numbers\fi + \ifcyrillic@numerals\noserbian@numbers\fi% + \noserbian@hyphens% } \def\Asbuk#1{\expandafter\serbian@asbuk@Alph\csname c@#1\endcsname} @@ -215,21 +276,21 @@ \def\AsbukTrad#1{\expandafter\cyr@Alph\csname c@#1\endcsname} \def\asbukTrad#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. +% This is a poor man's cyrillic alphanumeric. +% It just uses the alphabet and thus ends at 30. \def\serbian@asbuk@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 В\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}{serbian@asbuk@Alph}\fi% } \def\serbian@asbuk@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 в\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}{serbian@asbuk@alph}\fi% } |