如何运行sphinx并使用latex标记构建html页面

2024-10-01 17:26:09 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用sphinx创建文档。这涉及到很多数学问题,所以我想用latex格式的方程式创建一些页面

我的docs文件夹中有一个名为“functions.rst”的简单页面,它已添加到“index.rst”文件中。 functions.rst仅包含

#########
Functions
#########

$
a = \sqrt{\gamma R T}
$

conf.py具有

extensions = ["sphinx_rtd_theme", "sphinx.ext.imgmath"]

在命令行中运行.\make html时,生成的页面只是原始文本

当我运行类似sphinx-build -b html -D imgmath_latex=C:\Users\Fernando\latex.exe . _build/html 的东西时

输出为:

Running Sphinx v3.3.0
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 3 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
preparing documents... done
writing output... [100%] index
WARNING: LaTeX command 'C:\\Users\\Fernando\\latex.exe' cannot be run (needed for math display), check the imgmath_latex setting
generating indices... genindex done
writing additional pages... search done
copying static files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 1 warning.

The HTML pages are in _build\html.

有人能指出我遗漏了什么或修复了什么吗?我尝试过在每次错误输出时调整imgmath_latex设置几次,但我遇到了一个死胡同。 非常感谢您提前抽出时间


Tags: buildforindexhtmlsphinx页面filesrst

热门问题