"Fossies" - the Fresh Open Source Software Archive 
Member "hevea-2.35/latexcommon.hva" (16 Jan 2021, 28424 Bytes) of package /linux/www/hevea-2.35.tar.gz:
As a special service "Fossies" has tried to format the requested text file into HTML format (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1 \newif\ifhevea\heveatrue
2 \let\ifimage\iffalse
3 \newenvironment{htmlonly}{}{}
4 \newcommand{\home}[1]{\~{}#1}
5 %%%%%%%%%%%%%%%% Maths environments and TeXisms
6 \newcommand{\@dot}{.}
7 \newcommand{\textright}[1]{\def\@tmp{#1}\ifx\@tmp\@dot\else#1\fi}
8 \newcommand{\textleft}[1]{\def\@tmp{#1}\ifx\@tmp\@dot\else#1\fi}
9 \def\mathord#1{#1}
10 \def\mathrel#1{#1}
11 \def\mathbin#1{#1}
12 \def\mathopen#1{#1}
13 \def\mathclose#1{#1}
14 \def\mathchardef#1#2{}
15 \newenvironment{math}{$}{$}
16 \newcommand{\(}{$}\newcommand{\)}{$}
17 \newcommand{\[}{$$\@skip@blanks}\newcommand{\]}{$$}
18 \newcommand{\sp}[1]{^{#1}}\newcommand{\sb}[1]{_{#1}}
19 \newcommand{\ensuremath}[1]{\ifmmode#1\else\(#1\)\fi}
20 \newcommand{\@edm@act}{}
21 \newenvironment{ensuredisplaymath}
22 {\ifdisplay\ifmmode\def\@edm@act{NO}\else\let\@edm@act\relax\fi\else\let\@edm@act\relax\fi%
23 \ifx\@edm@act\relax$$\fi}
24 {\ifx\@edm@act\relax$$\fi}
25 \newcommand{\to}{\rightarrow}
26 %%%
27 \newcommand{\\*}{\\}
28 %%% Arrays
29 \let\arraystretch\@empty
30 \newenvironment{array}
31 {\let\\=\@HEVEA@bsbs\let\@hevea@amper=\@HEVEA@amper\@array}
32 {\end@array}
33 \newenvironment{tabular}
34 {\let\\=\@HEVEA@bsbs\let\@hevea@amper=\@HEVEA@amper\@tabular}
35 {\end@tabular}
36 \newenvironment{tabular*}
37 {\let\\=\@HEVEA@bsbs\let\@hevea@amper=\@HEVEA@amper\@tabular*}
38 {\end@tabular*}
39 %%%%% Arrays with attribute argument
40 \newenvironment{Array}
41 {\let\\=\@HEVEA@bsbs\let\@hevea@amper=\@HEVEA@amper\@Array}
42 {\end@Array}
43 \newenvironment{Tabular}
44 {\let\\=\@HEVEA@bsbs\let\@hevea@amper=\@HEVEA@amper\@Tabular}
45 {\end@Tabular}
46 \newenvironment{Tabular*}
47 {\let\\=\@HEVEA@bsbs\let\@hevea@amper=\@HEVEA@amper\@Tabular*}
48 {\end@Tabular*}
49 %%% Equations
50 \def\@changelabel
51 {\let\@oldlabel\label%
52 \renewcommand{\label}[1]{\@oldlabel[~]{##1}}}
53 \newstyle{.equationcontainer}{position:relative;}
54 \def\@eqnnumstyle{float:right;left:auto;position:absolute;right:0}
55 \newstyle{.equationnumber}{\@eqnnumstyle}
56 \newstyle{.equationnumber-valign}{\@eqnnumstyle;margin-top:-0.5em;}
57 \def\@equationnumber@class{equationnumber}
58 \newcommand{\set@equ@num@align}[1]{%
59 \ifthenelse{\equal{#1}{leqno}}{\def\@eqnnumstyle{float:left;left:0;position:absolute;right:auto}}{}%
60 }
61 \newcommand{\honor@leqno@option}{%
62 \@callprim{\@iter}{\string\set@equ@num@align,{\char123\usebox{\@document@opts}\char125}}
63 }
64 \newcommand{\eqno}[1]{\@open{span@inline@block}{class="\@equationnumber@class"}#1\@close{span@inline@block}}
65 \newenvironment{equation}{\@open{div}{class="equationcontainer"}\[\@changelabel\refstepcounter{equation}}{\eqno{(\theequation)}\]\@close{div}}
66 \newenvironment{eqnarray*}{$$\begin{array}{rcl}}{\end{array}$$}
67 \gdef\@yes@number{\eqno{(\theequation)}}
68 \gdef\@no@number{\addtocounter{equation}{-1}}
69 \newcommand{\@nonumber}{\global\let\@number\@no@number}
70 \newcommand{\@yesnumber}{\global\let\@number\@yes@number}
71 \let\nonumber\@nonumber
72 \newcounter{@eqna@col}
73 \newcommand{\lefteqn}[1]{\begin{ensuredisplaymath}\raggedright#1\end{ensuredisplaymath}}
74 \let\@HEVEA@lefteqn\lefteqn
75 \newenvironment{eqnarray}
76 {\@ifundefined{@eqna@inside}{\def\@eqna@inside{}}{\hva@warn{Nested eqnarray}}%
77 \def\@equationnumber@class{equationnumber-valign}%
78 \@open{div}{class="equationcontainer"}\[\@changelabel\def\@currentlabel{\theequation}%
79 \setcounter{@eqna@col}{0}\@yesnumber\stepcounter{equation}
80 \let\@PBS=\@HEVEA@bsbs
81 \let\@PAM=\@HEVEA@amper
82 \renewcommand{\lefteqn}[1]{\let\lefteqn\@HEVEA@lefteqn\multicolumn{3-\value{@eqna@col}}{l}{\ifthenelse{\value{@eqna@col}=0}{\qquad}{}##1}\setcounter{@eqna@col}{2}}
83 \newcommand{\@eqna@complete}
84 {\whiledo{\value{@eqna@col}<2}{&}}
85 \renewcommand{\@hevea@amper}
86 {\ifthenelse{\value{@eqna@col}<2}
87 {\stepcounter{@eqna@col}\@PAM}
88 {\hva@warn{Extra column in eqnarray}}}
89 \renewcommand{\\}[1][]{\@eqna@complete\@PAM\@number\setcounter{@eqna@col}{0}\@yesnumber\stepcounter{equation}\@PBS}
90 \@array{rclr}}
91 {\\{}\addtocounter{equation}{-1}\end@array\]\@close{div}}
92 \def\mathrm#1{{\rm#1}}
93 \def\mathtt#1{{\tt#1}}
94 \def\mathit#1{{\it#1}}
95 \def\mathbf#1{{\bf#1}}
96 \def\mathcal#1{{\cal#1}}
97 \def\mathsf#1{{\sf#1}}
98 \def\scriptstyle{\ifmathml{\scriptsize}\else\scriptsize\fi}
99 \def\scriptscriptstyle{\ifmathml{\scriptsize\@incsize{-1}}\else\scriptsize\@incsize{-1}\fi}
100 \def\textstyle{\ifmathml\@style{mtext}\fi}
101 \def\textsuperscript#1{\ensuremath{^{\mbox{#1}}}}
102 %\def\textsubscript#1{\ensuremath{_{\mbox{#1}}}}%existe pas!
103 %%%%% Figures and tables
104 %%General \caption command: #1 -> env name, #2 -> \caption arg
105 \newcommand{\hva@caption}[2]{%
106 \refstepcounter{#1}%
107 \begin{hva@capted}%
108 \csname #1name\endcsname{} \csname the#1\endcsname: #2%
109 \end{hva@capted}%
110 }
111 \newstyle{.floatrule}{background-color: black; border: none; height: 1px; width: 80\%}
112 \setenvclass{floatrule}{floatrule}
113 \newcommand{\@floatrule}{%
114 \ifu\floatseparator
115 \begin{center}%
116 \@hr[\envclass@attr{floatrule}]{}{}%
117 \end{center}%
118 \else
119 \floatseparator
120 \fi
121 }
122 \setenvclass{figure}{figure}
123 \newenvironment{figure}[1][]{%
124 \@forcecommand{\caption}[2][]{\hva@caption{figure}{##2}}%
125 \@open@quote{\envclass@attr{figure}}%
126 \@floatrule
127 }{\@floatrule\@close@quote}
128 \newenvironment{figure*}[1][]{\begin{figure}[#1]}{\end{figure}}
129 \setenvclass{table}{table}
130 \newenvironment{table}[1][]{%
131 \@forcecommand{\caption}[2][]{\hva@caption{table}{##2}}%
132 \@open@quote{\envclass@attr{table}}%
133 \@floatrule
134 }{\@floatrule\@close@quote}
135 \newenvironment{table*}[1][]{\begin{table}[#1]}{\end{table}}
136 \@forcecommand{\suppressfloats}[1][]{}
137 \newcounter{topnumber}
138 \newcounter{bottomnumber}
139 \newcounter{totalnumber}
140 \newcounter{dbltopnumber}
141 %% Page Styles
142 \def\pagestyle#1{}
143 \def\thispagestyle#1{}
144 %%% No table of figures/tables
145 \def\listoffigures{}
146 \def\listoftables{}
147 \newcommand{\contentsline}[3]{}
148 \newcommand{\numberline}[2]{}
149 \newcommand{\addtocontents}[2]{}
150 \newcommand{\markright}[1]{}
151 \newcommand{\markboth}[2]{}
152 \newcommand{\pagenumbering}[1]{}
153 \newcommand{\twocolumn}[1][]{}
154 \newcommand{\onecolumn}{}
155 %%% Stackrel et compagine
156 \newcommand{\stackrel}[2]{\mathop{#2}\limits^{\scriptsize{}#1}\nolimits}
157 \def\space@varray{1}
158 \newenvironment{@varray}
159 {\prim@def{\@table@attributes}{style="border:0;border-spacing:\space@varray{};border-collapse:separate" class="cellpadding0"}\def\space@varray{0}%
160 \begin{array}{c}}
161 {\end{array}}
162 %% Phantom
163 \newstyle{.phantom}{display: inline-block; visibility: hidden}
164 \newstyle{.hphantom}{display: inline-block; height: 0; visibility: hidden}
165 \newstyle{.vphantom}{display: inline-block; visibility: hidden; width: 0}
166 \newstyle{.smash}{display: inline-block; height: 0; line-height: 0}
167 \setenvclass{phantom}{phantom}
168 \setenvclass{hphantom}{hphantom}
169 \setenvclass{vphantom}{vphantom}
170 \setenvclass{smash}{smash}
171 \newcommand{\phantom}[1]{\@open{span@inline@block}{\envclass@attr{phantom}}#1\@close{span@inline@block}}
172 \newcommand{\hphantom}[1]{\@open{span@inline@block}{\envclass@attr{hphantom}}#1\@close{span@inline@block}}
173 \newcommand{\vphantom}[1]{\@open{span@inline@block}{\envclass@attr{vphantom}}#1\@close{span@inline@block}}
174 \newcommand{\smash}[1]{\@open{span@inline@block}{\envclass@attr{smash}}#1\@close{span@inline@block}}
175 %%% OLD DEFINITIONS : rediscovered, only \textoverline redefined in hevea.hva
176 %%%
177 \newcommand{\textoverline}[1]{\hva@warn{overline ignored in text mode}#1}
178 \def\overline#1{\ifdisplay
179 \begin{@varray}\hline #1\end{@varray}\else\textoverline{#1}\fi}
180 \newcommand{\textunderline}[1]{{\@style{U}#1}}
181 \def\underline#1{\ifdisplay
182 \begin{@varray}#1\\\hline\end{@varray}\else\textunderline{#1}\fi}
183 %%%Miscleanous, title stuff
184 %\input{common-math.hva}
185 \newcommand{\thanks}[1]{\footnote{#1}}
186 \newenvironment{titlepage}{}{}
187 \newcommand{\and}{\quad}
188 \newcommand{\title}[1]{\gdef{\@title}{#1}\global\let\@@title\relax}
189 \newcommand{\@titlebis}[1]
190 {\ifu\@@title\gdef{\@title}{#1}\title@tohaux{#1}\fi}
191 \newcommand{\@titleaux}[1]{\gdef{\@title}{#1}}
192 \newcommand{\author}[1]{\gdef{\@author}{#1}\global\let\author\@gooble}
193 \newcommand{\date}[1]{\gdef{\@date}{#1}\global\let\date\@gooble}
194 %% Lists
195 \setenvclass{li-itemize}{li-itemize}
196 \newstyle{.li-itemize}{margin:1ex 0ex;}
197 \newcommand{\item}[1][]{\hva@warn{\item outside a list-making environment}}
198 \newcommand{\@itemitemize}[1][!*!]
199 {\@itemize@li{\envclass@attr{li-itemize}}\ifthenelse{\equal{#1}{!*!}}{}{\hva@warn{Optional argument to \item in itemize environment}{#1}}}
200 \setenvclass{li-enumerate}{li-enumerate}
201 \newstyle{.li-enumerate}{margin:1ex 0ex;}
202 \newcommand{\@itemenumerate}[1][!*!]
203 {\let\@currentlabel\csname the\@enumcitem\endcsname%
204 \stepcounter{\@itemcount}\@enumerate@linum{\envclass@attr{li-enumerate}}\ifthenelse{\equal{#1}{!*!}}{}{\hva@warn{Ignored optional argument to \item in enumerate environment}}}
205 %environement itemize
206 \setenvclass{itemize}{itemize}
207 \newenvironment{itemize}
208 {\@open{ul}{\envclass@attr{itemize}}\let\item\@itemitemize}
209 {\@close{ul}}
210 \newcounter{enumcount}
211 \newcommand{\@enumstyle}
212 {\ifthenelse{\value{enumcount}=1}{type=1}{}%
213 \ifthenelse{\value{enumcount}=2}{type=a}{}%
214 \ifthenelse{\value{enumcount}=3}{type=i}{}%
215 \ifthenelse{\value{enumcount}=4}{type=A}{}}
216 \newcommand{\@enumcitem}
217 {\ifthenelse{\value{enumcount}=1}{itemi}{}%
218 \ifthenelse{\value{enumcount}=2}{itemii}{}%
219 \ifthenelse{\value{enumcount}=3}{itemiii}{}%
220 \ifthenelse{\value{enumcount}=4}{itemiiii}{}%
221 \ifthenelse{\value{enumcount}>4}{itemv}{}}
222 \newcounter{itemi}
223 \newcounter{itemii}
224 \renewcommand{\theitemii}{\theitemi(\alph{itemii})}
225 \newcounter{itemiii}
226 \renewcommand{\theitemiii}{\theitemii\roman{itemiii}}
227 \newcounter{itemiiii}
228 \renewcommand{\theitemiiii}{\theitemiii(\Alph{itemiiii})}
229 \newcounter{itemv}
230 \renewcommand{\theitemv}{\theitemiiii}
231 \newcommand{\itemi}{itemi}
232 \newcommand{\itemii}{itemii}
233 \newcommand{\itemiii}{itemiii}
234 \newcommand{\itemiiii}{itemiiii}
235 \newcommand{\itemv}{itemv}
236 %environment enumerate
237 \setenvclass{enumerate}{enumerate}
238 \newenvironment{enumerate}
239 {\stepcounter{enumcount}%
240 \@open{OL}{\envclass@attr[ ]{enumerate}\@enumstyle}%
241 \let\item\@itemenumerate%
242 \let\@itemcount\csname\@enumcitem\endcsname%
243 \setcounter{\@itemcount}{0}}
244 {\@close{OL}\addtocounter{enumcount}{-1}}
245 %
246 %% Modified to support styles e.g.
247 %% <DL class=list>,
248 %% <DT class=dt-list>
249 %% ONLY CHANGES : 1) class=list added to \@open{DL} argument
250 %% 2) \@dt replaced by \@list@dtdd
251 %% Remove these to get original behaviour
252 %
253 \newcommand{\setlistclass}[1]
254 {\setenvclass{list}{\getenvclass{#1}}%
255 \setenvclass{dt-list}{\getenvclass{dt-#1}}%
256 \setenvclass{dd-list}{\getenvclass{dd-#1}}}
257 \setenvclass{list}{list}
258 \setenvclass{dt-list}{dt-list}
259 \setenvclass{dd-list}{dd-list}
260 \newenvironment{list}[2]
261 {\@open{dl}{\envclass@attr{list}}
262 \renewcommand{\item}[1][#1]{\@dtdd{##1}{\envclass@attr{dt-list}}{\envclass@attr{dd-list}}}%
263 \@forcecommand{\makelabel}[1]{##1}%
264 #2%exec
265 }{\@close{dl}}
266 \setenvclass{description}{description}
267 \setenvclass{dt-description}{dt-description}
268 \setenvclass{dd-description}{dd-description}
269 \newstyle{.dd-description}{margin:0ex 0ex 1ex 4ex;}
270 \newstyle{.dt-description}{margin:0ex;}
271 \newenvironment{@list@description}[2]
272 {\@open{dl}{\envclass@attr{description}}%
273 \renewcommand{\item}[1][#1]{\@dtdd{##1}{\envclass@attr{dt-description}}{\envclass@attr{dd-description}}}%
274 \@forcecommand{\makelabel}[1]{##1}%
275 #2%exec
276 }{\@close{dl}}
277 \newenvironment{description}{\begin{@list@description}{}{\renewcommand{\makelabel}[1]{\textbf{##1}}}}{\end{@list@description}}
278 \setenvclass{trivlist}{trivlist}
279 \setenvclass{dt-trivlist}{dt-trivlist}
280 \setenvclass{dd-trivlist}{dd-trivlist}
281 \newenvironment{trivlist}
282 {\setlistclass{trivlist}\begin{list}{}{}}{\end{list}}
283 %% Input...
284 \newcommand{\listfiles}{}
285 %% Line breaking
286 \newcommand{\linebreak}[1][4]{\ifthenelse{#1=4}{\vspace{1em}}{}}
287 \newcommand{\nolinebreak}[1][4]{}
288 \newcommand{\sloppy}{}
289 \newcommand{\fussy}{}
290 \newenvironment{sloppypar}{}{}
291 \newcommand{\goodbreak}{}
292 %%%%%%%%%%%% Emulate hyphenation
293 \newcommand{\hyphenation}[1]{}
294 %% Page Breaking
295 \newcommand{\pagebreak}[1][]{}
296 \newcommand{\nopagebreak}[1][]{}
297 \newcommand{\enlargethispage}[1]{}
298 \newcommand{\enlargethispage*}[1]{}
299 \newcommand{\newpage}{}
300 \newcommand{\clearpage}{}
301 \newcommand{\cleardoublepage}{}
302 %%Lengths are ignored
303 \newcommand{\newlength}[1]
304 {\if@toplevel\begin{toimage}\newlength{#1}\end{toimage}\fi}
305 \newcommand{\setlength}[2]
306 {\if@toplevel\begin{toimage}\setlength{#1}{#2}\end{toimage}\fi}
307 \newcommand{\addtolength}[2]
308 {\if@toplevel\begin{toimage}\addtolength{#1}{#2}\end{toimage}\fi}
309 \newcommand{\settowidth}[2]{}
310 \newcommand{\settodepth}[2]{}
311 \newcommand{\settoheight}[2]{}
312 \newcommand{\fill}{}
313 \newcommand{\stretch}[1]{}
314 %%%%%%%%%%%%%%%%
315 \def\makeatletter{}
316 \def\makeatother{}
317 %%%%%%%%%%%% Ignore head and foot specifications
318 \def\cfoot{}
319 \def\chead{}
320 \newcommand{\rfoot}[2][]{}
321 \newcommand{\lfoot}[2][]{}
322 \newcommand{\rhead}[2][]{}
323 \newcommand{\lhead}[2][]{}
324 \newcommand{\chaptermark}[1]{}
325 \newcommand{\sectionmark}[1]{}
326 \newcommand{\oddsidemargin}{}
327 \newcommand{\evensidemargin}{}
328 %%%%%%%% various commands
329 \def\protect{}
330 \def\fancyplain#1#2{}
331 \def\newblock{}
332 \def\nobreak{}
333 \def\newdimen#1{}
334 \newenvironment{samepage}{}{}
335 \def\raggedbottom{}
336 \def\emergencystretch#1{}
337 %%%%%%%%%%%% A few texisms
338 \newcommand{\long}{}
339 \newcommand{\newline}{\@br}
340 \newcommand{\expandafter}{}
341 %% Arrays and tabular
342 \newcommand{\extracolsep}[1]{}
343 \newcommand{\cline}[1]{\hva@warn{\cline changed into \hline}\hline}
344 \newcommand{\cases}[1]{\left\{\begin{array}{l>{$}l<{$}}#1\end{array}\right.}
345 \newcommand{\endcases}{}
346 %%% tabularx
347 \newenvironment{tabularx}[2]{\begin{tabular}{#2}}{\end{tabular}}
348 \newcolumntype{X}{p{}}
349 %%% AtEof
350 \newcommand{\AtEndOfFile}[1]{\addtokens{\@ateof}{#1}}
351 %%% To save global options
352 \newsavebox{\@document@opts}
353 %%% AtBeginDocument and AtEndDocument
354 \newtokens{\@atbegindocument}
355 \newcommand{\AtBeginDocument}[1]{\addtokens{\@atbegindocument}{#1}}
356 \AtBeginDocument{\@begin@document}
357 \AtBeginDocument
358 {\@set@ttmode%set the value of tt_mode in Lexscan now that \tt is defined.
359 \begin{toimage}
360 \pagestyle{empty}
361 \thispagestyle{empty}
362 \begin{document}
363 \end{toimage}}
364 \newtokens{\@atenddocument}
365 \newcommand{\AtEndDocument}[1]{\addtokens{\@atenddocument}{#1}}
366 \def\@final@footer{%
367 \iffooter\ifhtml
368 \@print{<!--FOOTER-->}
369 \fi\@footer\fi}
370 \AtEndDocument
371 {\@imagenopt%
372 \begin{toimage}
373 \end{document}
374 \end{toimage}}
375 \def\@end@document@seen{NO}%
376 \AtEndDocument{\gdef\@end@document@seen{OK}}
377 %%% Boxes
378 \newcommand{\@makebox}[3]{\hva@warn{makebox}\mbox{#3}}
379 \newcommand{\@framebox}[3]{\hva@warn{framebox}\fbox{#3}}
380 \newcommand{\@raisebox}[4]{\hva@warn{raisebox}\mbox{#4}}
381 \newcommand{\parbox}[3][]{\hva@warn{parbox}#3}
382 \newcommand{\textfbox}[1]{\hva@warn{\fbox in text}\mbox{#1}}
383 \def\fbox#1{%
384 \ifdisplay
385 \begin{array}{|c|}%
386 \hline
387 #1%
388 \hline
389 \end{array}%
390 \else
391 \textfbox{#1}%
392 \fi
393 }
394 \newcommand{\hbox}[1]{\hva@warn{\hbox}\mbox{#1}}
395 \newcommand{\displaystyle}{\ifdisplay\else\hva@warn{\displaystyle ignored}\fi}
396 %%% Paragraphs
397 \let\par\@empty
398 \AtBeginDocument{\let\par\hva@par}
399 %%% Equations
400 \AtBeginDocument{\honor@leqno@option}
401 %%% References
402 \newcommand{\@currentlabel}{}
403 %%% Index references
404 \newcommand{\hva@idx@counter}[1]{\def\csname #1@idx@counter\endcsname{}}
405 \hva@idx@counter{part}%
406 \hva@idx@counter{chapter}%
407 \hva@idx@counter{section}%
408 \hva@idx@counter{subsection}%
409 \hva@idx@counter{subsubsection}%
410 \hva@idx@counter{paragraph}%
411 \hva@idx@counter{subparagraph}%
412 \newcommand{\@indexlabel}{}
413 \newcommand{\refstepcounter}[1]
414 {\let\@currentlabel\csname the#1\endcsname%
415 \ifu\csname #1@idx@counter\endcsname\else%
416 \let\@indexlabel\csname the#1\endcsname\fi%
417 \stepcounter{#1}}
418 \setenvclass{theindex}{theindex}
419 \newcommand{\hevea@indexprologue}{}
420 \newenvironment{the@hevea@index}%
421 {\@open{div}{class="\getenvclass{theindex}"}\@open@par[id="indexprologue"]\hevea@indexprologue\@close@par}%
422 {\@close{div}}
423 %%% Aux files
424 \newcommand{\@fst}[2]{#1}
425 \newcounter{labelorder}
426 \newcommand{\newlabel}[2]
427 {\stepcounter{labelorder}%
428 \prim@def\csname #1@label@order\endcsname{\thelabelorder}%
429 \@newlabel{#1}{\@funcall{\@fst}{#2}}}
430 %Also define section id to change
431 \newcommand{\new@anchor@label}[3]
432 {\def\csname #1@named@sec\endcsname{#2}%
433 \newlabel{#2}{#3}}
434 \newcommand{\@writefile}[2]{}
435 \newcommand{\@setckpt}[2]{}
436 \newcommand{\std@label}[2][]{\@locname{#2}{#1}\@auxwrite{#2}{\@currentlabel}}
437 \newcommand{\insec@label}[2][]
438 {\ifu\csname\@the@sec{}@label@seen\endcsname
439 \def\csname\@the@sec{}@label@seen\endcsname{#2}%
440 \def\csname\@the@sec{}@named@sec\endcsname{#2}%
441 #1\@@auxwrite{\@the@sec}{#2}{\@currentlabel}\else
442 \def\@tmp{#2}%
443 \ifx\@tmp\csname\@the@sec{}@label@seen\endcsname\else
444 \std@label[#1]{#2}\fi\fi}
445 \newcommand{\label}[2][]
446 {\ife\@the@sec\std@label[#1]{#2}\else\insec@label[#1]{#2}\fi}
447
448 %%No label translation any longer
449 \newcommand{\@check@anchor@label}[1]{#1}
450 \newcommand{\ref}[1]{\@locref{\@check@anchor@label{#1}}{\@auxread{#1}}}
451 \newcommand{\pageref}[1]{\@locref{#1}{??}}
452 \let\@input\input%appears inside aux files
453 \newcommand{\@readhaux}[1]
454 {\@hauxinit%
455 \@iffileexists{#1.haux}
456 {\@try{\input{#1.haux}}{\hva@warn{Failure while reading .haux}}}
457 {}%
458 \@hauxfinal}
459 \newcommand{\@readaux}[1]{\input{#1.aux}}
460 \newcommand{\@readauxorhaux}[2]
461 {\@stopoutput\@stopimage%
462 \ifthenelse{\@fileexists{#1.aux} \and \not \boolean{fixpoint}}
463 {\@try
464 {\@readaux{#1}}
465 {\hva@warn{Failure while reading .aux, reading .haux}\@readhaux{#2}}}
466 {\@readhaux{#2}}%
467 \@restartoutput\@restartimage}
468 \AtBeginDocument
469 {\@sawdocumenttrue\@save@macros\@readauxorhaux{\@basein}{\jobname}}
470 %%%%%%%%%%% Bibliography
471 \newcommand{\bibdata}[1]{}
472 \newcommand{\bibliography}[1]
473 {\@auxdowrite{\@print{\bibdata}\{\@getprint{#1}\}
474 }%
475 \@iffileexists{\jobname.hbbl}
476 {\input{\jobname.hbbl}}
477 {\@iffileexists{\jobname.bbl}
478 {\input{\jobname.bbl}}
479 {}}}
480 \newcommand{\bibstyle}[1]{}
481 \newcommand{\@bibliographystyle}[1]
482 {\@auxdowrite{\@print{\bibstyle}\{\@getprint{#1}\}
483 }}
484 \newcommand{\bibliographystyle}[1]
485 {\AtBeginDocument{\@bibliographystyle{#1}}}
486 \AtBeginDocument{\let\bibliographystyle\@bibliographystyle}
487 \newcommand{\citation}[1]{}
488 \newcommand{\nocite}[1]
489 {\@auxdowrite{\@print{\citation}\{\@getprint{#1}\}
490 }}
491 \setenvclass{thebibliography}{thebibliography}
492 \setenvclass{dt-thebibliography}{dt-thebibliography}
493 \setenvclass{dd-thebibliography}{dd-thebibliography}
494 \newcommand{\refname}{References}
495 \newenvironment{thebibliography}[1]
496 {\@end{thebibliography}%Execute sectionning command in outer scope
497 \@bibliosection{\refname}%
498 \@begin{thebibliography}%
499 \setlistclass{thebibliography}%
500 \begin{list}{\stepcounter{heveabib}\theheveabib}{\let\makelabel\@biblabel}}
501 {\end{list}}
502 \newcounter{heveabib}\newcommand{\bibtaghook}[1]{#1}%
503 \newcommand{\bibitem}[2][!*!]
504 {\ifthenelse{\equal{#1}{!*!}}
505 {\refstepcounter{heveabib}\@bibwrite{\theheveabib}{\bibtaghook{#2}}}
506 {\@bibwrite{#1}{\bibtaghook{#2}}}\item[#2]}
507 \newcommand{\@open@cite@one}{[}
508 \newcommand{\@open@cite@two}{}
509 \newcommand{\@cite@pre}[1]{}
510 \newcommand{\@close@cite}{]}
511 \newcommand{\@sep@cite}{,}
512 \newcommand{\@sep@cite@space}{ }
513 \newcommand{\@post@cite}{,}
514 \newcommand{\@bib@post}[1]{\ifthenelse{\equal{#1}{}}{}{\@post@cite{} #1}}
515 %%%%%%%%%%% Footnotes
516 \newcommand{\@footnotelevel}{document}%
517 \newcommand{\flushdef}[1]{\def\@footnotelevel{#1}}
518 \let\footnoteflush\@footnoteflush
519 \def\footnote@c{footnote}%indirection to footnote counter
520 \newcommand{\footnotesep}[1]{}
521 \newcounter{savenote}\newcounter{onemark}
522 \newcommand{\@fnmarktext}[1]{%
523 \setcounter{savenote}{\value{footnote}}%
524 \setcounter{footnote}{#1}%
525 \thefootnote%
526 \setcounter{footnote}{\value{savenote}}}
527 \newcommand{\@fnmarknote}[1]{%
528 \setcounter{savenote}{\value{footnote}}%
529 \setcounter{footnote}{#1}%
530 \@notenotestyle{\thefootnote}%
531 \setcounter{footnote}{\value{savenote}}}
532 %%%%%%%%%%%%%%%%%%
533 \newcommand{\footnotemark}[1][!*!]{%
534 \ifthenelse{\equal{#1}{!*!}}%
535 {\stepcounter{\footnote@c}\@stepanchor{\value{\footnote@c}}\setcounter{onemark}{\value{\footnote@c}}}%
536 {\setcounter{onemark}{#1}}%
537 \ifu\csname text@seen@\@anchorval{\value{onemark}}\endcsname%
538 \global\let\csname text@seen@\@anchorval{\value{onemark}}\endcsname\relax
539 %\typeout{Defined text@seen@\@anchorval{\value{onemark}}}%
540 \@notetextstyle{\@noteref{note}{text}
541 {\@anchorval{\value{onemark}}}
542 {\@fnmarktext{\value{onemark}}}}\else
543 \@notetextstyle{\@notepointer{note}
544 {\@anchorval{\value{onemark}}}
545 {\@fnmarktext{\value{onemark}}}}\fi
546 }
547 %Text of footnote.
548 \newcommand{\footnotetext}[2][\value{\footnote@c}]
549 {\@footnotetext{#1}{\@open@footnotetext{}#2\@close@footnotetext}}
550 \newcommand{\footnote}[2][!*!]{%
551 \ifthenelse{\equal{#1}{!*!}}
552 {\footnotemark\footnotetext{#2}}
553 {\footnotemark[#1]\footnotetext[#1]{#2}}}
554 %%% For defining Sectioning commands
555 \newif\if@refs\@refstrue
556 \newenvironment{@norefs}
557 {\@refsfalse%
558 \renewcommand{\@openlocref}[1]{}\renewcommand{\@closelocref}{}%
559 \renewcommand{\@aelement}[3][]{##3}\renewcommand{\label}[2][]{}\renewcommand{\ref}[1]{\@auxread{##1}}\renewcommand{\footnote}[1]{}}
560 {}
561 \newcounter{secnumdepth}\setcounter{secnumdepth}{3}%
562 \newcounter{tocdepth}\setcounter{tocdepth}{2}%
563 \newcommand{\@altdepth}[3]{\ifthenelse{\value{secnumdepth} > #1}{#2}{#3}}
564 \newcommand{\@checkdepth}[2]{\@altdepth{#1}{#2}{}}
565 \newcommand{\@alttocdepth}[3]{\ifthenelse{\value{tocdepth} > #1}{#2}{#3}}%
566 \newcommand{\@checktocdepth}[2]{\@alttocdepth{#1}{#2}{}}%
567 %% Putting (or not putting) section numbers in table of content
568 \newcommand{\@addsecnumber@yes}[3]{\@checkdepth{#1}{#2\quad}#3}
569 \newcommand{\@addsecnumber@no}[3]{#3}
570 \newcommand{\tocnumber}{\let\@addsecnumber\@addsecnumber@yes}
571 \newcommand{\notocnumber}{\let\@addsecnumber\@addsecnumber@no}
572 \notocnumber
573 \newcounter{tocanchor}
574 %\newcommand{\@doaddtoc}[3]
575 %{%\stepcounter{tocanchor}%
576 %\@auxdowrite{\@print{\@@addtocsec{htoc}}\{\@fmt@sec\}\{#1\}\{\@checkdepth{#1}{\@print{\@print}\{#2\}\@print{\quad{}}}\begin{@norefs}\@subst@expn{#3}\end{@norefs}\}\@print{
577 %}}}
578 \newcommand{\@doaddtoc}[3]
579 {%\stepcounter{tocanchor}%
580 \@auxdowrite{\@print{\@@addtocsec{htoc}}\{\@getprintnostyle{\@sec@id@attr}\}\{#1\}\{\@checkdepth{#1}{\@print{\@print}\{#2\}\@print{\quad{}}}\begin{@norefs}\@subst@expn{#3}\end{@norefs}\}\@print{
581 }}}
582 %%section identifiers
583 \newcounter{@sec}
584 \newcommand{\@fmt@sec}{sec\arabic{@sec}}
585 \newcommand{\@step@sec}
586 {\stepcounter{@sec}%
587 \ifu\csname\@fmt@sec{}@named@sec\endcsname\def\@sec@id@attr{\@fmt@sec}\else
588 \def\@sec@id@attr{\csname\@fmt@sec{}@named@sec\endcsname}\fi
589 \let\@the@sec\@fmt@sec
590 \def\@secid{\@getprint{id="\@sec@id@attr" }\let\@secid\relax}}
591 \let\@secid\relax
592 \newcommand{\end@step@sec}{\let\@the@sec\relax}
593 \let\@the@sec\relax
594 %%
595 \newcommand{\@makesection}[7]{%
596 \newcommand{\csname @#3@level\endcsname}{#2}%
597 \newcommand{#1}[2][]{%
598 \@secbegin\@step@sec\@checkdepth{#2}{\refstepcounter{#3}}%
599 \ifoptarg\@checktocdepth{#2}{\@doaddtoc{#2}{#5}{##1}}%
600 \cuthere{#3}{\@addsecnumber{#2}{#5}{##1}}\else
601 \@checktocdepth{#2}{\@doaddtoc{#2}{#5}{##2{}}}
602 \cuthere{#3}{\@addsecnumber{#2}{#5}{\begin{@norefs}##2{}\end{@norefs}}}\fi
603 #4\@secanchor%
604 \@altdepth{#2}{#5#6}{}%
605 %{\@alttocdepth{#2}{\@locname{htoc\thetocanchor}{#5}#6}{#5#6}}
606 %{\@checktocdepth{#2}{\@locname{htoc\thetocanchor}{}}}%
607 ##2{}#7\end@step@sec\@secend}%
608 \newcommand{#1*}[1]{%
609 \@secbegin\@step@sec\cuthere{#3}{##1}%
610 #4\@secanchor{}##1{}#7\end@step@sec\@secend}}%
611 %%%%%%%%%%%%%%
612 % Images %
613 %%%%%%%%%%%%%%
614 \newcounter{image}
615 \newcommand{\heveaimageext}{.png}
616 \newcommand{\heveaimagedir}{}
617 \renewcommand{\theimage}{\@arabic{image}}
618 \newcommand{\imageflush}[1][]
619 {\@imageflush\stepcounter{image}%
620 \imgsrc[#1]{\ife\heveaimagedir\else\heveaimagedir/\fi\jobname@base\theimage\heveaimageext}}
621 %%%%%%%%%% Compatibility with old hevea \url
622 \AtBeginDocument{\@ifundefined{url}{\input{compat.hva}}{}}
623 %%%%%%%%% Time stuff
624 %Change footnote counter when formatting title/autor/date
625 \newcommand{\@fmt@title}[1]
626 {{\def\footnote@c{titlenote}\let\thefootnote\thetitlenote#1}}
627 \AtBeginDocument
628 {\@ifundefined{theyear}
629 {\renewcommand{\today}{\hva@warn{\today needs '-exec xxdate.exe' option}}}
630 {\renewcommand{\theHour}{\@twoarabic{Hour}}
631 \renewcommand{\thehour}{\@twoarabic{hour}}
632 \renewcommand{\theminute}{\@twoarabic{minute}}
633 \renewcommand{\thesecond}{\@twoarabic{second}}}%
634 %Format date after \today is defined
635 \ifu\@title\fi\let\title\@titlebis}
636 %%End AtBeginDocument
637 %%%%%%%% Day and month formats
638 \def\default@day
639 {\ifthenelse{\value{day}=1}{\theday\textsuperscript{st}}
640 {\ifthenelse{\value{day}=21}{\theday\textsuperscript{st}}
641 {\ifthenelse{\value{day}=31}{\theday\textsuperscript{st}}
642 {\ifthenelse{\value{day}=2}{\theday\textsuperscript{nd}}
643 {\ifthenelse{\value{day}=22}{\theday\textsuperscript{nd}}
644 {\ifthenelse{\value{day}=3}{\theday\textsuperscript{rd}}
645 {\ifthenelse{\value{day}=23}{\theday\textsuperscript{rd}}
646 {\theday\textsuperscript{th}}}}}}}}}%
647 \def\default@month
648 {\ifthenelse{\value{month}=1}{January}
649 {\ifthenelse{\value{month}=2}{February}
650 {\ifthenelse{\value{month}=3}{March}
651 {\ifthenelse{\value{month}=4}{April}
652 {\ifthenelse{\value{month}=5}{May}
653 {\ifthenelse{\value{month}=6}{June}
654 {\ifthenelse{\value{month}=7}{July}
655 {\ifthenelse{\value{month}=8}{August}
656 {\ifthenelse{\value{month}=9}{September}
657 {\ifthenelse{\value{month}=10}{October}
658 {\ifthenelse{\value{month}=11}{November}
659 {\ifthenelse{\value{month}=12}{December}{}
660 }}}}}}}}}}}}%
661 %%%%%%%% Default today slightly differs from english babel today
662 \newcommand\today{\default@month~\theday, \theyear}
663 %%%%%%%%%%%%%% Defined counter printing functions
664 \newcommand{\@arabic}[1]{\@pad{0}{3}{\arabic{#1}}}
665 \newcommand{\@twoarabic}[1]{\@pad{0}{2}{\arabic{#1}}}
666 %%%%%%%%%%%%%%% Une horreur qui peut etre utile
667 \newcommand{\newverbenv}[1]
668 {\@stopimage%
669 \let{\csname #1\endcsname}\verbatim
670 \let{\csname end#1\endcsname}\endverbatim
671 \@restartimage}
672 \newcommand{\@noiso}[1]{\ifiso\isofalse#1\isotrue\else#1\fi}
673 \newcommand{\@rawchars}[1]{\ifraw#1\else\rawtrue#1\rawfalse\fi}
674 %%%%%%%%%%%%%%%%% Ignoring arguments
675 \newcommand{\@skipopt}[1][!*!]{}
676 \newcommand{\@skiparg}[1]{}
677 %%%%Utility
678 \newcommand{\@opencell}[3]{\@open{table}{#1}\@open{tr}{#2}\@open{td}{#3}}
679 \newcommand{\@closecell}{\@force{td}\@close{tr}\@close{table}}
680 %%%%%%%%%%%%%%%%% Length as percent
681 \def\linewidth{@percent}
682 \def\textwidth{@percent}
683 \def\hsize{@percent}
684 \def\baselineskip{1ex}
685 %%%%%%%%%%%%%%%%% Toc
686 \newstyle{.toc}{list-style:none;}
687 \setenvclass{toc}{toc}
688 \setenvclass{li-toc}{li-toc}
689 \newenvironment{tocenv}
690 {\setenvclass{itemize}{\getenvclass{toc}}%
691 \setenvclass{li-itemize}{\getenvclass{li-toc}}%
692 \begin{itemize}}
693 {\end{itemize}}
694 \newcommand{\tocitem}[1][]
695 {\ifoptarg\item[#1]\else\item\fi}
696 %%%%%%%%tocname changed to contentsname (standard)
697 \newcommand{\contentsname}{Contents}
698 \newcommand{\@readtoc}[2]
699 {\@tocsection{#2}
700 \@iffileexists{\jobname.#1}{\input{\jobname.#1}}{}}
701 \newcommand{\tableofcontents}{\@readtoc{htoc}{\contentsname}}
702 \newcommand{\addcontentsline}[3]
703 {\@auxdowrite{{\@nostyle\@print{\@addcontentsline}{\{h#1\}\{\csname @#2@level\endcsname\}}\{\@subst{#3}\}\@print{
704 }}}}
705 %%%%%%%%% Minipage
706 %Manage footnotes in minipage, as latex does
707 % 1. Use counter mpfootnote
708 % 2. Flush notes at end
709 \newcounter{mpfootnote}
710 \renewcommand{\thempfootnote}{\alph{mpfootnote}}
711 \newenvironment{minipage}[2][]
712 {\hva@warn{minipage, output may be poor}%
713 \renewcommand{\@footnotelevel}{document}\@footnotesub%
714 \setcounter{mpfootnote}{0}%
715 \def\footnote@c{mpfootnote}%
716 \@minipage\@start@text}
717 {\@end@text\@footnoteflush@sticky{document}\@endfootnotesub\end@minipage}
718 %%%%% Extension des environnments hevea en lecture de fichier
719 \newcommand{\rawhtmlinput}[1]
720 {\@scaninput{\begin{rawhtml}}{#1}{\end{rawhtml}}}
721 \newcommand{\rawtextinput}[1]
722 {\@scaninput{\begin{rawtext}}{#1}{\end{rawtext}}}
723 \newcommand{\rawinput}[1]
724 {\@scaninput{\begin{raw}}{#1}{\end{raw}}}
725 %%%Default definitions that can be redefined by babel
726 \newcommand\prefacename{Preface}
727 \newcommand\bibname{Bibliography}
728 \newcommand\chaptername{Chapter}
729 \newcommand\listfigurename{List of Figures}
730 \newcommand\listtablename{List of Tables}
731 \newcommand\indexname{Index}
732 \newcommand\figurename{Figure}
733 \newcommand\tablename{Table}
734 \newcommand\enclname{encl}
735 \newcommand\ccname{cc}
736 \newcommand\headtoname{To}
737 \newcommand\pagename{Page}
738 \newcommand\headpagename{Page}
739 \newcommand\seename{see}
740 \newcommand\alsoseename{see also}
741 \newcommand\dq{No-dq}
742 %%% Footer
743 \newif\iffooter\footertrue
744 \def\heveaurl{http://hevea.inria.fr}
745 \newcommand{\footertext}
746 {This document was translated from \LaTeX{} by
747 \footahref{\heveaurl/index.html}{\hevea}.}
748 \newcommand{\@footer}
749 {\@printHR{}{}\begin{quote}\em\footertext\end{quote}}
750 %%%%% Compat
751 %\let\@hva@newstack\hva@newstack