【问题标题】:how to truly turn off LaTex output in Doxygen如何在 Doxygen 中真正关闭 LaTex 输出
【发布时间】:2019-07-15 22:37:38
【问题描述】:

我的小组在 RHEL7 上使用 Doxygen 1.8.5 为大型 C++ 项目生成纯 HTML 文档。我们只需要 HTML 文档,不需要任何其他输出格式。该项目的 Doxygen 配置文件 (Doxyfile) 带有以下与默认设置不同的设置(当然还有其他设置):

OUTPUT_DIRECTORY="../Docs"
GENERATE_HTML=YES
GENERATE_LATEX=NO

当我们使用这个配置文件运行 Doxygen 时,在处理即将结束时,错误开始从 LaTeX 组件出现在屏幕上,并且处理被暂停,直到用户多次点击输入以克服这些错误,例如

...

sh: epstopdf: command not found
error: Problems running epstopdf. Check your TeX installation!
Generating graph info page...
Generating directory documentation...
</home/abilich/Src/GNSS_Software/Lib/LibgpsC++/>:3: warning: Found unknown command `\reference'
</home/abilich/Src/GNSS_Software/Lib/LibgpsC++/>:2: warning: Found unknown command `\reference'
</home/abilich/Src/GNSS_Software/Lib/LibgpsC++/>:2: warning: Found unknown command `\reference'
Generating bitmaps for formulas in HTML...
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)
 restricted \write18 enabled.
entering extended mode
(./_formulas.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, lo
aded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/epsfig.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/dvips.def))))
No file _formulas.aux.
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]
! Undefined control sequence.
l.53 \[ \Vert v - w \Vert \leqslant
                                    p\,\min(\Vert v\Vert, \Vert w\Vert). \]
? 

...

! Undefined control sequence.
l.533 $ \vert singular value \vert \leqslant
                                             threshold \times \vert max sing...

? 
[177] [178] (./_formulas.aux) )
Output written on _formulas.dvi (178 pages, 20576 bytes).
Transcript written on _formulas.log.
error: Problems running latex. Check your installation or look for typos in _formulas.tex and check _formulas.log!
Generating image form_0.png for formula
sh: gs: command not found
error: Problem running ghostscript gs -q -g60x50 -r384x384x -sDEVICE=ppmraw -sOutputFile=_form0.pnm -dNOPAUSE -dBATCH -- _form0.ps. Check your installation!
Generating index page...
/home/abilich/Src/GNSS_Software/Doxy/mainpage.h:15: warning: image file GNSSSoftwareTimeline.png is not found in IMAGE_PATH: assuming external image.
Generating page index...
Generating module index...
Generating namespace index...
Generating namespace member index...

我想创建一个无需用户干预即可运行且不会引发 LaTeX 错误的 Doxyfile。我误入了哪里?

【问题讨论】:

  • 版本 1.8.5 有点旧(2013 年 8 月),我会安装当前版本。回到 LaTeX 问题,可以使用 MATHJAX 来渲染公式(参见配置选项)。关于公式中的错误,我至少会检查这里有什么问题,因为它可能无论如何都会出现在输出中。
  • USE_MATHJAX=YES 消除了 LaTeX 错误,谢谢@albert。
  • 您是否检查了所有公式是否正常工作(尤其是抛出错误的那个)?

标签: doxygen


【解决方案1】:

感谢@albert的评论,实际上最新版本的doxygen确实支持通过设置GENERATE_LATEX=NO来关闭latex生成:

#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------

# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
# The default value is: YES.

GENERATE_LATEX         = NO

配置文件中的参数USE_PDFLATEX应该设置为NO(默认值为YES

# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as
# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX
# files. Set this option to YES, to get a higher quality PDF documentation.
#
# See also section LATEX_CMD_NAME for selecting the engine.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
USE_PDFLATEX           = NO

【讨论】:

  • 您可能在这里指出了 doxygen 中的一个小问题(谢谢),但对于最初的问题,我认为它没有任何影响(问题似乎是由于公式造成的)。
  • 我只是在if ( (format==PlantumlManager::PUML_EPS) &amp;&amp; (Config_getBool(USE_PDFLATEX)) ) 行进一步调查了这个问题,当GENERATE_LATEX=NO 不会有format == PUML_EPS 的请求,因此当GENERATE_NO 根本没有输入这部分。不需要通过设置USE_PDFLATEX=NO来禁用这部分。
  • @albert,你说得对,1.8.20版本确实支持通过设置GENERATE_LATEX=NO完全关闭LATEX
猜你喜欢
  • 2013-12-22
  • 2012-04-01
  • 2018-02-27
  • 1970-01-01
  • 2010-11-24
  • 2011-01-21
  • 2011-02-23
  • 2010-11-18
  • 1970-01-01
相关资源
最近更新 更多