Debian Codegraph @

texmf-dist/tex/latex/polyglossia/gloss-catalan.ldf

raw
1 % Language definition file (part of polyglossia v2.10 -- 2026/04/18)
2 %
3 \ProvidesFile{gloss-catalan.ldf}[polyglossia: module for Catalan]
4 \PolyglossiaSetup{catalan}{
5 bcp47=ca,
6 bcp47-language=ca,
7 bcp47-script=Latn,
8 hyphennames={catalan},
9 hyphenmins={2,2},
10 langtag=CAT,
11 frenchspacing=true,
12 indentfirst=true,
13 }
14
15 % BCP-47 compliant aliases
16 \setlanguagealias*{catalan}{ca}
17
18 \DeclareKeys[polyglossia/gloss/catalan]
19 {
20 babelshorthands.if = catalan@babelshorthands,
21 babelshorthands.default:n = true,
22 }
23 \ifsystem@babelshorthands
24 \SetGlossOptions{catalan}{babelshorthands=true}
25 % Register default options
26 \InitializeGlossOptions{catalan}{babelshorthands=true}
27 \else
28 \SetGlossOptions{catalan}{babelshorthands=false}
29 % Register default options
30 \InitializeGlossOptions{catalan}{babelshorthands=false}
31 \fi
32
33 \InitializeBabelShorthands
34
35 %%% adapted from Babel's catalan.ldf
36 \newdimen\leftllkern \newdimen\rightllkern \newdimen\raiselldim
37
38 % we check if char · exists, and use it instead of raised dot:
39 \def\xpg@raiseddot{%
40 \charifavailable{00B7}{\raise\raiselldim\hbox{.}}%
41 }
42
43 \def\lgem{%
44 \ifmmode
45 \csname normal@char\string"\endcsname l%
46 \else
47 \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
48 \setbox0\hbox{l}%
49 \IfCharIsAvailableTF{00B7}%
50 {\setbox2\hbox{\char"00B7}\setbox1\hbox{l}}%
51 {\setbox2\hbox{.}\setbox1\hbox{l\/}}%
52 \setbox3\hbox{.}%
53 \advance\raiselldim by \the\fontdimen5\the\font%
54 \advance\raiselldim by -\ht2%
55 \leftllkern=-.25\wd0%
56 \advance\leftllkern by \wd1%
57 \advance\leftllkern by -\wd0%
58 \advance\leftllkern by -0.5\wd2%
59 \advance\leftllkern by 0.5\wd3%
60 \rightllkern=-.25\wd0%
61 \advance\rightllkern by -\wd1%
62 \advance\rightllkern by \wd0%
63 \advance\rightllkern by -0.5\wd2%
64 \advance\rightllkern by 0.5\wd3%
65 \allowhyphens\discretionary{l-}{l}%
66 {\hbox{l}\kern\leftllkern\xpg@raiseddot%
67 \kern\rightllkern\hbox{l}}\allowhyphens
68 \fi
69 }
70
71 \def\Lgem{%
72 \ifmmode
73 \csname normal@char\string"\endcsname L%
74 \else
75 \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
76 \setbox0\hbox{L}%
77 \IfCharIsAvailableTF{00B7}%
78 {\setbox2\hbox{\char"00B7}\setbox1\hbox{L}}%
79 {\setbox2\hbox{.}\setbox1\hbox{L\/}}%
80 \setbox3\hbox{.}%
81 \advance\raiselldim by .5\ht0%
82 \advance\raiselldim by -.5\ht2%
83 \leftllkern=-.125\wd0%
84 \advance\leftllkern by \wd1%
85 \advance\leftllkern by -\wd0%
86 \advance\leftllkern by -0.5\wd2%
87 \advance\leftllkern by 0.5\wd3%
88 \rightllkern=-\wd0%
89 \divide\rightllkern by 6%
90 \advance\rightllkern by -\wd1%
91 \advance\rightllkern by \wd0%
92 \advance\rightllkern by -0.5\wd2%
93 \advance\rightllkern by 0.5\wd3%
94 \allowhyphens\discretionary{L-}{L}%
95 {\hbox{L}\kern\leftllkern\xpg@raiseddot%
96 \kern\rightllkern\hbox{L}}\allowhyphens
97 \fi
98 }
99
100 \AtBeginDocument{%
101 \let\lslash\l
102 \let\Lslash\L
103 \DeclareRobustCommand\l{\@ifnextchar.\bbl@l{\@ifnextchar·\bbl@l\lslash}}
104 \DeclareRobustCommand\L{\@ifnextchar.\bbl@L{\@ifnextchar·\bbl@L\Lslash}}}
105 \def\bbl@l#1#2{\lgem}
106 \def\bbl@L#1#2{\Lgem}
107
108 \def\catalan@shorthands{%
109 \xpg@activate@shorthands%
110 \def\language@group{catalan}%
111 \declare@shorthand{catalan}{"l}{\lgem{}}%
112 \declare@shorthand{catalan}{"L}{\Lgem{}}%
113 }
114
115 \def\nocatalan@shorthands{%
116 \xpg@deactivate@shorthands%
117 }
118
119 \def\captionscatalan{%
120 \def\refname{Referències}%
121 \def\abstractname{Resum}%
122 \def\bibname{Bibliografia}%
123 \def\prefacename{Pròleg}%
124 \def\chaptername{Capítol}%
125 \def\appendixname{Apèndix}%
126 \def\contentsname{Índex}%
127 \def\listfigurename{Índex de figures}%
128 \def\listtablename{Índex de taules}%
129 \def\indexname{Índex alfabètic}%
130 \def\figurename{Figura}%
131 \def\tablename{Taula}%
132 %\def\thepart{}%
133 \def\partname{Part}%
134 \def\pagename{Pàgina}%
135 \def\seename{Vegeu}%
136 \def\alsoname{Vegeu també}%
137 \def\enclname{Adjunt}%
138 \def\ccname{Còpies a}%
139 \def\headtoname{A}%
140 \def\proofname{Demostració}%
141 \def\glossaryname{Glossari}%
142 }
143 \def\datecatalan{%
144 \def\today{\number\day~\ifcase\month\or
145 de gener\or de febrer\or de març\or d'abril\or de maig\or
146 de juny\or de juliol\or d'agost\or de setembre\or d'octubre\or
147 de novembre\or de desembre\fi
148 \space de~\number\year}}
149
150 \def\noextras@catalan{%
151 \ifcatalan@babelshorthands\nocatalan@shorthands\fi%
152 }
153
154 \def\blockextras@catalan{%
155 \ifcatalan@babelshorthands\catalan@shorthands\else\nocatalan@shorthands\fi%
156 }
157
158 \def\inlineextras@catalan{%
159 \ifcatalan@babelshorthands\catalan@shorthands\else\nocatalan@shorthands\fi%
160 }
161 \endinput