如何解决如何正确显示Sphinx文档生成器生成的pdf中的超链接
在 Sphinx 文档环境中,我正在使用 pdflatex 创建pdf文档。
要在源文件之间导航,我在某些文件中使用了label
和ref
添加了链接,这些链接在HTML文档中绝对可以正常工作。但是,上述链接不会显示在生成的pdf文件中。
我正在复制.rst
文件(的一部分),它们之间具有 reference :
文件 define_ques_list.rst (从该文件中,我将文件称为capa.rst
)
###################
Question List
###################
**DeFinition**
Question lists are multilingual collections of questions that are answered during the exe...
:ref:`CAPA <corr-n-prev-action-capa-label>`
.. index:: question list
文件 capa.rst
.. _corr-n-prev-action-capa-label:
##########################
CAPA
#########################
Corrective Actions/Preventive Actions
-------------------------------------
**DeFinition**
*Corrective Actions*
These are actions that are deemed necessary to eliminate the cause of errors that were determined dur...
*Preventive Actions*
These are actions that are deemed necessary to eliminate the causes of possible errors before they ...
.. index:: corrective action CAPA
\chapter{Question List}
\label{\detokenize{modules/deFinitions/define_ques_list:question-list}}\label{\detokenize{modules/deFinitions/define_ques_list:question-list-href-label}}\label{\detokenize{modules/deFinitions/define_ques_list::doc}}
\sphinxstylestrong{DeFinition}
Question lists are multilingual collections of questions that are answered during the exe...
\DUrole{xref,std,std-ref}{CAPA} <= This is the hyperlink as translated?
\index{question list@\spxentry{question list}}\ignorespaces
解决方法
由于@mzjn和@Trendfischer,提出了以下解决方案:
使用 index.rst 中的指令xml
,将 referred 添加到文件 capa.rst 中,如下所示:>
index.rst
:hidden:
通过这种安排,我现在在生成pdf文件时将超链接链接到被调用文件( capa.rst )。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。