How to maintain HTML internal links when converting with Pandoc

ぐ巨炮叔叔 提交于 2019-12-10 16:29:13

问题


I am trying to convert from html to pdf with Pandoc. The output is pretty nice, still with the command pandoc index.html -o output.pdfI lose all my internal links (from table of contents to chapters, from text to footnotes, etc).

In my HTML this is the outdegree link

<p class="calibre18"><a href="#calibre_link-73"><span class="calibre8">CHAPTER ONE</span></a><br class="calibre19"></br><a href="#calibre_link-73">The Ever Expanding Domain of Computation</a></p>

which then lands here

<a href="#calibre_link-73">Chapter 1</a> makes the case that because of...

and here

<p class="calibre18"><a href="#calibre_link-73"><span class="calibre8">CHAPTER ONE</span></a><br class="calibre19"></br><a href="#calibre_link-73">The Ever Expanding Domain of Computation</a></p>...

Is there any way to keep all the links also in the output?


回答1:


The Pandoc User's Guide section on Internal Links says

Internal links are currently supported for HTML formats (including HTML slide shows and EPUB), LaTeX, and ConTeXt.

This suggests that internal links aren't currently supported for PDF output, even though the PDF output is generated via LaTeX.




回答2:


Internal links should work straightforwardly in PDF. However, for printing purposes, the default is not to color them. Have you tried clicking on the text that should be a link?



来源:https://stackoverflow.com/questions/18427446/how-to-maintain-html-internal-links-when-converting-with-pandoc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!