Imported Upstream version 1.8.15
[platform/upstream/doxygen.git] / templates / latex / doxygen.sty
1 \NeedsTeXFormat{LaTeX2e}
2 \ProvidesPackage{doxygen}
3
4 % Packages used by this style file
5 \RequirePackage{alltt}
6 \RequirePackage{array}
7 \RequirePackage{calc}
8 \RequirePackage{float}
9 \RequirePackage{ifthen}
10 \RequirePackage{verbatim}
11 \RequirePackage[table]{xcolor}
12 \RequirePackage{longtable}
13 \RequirePackage{tabu}
14 \RequirePackage{fancyvrb}
15 \RequirePackage{tabularx}
16 \RequirePackage{multirow}
17 \RequirePackage{hanging}
18 \RequirePackage{ifpdf}
19 \RequirePackage{adjustbox}
20 \RequirePackage{amssymb}
21 \RequirePackage{stackengine}
22 \RequirePackage[normalem]{ulem} % for strikeout, but don't modify emphasis
23
24 %---------- Internal commands used in this style file ----------------
25
26 \newcommand{\ensurespace}[1]{%
27   \begingroup%
28     \setlength{\dimen@}{#1}%
29     \vskip\z@\@plus\dimen@%
30     \penalty -100\vskip\z@\@plus -\dimen@%
31     \vskip\dimen@%
32     \penalty 9999%
33     \vskip -\dimen@%
34     \vskip\z@skip% hide the previous |\vskip| from |\addvspace|
35   \endgroup%
36 }
37
38 \newcommand{\DoxyLabelFont}{}
39 \newcommand{\entrylabel}[1]{%
40   {%
41     \parbox[b]{\labelwidth-4pt}{%
42       \makebox[0pt][l]{\DoxyLabelFont#1}%
43       \vspace{1.5\baselineskip}%
44     }%
45   }%
46 }
47
48 \newenvironment{DoxyDesc}[1]{%
49   \ensurespace{4\baselineskip}%
50   \begin{list}{}{%
51     \settowidth{\labelwidth}{20pt}%
52     \setlength{\parsep}{0pt}%
53     \setlength{\itemsep}{0pt}%
54     \setlength{\leftmargin}{\labelwidth+\labelsep}%
55     \renewcommand{\makelabel}{\entrylabel}%
56   }%
57   \item[#1]%
58 }{%
59   \end{list}%
60 }
61
62 \newsavebox{\xrefbox}
63 \newlength{\xreflength}
64 \newcommand{\xreflabel}[1]{%
65   \sbox{\xrefbox}{#1}%
66   \setlength{\xreflength}{\wd\xrefbox}%
67   \ifthenelse{\xreflength>\labelwidth}{%
68     \begin{minipage}{\textwidth}%
69       \setlength{\parindent}{0pt}%
70       \hangindent=15pt\bfseries #1\vspace{1.2\itemsep}%
71     \end{minipage}%
72   }{%
73    \parbox[b]{\labelwidth}{\makebox[0pt][l]{\textbf{#1}}}%
74   }%
75 }
76
77 %---------- Commands used by doxygen LaTeX output generator ----------
78
79 % Used by <pre> ... </pre>
80 \newenvironment{DoxyPre}{%
81   \small%
82   \begin{alltt}%
83 }{%
84   \end{alltt}%
85   \normalsize%
86 }
87 % Necessary for redefining not defined charcaters, i.e. "Replacement Character" in tex output.
88 \newlength{\CodeWidthChar}
89 \newlength{\CodeHeightChar}
90 \settowidth{\CodeWidthChar}{?}
91 \settoheight{\CodeHeightChar}{?}
92 % Necessary for hanging indent
93 \newlength{\DoxyCodeWidth}
94
95 \newcommand\DoxyCodeLine[1]{\hangpara{\DoxyCodeWidth}{1}{#1}\par}
96
97 \newcommand\NiceSpace{%
98      \discretionary{}{\kern\fontdimen2\font}{\kern\fontdimen2\font}%
99 }
100
101 % Used by @code ... @endcode
102 \newenvironment{DoxyCode}[1]{%
103   \par%
104   \scriptsize%
105   \normalfont\ttfamily%
106   \rightskip0pt plus 1fil%
107   \settowidth{\DoxyCodeWidth}{000000}%
108   \settowidth{\CodeWidthChar}{?}%
109   \settoheight{\CodeHeightChar}{?}%
110   \setlength{\parskip}{0ex plus 0ex minus 0ex}%
111   \ifthenelse{\equal{#1}{0}}
112   {
113     {\lccode`~32 \lowercase{\global\let~}\NiceSpace}\obeyspaces%
114   }
115   {
116     {\lccode`~32 \lowercase{\global\let~}}\obeyspaces%
117   }
118
119 }{%
120   \normalfont%
121   \normalsize%
122   \settowidth{\CodeWidthChar}{?}%
123   \settoheight{\CodeHeightChar}{?}%
124 }
125
126 % Redefining not defined characters, i.e. "Replacement Character" in tex output.
127 \def\ucr{\adjustbox{width=\CodeWidthChar,height=\CodeHeightChar}{\stackinset{c}{}{c}{-.2pt}{%
128    \textcolor{white}{\sffamily\bfseries\small ?}}{%
129    \rotatebox{45}{$\blacksquare$}}}}
130
131 % Used by @example, @include, @includelineno and @dontinclude
132 \newenvironment{DoxyCodeInclude}[1]{%
133         \DoxyCode{#1}%
134 }{%
135   \endDoxyCode%
136 }
137
138 % Used by @verbatim ... @endverbatim
139 \newenvironment{DoxyVerb}{%
140   \footnotesize%
141   \verbatim%
142 }{%
143   \endverbatim%
144   \normalsize%
145 }
146
147 % Used by @verbinclude
148 \newenvironment{DoxyVerbInclude}{%
149   \DoxyVerb%
150 }{%
151   \endDoxyVerb%
152 }
153
154 % Used by numbered lists (using '-#' or <ol> ... </ol>)
155 \newenvironment{DoxyEnumerate}{%
156   \enumerate%
157 }{%
158   \endenumerate%
159 }
160
161 % Used by bullet lists (using '-', @li, @arg, or <ul> ... </ul>)
162 \newenvironment{DoxyItemize}{%
163   \itemize%
164 }{%
165   \enditemize%
166 }
167
168 % Used by description lists (using <dl> ... </dl>)
169 \newenvironment{DoxyDescription}{%
170   \description%
171 }{%
172   \enddescription%
173 }
174
175 % Used by @image, @dotfile, @dot ... @enddot, and @msc ... @endmsc
176 % (only if caption is specified)
177 \newenvironment{DoxyImage}{%
178   \begin{figure}[H]%
179     \begin{center}%
180 }{%
181     \end{center}%
182   \end{figure}%
183 }
184
185 % Used by @image, @dotfile, @dot ... @enddot, and @msc ... @endmsc
186 % (only if no caption is specified)
187 \newenvironment{DoxyImageNoCaption}{%
188   \begin{center}%
189 }{%
190   \end{center}%
191 }
192
193 % Used by @image
194 % (only if inline is specified)
195 \newenvironment{DoxyInlineImage}{%
196 }{%
197 }
198
199 % Used by @attention
200 \newenvironment{DoxyAttention}[1]{%
201   \begin{DoxyDesc}{#1}%
202 }{%
203   \end{DoxyDesc}%
204 }
205
206 % Used by @author and @authors
207 \newenvironment{DoxyAuthor}[1]{%
208   \begin{DoxyDesc}{#1}%
209 }{%
210   \end{DoxyDesc}%
211 }
212
213 % Used by @date
214 \newenvironment{DoxyDate}[1]{%
215   \begin{DoxyDesc}{#1}%
216 }{%
217   \end{DoxyDesc}%
218 }
219
220 % Used by @invariant
221 \newenvironment{DoxyInvariant}[1]{%
222   \begin{DoxyDesc}{#1}%
223 }{%
224   \end{DoxyDesc}%
225 }
226
227 % Used by @note
228 \newenvironment{DoxyNote}[1]{%
229   \begin{DoxyDesc}{#1}%
230 }{%
231   \end{DoxyDesc}%
232 }
233
234 % Used by @post
235 \newenvironment{DoxyPostcond}[1]{%
236   \begin{DoxyDesc}{#1}%
237 }{%
238   \end{DoxyDesc}%
239 }
240
241 % Used by @pre
242 \newenvironment{DoxyPrecond}[1]{%
243   \begin{DoxyDesc}{#1}%
244 }{%
245   \end{DoxyDesc}%
246 }
247
248 % Used by @copyright
249 \newenvironment{DoxyCopyright}[1]{%
250   \begin{DoxyDesc}{#1}%
251 }{%
252   \end{DoxyDesc}%
253 }
254
255 % Used by @remark
256 \newenvironment{DoxyRemark}[1]{%
257   \begin{DoxyDesc}{#1}%
258 }{%
259   \end{DoxyDesc}%
260 }
261
262 % Used by @return and @returns
263 \newenvironment{DoxyReturn}[1]{%
264   \begin{DoxyDesc}{#1}%
265 }{%
266   \end{DoxyDesc}%
267 }
268
269 % Used by @since
270 \newenvironment{DoxySince}[1]{%
271   \begin{DoxyDesc}{#1}%
272 }{%
273   \end{DoxyDesc}%
274 }
275
276 % Used by @see
277 \newenvironment{DoxySeeAlso}[1]{%
278   \begin{DoxyDesc}{#1}%
279 }{%
280   \end{DoxyDesc}%
281 }
282
283 % Used by @version
284 \newenvironment{DoxyVersion}[1]{%
285   \begin{DoxyDesc}{#1}%
286 }{%
287   \end{DoxyDesc}%
288 }
289
290 % Used by @warning
291 \newenvironment{DoxyWarning}[1]{%
292   \begin{DoxyDesc}{#1}%
293 }{%
294   \end{DoxyDesc}%
295 }
296
297 % Used by @internal
298 \newenvironment{DoxyInternal}[1]{%
299   \paragraph*{#1}%
300 }{%
301 }
302
303 % Used by @par and @paragraph
304 \newenvironment{DoxyParagraph}[1]{%
305   \begin{list}{}{%
306     \settowidth{\labelwidth}{40pt}%
307     \setlength{\leftmargin}{\labelwidth}%
308     \setlength{\parsep}{0pt}%
309     \setlength{\itemsep}{-4pt}%
310     \renewcommand{\makelabel}{\entrylabel}%
311   }%
312   \item[#1]%
313 }{%
314   \end{list}%
315 }
316
317 % Used by parameter lists
318 \newenvironment{DoxyParams}[2][]{%
319     \tabulinesep=1mm%
320     \par%
321     \ifthenelse{\equal{#1}{}}%
322       {\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|}}% name + description
323     {\ifthenelse{\equal{#1}{1}}%
324       {\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + name + desc
325       {\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + type + name + desc
326     }
327     \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]%
328     \hline%
329     \endfirsthead%
330     \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]%
331     \hline%
332     \endhead%
333 }{%
334     \end{longtabu*}%
335     \vspace{6pt}%
336 }
337
338 % Used for fields of simple structs
339 \newenvironment{DoxyFields}[1]{%
340     \tabulinesep=1mm%
341     \par%
342     \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|X[-1,l]|}%
343     \multicolumn{3}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
344     \hline%
345     \endfirsthead%
346     \multicolumn{3}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
347     \hline%
348     \endhead%
349 }{%
350     \end{longtabu*}%
351     \vspace{6pt}%
352 }
353
354 % Used for fields simple class style enums
355 \newenvironment{DoxyEnumFields}[1]{%
356     \tabulinesep=1mm%
357     \par%
358     \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}%
359     \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
360     \hline%
361     \endfirsthead%
362     \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
363     \hline%
364     \endhead%
365 }{%
366     \end{longtabu*}%
367     \vspace{6pt}%
368 }
369
370 % Used for parameters within a detailed function description
371 \newenvironment{DoxyParamCaption}{%
372   \renewcommand{\item}[2][]{\\ \hspace*{2.0cm} ##1 {\em ##2}}% 
373 }{%
374 }
375
376 % Used by return value lists
377 \newenvironment{DoxyRetVals}[1]{%
378     \tabulinesep=1mm%
379     \par%
380     \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}%
381     \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
382     \hline%
383     \endfirsthead%
384     \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
385     \hline%
386     \endhead%
387 }{%
388     \end{longtabu*}%
389     \vspace{6pt}%
390 }
391
392 % Used by exception lists
393 \newenvironment{DoxyExceptions}[1]{%
394     \tabulinesep=1mm%
395     \par%
396     \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}%
397     \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
398     \hline%
399     \endfirsthead%
400     \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
401     \hline%
402     \endhead%
403 }{%
404     \end{longtabu*}%
405     \vspace{6pt}%
406 }
407
408 % Used by template parameter lists
409 \newenvironment{DoxyTemplParams}[1]{%
410     \tabulinesep=1mm%
411     \par%
412     \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}%
413     \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
414     \hline%
415     \endfirsthead%
416     \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
417     \hline%
418     \endhead%
419 }{%
420     \end{longtabu*}%
421     \vspace{6pt}%
422 }
423
424 % Used for member lists
425 \newenvironment{DoxyCompactItemize}{%
426   \begin{itemize}%
427     \setlength{\itemsep}{-3pt}%
428     \setlength{\parsep}{0pt}%
429     \setlength{\topsep}{0pt}%
430     \setlength{\partopsep}{0pt}%
431 }{%
432   \end{itemize}%
433 }
434
435 % Used for member descriptions
436 \newenvironment{DoxyCompactList}{%
437   \begin{list}{}{%
438     \setlength{\leftmargin}{0.5cm}%
439     \setlength{\itemsep}{0pt}%
440     \setlength{\parsep}{0pt}%
441     \setlength{\topsep}{0pt}%
442     \renewcommand{\makelabel}{\hfill}%
443   }%
444 }{%
445   \end{list}%
446 }
447
448 % Used for reference lists (@bug, @deprecated, @todo, etc.)
449 \newenvironment{DoxyRefList}{%
450   \begin{list}{}{%
451     \setlength{\labelwidth}{10pt}%
452     \setlength{\leftmargin}{\labelwidth}%
453     \addtolength{\leftmargin}{\labelsep}%
454     \renewcommand{\makelabel}{\xreflabel}%
455   }%
456 }{%
457   \end{list}%
458 }
459
460 % Used by @bug, @deprecated, @todo, etc.
461 \newenvironment{DoxyRefDesc}[1]{%
462   \begin{list}{}{%
463     \renewcommand\makelabel[1]{\textbf{##1}}%
464     \settowidth\labelwidth{\makelabel{#1}}%
465     \setlength\leftmargin{\labelwidth+\labelsep}%
466   }%
467 }{%
468   \end{list}%
469 }
470
471 % Used by parameter lists and simple sections
472 \newenvironment{Desc}
473 {\begin{list}{}{%
474     \settowidth{\labelwidth}{20pt}%
475     \setlength{\parsep}{0pt}%
476     \setlength{\itemsep}{0pt}%
477     \setlength{\leftmargin}{\labelwidth+\labelsep}%
478     \renewcommand{\makelabel}{\entrylabel}%
479   }
480 }{%
481   \end{list}%
482 }
483
484 % Used by tables
485 \newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp}%
486 \newenvironment{TabularC}[1]%
487 {\tabulinesep=1mm
488 \begin{longtabu*}spread 0pt [c]{*#1{|X[-1]}|}}%
489 {\end{longtabu*}\par}%
490
491 \newenvironment{TabularNC}[1]%
492 {\begin{tabu}spread 0pt [l]{*#1{|X[-1]}|}}%
493 {\end{tabu}\par}%
494
495 % Used for member group headers
496 \newenvironment{Indent}{%
497   \begin{list}{}{%
498     \setlength{\leftmargin}{0.5cm}%
499   }%
500   \item[]\ignorespaces%
501 }{%
502   \unskip%
503   \end{list}%
504 }
505
506 % Used when hyperlinks are turned off
507 \newcommand{\doxyref}[3]{%
508   \textbf{#1} (\textnormal{#2}\,\pageref{#3})%
509 }
510
511 % Used to link to a table when hyperlinks are turned on
512 \newcommand{\doxytablelink}[2]{%
513   \ref{#1}%
514 }
515
516 % Used to link to a table when hyperlinks are turned off
517 \newcommand{\doxytableref}[3]{%
518   \ref{#3}%
519 }
520
521 % Used by @addindex
522 \newcommand{\lcurly}{\{}
523 \newcommand{\rcurly}{\}}
524
525 % Colors used for syntax highlighting
526 \definecolor{comment}{rgb}{0.5,0.0,0.0}
527 \definecolor{keyword}{rgb}{0.0,0.5,0.0}
528 \definecolor{keywordtype}{rgb}{0.38,0.25,0.125}
529 \definecolor{keywordflow}{rgb}{0.88,0.5,0.0}
530 \definecolor{preprocessor}{rgb}{0.5,0.38,0.125}
531 \definecolor{stringliteral}{rgb}{0.0,0.125,0.25}
532 \definecolor{charliteral}{rgb}{0.0,0.5,0.5}
533 \definecolor{vhdldigit}{rgb}{1.0,0.0,1.0}
534 \definecolor{vhdlkeyword}{rgb}{0.43,0.0,0.43}
535 \definecolor{vhdllogic}{rgb}{1.0,0.0,0.0}
536 \definecolor{vhdlchar}{rgb}{0.0,0.0,0.0}
537
538 % Color used for table heading
539 \newcommand{\tableheadbgcolor}{lightgray}%
540
541 % Version of hypertarget with correct landing location
542 \newcommand{\Hypertarget}[1]{\Hy@raisedlink{\hypertarget{#1}{}}}
543
544 % Define caption that is also suitable in a table
545 \makeatletter
546 \def\doxyfigcaption{%
547 \refstepcounter{figure}%
548 \@dblarg{\@caption{figure}}}
549 \makeatother