Dou*_*tti 3 python python-sphinx
我试图在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:
显示表的标题,所以我理解引用是正确的.有人能指出我所做的事情有什么不对吗?
补救措施是numfig = True
在conf.py中设置.如果没有此设置,您应该在运行sphinx-build时看到一条消息,其中显示"警告:numfig已禁用.:numref:被忽略".
这适用于HTML和LaTeX输出.请参见http://sphinx-doc.org/en/stable/config.html#confval-numfig.
归档时间: |
|
查看次数: |
1506 次 |
最近记录: |