blob: 32d25215497efdc313d85a98b5b35e344d20ff1a (
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
%%
%% This is file `romanidx.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% spanish.dtx (with options: `indexes')
%% This is a generated file.
%%
%% Copyright (C) 1997 - 2014
%% Javier Bezos (www.tex-tipografia.com)
%% and
%% CervanTeX (www.cervantex.es)
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License, either version 1.3 of this license or
%% (at your option) any later version. The latest version of this
%% license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX version
%% 2003/12/01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% The Current Maintainer of this work is Javier Bezos
%%
%% The list of derived (unpacked) files belonging to the distribution
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension .ins) which are part of the distribution.
%% File `spanish.dtx'
%% Spanish Language Definition File
%% Copyright (C) 1997 - 2016
%% Javier Bezos (www.tex-tipografia.com)
%% and
%% CervanTeX (www.cervantex.es)
%% Please report errors to: Javier Bezos (preferably)
%% www.tex-tipografia.com
\makeatletter
\@ifundefined{es@idxfile}
{\def\spanishindexchars#1#2#3{%
\edef\es@encap{`\expandafter\noexpand\csname\string#1\endcsname}%
\edef\es@openrange{`\expandafter\noexpand\csname\string#2\endcsname}%
\edef\es@closerange{`\expandafter\noexpand\csname\string#3\endcsname}}%
\spanishindexchars{|}{(}{)}%
\ifx\documentclass\@twoclasseserror
\edef\es@idxfile{\jobname}%
\AtEndDocument{%
\addto\@defaultsubs{%
\immediate\closeout\@indexfile
\input{romanidx.sty}}}%
\expandafter\endinput
\fi}{}
\newcount\es@converted
\newcount\es@processed
\def\es@split@file#1.#2\@@{#1}
\def\es@split@ext#1.#2\@@{#2}
\@ifundefined{es@idxfile}
{\typein[\answer]{^^JArchivo que convertir^^J%
(extension por omision .idx):}}
{\let\answer\es@idxfile}
\@expandtwoargs\in@{.}{\answer}
\ifin@
\edef\es@input@file{\expandafter\es@split@file\answer\@@}
\edef\es@input@ext{\expandafter\es@split@ext\answer\@@}
\else
\edef\es@input@file{\answer}
\def\es@input@ext{idx}
\fi
\@ifundefined{es@idxfile}
{\typein[\answer]{^^JArchivo de destino^^J%
(archivo por omision: \es@input@file.eix,^^J%
extension por omision .eix):}}
{\let\answer\es@idxfile}
\ifx\answer\@empty
\edef\es@output{\es@input@file.eix}
\else
\@expandtwoargs\in@{.}{\answer}
\ifin@
\edef\es@output{\answer}
\else
\edef\es@output{\answer.eix}
\fi
\fi
\@ifundefined{es@idxfile}
{\typein[\answer]{%
^^J?Se ha usado algun esquema especial de controles^^J%
de MakeIndex para encap, open_range o close_range?^^J%
[s/n] (n por omision)}}
{\def\answer{n}}
\if s\answer
\typein[\answer]{^^JCaracter para 'encap'^^J%
(\string| por omision)}
\ifx\answer\@empty\else
\edef\es@encap{%
`\expandafter\noexpand\csname\expandafter\string\answer\endcsname}
\fi
\typein[\answer]{^^JCaracter para 'open_range'^^J%
(\string( por omision)}
\ifx\answer\@empty\else
\edef\es@openrange{%
`\expandafter\noexpand\csname\expandafter\string\answer\endcsname}
\fi
\typein[\answer]{^^JCaracter para 'close_range'^^J%
(\string) por omision)}
\ifx\answer\@empty\else
\edef\es@closerange{%
`\expandafter\noexpand\csname\expandafter\string\answer\endcsname}
\fi
\fi
\newwrite\es@indexfile
\immediate\openout\es@indexfile=\es@output
\newif\ifes@encapsulated
\def\es@scroman#1{#1}
\edef\es@slash{\expandafter\@gobble\string\\}
\def\indexentry{%
\begingroup
\@sanitize
\es@indexentry}
\begingroup
\catcode`\|=12 \lccode`\|=\es@encap\relax
\catcode`\(=12 \lccode`\(=\es@openrange\relax
\catcode`\)=12 \lccode`\)=\es@closerange\relax
\lowercase{
\gdef\es@indexentry#1{%
\endgroup
\advance\es@processed\@ne
\es@encapsulatedfalse
\es@bar@idx#1|\@@
\es@idxentry}%
}
\lowercase{
\gdef\es@idxentry#1{%
\in@{\es@scroman}{#1}%
\ifin@
\advance\es@converted\@ne
\immediate\write\es@indexfile{%
\string\indexentry{\es@b|\ifes@encapsulated\es@p\fi esromanindex%
{\ifx\es@a\@empty\else\es@slash\es@a\fi}}{#1}}%
\else
\immediate\write\es@indexfile{%
\string\indexentry{\es@b\ifes@encapsulated|\es@p\es@a\fi}{#1}}%
\fi}
}
\lowercase{
\gdef\es@bar@idx#1|#2\@@{%
\def\es@b{#1}\def\es@a{#2}%
\ifx\es@a\@empty\else\es@encapsulatedtrue\es@bar@eat#2\fi}
}
\lowercase{
\gdef\es@bar@eat#1#2|{\def\es@p{#1}\def\es@a{#2}%
\edef\es@t{(}\ifx\es@t\es@p
\else\edef\es@t{)}\ifx\es@t\es@p
\else
\edef\es@a{\es@p\es@a}\let\es@p\@empty%
\fi\fi}
}
\endgroup
\input \es@input@file.\es@input@ext
\immediate\closeout\es@indexfile
\typeout{*****************}
\typeout{Se ha procesado: \es@input@file.\es@input@ext }
\typeout{Lineas leidas: \the\es@processed}
\typeout{Lineas convertidas: \the\es@converted}
\typeout{Resultado en: \es@output}
\ifnum\es@converted>\z@
\typeout{Genere el indice a partir de ese archivo}
\else
\typeout{No se ha convertido nada. Se puede generar}
\typeout{el .ind directamente de \es@input@file.\es@input@ext}
\fi
\typeout{*****************}
\@ifundefined{es@sdef}{\@@end}{}
\endinput
%%
%% End of file `romanidx.sty'.
|