kam*_*lla 5 latex doxygen miktex tex pdflatex
我正在尝试使用Doxygen和MikTex(也经过Tex Live测试)从源文件生成PDF,但没有成功。这是一个示例文件,我正在尝试从中生成文档:
/**
* @defgroup Example examplegroup
* @{ */
/**
* @brief Example function
* @param[in] e example var */
void exampleFunction( int e )
{
(void)e;
}
/** @} */
Run Code Online (Sandbox Code Playgroud)
当我尝试运行latex / make.bat生成PDF时,出现错误:
//...
("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}
?
Run Code Online (Sandbox Code Playgroud)
因此,我得出的结论是,当我在源文件注释中使用param-tag时,doxygen会向doxygen.sty生成这种DoxyParams部分,从而导致问题:
%...
% 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}%
}
%...
Run Code Online (Sandbox Code Playgroud)
我在想,如果ifthe-begins没有正确地用结束标签关闭?因为如果我删除第一个ifthens并开始,我将使pdflatex正常工作。还是还有其他东西?Doxygen中是否有错误生成了无效的doxygen.sty?还是这个问题在其他地方?如何使文档生成正常工作?
编辑:
更多信息,我认为该问题也与分组有关,因为如果删除分组,则生成工作正常。所以defgroup + paramoxy与doxygen + pdflatex->问题。
所有的功劳都归于 albert,因为问题与他建议的 LaTex 禁忌包有关。这里是关于这个问题的一个小总结。
由于 latex3/latex2e ( https://github.com/latex3/latex2e/issues/111 & https://github.com/doxygen/ ) 中的更改 (2018 年 12 月),LaTeX 禁忌包存在问题doxygen/issues/6769 ) 导致在使用 'tabu' 时在某些情况下生成失败(longtabu-package 的开发者很久以前就离开了,不再维护该包)。
已经有补丁 ( https://github.com/tabu-fixed/tabu ) 可用(并且已经在最新的 MikTek 版本中更新)修复了大多数情况(如 Doxygen 文档,如果不打补丁就无法生成)禁忌包),但它不适用于所有情况。即使使用打补丁的禁忌包,在禁忌环境中包含表格的示例也会中断生成。
如果补丁没有解决问题,建议使用更改前的 TeX 版本(https://github.com/latex3/latex2e)。
如果降级或使用较旧的 (Mik)TeX 版本不是一种选择,一种解决方法是使用其他软件包而不是损坏的软件包。例如编写一个脚本来编辑那些使用 longtabu* 的部分的 doxygen.sty 定义,并在 Doxygen 生成了 doxygen.sty 文件后用 {longtable}{|c|c|c|c|} 替换那些 longtabu*:s .