Debian Codegraph @

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

raw
1 % Language definition file (part of polyglossia v2.10 -- 2026/04/18)
2 %
3 \ProvidesFile{gloss-spanish.ldf}[polyglossia: module for Spanish]
4
5 \PolyglossiaSetup{spanish}{
6 bcp47=es-ES,
7 bcp47-language=es,
8 bcp47-region=ES,
9 bcp47-script=Latn,
10 hyphennames={spanish},
11 hyphenmins={2,2},
12 totalhyphenmin=5,
13 langtag=ESP,
14 frenchspacing=true,
15 indentfirst=true,
16 babelname=spanish
17 }
18
19 % BCP-47 compliant aliases
20 \setlanguagealias*{spanish}{es}
21 \setlanguagealias*[variant=mexican]{spanish}{es-MX}
22 \setlanguagealias*[variant=spanish]{spanish}{es-ES}
23
24 % Babel aliases
25 \setlanguagealias[variant=mexican]{spanish}{spanishmx}
26
27 \newif\if@spanish@mexico
28 \@spanish@mexicofalse
29
30 % Localized math operators à la babel
31 \newif\ifspanish@accentedoperators
32 \newif\ifspanish@spacedoperators
33 \newif\ifspanish@locoperators
34
35 \DeclareKeys[polyglossia/gloss/spanish]
36 {
37 variant.choice:,
38 variant / spanish.code =
39 {%
40 \@spanish@mexicofalse
41 \SetLanguageKeys{spanish}{babelname=spanish,bcp47=es-ES,bcp47-region=ES}%
42 },
43 variant / mexican.code =
44 {%
45 \@spanish@mexicotrue
46 \SetLanguageKeys{spanish}{babelname=spanishmx,bcp47=es-MX,bcp47-region=MX}%
47 },
48 variant.default:n = spanish,
49 variant/unknown.code = \xpg@warning{Unknown spanish variant `#1'},
50 spanishoperators.choice:,
51 spanishoperators / all.code =
52 {%
53 \spanish@locoperatorstrue
54 \spanish@accentedoperatorstrue
55 \spanish@spacedoperatorstrue
56 },
57 spanishoperators / accented.code =
58 {%
59 \spanish@locoperatorsfalse
60 \spanish@accentedoperatorstrue
61 \spanish@spacedoperatorsfalse
62 },
63 spanishoperators / spaced.code =
64 {%
65 \spanish@locoperatorsfalse
66 \spanish@accentedoperatorsfalse
67 \spanish@spacedoperatorstrue
68 },
69 spanishoperators / none.code =
70 {%
71 \spanish@locoperatorsfalse
72 \spanish@accentedoperatorsfalse
73 \spanish@spacedoperatorsfalse
74 },
75 spanishoperators.default:n = all,
76 spanishoperators/unknown.code = \xpg@warning{Unknown spanishoperators value `#1'}
77 }
78
79 % Register default options
80 \InitializeGlossOptions{spanish}{variant=spanish,spanishoperators=none}
81
82 \let\xpg@save@lim\lim
83 \let\xpg@save@limsup\limsup
84 \let\xpg@save@liminf\liminf
85 \let\xpg@save@max\max
86 \let\xpg@save@min\min
87 \let\xpg@save@inf\inf
88 \let\xpg@save@bmod\bmod
89 \let\xpg@save@pmod\pmod
90
91 \def\spanish@accentedoperators{%
92 \DeclareRobustCommand\lim{\mathop{\operator@font lím}}%
93 \DeclareRobustCommand\limsup{\mathop{\operator@font lím\,sup}}%
94 \DeclareRobustCommand\liminf{\mathop{\operator@font lím\,inf}}%
95 \DeclareRobustCommand\max{\mathop{\operator@font máx}}%
96 \DeclareRobustCommand\min{\mathop{\operator@font mín}}%
97 \DeclareRobustCommand\inf{\mathop{\operator@font ínf}}%
98 \DeclareRobustCommand\bmod{%
99 \nonscript\mskip-\medmuskip\mkern5mu%
100 \mathbin{\operator@font mód}\penalty900\mkern5mu%
101 \nonscript\mskip-\medmuskip}%
102 \@ifundefined{@amsmath@err}%
103 {\DeclareRobustCommand\pmod[1]{%
104 \allowbreak\mkern18mu({\operator@font mód}\,\,##1)}}%
105 {\let\xpg@save@mod\mod
106 \DeclareRobustCommand\mod[1]{\allowbreak\if@display\mkern18mu
107 \else\mkern12mu\fi{\operator@font mód}\,\,##1}%
108 \DeclareRobustCommand\pmod[1]{\pod{{\operator@font mód}%
109 \mkern6mu##1}}}%
110 }
111
112 \def\nospanish@accentedoperators{%
113 \let\lim\xpg@save@lim%
114 \let\limsup\xpg@save@limsup%
115 \let\liminf\xpg@save@liminf%
116 \let\max\xpg@save@max%
117 \let\min\xpg@save@min%
118 \let\inf\xpg@save@inf%
119 \let\bmod\xpg@save@bmod%
120 \let\pmod\xpg@save@pmod%
121 \@ifundefined{@amsmath@err}{}{\let\mod\xpg@save@mod}%
122 }
123
124 \let\xpg@save@arccos\arccos
125 \let\xpg@save@arcsin\arcsin
126 \let\xpg@save@arctan\arctan
127 \let\arcsen\arcsin
128 \let\arctg\arctan
129
130
131 \def\spanish@spacedoperators{%
132 \DeclareRobustCommand\arccos{\mathop{\operator@font arc\,cos}\nolimits}%
133 \DeclareRobustCommand\arcsin{\mathop{\operator@font arc\,sen}\nolimits}%
134 \DeclareRobustCommand\arctan{\mathop{\operator@font arc\,tg}\nolimits}%
135 }
136
137 \def\nospanish@spacedoperators{%
138 \let\arccos\xpg@save@arccos%
139 \let\arcsen\arcsin%
140 \let\arctg\arctan%
141 }
142
143
144 \let\xpg@save@sin\sin
145 \let\xpg@save@tan\tan
146 \let\xpg@save@sinh\sinh
147 \let\xpg@save@tanh\tanh
148 \let\sen\sin
149 \let\tg\tan
150 \let\senh\sinh
151 \let\tgh\tanh
152
153 \def\spanish@locoperators{%
154 \DeclareRobustCommand\sin{\mathop{\operator@font sen}\nolimits}%
155 \DeclareRobustCommand\tan{\mathop{\operator@font tg}\nolimits}%
156 \DeclareRobustCommand\sinh{\mathop{\operator@font senh}\nolimits}%
157 \DeclareRobustCommand\tanh{\mathop{\operator@font tgh}\nolimits}%
158 }
159
160 \def\nospanish@locoperators{%
161 \let\sen\xpg@save@sin%
162 \let\tg\xpg@save@tan%
163 \let\sinh\xpg@save@sinh%
164 \let\tanh\xpg@save@tanh%
165 \let\sen\relax%
166 \let\tg\relax%
167 \let\senh\relax%
168 \let\tgh\relax%
169 }
170
171 % Use \providecommand here as the ldf file might
172 % be reloaded via babel aliases.
173 \providecommand*\spanishoperator[2][]{%
174 \ifx#1\\\\
175 \protected@csxdef{#2}{\mathop{\operator@font #2}\nolimits}%
176 \else
177 \protected@csxdef{#2}{\mathop{\operator@font #1}\nolimits}%
178 \fi
179 }
180
181 \def\captionsspanish{%
182 \def\prefacename{Prefacio}%
183 \def\refname{Referencias}%
184 \def\abstractname{Resumen}%
185 \def\bibname{Bibliografía}%
186 \def\chaptername{Capítulo}%
187 \def\appendixname{Apéndice}%
188 \def\contentsname{Índice general}%
189 \def\listfigurename{Índice de figuras}%
190 \def\listtablename{Índice de cuadros}%
191 \def\indexname{Índice alfabético}%
192 \def\figurename{Figura}%
193 \def\tablename{Cuadro}%
194 \def\partname{Parte}%
195 \def\enclname{Adjunto(s)}%
196 \def\ccname{Copia a}%
197 \def\headtoname{A}%
198 \def\pagename{Página}%
199 \def\seename{véase}%
200 \def\alsoname{véase también}%
201 \def\proofname{Prueba}%
202 \def\glossaryname{Glosario}%
203 \if@spanish@mexico
204 \captionsspanish@mexico%
205 \fi%
206 }
207
208 \def\captionsspanish@mexico{%
209 \def\tablename{Tabla}%
210 }
211
212 \def\datespanish{%
213 \def\today{\number\day~de~\ifcase\month\or
214 enero\or febrero\or marzo\or abril\or mayo\or junio\or
215 julio\or agosto\or septiembre\or octubre\or noviembre\or
216 diciembre\fi\space de~\number\year}%
217 }
218
219 \def\noextras@spanish{%
220 \nospanish@accentedoperators%
221 \nospanish@spacedoperators%
222 \nospanish@locoperators%
223 }
224
225 \def\blockextras@spanish{%
226 \ifspanish@accentedoperators\spanish@accentedoperators\fi%
227 \ifspanish@spacedoperators\spanish@spacedoperators\fi%
228 \ifspanish@locoperators\spanish@locoperators\fi%
229 }
230
231 \def\inlineextras@spanish{%
232 \ifspanish@accentedoperators\spanish@accentedoperators\fi%
233 \ifspanish@spacedoperators\spanish@spacedoperators\fi%
234 \ifspanish@locoperators\spanish@locoperators\fi%
235 }
236
237 \endinput