This repository has been archived by the owner on Mar 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tabela-simbolos.sty
270 lines (218 loc) · 10.7 KB
/
tabela-simbolos.sty
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
%% $Id: tabela-simbolos.sty,v 1.12 2006/09/09 23:18:26 gweber Exp $
%% name of this file tabela-simbolos.sty
%% Copyright 2003-2006 by the abnTeX group at http://abntex.codigolivre.org.br
%%
%% Maintainer: Gerald Weber <[email protected]>
%%
%% This file is distributed under the LaTeX-Project Public License (LPPL)
%% http://www.latex-project.org/lppl.html
%% You are free to modify this file under the LPPL.
%%
\NeedsTeXFormat{LaTeX2e}
\input{cvs-id.def}
\CVSExtract$Id: tabela-simbolos.sty,v 1.12 2006/09/09 23:18:26 gweber Exp $
\CVSPackage{tabelasimbolos}{\space Tabela de simbolos e siglas}
\RequirePackage{index}[2004/01/20]
%pacotes padrao do latex
\RequirePackage{ifthen}
\RequirePackage{abntex-abrev}
\PassOptionsToPackage{hyperindex=false}{hyperref}
\newcommand{\TSStextpagesep}{,}
\newboolean{tsspages}
\DeclareOption{paginas=sim}{\setboolean{tsspages}{true}}
\DeclareOption{paginas=nao}
{
\setboolean{tsspages}{false}
\renewcommand{\TSStextpagesep}{}
}
\newboolean{AlphaSort}
\DeclareOption{ordem=alf}{\setboolean{AlphaSort}{true}}
\DeclareOption{ordem=oc}{\setboolean{AlphaSort}{false}}
\newboolean{SeparateSortScheme}
\DeclareOption{esquema=separado}{\setboolean{SeparateSortScheme}{true}}
\DeclareOption{esquema=misto}{\setboolean{SeparateSortScheme}{false}}
\newboolean{CaseSortScheme}
\newboolean{UpperCaseLast}
\DeclareOption{caixa=mM}{\setboolean{CaseSortScheme}{true}\setboolean{UpperCaseLast}{true}}
\DeclareOption{caixa=Mm}{\setboolean{CaseSortScheme}{true}\setboolean{UpperCaseLast}{false}}
\DeclareOption{caixa=mista}{\setboolean{CaseSortScheme}{false}\setboolean{UpperCaseLast}{false}}
\newboolean{SeparateListDisplay}
\DeclareOption{lista=separada}{\setboolean{SeparateListDisplay}{true}}
\DeclareOption{lista=unica}{\setboolean{SeparateListDisplay}{false}}
\DeclareOption{romanos=1}{\def\RomanOrder{1}}
\DeclareOption{romanos=2}{\def\RomanOrder{2}}
\DeclareOption{romanos=3}{\def\RomanOrder{3}}
\DeclareOption{gregos=1}{\def\GreekOrder{1}}
\DeclareOption{gregos=2}{\def\GreekOrder{2}}
\DeclareOption{gregos=3}{\def\GreekOrder{3}}
\DeclareOption{simbolos=1}{\def\SymbolOrder{1}}
\DeclareOption{simbolos=2}{\def\SymbolOrder{2}}
\DeclareOption{simbolos=3}{\def\SymbolOrder{3}}
\ExecuteOptions{romanos=1,gregos=2,simbolos=3}
\DeclareOption{estilo=UFPR}{%
\ExecuteOptions{paginas=nao,ordem=alf,esquema=separado,caixa=mM,lista=unica}%
\ExecuteOptions{romanos=1,gregos=2,simbolos=3}}
\DeclareOption{estilo=14724:2001}{%
\ExecuteOptions{paginas=sim,ordem=oc,esquema=misto,caixa=mista,lista=unica}}
\ExecuteOptions{estilo=14724:2001}
\ProcessOptions*
\ifthenelse{\boolean{SeparateSortScheme}}{%
\AtEndDocument{%
\typeout{####################################}
\typeout{tabela-simbolos: agora rode geratss (linux) ou manualmente,}
\typeout{makeindex -s tabela-siglas.ist -o \jobname.sigla \jobname.siglax}%
\typeout{makeindex -s tabela-simbolos.ist -o \jobname.romanlow \jobname.romanlowx}%
\typeout{makeindex -s tabela-simbolos.ist -o \jobname.romanupp \jobname.romanuppx}%
\typeout{makeindex -s tabela-simbolos.ist -o \jobname.greeklow \jobname.greeklowx}%
\typeout{makeindex -s tabela-simbolos.ist -o \jobname.greekupp \jobname.greekuppx}%
\typeout{makeindex -s tabela-simbolos.ist -o \jobname.miscelan \jobname.miscelanx}%
\typeout{makeindex -s tabela-simbolos.ist -o \jobname.symbols \jobname.symbolsx}%
\typeout{####################################}}
}{%
\AtEndDocument{%
\typeout{####################################}
\typeout{tabela-simbolos: agora rode geratss (linux) ou manualmente,}
\typeout{makeindex -s tabela-siglas.ist -o \jobname.sigla \jobname.siglax}%
\typeout{makeindex -s tabela-simbolos.ist -o \jobname.symbols \jobname.symbolsx}%
\typeout{####################################}}
}
\ifthenelse{\boolean{SeparateSortScheme}}{%
\ifnum\RomanOrder=\GreekOrder%
\PackageWarning{simbolos gregos e romanos com a mesma ordem, voltando ao padrao}{}
\def\RomanOrder{1}\def\GreekOrder{2}\def\SymbolOrder{3}\fi
\ifnum\RomanOrder=\SymbolOrder%
\PackageWarning{simbolos romanos e outros simbolos com a mesma ordem, voltando ao padrao}{}
\def\RomanOrder{1}\def\GreekOrder{2}\def\SymbolOrder{3}\fi
\ifnum\GreekOrder=\SymbolOrder%
\PackageWarning{simbolos gregos e outros simbolos com a mesma ordem, voltando ao padrao}{}
\def\RomanOrder{1}\def\GreekOrder{2}\def\SymbolOrder{3}\fi}{}
%See p. 345 in The Thexbook, D. E. Knuth
%\newcommand{\testuppercase}[1]{%
%\expandafter\ifnum\the\sfcode`#1=999 true\else false\fi}
\newindex{sigla}{siglax}{sigla}{\listofabreviationsname}
\ifthenelse{\boolean{SeparateSortScheme}}{%
\newindex{romanlow}{romanlowx}{romanlow}{Lista de s\'\i mbolos romanos min\'usculos}%
\newindex{romanupp}{romanuppx}{romanupp}{Lista de s\'\i mbolos romanos mai\'usculos}%
\newindex{greeklow}{greeklowx}{greeklow}{Lista de s\'\i mbolos gregos min\'usculos}%
\newindex{greekupp}{greekuppx}{greekupp}{Lista de s\'\i mbolos gregos mai\'usculos}%
\newindex{miscelan}{miscelanx}{miscelan}{Lista de outros s\'\i mbolos}%
\def\RomanLow{romanlow}%
\def\GreekLow{greeklow}%
\ifthenelse{\boolean{CaseSortScheme}}{\def\RomanUpp{romanupp}\def\GreekUpp{greekupp}}
{\def\RomanUpp{romanlow}\def\GreekUpp{greeklow}}
\def\Miscelan{miscelan}}{%
\newindex{symbols}{symbolsx}{symbols}{\listofsymbolsname}%
\def\RomanLow{symbols}%
\def\RomanUpp{symbols}%
\def\GreekLow{symbols}%
\def\GreekUpp{symbols}%
\def\Miscelan{symbols}}
% Auxiliary counter which helps maintaining and indexing by occurence, rather
% than by some sorting criterium. The counter is added to the indexentry which is then
% followed by an @. See latex documentation on indexentry,
% e.g. "The LaTeX Companion", Mittelbach & Goossens, 2nd Ed., p.874.
\newcounter{Ocorrencia}
\setcounter{Ocorrencia}{1000}
\ifthenelse{\boolean{AlphaSort}}{\def\TheOcor{}}{\def\TheOcor{\arabic{Ocorrencia}\space}}
\def\@wrindex#1#2{%
\begingroup
\def\@tempa{#2}%
\edef\@tempb{\@nameuse{idx@#1}}%
\edef\@tempb{\expandafter\@third\@tempb\@nil}%
\csname if@immediate@#1\endcsname \else
\expandafter\let\csname\@tempb\endcsname\relax
\fi
\edef\@tempa{%
\write\@auxout{%
\string\@writefile{#1}{\string\indexentry{\TheOcor\@nearverbatim\@tempa}{\thepage}}%
}%
}%
\expandafter\endgroup\@tempa
\if@nobreak\ifvmode\nobreak\fi\fi
}
\newcommand{\IndexCommand}[3]{%
\ifthenelse{\boolean{AlphaSort}}{\index[#1]{#2@#3|TSSThePage}}%
{\addtocounter{Ocorrencia}{1}%
\index[#1]{@#3|TSSThePage}}}
\newcommand{\sigla}[2]{\IndexCommand{sigla}{#1 #2}{#1& #2}}
\newcommand{\rsimpsymbol}[2]{\IndexCommand{\RomanLow}{#1 #2}{$#1$& #2}}
\newcommand{\rcompsymbol}[3]{\IndexCommand{\RomanLow}{#2 #3}{#1& #3}}
\newcommand{\Rsimpsymbol}[2]{\IndexCommand{\RomanUpp}{#1 #2}{$#1$& #2}}
\newcommand{\Rcompsymbol}[3]{\IndexCommand{\RomanUpp}{#2 #3}{#1& #3}}
\newcommand{\gsimpsymbol}[2]{\IndexCommand{\GreekLow}{#1 #2}{$#1$& #2}}
\newcommand{\gcompsymbol}[3]{\IndexCommand{\GreekLow}{#2 #3}{#1& #3}}
\newcommand{\Gsimpsymbol}[2]{\IndexCommand{\GreekUpp}{#1 #2}{$#1$& #2}}
\newcommand{\Gcompsymbol}[3]{\IndexCommand{\GreekUpp}{#2 #3}{#1& #3}}
\newcommand{\msimpsymbol}[2]{\IndexCommand{\Miscelan}{#1 #2}{$#1$& #2}}
\newcommand{\mcompsymbol}[3]{\IndexCommand{\Miscelan}{#2 #3}{#1& #3}}
\newcommand{\simbolo}[3][0]{%
\ifthenelse{\equal{#1}{0}}{\rsimpsymbol{#2}{#3}}{\rcompsymbol{#1}{#2}{#3}}}
\newcommand{\Simbolo}[3][0]{%
\ifthenelse{\equal{#1}{0}}{\Rsimpsymbol{#2}{#3}}{\Rcompsymbol{#1}{#2}{#3}}}
\newcommand{\simbologrego}[3][0]{%
\ifthenelse{\equal{#1}{0}}{\gsimpsymbol{#2}{#3}}{\rgcompsymbol{#1}{#2}{#3}}}
\newcommand{\Simbologrego}[3][0]{%
\ifthenelse{\equal{#1}{0}}{\Gsimpsymbol{#2}{#3}}{\Gcompsymbol{#1}{#2}{#3}}}
\newcommand{\simbolomisc}[3][0]{%
\ifthenelse{\equal{#1}{0}}{\msimpsymbol{#2}{#3}}{\mcompsymbol{#1}{#2}{#3}}}
\ifthenelse{\boolean{tsspages}}%
{\newcommand{\TSSThePage}[1]{& \ABNTEXabrevp{page}~#1}}%
{\newcommand{\TSSThePage}[1]{&}}
\providecommand{\pretextualchapter}[1]{\chapter*{#1}}
\newcommand{\abrevtablewidth}{0.7\textwidth}
\newcommand{\abrevcolumns}{lp{\abrevtablewidth}l}
\newcommand{\Babrevtable}{\begin{center}\begin{tabular}{\abrevcolumns}}
\newcommand{\Eabrevtable}{\end{tabular}\end{center}}
\newenvironment{tabeladesiglas}{\Babrevtable}{\Eabrevtable}
\newcommand{\symboltablewidth}{0.7\textwidth}
\newcommand{\symbolcolumns}{lp{\symboltablewidth}l}
\newcommand{\Bsymboltable}{\begin{center}\begin{tabular}{\symbolcolumns}}
\newcommand{\Esymboltable}{\end{tabular}\end{center}}
\AtBeginDocument{
\@ifpackageloaded{supertabular}{%
\renewcommand{\Babrevtable}{\begin{center}\begin{supertabular}{\abrevcolumns}}
\renewcommand{\Eabrevtable}{\end{supertabular}\end{center}}
\renewcommand{\Bsymboltable}{\begin{center}\begin{supertabular}{\symbolcolumns}}
\renewcommand{\Esymboltable}{\end{supertabular}\end{center}}
\PackageWarning{tabel-simbolos}{package supertabular detected, redefining table commands}
}{\relax}
}
\newenvironment{tabeladesimbolos}{\Bsymboltable}{\Esymboltable}
\ifcase\RomanOrder\or\def\FirstList{1}\or\def\SecondList{1}\or\def\ThirdList{1}\fi
\ifcase\GreekOrder\or\def\FirstList{2}\or\def\SecondList{2}\or\def\ThirdList{2}\fi
\ifcase\SymbolOrder\or\def\FirstList{3}\or\def\SecondList{3}\or\def\ThirdList{3}\fi
\newcommand{\ShowListOrder}[1]{%
\ifcase#1\or Romanos\or Gregos\or Simbolos\fi}
\typeout{Ordem: 1: \ShowListOrder{\FirstList} 2: \ShowListOrder{\SecondList} %
3: \ShowListOrder{\ThirdList}}
\newcommand{\PrintRomanList}{%
\ifthenelse{\boolean{SeparateListDisplay}}{\\ &\multicolumn{1}{c}{\emph{\romansymbolsname}}& }{}%
\ifthenelse{\boolean{UpperCaseLast}}{\printindex[romanlow]\printindex[romanupp]}%
{\printindex[romanupp]\printindex[romanlow]}}
\newcommand{\PrintGreekList}{%
\ifthenelse{\boolean{SeparateListDisplay}}{\\ &\multicolumn{1}{c}{\emph{\greeksymbolsname}}& }{}%
\ifthenelse{\boolean{UpperCaseLast}}{\printindex[greeklow]\printindex[greekupp]}%
{\printindex[greekupp]\printindex[greeklow]}}
\newcommand{\PrintSymbolList}{%
\ifthenelse{\boolean{SeparateListDisplay}}{\\ &\multicolumn{1}{c}{\emph{\othersymbolsname}}& }{}%
\printindex[miscelan]}
\newcommand{\PrintList}[1]{%
\ifcase#1\or\PrintRomanList\or\PrintGreekList\or\PrintSymbolList\fi}
\newcommand{\listadesiglas}{
\pretextualchapter{\listofabreviationsname}
\IfFileExists{\jobname.sigla}{
\begin{tabeladesiglas}%
\printindex[sigla]
\end{tabeladesiglas}}{Sua lista de siglas s\'o vai aparecer aqui quando for rodar o makeindex.
Veja a documenta\c c\~ao para mais detalhes.}}
\newcommand{\listadesimbolos}{%
\pretextualchapter{\listofsymbolsname}
\IfFileExists{\jobname.symbols}{%
\begin{tabeladesimbolos}%
\ifthenelse{\boolean{SeparateSortScheme}}{%
\PrintList{\FirstList}
\PrintList{\SecondList}
\PrintList{\ThirdList}}{%
\printindex[symbols]}
\end{tabeladesimbolos}}{Sua lista de s\'\i mbolos s\'o vai aparecer aqui quando for rodar o makeindex.
Veja a documenta\c c\~ao para mais detalhes.}}