# Pandoc breaks hyperlinks in LaTeX file conversion

I want to convert a (quite complex) LaTeX file to epub using pandoc with:

pandoc -S file.tex -o file.epub


I have not used markdown in the creation of the tex file, however. When I, now, check the generated epub file I see that all hyperlinks (made by hyperref) are broken and thinks like this appear instead:

Fig. [fig:initial_model], s. Table [tab:dis-advantages] or chapter [ch:findings].

A check of the epub file displays the following error message:

Non-registered URI scheme type found in href.


What can I do about it?

• you can try tex4ebook – michal.h21 Sep 1 '15 at 17:10
• Hi Michal.h21, can you elaborate a bit further, for example, how one can use this within the command line without changing the code? – Til Hund Sep 1 '15 at 19:08
• if you have TL 2015 installed, you can try to run tex4ebook filename. it will create epub2 file by default. You shouldn't need to change your TeX file, unless you use some package which isn't supported by tex4ht (which tex4ebook uses for LaTeX to html conversion) – michal.h21 Sep 1 '15 at 19:12
• Uh, it might still take some time to arrive on archlinux, I guess, see here. – Til Hund Sep 1 '15 at 21:10
• Unfortunately, pandoc currently doesn't seem to support internal links to tables and figures (#813, though that seems strongly tied to pandoc's Markdown). Concerning chapters, you probably need to use \hyperdef{}{chap-one}{\chapter{One}}\label{chap-one} and \hyperref[chap-one]{One} as pandoc does when converting from Markdown, as described here. Maybe you can find some relevant hypersetup switches in the default LaTeX template (pandoc -D latex as well. – Tobias Kienzler Dec 11 '15 at 11:48