summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/polyglossia/gloss-catalan.ldf
blob: 8d349c9bcda06f27f28843cebbece5c079ac44bc (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
\ProvidesFile{gloss-catalan.ldf}[polyglossia: module for catalan]
\PolyglossiaSetup{catalan}{
  hyphennames={catalan},
  hyphenmins={2,2},
  frenchspacing=true,
  indentfirst=true,
  fontsetup=true,
}

\define@boolkey{catalan}[catalan@]{babelshorthands}[true]{}
\ifsystem@babelshorthands
  \setkeys{catalan}{babelshorthands=true}
\else
  \setkeys{catalan}{babelshorthands=false}
\fi
\ifcsundef{initiate@active@char}{%
\input{babelsh.def}%
\initiate@active@char{"}%
}{}

%%% adapted from Babel's catalan.ldf
\newdimen\leftllkern \newdimen\rightllkern \newdimen\raiselldim
% we check if char · exists, and use it instead of raised dot:
\def\xpg@raiseddot{\ifnum\XeTeXcharglyph"00B7 > 0\hbox{\char"00B7}%
  \else\raise\raiselldim\hbox{.}\fi}
\def\lgem{%
  \ifmmode
    \csname normal@char\string"\endcsname l%
  \else
    \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
    \setbox0\hbox{l}\setbox1\hbox{l\/}%
    \ifnum\XeTeXcharglyph"00B7 > 0\setbox2\hbox{\char"00B7}\else\setbox2\hbox{.}\fi
    \advance\raiselldim by \the\fontdimen5\the\font
    \advance\raiselldim by -\ht2%
    \leftllkern=-.25\wd0%
    \advance\leftllkern by \wd1%
    \advance\leftllkern by -\wd0%
    \rightllkern=-.25\wd0%
    \advance\rightllkern by -\wd1%
    \advance\rightllkern by \wd0%
    \allowhyphens\discretionary{l-}{l}%
    {\hbox{l}\kern\leftllkern\xpg@raiseddot%
      \kern\rightllkern\hbox{l}}\allowhyphens
  \fi
}
\def\Lgem{%
  \ifmmode
    \csname normal@char\string"\endcsname L%
  \else
    \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
    \setbox0\hbox{L}\setbox1\hbox{L\/}%
    \ifnum\XeTeXcharglyph"00B7 > 0\setbox2\hbox{\char"00B7}\else\setbox2\hbox{.}\fi
    \advance\raiselldim by .5\ht0%
    \advance\raiselldim by -.5\ht2%
    \leftllkern=-.125\wd0%
    \advance\leftllkern by \wd1%
    \advance\leftllkern by -\wd0%
    \rightllkern=-\wd0%
    \divide\rightllkern by 6%
    \advance\rightllkern by -\wd1%
    \advance\rightllkern by \wd0%
    \allowhyphens\discretionary{L-}{L}%
    {\hbox{L}\kern\leftllkern\xpg@raiseddot%
      \kern\rightllkern\hbox{L}}\allowhyphens
  \fi
}
\AtBeginDocument{%
  \let\lslash\l
  \let\Lslash\L
  \DeclareRobustCommand\l{\@ifnextchar.\bbl@l{\@ifnextchar·\bbl@l\lslash}}
  \DeclareRobustCommand\L{\@ifnextchar.\bbl@L{\@ifnextchar·\bbl@L\Lslash}}}
\def\bbl@l#1#2{\lgem}
\def\bbl@L#1#2{\Lgem}

\def\catalan@shorthands{%
  \bbl@activate{"}%
  \def\language@group{catalan}%
  \declare@shorthand{catalan}{"l}{\lgem{}}
  \declare@shorthand{catalan}{"L}{\Lgem{}}
}

\def\nocatalan@shorthands{%
    \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}%
}

\def\captionscatalan{%
   \def\refname{Referències}%
   \def\abstractname{Resum}%
   \def\bibname{Bibliografia}%
   \def\prefacename{Pròleg}%
   \def\chaptername{Capítol}%
   \def\appendixname{Apèndix}%
   \def\contentsname{Índex}%
   \def\listfigurename{Índex de figures}%
   \def\listtablename{Índex de taules}%
   \def\indexname{Índex alfabètic}%
   \def\figurename{Figura}%
   \def\tablename{Taula}%
   %\def\thepart{}%
   \def\partname{Part}%
   \def\pagename{Pàgina}%
   \def\seename{Vegeu}%
   \def\alsoname{Vegeu també}%
   \def\enclname{Adjunt}%
   \def\ccname{Còpies a}%
   \def\headtoname{A}%
   \def\proofname{Demostració}%
   \def\glossaryname{Glossari}%
   }
\def\datecatalan{%
   \def\today{\number\day~\ifcase\month\or
    de gener\or de febrer\or de març\or d'abril\or de maig\or
    de juny\or de juliol\or d'agost\or de setembre\or d'octubre\or
    de novembre\or de desembre\fi
    \space de~\number\year}}

\def\noextras@catalan{%
   \nocatalan@shorthands%
}

\def\blockextras@catalan{%
   \ifcatalan@babelshorthands\catalan@shorthands\fi%
}

\def\inlineextras@catalan{%
   \ifcatalan@babelshorthands\catalan@shorthands\fi%
}
\endinput