From 647b6ac8669cd8ba1e8c60eeb3c2de961c7d6a1b Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 29 Jun 2015 19:45:55 +0200 Subject: Using tabu package for LaTeX tables --- doc/CMakeLists.txt | 5 +- doc/Doxyfile | 1 + doc/doxygen.sty | 486 -------------------------------------------- doc/doxygen_manual.tex | 1 + doc/manual.sty | 33 +++ src/docparser.h | 19 +- src/latexdocvisitor.cpp | 30 ++- src/latexdocvisitor.h | 1 + src/latexgen.cpp | 8 +- src/util.cpp | 3 +- templates/latex/doxygen.sty | 129 ++++++------ 11 files changed, 145 insertions(+), 571 deletions(-) delete mode 100644 doc/doxygen.sty create mode 100644 doc/manual.sty diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index af557d8..3a5d682 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -30,9 +30,10 @@ add_custom_target(docs COMMAND ${CMAKE_COMMAND} -E copy doxygen_logo_low.gif ../html COMMAND ${CMAKE_COMMAND} -E copy Makefile.latex ../latex/Makefile COMMAND ${SED} -e "s/\$VERSION/${VERSION}/g" doxygen_manual.tex > ../latex/doxygen_manual.tex - COMMAND ${SED} -e "s/\$VERSION/${VERSION}/g" doxygen.sty > ../latex/doxygen.sty + COMMAND ${SED} -e "s/\$VERSION/${VERSION}/g" manual.sty > ../latex/manual.sty COMMAND ${EPSTOPDF} doxygen_logo.eps --outfile=../latex/doxygen_logo.pdf - COMMAND ${MAKE} -C ../latex > latex_out.txt + COMMAND ${MAKE} -C ../latex +#> latex_out.txt DEPENDS doxygen copy_docs ${PROJECT_BINARY_DIR}/doc/language.doc config.doc examples "${PROJECT_BINARY_DIR}/man/doxygen.1" "${PROJECT_BINARY_DIR}/man/doxywizard.1" diff --git a/doc/Doxyfile b/doc/Doxyfile index ab97227..9ea8553 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -54,3 +54,4 @@ HTML_STYLESHEET = doxygen_manual.css ALIASES = LaTeX="\f$\mbox{\LaTeX}\f$" ALIASES += TeX="\f$\mbox{\TeX}\f$" LATEX_BATCHMODE = YES +LATEX_EXTRA_STYLESHEET = manual.sty diff --git a/doc/doxygen.sty b/doc/doxygen.sty deleted file mode 100644 index 8013dad..0000000 --- a/doc/doxygen.sty +++ /dev/null @@ -1,486 +0,0 @@ -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{doxygen} - -% Packages used by this style file -\RequirePackage{alltt} -\RequirePackage{array} -\RequirePackage{calc} -\RequirePackage{color} -\RequirePackage{fancyhdr} -\RequirePackage{longtable} -\RequirePackage{verbatim} -\RequirePackage{ifthen} -\RequirePackage{xtab} -\RequirePackage{multirow} -\RequirePackage[table]{xcolor} - -% Use helvetica font instead of times roman -\RequirePackage{helvet} -\RequirePackage{sectsty} -\RequirePackage{tocloft} -\providecommand{\rmdefault}{phv} -\providecommand{\bfdefault}{bc} - - -% Setup fancy headings -\pagestyle{fancyplain} -\newcommand{\clearemptydoublepage}{% - \newpage{\pagestyle{empty}\cleardoublepage}% -} -\renewcommand{\chaptermark}[1]{% - \markboth{#1}{}% -} -\renewcommand{\sectionmark}[1]{% - \markright{\thesection\ #1}% -} -\fancyhead[LE]{\fancyplain{}{\bfseries\thepage}} -\fancyhead[CE]{\fancyplain{}{}} -\fancyhead[RE]{\fancyplain{}{\bfseries\leftmark}} -\fancyhead[LO]{\fancyplain{}{\bfseries\rightmark}} -\fancyhead[CO]{\fancyplain{}{}} -\fancyhead[RO]{\fancyplain{}{\bfseries\thepage}} -\fancyfoot[LE]{\fancyplain{}{}} -\fancyfoot[CE]{\fancyplain{}{}} -\fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen }} -\fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen }} -\fancyfoot[CO]{\fancyplain{}{}} -\fancyfoot[RO]{\fancyplain{}{}} -%---------- Internal commands used in this style file ---------------- - -\newcommand\tabfill[1]{% - \dimen@\linewidth% - \advance\dimen@\@totalleftmargin% - \advance\dimen@-\dimen\@curtab% - \parbox[t]\dimen@{\raggedright #1\ifhmode\strut\fi}% -} - -\newcommand{\ensurespace}[1]{% - \begingroup - \setlength{\dimen@}{#1}% - \vskip\z@\@plus\dimen@ - \penalty -100\vskip\z@\@plus -\dimen@ - \vskip\dimen@ - \penalty 9999% - \vskip -\dimen@ - \vskip\z@skip % hide the previous |\vskip| from |\addvspace| - \endgroup -} - -% Generic environment used by all paragraph-based environments defined -% below. Note that the command \title{...} needs to be defined inside -% those environments! -\newenvironment{DoxyDesc}[1]{% - \ensurespace{4\baselineskip}% - \begin{list}{}% - {% - \settowidth{\labelwidth}{40pt}% - \setlength{\leftmargin}{\labelwidth}% - \setlength{\parsep}{0pt}% - \setlength{\itemsep}{-4pt}% - \renewcommand{\makelabel}{\entrylabel}% - }% - \item[#1]% -}{% - \end{list}% -} - -%---------- Commands used by doxygen LaTeX output generator ---------- - -% Used by
 ... 
-\newenvironment{DoxyPre}{% - \small% - \begin{alltt}% -}{% - \end{alltt}% - \normalsize% -} - -% Used by @code ... @endcode -\newenvironment{DoxyCode}{% - - -\begin{scriptsize}\begin{alltt}% -}{% -\end{alltt}\end{scriptsize}% -} - -% Used by @example, @include, @includelineno and @dontinclude -\newenvironment{DoxyCodeInclude}{% - \DoxyCode% -}{% - \endDoxyCode% -} - -% Used by @verbatim ... @endverbatim -\newenvironment{DoxyVerb}{% - \footnotesize% - \verbatim% -}{% - \endverbatim% - \normalsize% -} - -% Used by @verbinclude -\newenvironment{DoxyVerbInclude}{% - \DoxyVerb% -}{% - \endDoxyVerb% -} - -% Used by numbered lists (using '-#' or
    ...
) -\newenvironment{DoxyEnumerate}{% - \enumerate% -}{% - \endenumerate% -} - -% Used by bullet lists (using '-', @li, @arg, or ) -\newenvironment{DoxyItemize}{% - \itemize% -}{% - \enditemize% -} - -% Used by description lists (using
...
) -\newenvironment{DoxyDescription}{% - \description% -}{% - \enddescription% -} - -% Used by @image, @dotfile, and @dot ... @enddot -% (only if caption is specified) -\newenvironment{DoxyImage}{% - \begin{figure}[H]% - \begin{center}% -}{% - \end{center}% - \end{figure}% -} - -% Used by @image, @dotfile, @dot ... @enddot, and @msc ... @endmsc -% (only if no caption is specified) -\newenvironment{DoxyImageNoCaption}{% -}{% -} - -% Used by @attention -\newenvironment{DoxyAttention}[1]{% - \begin{DoxyDesc}{#1}% -}{% - \end{DoxyDesc}% -} - -% Used by @author and @authors -\newenvironment{DoxyAuthor}[1]{% - \begin{DoxyDesc}{#1}% -}{% - \end{DoxyDesc}% -} - -% Used by @date -\newenvironment{DoxyDate}[1]{% - \begin{DoxyDesc}{#1}% -}{% - \end{DoxyDesc}% -} - -% Used by @invariant -\newenvironment{DoxyInvariant}[1]{% - \begin{DoxyDesc}{#1}% -}{% - \end{DoxyDesc}% -} - -% Used by @note -\newenvironment{DoxyNote}[1]{% - \begin{DoxyDesc}{#1}% -}{% - \end{DoxyDesc}% -} - -% Used by @post -\newenvironment{DoxyPostcond}[1]{% - \begin{DoxyDesc}{#1}% -}{% - \end{DoxyDesc}% -} - -% Used by @pre -\newenvironment{DoxyPrecond}[1]{% - \begin{DoxyDesc}{#1}% -}{% - \end{DoxyDesc}% -} - -% Used by @copyright -\newenvironment{DoxyCopyright}[1]{% - \begin{DoxyDesc}{#1}% -}{% - \end{DoxyDesc}% -} - -% Used by @remark -\newenvironment{DoxyRemark}[1]{% - \begin{DoxyDesc}{#1}% -}{% - \end{DoxyDesc}% -} - -% Used by @return -\newenvironment{DoxyReturn}[1]{% - \begin{DoxyDesc}{#1}% -}{% - \end{DoxyDesc}% -} - -% Used by @since -\newenvironment{DoxySince}[1]{% - \begin{DoxyDesc}{#1}% -}{% - \end{DoxyDesc}% -} - -% Used by @see -\newenvironment{DoxySeeAlso}[1]{% - \begin{DoxyDesc}{#1}% -}{% - \end{DoxyDesc}% -} - -% Used by @version -\newenvironment{DoxyVersion}[1]{% - \begin{DoxyDesc}{#1}% -}{% - \end{DoxyDesc}% -} - -% Used by @warning -\newenvironment{DoxyWarning}[1]{% - \begin{DoxyDesc}{#1}% -}{% - \end{DoxyDesc}% -} - -% Used by @internal -\newenvironment{DoxyInternal}[1]{% - \paragraph*{#1}% -}{% -} - -% Used by @par and @paragraph -\newenvironment{DoxyParagraph}[1]{% - \begin{list}{}% - {% - \settowidth{\labelwidth}{40pt}% - \setlength{\leftmargin}{\labelwidth}% - \setlength{\parsep}{0pt}% - \setlength{\itemsep}{-4pt}% - \renewcommand{\makelabel}{\entrylabel}% - }% - \item[#1]% -}{% - \end{list}% -} - -% Used by parameter lists -\newenvironment{DoxyParams}[2][]{% - \begin{DoxyDesc}{#2}% - \item[] \hspace{\fill} \vspace{-40pt}% - \settowidth{\labelwidth}{40pt}% - \setlength{\LTleft}{0pt}% - \setlength{\tabcolsep}{0.01\textwidth}% - \ifthenelse{\equal{#1}{}}% - {\begin{longtable}{|>{\raggedleft\hspace{0pt}}p{0.15\textwidth}|% - p{0.815\textwidth}|}}% - {\ifthenelse{\equal{#1}{1}}% - {\begin{longtable}{|>{\centering}p{0.10\textwidth}|% - >{\raggedleft\hspace{0pt}}p{0.15\textwidth}|% - p{0.685\textwidth}|}}% - {\begin{longtable}{|>{\centering}p{0.10\textwidth}|% - >{\centering\hspace{0pt}}p{0.15\textwidth}|% - >{\raggedleft\hspace{0pt}}p{0.15\textwidth}|% - p{0.515\textwidth}|}}% - }\hline% -}{% - \end{longtable}% - \end{DoxyDesc}% -} - -% Used for fields of simple structs -\newenvironment{DoxyFields}[1]{% - \begin{DoxyDesc}{#1}% - \item[] \hspace{\fill} \vspace{-40pt}% - \settowidth{\labelwidth}{40pt}% - \setlength{\LTleft}{0pt}% - \setlength{\tabcolsep}{0.01\textwidth}% - \begin{longtable}{|>{\raggedleft\hspace{0pt}}p{0.15\textwidth}|% - p{0.15\textwidth}|% - p{0.635\textwidth}|}% - \hline% -}{% - \end{longtable}% - \end{DoxyDesc}% -} - -% is used for parameters within a detailed function description -\newenvironment{DoxyParamCaption}{% - \renewcommand{\item}[2][]{##1 {\em ##2}}% - }{% -} - -% Used by return value lists -\newenvironment{DoxyRetVals}[1]{% - \begin{DoxyDesc}{#1}% - \begin{description}% - \item[] \hspace{\fill} \vspace{-25pt}% - \setlength{\tabcolsep}{0.01\textwidth}% - \begin{longtable}{|>{\raggedleft\hspace{0pt}}p{0.25\textwidth}|% - p{0.77\textwidth}|}% - \hline% -}{% - \end{longtable}% - \end{description}% - \end{DoxyDesc}% -} - -% Used by exception lists -\newenvironment{DoxyExceptions}[1]{% - \begin{DoxyDesc}{#1}% - \begin{description}% - \item[] \hspace{\fill} \vspace{-25pt}% - \definecolor{tableShade}{HTML}{F8F8F8}% - \rowcolors{1}{white}{tableShade}% - \arrayrulecolor{gray}% - \setlength{\tabcolsep}{0.01\textwidth}% - \begin{longtable}{|>{\raggedleft\hspace{0pt}}p{0.25\textwidth}|% - p{0.77\textwidth}|}% - \hline% -}{% - \end{longtable}% - \end{description}% - \end{DoxyDesc}% -} - -% Used by template parameter lists -\newenvironment{DoxyTemplParams}[1]{% - \begin{DoxyDesc}{#1}% - \begin{description}% - \item[] \hspace{\fill} \vspace{-25pt}% - \definecolor{tableShade}{HTML}{F8F8F8}% - \rowcolors{1}{white}{tableShade}% - \arrayrulecolor{gray}% - \setlength{\tabcolsep}{0.01\textwidth}% - \begin{longtable}{|>{\raggedleft\hspace{0pt}}p{0.25\textwidth}|% - p{0.77\textwidth}|}% - \hline% -}{% - \end{longtable}% - \end{description}% - \end{DoxyDesc}% -} - -\newcommand{\doxyref}[3]{\textbf{#1} (\textnormal{#2}\,\pageref{#3})} -\newcommand{\lcurly}{\{} -\newcommand{\rcurly}{\}} -\newenvironment{DoxyCompactList} -{\begin{list}{}{ - \setlength{\leftmargin}{0.5cm} - \setlength{\itemsep}{0pt} - \setlength{\parsep}{0pt} - \setlength{\topsep}{0pt} - \renewcommand{\makelabel}{\hfill}}} -{\end{list}} -\newenvironment{DoxyCompactItemize} -{ - \begin{itemize} - \setlength{\itemsep}{-3pt} - \setlength{\parsep}{0pt} - \setlength{\topsep}{0pt} - \setlength{\partopsep}{0pt} -} -{\end{itemize}} -\newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp} -\newlength{\tmplength} -\newenvironment{TabularC}[1] -{ -\setlength{\tmplength} - {\linewidth/(#1)-\tabcolsep*2-\arrayrulewidth*(#1+1)/(#1)} - \par\begin{xtabular*}{\linewidth} - {*{#1}{|>{\PBS\raggedright\hspace{0pt}}p{\the\tmplength}}|} -} -{\end{xtabular*}\par} -\newcommand{\entrylabel}[1]{ - {\parbox[b]{\labelwidth-4pt}{\makebox[0pt][l]{% - \usefont{OT1}{phv}{bc}{n}\color{darkgray}#1}\vspace{1.5\baselineskip}}}} -\newenvironment{Desc} -{\begin{list}{} - { - \settowidth{\labelwidth}{40pt} - \setlength{\leftmargin}{\labelwidth} - \setlength{\parsep}{0pt} - \setlength{\itemsep}{-4pt} - \renewcommand{\makelabel}{\entrylabel} - } -} -{\end{list}} -\newsavebox{\xrefbox} -\newlength{\xreflength} -\newcommand{\xreflabel}[1]{% - \sbox{\xrefbox}{#1}% - \setlength{\xreflength}{\wd\xrefbox}% - \ifthenelse{\xreflength>\labelwidth}{% - \begin{minipage}{\textwidth}% - \setlength{\parindent}{0pt}% - \hangindent=15pt\bfseries #1\vspace{1.2\itemsep}% - \end{minipage}% - }{% - \parbox[b]{\labelwidth}{\makebox[0pt][l]{\textbf{#1}}}% - }}% -\newenvironment{DoxyRefList}{% - \begin{list}{}{% - \setlength{\labelwidth}{10pt}% - \setlength{\leftmargin}{\labelwidth}% - \addtolength{\leftmargin}{\labelsep}% - \renewcommand{\makelabel}{\xreflabel}% - }% - }% -{\end{list}} -\newenvironment{DoxyRefDesc}[1] -{\begin{list}{}{% - \renewcommand\makelabel[1]{\textbf{##1}} - \settowidth\labelwidth{\makelabel{#1}} - \setlength\leftmargin{\labelwidth+\labelsep}}} -{\end{list}} -\newenvironment{Indent} - {\begin{list}{}{\setlength{\leftmargin}{0.5cm}} - \item[]\ignorespaces} - {\unskip\end{list}} -\setlength{\parindent}{0cm} -\setlength{\parskip}{0.2cm} -\addtocounter{secnumdepth}{2} -\usepackage[T1]{fontenc} -\makeatletter -\renewcommand{\paragraph}{\@startsection{paragraph}{4}{0ex}% - {-1.0ex}% - {1.0ex}% - {\usefont{OT1}{phv}{bc}{n}\color{darkgray}}} -\renewcommand{\subparagraph}{\@startsection{subparagraph}{5}{0ex}% - {-1.0ex}% - {1.0ex}% - {\usefont{OT1}{phv}{bc}{n}\color{darkgray}}} -\makeatother -\allsectionsfont{\usefont{OT1}{phv}{bc}{n}\selectfont\color{darkgray}} -\stepcounter{secnumdepth} -\stepcounter{tocdepth} -\definecolor{comment}{rgb}{0.5,0.0,0.0} -\definecolor{keyword}{rgb}{0.0,0.5,0.0} -\definecolor{keywordtype}{rgb}{0.38,0.25,0.125} -\definecolor{keywordflow}{rgb}{0.88,0.5,0.0} -\definecolor{preprocessor}{rgb}{0.5,0.38,0.125} -\definecolor{stringliteral}{rgb}{0.0,0.125,0.25} -\definecolor{charliteral}{rgb}{0.0,0.5,0.5} -\definecolor{vhdldigit}{rgb}{1.0,0.0,1.0} -\definecolor{vhdlkeyword}{rgb}{0.43,0.0,0.43} -\definecolor{vhdllogic}{rgb}{1.0,0.0,0.0} -\definecolor{vhdlchar}{rgb}{0.0,0.0,0.0} diff --git a/doc/doxygen_manual.tex b/doc/doxygen_manual.tex index c97c5f0..5a3c372 100644 --- a/doc/doxygen_manual.tex +++ b/doc/doxygen_manual.tex @@ -53,6 +53,7 @@ \usepackage[titles]{tocloft} \usepackage{amssymb} \usepackage{doxygen} +\usepackage{manual} \newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}} \lstset{language=C++,inputencoding=utf8,basicstyle=\footnotesize,breaklines=true,breakatwhitespace=true,tabsize=8,numbers=left } \makeindex diff --git a/doc/manual.sty b/doc/manual.sty new file mode 100644 index 0000000..254aa03 --- /dev/null +++ b/doc/manual.sty @@ -0,0 +1,33 @@ +% Use helvetica font instead of times roman +\RequirePackage{helvet} +\RequirePackage{sectsty} +\RequirePackage{tocloft} +\providecommand{\rmdefault}{phv} +\providecommand{\bfdefault}{bc} +\usepackage[T1]{fontenc} + +% Setup fancy headings +\RequirePackage{fancyhdr} +\pagestyle{fancyplain} +\newcommand{\clearemptydoublepage}{% + \newpage{\pagestyle{empty}\cleardoublepage}% +} +\renewcommand{\chaptermark}[1]{% + \markboth{#1}{}% +} +\renewcommand{\sectionmark}[1]{% + \markright{\thesection\ #1}% +} +\fancyhead[LE]{\fancyplain{}{\bfseries\thepage}} +\fancyhead[CE]{\fancyplain{}{}} +\fancyhead[RE]{\fancyplain{}{\bfseries\leftmark}} +\fancyhead[LO]{\fancyplain{}{\bfseries\rightmark}} +\fancyhead[CO]{\fancyplain{}{}} +\fancyhead[RO]{\fancyplain{}{\bfseries\thepage}} +\fancyfoot[LE]{\fancyplain{}{}} +\fancyfoot[CE]{\fancyplain{}{}} +\fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen $VERSION }} +\fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen $VERSION }} +\fancyfoot[CO]{\fancyplain{}{}} +\fancyfoot[RO]{\fancyplain{}{}} + diff --git a/src/docparser.h b/src/docparser.h index 1abb687..4984921 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -1303,8 +1303,18 @@ class DocHtmlRow : public CompAccept, public DocNode const HtmlAttribList &attribs() const { return m_attribs; } int parse(); int parseXml(bool header); - bool isHeading() const { return m_children.count()>0 && - ((DocHtmlCell*)m_children.getFirst())->isHeading(); + bool isHeading() const { // a row is a table heading if all cells are marked as such + bool heading=TRUE; + QListIterator it(m_children); + DocNode *n; + for (;(n=it.current());++it) + { + if (n->kind()==Kind_HtmlCell) + { + heading = heading && ((DocHtmlCell*)n)->isHeading(); + } + } + return m_children.count()>0 && heading; } void setVisibleCells(int n) { m_visibleCells = n; } int visibleCells() const { return m_visibleCells; } @@ -1332,6 +1342,11 @@ class DocHtmlTable : public CompAccept, public DocNode int parseXml(); uint numColumns() const { return m_numCols; } void accept(DocVisitor *v); + DocHtmlRow *firstRow() { + DocNode *n = m_children.getFirst(); + if (n && n->kind()==Kind_HtmlRow) return (DocHtmlRow*)n; + return 0; + } private: void computeTableGrid(); diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 37c2130..b9e5839 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -173,7 +173,7 @@ LatexDocVisitor::LatexDocVisitor(FTextStream &t,CodeOutputInterface &ci, : DocVisitor(DocVisitor_Latex), m_t(t), m_ci(ci), m_insidePre(FALSE), m_insideItem(FALSE), m_hide(FALSE), m_insideTabbing(insideTabbing), m_insideTable(FALSE), m_langExt(langExt), m_currentColumn(0), - m_inRowspan(FALSE), m_inColspan(FALSE) + m_inRowspan(FALSE), m_inColspan(FALSE), m_firstRow(FALSE) { m_rowSpans.setAutoDelete(TRUE); } @@ -913,6 +913,17 @@ void LatexDocVisitor::visitPre(DocHtmlTable *t) m_t << "\\begin{" << getTableName(t->parent()) << "}{" << t->numColumns() << "}\n"; m_numCols = t->numColumns(); m_t << "\\hline\n"; + + // check if first row is a heading and then render the row already here + // and end it with \endfirsthead (triggered via m_firstRow==TRUE) + // then repeat the row as normal and end it with \endhead (m_firstRow==FALSE) + DocHtmlRow *firstRow = t->firstRow(); + if (firstRow && firstRow->isHeading()) + { + m_firstRow=TRUE; + firstRow->accept(this); + m_firstRow=FALSE; + } } void LatexDocVisitor::visitPost(DocHtmlTable *t) @@ -944,7 +955,7 @@ void LatexDocVisitor::visitPost(DocHtmlCaption *) void LatexDocVisitor::visitPre(DocHtmlRow *r) { m_currentColumn = 0; - if (r->isHeading()) m_t << "\\rowcolor{lightgray}"; + if (r->isHeading()) m_t << "\\rowcolor{\\tableheadbgcolor}"; } void LatexDocVisitor::visitPost(DocHtmlRow *row) @@ -1011,6 +1022,19 @@ void LatexDocVisitor::visitPost(DocHtmlRow *row) } m_t << "\n"; + + if (row->isHeading() && row->rowIndex()==1) + { + if (m_firstRow) + { + m_t << "\\endfirsthead" << endl; + m_t << "\\hline" << endl; + } + else + { + m_t << "\\endhead" << endl; + } + } } void LatexDocVisitor::visitPre(DocHtmlCell *c) @@ -1076,7 +1100,7 @@ void LatexDocVisitor::visitPre(DocHtmlCell *c) << m_numCols << "-\\arrayrulewidth*" << row->visibleCells() << ")*" << cs <<"/"<< m_numCols << "}|}{"; - if (c->isHeading()) m_t << "\\cellcolor{lightgray}"; + if (c->isHeading()) m_t << "\\cellcolor{\\tableheadbgcolor}"; } int rs = c->rowSpan(); if (rs>0) diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h index d3aeaea..e36e56c 100644 --- a/src/latexdocvisitor.h +++ b/src/latexdocvisitor.h @@ -199,6 +199,7 @@ class LatexDocVisitor : public DocVisitor int m_currentColumn; bool m_inRowspan; bool m_inColspan; + bool m_firstRow; }; #endif diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 042dd7c..30e28ec 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -1422,6 +1422,10 @@ void LatexGenerator::startDoxyAnchor(const char *fName,const char *, const char *anchor, const char *, const char *) { +} + +void LatexGenerator::endDoxyAnchor(const char *fName,const char *anchor) +{ static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS"); static bool usePDFLatex = Config_getBool("USE_PDFLATEX"); if (usePDFLatex && pdfHyperlinks) @@ -1431,10 +1435,6 @@ void LatexGenerator::startDoxyAnchor(const char *fName,const char *, if (anchor) t << "_" << anchor; t << "}{}"; } -} - -void LatexGenerator::endDoxyAnchor(const char *fName,const char *anchor) -{ t << "\\label{"; if (fName) t << stripPath(fName); if (anchor) t << "_" << anchor; diff --git a/src/util.cpp b/src/util.cpp index 3ee7ae5..d367c40 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6461,7 +6461,6 @@ void filterLatexString(FTextStream &t,const char *str, bool insideTabbing,bool insidePre,bool insideItem) { if (str==0) return; - //printf("filterLatexString(%s)\n",str); //if (strlen(str)<2) stackTrace(); const unsigned char *p=(const unsigned char *)str; const unsigned char *q; @@ -6555,7 +6554,7 @@ void filterLatexString(FTextStream &t,const char *str, default: //if (!insideTabbing && forceBreaks && c!=' ' && *p!=' ') if (!insideTabbing && - ((c>='A' && c<='Z' && pc!=' ' && pc!='\0') || (c==':' && pc!=':') || (pc=='.' && isId(c))) + ((c>='A' && c<='Z' && pc!=' ' && pc!='\0' && *p) || (c==':' && pc!=':') || (pc=='.' && isId(c))) ) { t << "\\+"; diff --git a/templates/latex/doxygen.sty b/templates/latex/doxygen.sty index acd68e4..66ffca3 100644 --- a/templates/latex/doxygen.sty +++ b/templates/latex/doxygen.sty @@ -9,7 +9,8 @@ \RequirePackage{ifthen} \RequirePackage{verbatim} \RequirePackage[table]{xcolor} -\RequirePackage{xtab} +\RequirePackage{longtable} +\RequirePackage{tabu} %---------- Internal commands used in this style file ---------------- @@ -267,46 +268,38 @@ % Used by parameter lists \newenvironment{DoxyParams}[2][]{% + \tabulinesep=1mm% \par% - \tabletail{\hline}% - \tablelasttail{\hline}% - \tablefirsthead{}% - \tablehead{}% \ifthenelse{\equal{#1}{}}% - {\tablefirsthead{\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]}% - \begin{xtabular}{|>{\raggedleft\hspace{0pt}}p{0.15\textwidth}|% - p{0.805\textwidth}|}}% + {\begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}}% name + description {\ifthenelse{\equal{#1}{1}}% - {\tablefirsthead{\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]}% - \begin{xtabular}{|>{\centering}p{0.10\textwidth}|% - >{\raggedleft\hspace{0pt}}p{0.15\textwidth}|% - p{0.678\textwidth}|}}% - {\tablefirsthead{\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]}% - \begin{xtabular}{|>{\centering}p{0.10\textwidth}|% - >{\centering\hspace{0pt}}p{0.15\textwidth}|% - >{\raggedleft\hspace{0pt}}p{0.15\textwidth}|% - p{0.501\textwidth}|}}% - }\hline% -}{% - \end{xtabular}% - \tablefirsthead{}% + {\begin{longtabu} spread 0pt [l]{|X[-1,c]|X[-1,r]|X[-1,l]|}}% in/out + name + desc + {\begin{longtabu} spread 0pt [l]{|X[-1,c]|X[-1,c]|X[-1,r]|X[-1,l]|}}% in/out + type + name + desc + } + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]% + \hline% + \endfirsthead% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]% + \hline% + \endhead% +}{% + \end{longtabu}% \vspace{6pt}% } % Used for fields of simple structs \newenvironment{DoxyFields}[1]{% + \tabulinesep=1mm% \par% - \tabletail{\hline}% - \tablelasttail{\hline}% - \tablehead{}% - \tablefirsthead{\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]}% - \begin{xtabular}{|>{\raggedleft\hspace{0pt}}p{0.15\textwidth}|% - p{0.15\textwidth}|% - p{0.63\textwidth}|}% + \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|X[-1,l]|}% + \multicolumn{3}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% \hline% + \endfirsthead% + \multicolumn{3}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endhead% }{% - \end{xtabular}% - \tablefirsthead{}% + \end{longtabu}% \vspace{6pt}% } @@ -318,49 +311,49 @@ % Used by return value lists \newenvironment{DoxyRetVals}[1]{% + \tabulinesep=1mm% \par% - \tabletail{\hline}% - \tablelasttail{\hline}% - \tablehead{}% - \tablefirsthead{\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]}% - \begin{xtabular}{|>{\raggedleft\hspace{0pt}}p{0.25\textwidth}|% - p{0.705\textwidth}|}% + \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endfirsthead% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% \hline% + \endhead% }{% - \end{xtabular}% - \tablefirsthead{}% + \end{longtabu}% \vspace{6pt}% } % Used by exception lists \newenvironment{DoxyExceptions}[1]{% + \tabulinesep=1mm% \par% - \tabletail{\hline}% - \tablelasttail{\hline}% - \tablehead{}% - \tablefirsthead{\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]}% - \begin{xtabular}{|>{\raggedleft\hspace{0pt}}p{0.25\textwidth}|% - p{0.705\textwidth}|}% + \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% \hline% + \endfirsthead% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endhead% }{% - \end{xtabular}% - \tablefirsthead{}% + \end{longtabu}% \vspace{6pt}% } % Used by template parameter lists \newenvironment{DoxyTemplParams}[1]{% + \tabulinesep=1mm% \par% - \tabletail{\hline}% - \tablelasttail{\hline}% - \tablehead{}% - \tablefirsthead{\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]}% - \begin{xtabular}{|>{\raggedleft\hspace{0pt}}p{0.25\textwidth}|% - p{0.705\textwidth}|}% + \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endfirsthead% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% \hline% + \endhead% }{% - \end{xtabular}% - \tablefirsthead{}% + \end{longtabu}% \vspace{6pt}% } @@ -426,25 +419,14 @@ % Used by tables \newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp}% -\newlength{\tmplength}% \newenvironment{TabularC}[1]% -{% -\setlength{\tmplength}% - {\linewidth/(#1)-\tabcolsep*2-\arrayrulewidth*(#1+1)/(#1)}% - \par\begin{xtabular*}{\linewidth}% - {*{#1}{|>{\PBS\raggedright\hspace{0pt}}p{\the\tmplength}}|}% -}% -{\end{xtabular*}\par}% - -% Used by nested tables +{\tabulinesep=1mm +\begin{longtabu} spread 0pt [l]{*#1{|X[-1]}|}}% +{\end{longtabu}\par}% + \newenvironment{TabularNC}[1]% -{% -\setlength{\tmplength}% - {\linewidth/(#1)-\tabcolsep*2-\arrayrulewidth*(#1+1)/(#1)}% - \par\begin{tabular*}{\linewidth}% - {*{#1}{|>{\PBS\raggedright\hspace{0pt}}p{\the\tmplength}}|}% -}% -{\end{tabular*}\par}% +{\begin{tabu} spread 0pt [l]{*#1{|X[-1]}|}}% +{\end{tabu}\par}% % Used for member group headers \newenvironment{Indent}{% @@ -466,7 +448,7 @@ \newcommand{\lcurly}{\{} \newcommand{\rcurly}{\}} -% Used for syntax highlighting +% Colors used for syntax highlighting \definecolor{comment}{rgb}{0.5,0.0,0.0} \definecolor{keyword}{rgb}{0.0,0.5,0.0} \definecolor{keywordtype}{rgb}{0.38,0.25,0.125} @@ -478,3 +460,6 @@ \definecolor{vhdlkeyword}{rgb}{0.43,0.0,0.43} \definecolor{vhdllogic}{rgb}{1.0,0.0,0.0} \definecolor{vhdlchar}{rgb}{0.0,0.0,0.0} + +% Color used for table heading +\newcommand{\tableheadbgcolor}{lightgray}% -- cgit v0.12