问题
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