相关疑难解决方法(0)

在sphinx中重置图号,但仅限于html

使用HTML构建sphinx文档时,图形编号显示在全局范围内,即给定页面的图形以图42开始,尽管图42是该页面上的第一个图形,之前的所有其他图形出现在其他页面上.虽然这对于Latex来说绝对是理想的,但在HTML中却有些奇怪.

我正在使用sphinx 1.1和numfig,如在Sphinx和reStructuredText中使用数字引用数字,特别是pip包sphinx_numfig.Python版本是2.7,但我想这没关系.

如何重置第一个文件的图号,但仅当文档是以HTML格式生成时?

restructuredtext python-sphinx

6
推荐指数
0
解决办法
196
查看次数

如何在Sphinx中正确地使用numref表?

我试图在Sphinx文档中引用一个表格.我为表命名,然后尝试使用numref,但它错误地显示了表的标签("modules_classes")而不是它的编号.

.. _modules_classes:

.. table:: Modules and their corresponding abstract classes

[table content]

Modules and their corresponding abstract classes are presented on table :numref:`modules_classes`.
Run Code Online (Sandbox Code Playgroud)

我也试过这样做,因为我在网上找到了一个例子,但结果是一样的:

.. table:: Modules and their corresponding abstract classes
    :name: modules_classes
Run Code Online (Sandbox Code Playgroud)

我看到它的方式,我不需要导入numfig包,因为它默认包含在Sphinx中.使用该命令:ref:显示表的标题,所以我理解引用是正确的.有人能指出我所做的事情有什么不对吗?

python python-sphinx

3
推荐指数
1
解决办法
1506
查看次数

标签 统计

python-sphinx ×2

python ×1

restructuredtext ×1