How to maintain HTML internal links when converting with Pandoc

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

In my HTML, this is an outdated 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 a way to keep all links in the output?

+4
source share
2 answers

The Pandoc user guide section in internal links reports

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

This suggests that internal links are not currently supported for PDF output, although PDF output is created through LaTeX.

+1
source

Internal links should work directly in PDF. However, for printing, they should not be painted by default. Did you try to click on the text that should be the link?

+1
source

Source: https://habr.com/ru/post/1498808/


All Articles