diff options
Diffstat (limited to 'src/latexgen.cpp')
-rw-r--r-- | src/latexgen.cpp | 469 |
1 files changed, 5 insertions, 464 deletions
diff --git a/src/latexgen.cpp b/src/latexgen.cpp index ac73331..1434dca 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -37,6 +37,10 @@ #include "namespacedef.h" #include "filename.h" +static const char doxygenLatexStyle[] = +#include "doxygen_sty.h" +; + //static QCString filterTitle(const char *s) //{ // QCString tmp=s,result; @@ -505,470 +509,7 @@ static void writeDefaultHeaderPart3(FTextStream &t) static void writeDefaultStyleSheet(FTextStream &t) { - // part 1 - t << "\\NeedsTeXFormat{LaTeX2e}\n" - "\\ProvidesPackage{doxygen}\n" - "\n"; - t << "% Packages used by this style file\n" - "\\RequirePackage{alltt}\n" - "\\RequirePackage{array}\n" - "\\RequirePackage{calc}\n" - "\\RequirePackage{float}\n" - "\\RequirePackage{ifthen}\n" - "\\RequirePackage{longtable}\n" - "\\RequirePackage{verbatim}\n" - "\\RequirePackage[table]{xcolor}\n" - "\\RequirePackage{xtab}\n" - "\n" - "\n"; - t << "%---------- Internal commands used in this style file ----------------\n" - "\n"; - t << "\\newcommand{\\ensurespace}[1]{%\n" - " \\begingroup%\n" - " \\setlength{\\dimen@}{#1}%\n" - " \\vskip\\z@\\@plus\\dimen@%\n" - " \\penalty -100\\vskip\\z@\\@plus -\\dimen@%\n" - " \\vskip\\dimen@%\n" - " \\penalty 9999%\n" - " \\vskip -\\dimen@%\n" - " \\vskip\\z@skip% hide the previous |\\vskip| from |\\addvspace|\n" - " \\endgroup%\n" - "}\n" - "\n"; - t << "\\newcommand{\\DoxyLabelFont}{}\n" - "\\newcommand{\\entrylabel}[1]{%\n" - " {%\n" - " \\parbox[b]{\\labelwidth-4pt}{%\n" - " \\makebox[0pt][l]{\\DoxyLabelFont#1}%\n" - " \\vspace{1.5\\baselineskip}%\n" - " }%\n" - " }%\n" - "}\n" - "\n"; - t << "\\newenvironment{DoxyDesc}[1]{%\n" - " \\ensurespace{4\\baselineskip}%\n" - " \\begin{list}{}{%\n" - " \\settowidth{\\labelwidth}{40pt}%\n" - " \\setlength{\\leftmargin}{\\labelwidth}%\n" - " \\setlength{\\parsep}{0pt}%\n" - " \\setlength{\\itemsep}{-4pt}%\n" - " \\renewcommand{\\makelabel}{\\entrylabel}%\n" - " }%\n" - " \\item[#1]%\n" - "}{%\n" - " \\end{list}%\n" - "}\n" - "\n"; - t << "\\newsavebox{\\xrefbox}\n" - "\\newlength{\\xreflength}\n" - "\\newcommand{\\xreflabel}[1]{%\n" - " \\sbox{\\xrefbox}{#1}%\n" - " \\setlength{\\xreflength}{\\wd\\xrefbox}%\n" - " \\ifthenelse{\\xreflength>\\labelwidth}{%\n" - " \\begin{minipage}{\\textwidth}%\n" - " \\setlength{\\parindent}{0pt}%\n" - " \\hangindent=15pt\\bfseries #1\\vspace{1.2\\itemsep}%\n" - " \\end{minipage}%\n" - " }{%\n" - " \\parbox[b]{\\labelwidth}{\\makebox[0pt][l]{\\textbf{#1}}}%\n" - " }%\n" - "}\n" - "\n" - "\n"; - t << "%---------- Commands used by doxygen LaTeX output generator ----------\n" - "\n"; - t << "% Used by <pre> ... </pre>\n" - "\\newenvironment{DoxyPre}{%\n" - " \\small%\n" - " \\begin{alltt}%\n" - "}{%\n" - " \\end{alltt}%\n" - " \\normalsize%\n" - "}\n" - "\n"; - t << "% Used by @code ... @endcode\n" - "\\newenvironment{DoxyCode}{%\n" - " \\par%\n" - " \\scriptsize%\n" - " \\begin{alltt}%\n" - "}{%\n" - " \\end{alltt}%\n" - " \\normalsize%\n" - "}\n" - "\n"; - t << "% Used by @example, @include, @includelineno and @dontinclude\n" - "\\newenvironment{DoxyCodeInclude}{%\n" - " \\DoxyCode%\n" - "}{%\n" - " \\endDoxyCode%\n" - "}\n" - "\n"; - t << "% Used by @verbatim ... @endverbatim\n" - "\\newenvironment{DoxyVerb}{%\n" - " \\footnotesize%\n" - " \\verbatim%\n" - "}{%\n" - " \\endverbatim%\n" - " \\normalsize%\n" - "}\n" - "\n"; - t << "% Used by @verbinclude\n" - "\\newenvironment{DoxyVerbInclude}{%\n" - " \\DoxyVerb%\n" - "}{%\n" - " \\endDoxyVerb%\n" - "}\n" - "\n"; - t << "% Used by numbered lists (using '-#' or <ol> ... </ol>)\n" - "\\newenvironment{DoxyEnumerate}{%\n" - " \\enumerate%\n" - "}{%\n" - " \\endenumerate%\n" - "}\n" - "\n"; - t << "% Used by bullet lists (using '-', @li, @arg, or <ul> ... </ul>)\n" - "\\newenvironment{DoxyItemize}{%\n" - " \\itemize%\n" - "}{%\n" - " \\enditemize%\n" - "}\n" - "\n"; - t << "% Used by description lists (using <dl> ... </dl>)\n" - "\\newenvironment{DoxyDescription}{%\n" - " \\description%\n" - "}{%\n" - " \\enddescription%\n" - "}\n" - "\n"; - t << "% Used by @image, @dotfile, @dot ... @enddot, and @msc ... @endmsc\n" - "% (only if caption is specified)\n" - "\\newenvironment{DoxyImage}{%\n" - " \\begin{figure}[H]%\n" - " \\begin{center}%\n" - "}{%\n" - " \\end{center}%\n" - " \\end{figure}%\n" - "}\n" - "\n"; - t << "% Used by @image, @dotfile, @dot ... @enddot, and @msc ... @endmsc\n" - "% (only if no caption is specified)\n" - "\\newenvironment{DoxyImageNoCaption}{%\n" - "}{%\n" - "}\n" - "\n"; - t << "% Used by @attention\n" - "\\newenvironment{DoxyAttention}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - "}{%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by @author and @authors\n" - "\\newenvironment{DoxyAuthor}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - "}{%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by @date\n" - "\\newenvironment{DoxyDate}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - "}{%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by @invariant\n" - "\\newenvironment{DoxyInvariant}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - "}{%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by @note\n" - "\\newenvironment{DoxyNote}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - "}{%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by @post\n" - "\\newenvironment{DoxyPostcond}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - "}{%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by @pre\n" - "\\newenvironment{DoxyPrecond}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - "}{%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by @copyright\n" - "\\newenvironment{DoxyCopyright}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - "}{%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by @remark\n" - "\\newenvironment{DoxyRemark}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - "}{%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by @return and @returns\n" - "\\newenvironment{DoxyReturn}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - "}{%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by @since\n" - "\\newenvironment{DoxySince}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - "}{%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by @see\n" - "\\newenvironment{DoxySeeAlso}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - "}{%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by @version\n" - "\\newenvironment{DoxyVersion}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - "}{%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by @warning\n" - "\\newenvironment{DoxyWarning}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - "}{%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by @internal\n" - "\\newenvironment{DoxyInternal}[1]{%\n" - " \\paragraph*{#1}%\n" - "}{%\n" - "}\n" - "\n"; - t << "% Used by @par and @paragraph\n" - "\\newenvironment{DoxyParagraph}[1]{%\n" - " \\begin{list}{}{%\n" - " \\settowidth{\\labelwidth}{40pt}%\n" - " \\setlength{\\leftmargin}{\\labelwidth}%\n" - " \\setlength{\\parsep}{0pt}%\n" - " \\setlength{\\itemsep}{-4pt}%\n" - " \\renewcommand{\\makelabel}{\\entrylabel}%\n" - " }%\n" - " \\item[#1]%\n" - "}{%\n" - " \\end{list}%\n" - "}\n" - "\n"; - t << "% Used by parameter lists\n" - "\\newenvironment{DoxyParams}[2][]{%\n" - " \\begin{DoxyDesc}{#2}%\n" - " \\item[] \\hspace{\\fill} \\vspace{-25pt}%\n" - " \\settowidth{\\labelwidth}{40pt}%\n" - " \\setlength{\\LTleft}{0pt}%\n" - " \\setlength{\\tabcolsep}{0.01\\textwidth}%\n" - " \\ifthenelse{\\equal{#1}{}}%\n" // default: name, docs columns - " {\\begin{longtable}{|>{\\raggedleft\\hspace{0pt}}p{0.15\\textwidth}|%\n" - " p{0.815\\textwidth}|}}%\n" - " {\\ifthenelse{\\equal{#1}{1}}%\n" // inout, name, docs columns, or type, name, docs columns - " {\\begin{longtable}{|>{\\centering}p{0.10\\textwidth}|%\n" - " >{\\raggedleft\\hspace{0pt}}p{0.15\\textwidth}|%\n" - " p{0.685\\textwidth}|}}%\n" - " {\\begin{longtable}{|>{\\centering}p{0.10\\textwidth}|%\n" // inout, type, name, docs columns - " >{\\centering\\hspace{0pt}}p{0.15\\textwidth}|%\n" - " >{\\raggedleft\\hspace{0pt}}p{0.15\\textwidth}|%\n" - " p{0.515\\textwidth}|}}%\n" - " }\\hline%\n" - "}{%\n" - " \\end{longtable}%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used for fields of simple structs\n" - "\\newenvironment{DoxyFields}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - " \\item[] \\hspace{\\fill} \\vspace{-25pt}%\n" - " \\settowidth{\\labelwidth}{40pt}%\n" - " \\setlength{\\LTleft}{0pt}%\n" - " \\setlength{\\tabcolsep}{0.01\\textwidth}%\n" - " \\begin{longtable}{|>{\\raggedleft\\hspace{0pt}}p{0.15\\textwidth}|%\n" - " p{0.15\\textwidth}|%\n" - " p{0.635\\textwidth}|}%\n" - " \\hline%\n" - "}{%\n" - " \\end{longtable}%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used for parameters within a detailed function description\n" - "\\newenvironment{DoxyParamCaption}{%\n" - " \\renewcommand{\\item}[2][]{##1 {\\em ##2}}%\n" - "}{%\n" - "}\n" - "\n"; - t << "% Used by return value lists\n" - "\\newenvironment{DoxyRetVals}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - " \\begin{description}%\n" - " \\item[] \\hspace{\\fill} \\vspace{-25pt}%\n" - " \\setlength{\\tabcolsep}{0.01\\textwidth}%\n" - " \\begin{longtable}{|>{\\raggedleft\\hspace{0pt}}p{0.25\\textwidth}|%\n" - " p{0.705\\textwidth}|}%\n" - " \\hline%\n" - "}{%\n" - " \\end{longtable}%\n" - " \\end{description}%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by exception lists\n" - "\\newenvironment{DoxyExceptions}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - " \\begin{description}%\n" - " \\item[] \\hspace{\\fill} \\vspace{-25pt}%\n" - " \\setlength{\\tabcolsep}{0.01\\textwidth}%\n" - " \\begin{longtable}{|>{\\raggedleft\\hspace{0pt}}p{0.25\\textwidth}|%\n" - " p{0.705\\textwidth}|}%\n" - " \\hline%\n" - "}{%\n" - " \\end{longtable}%\n" - " \\end{description}%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used by template parameter lists\n" - "\\newenvironment{DoxyTemplParams}[1]{%\n" - " \\begin{DoxyDesc}{#1}%\n" - " \\begin{description}%\n" - " \\item[] \\hspace{\\fill} \\vspace{-25pt}%\n" - " \\setlength{\\tabcolsep}{0.01\\textwidth}%\n" - " \\begin{longtable}{|>{\\raggedleft\\hspace{0pt}}p{0.25\\textwidth}|%\n" - " p{0.705\\textwidth}|}%\n" - " \\hline%\n" - "}{%\n" - " \\end{longtable}%\n" - " \\end{description}%\n" - " \\end{DoxyDesc}%\n" - "}\n" - "\n"; - t << "% Used for member lists\n" - "\\newenvironment{DoxyCompactItemize}{%\n" - " \\begin{itemize}%\n" - " \\setlength{\\itemsep}{-3pt}%\n" - " \\setlength{\\parsep}{0pt}%\n" - " \\setlength{\\topsep}{0pt}%\n" - " \\setlength{\\partopsep}{0pt}%\n" - "}{%\n" - " \\end{itemize}%\n" - "}\n" - "\n"; - t << "% Used for member descriptions\n" - "\\newenvironment{DoxyCompactList}{%\n" - " \\begin{list}{}{%\n" - " \\setlength{\\leftmargin}{0.5cm}%\n" - " \\setlength{\\itemsep}{0pt}%\n" - " \\setlength{\\parsep}{0pt}%\n" - " \\setlength{\\topsep}{0pt}%\n" - " \\renewcommand{\\makelabel}{\\hfill}%\n" - " }%\n" - "}{%\n" - " \\end{list}%\n" - "}\n" - "\n"; - t << "% Used for reference lists (@bug, @deprecated, @todo, etc.)\n" - "\\newenvironment{DoxyRefList}{%\n" - " \\begin{list}{}{%\n" - " \\setlength{\\labelwidth}{10pt}%\n" - " \\setlength{\\leftmargin}{\\labelwidth}%\n" - " \\addtolength{\\leftmargin}{\\labelsep}%\n" - " \\renewcommand{\\makelabel}{\\xreflabel}%\n" - " }%\n" - "}{%\n" - " \\end{list}%\n" - "}\n" - "\n"; - t << "% Used by @bug, @deprecated, @todo, etc.\n" - "\\newenvironment{DoxyRefDesc}[1]{%\n" - " \\begin{list}{}{%\n" - " \\renewcommand\\makelabel[1]{\\textbf{##1}}%\n" - " \\settowidth\\labelwidth{\\makelabel{#1}}%\n" - " \\setlength\\leftmargin{\\labelwidth+\\labelsep}%\n" - " }%\n" - "}{%\n" - " \\end{list}%\n" - "}\n" - "\n"; - t << "% Used by parameter lists and simple sections\n" - "\\newenvironment{Desc}\n" - "{\\begin{list}{}{%\n" - " \\settowidth{\\labelwidth}{40pt}%\n" - " \\setlength{\\leftmargin}{\\labelwidth}%\n" - " \\setlength{\\parsep}{0pt}%\n" - " \\setlength{\\itemsep}{-4pt}%\n" - " \\renewcommand{\\makelabel}{\\entrylabel}%\n" - " }\n" - "}{%\n" - " \\end{list}%\n" - "}\n" - "\n"; - t << "% Used by tables\n" - "\\newcommand{\\PBS}[1]{\\let\\temp=\\\\#1\\let\\\\=\\temp}\n" - "\\newlength{\\tmplength}\n" - "\\newenvironment{TabularC}[1]{%\n" - " \\setlength{\\tmplength}{%\n" - " \\linewidth/(#1)-\\tabcolsep*2-\\arrayrulewidth*(#1+1)/(#1)%\n" - " }%\n" - " \\par%\n" - " \\begin{xtabular*}{\\linewidth}{%\n" - " *{#1}{|>{\\PBS\\raggedright\\hspace{0pt}}p{\\the\\tmplength}}|%\n" - " }%\n" - "}{%\n" - " \\end{xtabular*}%\n" - " \\par%\n" - "}\n" - "\n"; - t << "% Used for member group headers\n" - "\\newenvironment{Indent}{%\n" - " \\begin{list}{}{%\n" - " \\setlength{\\leftmargin}{0.5cm}%\n" - " }%\n" - " \\item[]\\ignorespaces%\n" - "}{%\n" - " \\unskip%\n" - " \\end{list}%\n" - "}\n" - "\n"; - t << "% Used when hyperlinks are turned off\n" - "\\newcommand{\\doxyref}[3]{%\n" - " \\textbf{#1} (\\textnormal{#2}\\,\\pageref{#3})%\n" - "}\n" - "\n"; - t << "% Used for syntax highlighting\n" - "\\definecolor{comment}{rgb}{0.5,0.0,0.0}\n" - "\\definecolor{keyword}{rgb}{0.0,0.5,0.0}\n" - "\\definecolor{keywordtype}{rgb}{0.38,0.25,0.125}\n" - "\\definecolor{keywordflow}{rgb}{0.88,0.5,0.0}\n" - "\\definecolor{preprocessor}{rgb}{0.5,0.38,0.125}\n" - "\\definecolor{stringliteral}{rgb}{0.0,0.125,0.25}\n" - "\\definecolor{charliteral}{rgb}{0.0,0.5,0.5}\n" - "\\definecolor{vhdldigit}{rgb}{1.0,0.0,1.0}\n" - "\\definecolor{vhdlkeyword}{rgb}{0.43,0.0,0.43}\n" - "\\definecolor{vhdllogic}{rgb}{1.0,0.0,0.0}\n" - "\\definecolor{vhdlchar}{rgb}{0.0,0.0,0.0}\n"; + t << doxygenLatexStyle; } static void writeDefaultFooter(FTextStream &t) |