forked from ivoa-std/ivoatex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tthdefs.tex
180 lines (146 loc) · 5.42 KB
/
tthdefs.tex
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
\newif\iftth
\iftth
\input ivoatexmeta
\input tthntbib.sty
\begin{html}
<meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
\end{html}
\definecolor{ivoacolor}{rgb}{0.0,0.318,0.612}
%%%%%%%%%%%%%%%%%%% ivoatex features
\renewcommand{\author}[2][0]{\def\@tmp{#1}
\if 0\@tmp
{\begin{html}<li class="author">\end{html}#2\begin{html}</li>\end{html}}\else
{\begin{html}<li class="author"><a href="#1">\end{html}#2\begin{html}</a></li>\end{html}}\fi}
\renewcommand{\previousversion}[2][0]{\def\@tmp{#1}
\if 0\@tmp
{\begin{html}<li class="previousversion">#2</li>\end{html}}\else
{\begin{html}<li class="previousversion">
<a href="#1">#2</a></li>\end{html}}\fi}
\renewcommand{\ivoagroup}[1]
{\begin{html}<dd id="ivoagroup">#1</dd>\end{html}}
\renewcommand{\editor}[2][0]{\def\@tmp{#1}
\if 0\@tmp
{\begin{html}<li class="editor">\end{html}#2\begin{html}</li>\end{html}}\else
{\begin{html}<li class="editor"><a href="#1">\end{html}#2\begin{html}</a></li>\end{html}}\fi}
\newcommand{\includeMeta}{%
\special{html:<span id='version'>}\ivoaDocversion\special{html:</span>
<span id='doctype'>}\ivoaDoctype\special{html:</span>
<span id='docname'>}\ivoaDocname\special{html:</span>
<span id='docdate'>}\ivoaDocdate\special{html:</span>}}
% this is for SVN-provided VCS info (and will be picked up by
% tth-ivoa.xslt.
\def\SVN$#1: #2 ${%
\special{html:<span id='vcs#1'>}#2\special{html:</span>}}
% this is for VCS info put in by git
\def\vcsrevision#1{%
\special{html:<span id='vcsRev'>}#1\special{html:</span>}}
\def\vcsdate#1{%
\special{html:<span id='vcsDate'>}#1\special{html:</span>}}
\def\vcsurl#1{%
\special{html:<span id='vcsURL'>}#1\special{html:</span>}}
\newenvironment{abstract}{%
\includeMeta
\begin{html}
</div> <!-- titlepage -->
<div id="abstract"><h2>Abstract</h2>
\end{html}
}{%
\special{html:</div> <!-- abstract -->
<h2>Status of this Document</h2>
<div id='statusOfThisDocument'>}\ivoaDoctype\special{html:</div>}
\tableofcontents
}
\newenvironment{generated}{%
\begin{html}
<div class="generated">
\end{html}
}{%
\begin{html}
</div> <!-- generated -->
\end{html}
}
\newenvironment{admonition}[1]{%
\begin{html}
<div class="admonition">
<p class="admonition-type">#1</p>
\end{html}
}{%
\begin{html}
</div> <!-- admonition -->
\end{html}
}
\newcommand{\lstinputlisting}[2][plain]{
\special{html:<div keyvals="#1">}
\verbatiminput{#2}
\special{html:</div>}
}
\newcommand{\lstinline}[1]{\special{html:<code>}#1\special{html:</code>}}
\newcommand{\lstloadlanguages}[1]{}
\newcommand{\lstset}[1]{}
\newenvironment{lstlisting}[1][plain]
{\special{html:<div keyvals="#1">}\tthverbatim{lstlisting}}
{\special{html:</div>}}
\def\nolinkurl#1{\special{html:<span class="nolinkurl">}%
\verb|#1|%
\special{html:</span>}}
\newenvironment{bigdescription}{%
\begin{html}<div class="bigdescription">\end{html}
\begin{description}\let\term\item
}{\end{description}\begin{html}</div>\end{html}}
\newenvironment{longtermsdescription}{%
\begin{html}<div class="longtermsdescription">\end{html}
\begin{description}
}{\end{description}\begin{html}</div>\end{html}}
% declare additional css to be included; only effective in the preamble
\renewcommand{\customcss}[1]{%
\begin{html}<span class="customcss" ref="#1"/>\end{html}}
\newcommand{\specialterm}[2]{%
\begin{html}<span class="#1">\end{html}#2\begin{html}</span>\end{html}}
\newcommand{\xmlel}[1]{\specialterm{xmlel}{#1}}
\newcommand{\vorent}[1]{\specialterm{vorent}{#1}}
%don't do table rules, these come in through CSS
\newcommand{\sptablerule}{}
\def\dquote{"}
\newcommand{\todo}[2][None]{%
\begin{html}<span class="redaction">#2</span>\end{html}}
\newenvironment{SCfigure}{\begin{figure}}{\end{figure}}
\newcommand{\ivoatex}{%
\special{html:<span class="ivoatex">IVOAT<sub>E</sub>X</span>}}
\newcommand{\auxiliaryurl}[1]{%
\href{http://www.ivoa.net/documents/\ivoaDocname/\ivoaDocdatecode/#1}
{http://www.ivoa.net/documents/\ivoaDocname/\ivoaDocdatecode/#1}}
\newenvironment{inlinetable}{}{}
% TODO: support some common styles
\newenvironment{compactenum}[1][None]
{\begin{html}<div class="compact">\end{html}\begin{enumerate}}
{\end{enumerate}\begin{html}</div>\end{html}}
\newenvironment{compactitem}[1][None]
{\begin{html}<div class="compact">\end{html}\begin{itemize}}
{\end{itemize}\begin{html}</div>\end{html}}
%%%%%%%%%%%%%%%%%%%%%%%%%%% Simplified support for Harvard citation style
\newcommand{\harvarditem}[4][0]{%
\special{html:<a name='#4'/>}
\if 0#1 \item[#2 (#3)]
\else \item[#1 (#3)]\fi}
\newcommand{\harvardurl}[1]{\url{#1}}
\newcommand{\harvardand}{\&}
\newcommand{\harvardyearleft}{(}
\newcommand{\harvardyearright}{)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%% Hacks
% shut up harmless error due to some package we're actually using
\def\AtBeginDocument#1{\relax}
\def\pgfsyspdfmark#1#2#3{\relax}
\def\spacefactor{\relax}
\newbox\voidb@x
\def\@m{\relax}
% The default rendering of the captions is really ugly, and so I need to
% fiddle in some HTML to let me style it. I frankly cannot quite
% say what tth things the first argument to caption would be in
% the following definition; let's consider it an implementation detail.
\newcommand\caption[2][]{\special{html:<div class="caption">}%
\tthcaption{#2}\special{html:</div>}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%% Now open up titlepage metadata
\begin{html}
<div id="titlepage">
\end{html}
\fi