微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何正确显示Sphinx文档生成器生成的pdf中的超链接

如何解决如何正确显示Sphinx文档生成器生成的pdf中的超链接

Sphinx 文档环境中,我正在使用 pdflatex 创建pdf文档。

要在源文件之间导航,我在某些文件中使用了labelref添加链接,这些链接在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

我检查了文件*.tex中的(相关)内容,可以看到以下内容

\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 

我的问题是:为什么pdf文件中缺少我的超链接

解决方法

由于@mzjn和@Trendfischer,提出了以下解决方案:

使用 index.rst 中的指令xml,将 referred 添加到文件 capa.rst 中,如下所示:>

index.rst

:hidden:

通过这种安排,我现在在生成pdf文件时将超链接链接到被调用文件( capa.rst )。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。