Pandoc 转换为 PDF 不提供彩色超文本链接

jav*_*dba 4 pandoc pandoc-citeproc

考虑以下pandoc通过latex.

你能识别那里的超文本链接吗?我也不是......事实证明,第二个 Kaplan Meier具有指向外部站点的功能齐全的链接。但是我们如何推测呢?

请注意,pandoc 序言中已经存在以下选项- 没有它,超链接将根本无法工作:

link-citations: true
Run Code Online (Sandbox Code Playgroud)

缺少一个“真正的”解决方案,我需要修改一些东西来为链接提供提示——可能是通过字体操作。

Clé*_*ent 20

您还可以添加到元数据colorlinks: true

---
colorlinks: true
---

[Test](/sf/answers/4999828221/)
Run Code Online (Sandbox Code Playgroud)

给出:

在此输入图像描述


Kur*_*fle 6

如果您使用最新版本的 Pandoc(最新版本是 v2.7.3),只需将(例如)这些添加到命令行:

-V colorlinks=true \
-V linkcolor=blue \
-V urlcolor=red \
-V toccolor=gray
Run Code Online (Sandbox Code Playgroud)

无需摆弄preamble

您可以通过以下命令调查您自己的 Pandoc 附带的内置 LaTeX 模板:

pandoc -D latex | less
Run Code Online (Sandbox Code Playgroud)

然后搜索linkurlcolor等以查看其中预定义了哪些变量。或者:

pandoc -D latex | grep --color -E '(links|color|url|file)'
Run Code Online (Sandbox Code Playgroud)

会让你知道你可能想要操纵的其他“链接”。