-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathacroterm.sty
More file actions
97 lines (96 loc) · 3.28 KB
/
Copy pathacroterm.sty
File metadata and controls
97 lines (96 loc) · 3.28 KB
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
%%
%% This is file `acroterm.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% acroterm.dtx (with options: `package')
%%
%% The Acroterm package
%%
%% Copyright (C) 2010 by Jakob Voss
%%
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
%% this license is at: http://www.latex-project.org/lppl.txt
%%
%% This work is "maintained" (as per LPPL maintenance status)
%% by Jakob Voss.
%%
%% This work consists of the file acroterm.dtx
%% and the derived files acroterm.sty,
%% acroterm.ins, and
%% acroterm.pdf.
%%
\ProvidesPackage{acroterm}
[2010/12/06 v0.1b Manage and index acronyms and terms]
\RequirePackage{splitidx}[2009/02/18 v1.1a]
\RequirePackage{xifthen}[2009/03/17]
\newcommand{\acrostyle}[1]{\textsc{\lowercase{#1}}}
\newcommand{\Acrostyle}[1]{\textit{\uppercase{#1}}}
\newcommand{\termstyle}[1]{#1}
\newcommand{\Termstyle}[1]{\textit{#1}}
\newcommand{\tacrostyle}[2]{\termstyle{#1} (\acrostyle{#2})}
\newcommand{\Tacrostyle}[2]{\Termstyle{#1} (\acrostyle{#2})}
\newcommand{\atermstyle}[2]{\acrostyle{#1} (\termstyle{#2})}
\newcommand{\Atermstyle}[2]{\acrostyle{#1} (\termstyle{#2})}
\newcommand{\acroindexstyle}[1]{\acrostyle{#1}\acroexpand[ --- ]{#1}}
\newcommand{\provideacronym}[2]{% TODO: detect redefinitions
\expandafter\providecommand\expandafter{%
\csname acronymlong#1\endcsname}{#2}%
}
\newcommand{\acrotermbfhp}[1]{\textbf{\hyperpage{#1}}}
\newcommand{\acro@define}[2]{% #1: long term, #2: acronym
\sindex[idx]{#1|see{\acrostyle{#2}}}% TODO: acronyms in general index?
\@ifundefined{acronymlong#2}{%
\provideacronym{#2}{#1}}{}%
\sindex[acronym]{#2@\acroindexstyle{#2}|acrotermbfhp}%
}
\newcommand{\acroexpand}[2][]{%
\@ifundefined{acronymlong#2}{}{%
#1\csname acronymlong#2\endcsname}%
}
\def\term{\@ifstar\term@index\term@show}
\newcommand{\term@index}[2][]{%
\ifthenelse{\isempty{#1}}%
{\sindex[idx]{#2}}{\sindex[idx]{#1}}}
\newcommand{\termtestshow}[2][]{%
%\ifthenelse{\isempty{#1}}%
%{\sindex[idx]{#2}}{\sindex[idx]{#1}}%
\sindex[idx]{#1}\termstyle{#2}}
\newcommand{\term@show}[2][]{%
\term@index[#1]{#2}\termstyle{#2}}
\def\Term{\@ifstar\Term@index\Term@show}
\newcommand{\Term@index}[2][]{%
\ifthenelse{\isempty{#1}}%
{\sindex[idx]{#2|acrotermbfhp}}%
{\sindex[idx]{#1|acrotermbfhp}}}
\newcommand{\Term@show}[2][]{%
\Term@index[#1]{#2}\Termstyle{#2}}
\def\acro{\@ifstar\acro@index\acro@show}
\newcommand{\acro@index}[1]{%
{\sindex[acronym]{#1@\acroindexstyle{#1}}}}
\newcommand{\acro@show}[1]{%
\acrostyle{#1}\acro@index{#1}}
\def\Acro{\@ifstar\Acro@index\Acro@show}
\newcommand{\Acro@index}[1]{%
{\sindex[acronym]{#1@\acroindexstyle{#1}}}}
\newcommand{\Acro@show}[1]{%
\Acrostyle{#1}\Acro@index{#1}}
\newcommand{\tacro}[3][]{%
\ifthenelse{\isempty{#1}}%
{\acro@define{#2}{#3}}{\acro@define{#1}{#3}}% TODO: not define?
\tacrostyle{#2}{#3}}
\newcommand{\Tacro}[3][]{%
\ifthenelse{\isempty{#1}}%
{\acro@define{#2}{#3}}{\acro@define{#1}{#3}}%
\Tacrostyle{#2}{#3}}
\newcommand{\aterm}[2]{%
\acro@define{#2}{#1}% TODO: not define but only use?
\atermstyle{#1}{#2}}
\newcommand{\Aterm}[2]{%
\acro@define{#2}{#1}%
\Atermstyle{#1}{#2}}
\endinput
%%
%% End of file `acroterm.sty'.