Doxygen & (La)Tex - Cannot create PDF when using param-tags
Asked Answered
W

1

6

I'm trying to generate PDF from source files using Doxygen and MikTex (also Tex Live tested) but with no success. Here is an example file which from I'm trying to generate the documentation:

/**
 *  @defgroup Example examplegroup
 *  @{ */

/**
 *  @brief Example function
 *  @param[in] e example var */
void exampleFunction( int e )
{
        (void)e;
}

/** @} */

And when I try to run latex/make.bat to generate PDF I get error:

//...

("C:\Program Files\MiKTeX 2.9\tex/latex/caption\ltcaption.sty"))
("C:\Program Files\MiKTeX 2.9\tex/latex/etoc\etoc.sty")
No file refman.aux.
("C:\Program Files\MiKTeX 2.9\tex/latex/base\ts1cmr.fd")
("C:\Program Files\MiKTeX 2.9\tex/latex/psnfss\t1phv.fd")
("C:\Program Files\MiKTeX 2.9\tex/context/base\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
) ("C:\Program Files\MiKTeX 2.9\tex/latex/oberdiek\epstopdf-base.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/oberdiek\grfext.sty"))
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
("C:\Program Files\MiKTeX 2.9\tex/latex/hyperref\nameref.sty"
("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\gettitlestring.sty"))
No file refman.toc.
[1{C:/Users/FIJOGRE/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]
[2]
Chapter 1.
(modules.tex ("C:\Program Files\MiKTeX 2.9\tex/latex/amsfonts\umsa.fd")
("C:\Program Files\MiKTeX 2.9\tex/latex/amsfonts\umsb.fd")
("C:\Program Files\MiKTeX 2.9\tex/latex/wasysym\uwasy.fd")

LaTeX Warning: Reference `group___example' on page 1 undefined on input line 3.


) [1] [2]
Chapter 2.
(group___example.tex ("C:\Program Files\MiKTeX 2.9\tex/latex/psnfss\ts1phv.fd")
("C:\Program Files\MiKTeX 2.9\tex/latex/psnfss\t1pcr.fd")
! Missing } inserted.
<inserted text>
                }
l.28 \end{DoxyParams}


?

So what I have concluded is that when I use param-tag in source file comments, the doxygen generates this kind of DoxyParams section to doxygen.sty that causes the issues:

%...

% Used by parameter lists
\newenvironment{DoxyParams}[2][]{%
    \tabulinesep=1mm%
    \par%
    \ifthenelse{\equal{#1}{}}%
      {\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|}}% name + description
    {\ifthenelse{\equal{#1}{1}}%
      {\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + name + desc
      {\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|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}%
}

%...

I'm thinking maybe the ifthen-begins are not properly closed with end-tags? because if I remove the first ifthens and begins I get the pdflatex to work. Or is there something else? Is there a bug in Doxygen that generates invalid doxygen.sty? Or is the issue somewhere else? What can I do to make the documentation generation to work correctly?

EDIT:

More info, I think the issue is also related to grouping, because if I remove the groupings the generation works. So defgroup + param with doxygen + pdflatex -> problems.

Wisdom answered 20/2, 2019 at 6:25 Comment(6)
Did you recently install / update your MikTeX distribution (i.e. after mid if December 2018)? There is a problem with the LaTeX tabu package, outside doxygen control, due to a change in latex3/latex2e, see also the doxygen issue github.com/doxygen/doxygen/issues/6769Nuclei
I did install newest versions just few days ago and updated all up to date, and I tried manually adding that custom tabu-package as well, but with no success.Wisdom
I think you have to downgrade to a version before mid of December 2018.Nuclei
Is that even possible? Where should I get old versions?Wisdom
Unfortunately I have no experience with downgrading / obtaining an old MikTeX version (I didn't investigate either). Maybe best to look in the MikTex site to see what is possible or ask in the tex.stackexchange.com forum. The main problem is that the tabu package is not maintained and is broken now due to a change in latex3/latex2e and the, knowledgeable, people who made that github.com/tabu-fixed/tabu repository are busy with other task and it is hard to fix the tabu package (and all the interactions).Nuclei
Yes, it would seem like that. I have managed to modify tabu.sty so I can least generate the PDF but it doesn't look good. I also investigated possibility to downgrade MikTex but it seems it is not an easy task to do, and definitely not feasible if even possible. But thanks! At least I know the root cause of this and it's better than nothing.Wisdom
W
7

All the credits go to albert since the issue was about the LaTex tabu-package as he suggested. Here is a small summary about the issue.

There is a problem with the LaTeX tabu package, due to a change (Dec/2018) in latex3/latex2e (https://github.com/latex3/latex2e/issues/111 & https://github.com/doxygen/doxygen/issues/6769) that causes generation to fail in certain situations when 'tabu' is used (the developer of longtabu-package has gone long time ago and the package is not maintained anymore).

There is already patch (https://github.com/tabu-fixed/tabu) available (and already updated in the newest MikTek release) that fixes most of the cases (like the Doxygen documentation, that couldn't be generated without patching the tabu-package), but it doesn't work on all the situations. Example including a table in the tabu-environment breaks the generation even with the patched tabu-package.

If the patch doesn't fix the issue, it is advised to to use a TeX version from before the change (https://github.com/latex3/latex2e).

If downgrading or using older (Mik)TeX version is not an option, one workaround would be to use some other package instead of the broken one. For example writing a script that edits the doxygen.sty definitions for those parts that utilize longtabu* and replaces those longtabu*:s with {longtable}{|c|c|c|c|} after Doxygen has generated the doxygen.sty file.

Wisdom answered 4/3, 2019 at 11:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.