Skip to content

Issue with doxyfigcaption #10707

@zyphlar

Description

@zyphlar

Describe the bug

When running cd ./latex && make pdf on a .dox file that includes images with captions, I get this error:

...
(C:\Users\me\AppData\Local\Programs\MiKTeX\tex/context/base/mkii\supp-pdf.mki
i
[Loading MPS to PDF converter (version 2006.09.02).]
)
(C:\Users\me\AppData\Local\Programs\MiKTeX\tex/latex/epstopdf-pkg\epstopdf-ba
se.sty
(C:\Users\me\AppData\Local\Programs\MiKTeX\tex/latex/00miktex\epstopdf-sys.cf
g))
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
No file refman.toc.
(C:\Users\me\AppData\Local\Programs\MiKTeX\tex/latex/amsfonts\umsa.fd)
(C:\Users\me\AppData\Local\Programs\MiKTeX\tex/latex/amsfonts\umsb.fd)
(C:\Users\me\AppData\Local\Programs\MiKTeX\tex/latex/wasysym\uwasy.fd)
[1{C:/Users/me/AppData/Local/MiKTeX/fonts/map/pdftex/pdftex.map}{C:/Users/Wil
l/AppData/Local/Programs/MiKTeX/fonts/enc/dvips/base/8r.enc}] (intro.tex
(C:\Users\me\AppData\Local\Programs\MiKTeX\tex/latex/psnfss\t1pcr.fd)
(C:\Users\me\AppData\Local\Programs\MiKTeX\tex/latex/psnfss\ts1phv.fd) <./figure.jpg> [1] <./image.jpg>
! Undefined control sequence.
\doxyfigcaption ->\H@refstepcounter
                                    {figure}\@dblarg {\@caption {figure}}
l.49 \doxyfigcaption
                    {hi}
?

My doxygen.sty is the autogenerated default:

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

The offending .tex section:

\begin{DoxyImage}
\includegraphics[width=\textwidth]{image.jpg}
\doxyfigcaption{hi}
\end{DoxyImage}

And the offending .dox line:

\image latex image.jpg "hi" width=\textwidth

Changing the doxyfigcaption definition to empty resolves the error, just outputting the caption plainly without any kind of figure counters:

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

Expected behavior

Doxygen and LaTeX shouldn't explode on images with captions

Version
Latest from Github, Windows (1.11.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions