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