From a3093ff24ec75b70d6d7dc37ca2c7e68f36161fe Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 29 Aug 2019 16:42:44 +0200 Subject: Problem with `
` in LaTeX multicolumn cell In case we have a `
` in a table cell then it is displayed as a horizontal line (in LaTeX) unless it is in a multicolumn cell. In the later case it throws an error: ``` ! You can't use `\hrule' here except with leaders. \DoxyHorRuler ... }{0ex plus 0ex minus 0ex}\hrule ``` We have to use use `\hrulefill` in a table but in combination with the table option of xcolor this gives some problems so a new command has to be defined for this. See also: - horizontal rule / line inside a multicolumn field (https://tex.stackexchange.com/questions/506211/horizontal-rule-line-inside-a-multicolumn-field) - interaction between \usepackage[table]{xcolor} and \hrulefill (https://tex.stackexchange.com/questions/506221/interaction-between-usepackagetablexcolor-and-hrulefill) --- src/latexdocvisitor.cpp | 5 ++++- templates/latex/doxygen.sty | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index a0bbf73..5e424b0 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -280,7 +280,10 @@ void LatexDocVisitor::visit(DocLineBreak *) void LatexDocVisitor::visit(DocHorRuler *) { if (m_hide) return; - m_t << "\\DoxyHorRuler\n"; + if (insideTable()) + m_t << "\\DoxyHorRuler{1}\n"; + else + m_t << "\\DoxyHorRuler{0}\n"; } void LatexDocVisitor::visit(DocStyleChange *s) diff --git a/templates/latex/doxygen.sty b/templates/latex/doxygen.sty index bf19901..d28554b 100644 --- a/templates/latex/doxygen.sty +++ b/templates/latex/doxygen.sty @@ -35,9 +35,19 @@ \endgroup% } -\newcommand{\DoxyHorRuler}{% +\makeatletter +\newcommand\hrulefilll{\leavevmode\leaders\hrule\hskip 0pt plus 1filll\kern\z@} +\makeatother + +\newcommand{\DoxyHorRuler}[1]{% \setlength{\parskip}{0ex plus 0ex minus 0ex}% - \hrule% + \ifthenelse{#1=0}% + {% + \hrule% + }% + {% + \hrulefilll% + }% } \newcommand{\DoxyLabelFont}{} \newcommand{\entrylabel}[1]{% -- cgit v0.12 From 416ee572ba35b4d0cf30ccca66f0691c658f2e53 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 29 Aug 2019 18:06:51 +0200 Subject: Problem with `
` in LaTeX multicolumn cell Small problem with defining `\hrulefilll`, moved code. --- doc/doxygen_manual.tex | 5 +++++ src/latexgen.cpp | 5 +++++ templates/latex/doxygen.sty | 4 ---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/doxygen_manual.tex b/doc/doxygen_manual.tex index 8ff3c66..e350013 100644 --- a/doc/doxygen_manual.tex +++ b/doc/doxygen_manual.tex @@ -66,6 +66,11 @@ \usepackage{doxygen} \usepackage{manual} %% +%gave problems when in doxygen.sty +\makeatletter +\newcommand\hrulefilll{\leavevmode\leaders\hrule\hskip 0pt plus 1filll\kern\z@} +\makeatother +%% % unfortunately constructs like: % \renewcommand{\doxysection}[1]{\doxysubsection{##1}} % using values from book.cls (see also doxygen.sty) and redefining sections to correct level. diff --git a/src/latexgen.cpp b/src/latexgen.cpp index e6c6861..1792f15 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -623,6 +623,11 @@ static void writeDefaultHeaderPart1(FTextStream &t) "}\n" "\\makeatother\n" "\n"; + // + t << "\\makeatletter\n" + "\\newcommand\\hrulefilll{\\leavevmode\\leaders\\hrule\\hskip 0pt plus 1filll\\kern\\z@}\n" + "\\makeatother\n" + "\n"; // Headers & footers QGString genString; diff --git a/templates/latex/doxygen.sty b/templates/latex/doxygen.sty index d28554b..83891a5 100644 --- a/templates/latex/doxygen.sty +++ b/templates/latex/doxygen.sty @@ -35,10 +35,6 @@ \endgroup% } -\makeatletter -\newcommand\hrulefilll{\leavevmode\leaders\hrule\hskip 0pt plus 1filll\kern\z@} -\makeatother - \newcommand{\DoxyHorRuler}[1]{% \setlength{\parskip}{0ex plus 0ex minus 0ex}% \ifthenelse{#1=0}% -- cgit v0.12