Skip to content

Commit

Permalink
PDF generation stops when image with caption is included in a table.
Browse files Browse the repository at this point in the history
In case an image is included in a table and this image has a caption the generation of a PDF stops with the message:
! Misplaced \noalign.
\caption ->\noalign
                    \bgroup \@ifnextchar [{\egroup \LT@c@ption \@Firstofone ...
l.45 \end{longtabu}

This problem has in general been described in: http://tex.stackexchange.com/questions/85919/adding-a-caption-to-a-graphic-inside-a-longtable

In this patch the suggestion from this reference is implemented by defining \doxyfigcaption and using this where  a caption is required.
  • Loading branch information
albert-github committed Jan 13, 2016
1 parent bbbd409 commit 7b0b7ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/latexdocvisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name,

if (hasCaption)
{
t << "\n\\caption{";
t << "\n\\doxyfigcaption{";
}
}

Expand Down Expand Up @@ -947,7 +947,7 @@ void LatexDocVisitor::visitPre(DocHtmlTable *t)
if (t->hasCaption())
{
DocHtmlCaption *c = t->caption();
m_t << "\\caption{";
m_t << "\\doxyfigcaption{";
visitCaption(this, c->children());
m_t << "}";
m_t << "\\label{" << stripPath(c->file()) << "_" << c->anchor() << "}";
Expand Down
7 changes: 7 additions & 0 deletions templates/latex/doxygen.sty
Original file line number Diff line number Diff line change
Expand Up @@ -475,3 +475,10 @@

% Color used for table heading
\newcommand{\tableheadbgcolor}{lightgray}%

% Define caption that is also suitable in a table
\makeatletter
\def\doxyfigcaption{%
\refstepcounter{figure}%
\@dblarg{\@caption{figure}}}
\makeatother

0 comments on commit 7b0b7ef

Please sign in to comment.