4

I am using the hyperref package to insert links to websites in my documents.

The Adobe reader opens a new tab for each link in the PDF, and that is what I want.

Next I want to get the same behavior when I generate HTML using some LaTeX to HTML converter. I am using plasTeX.

How do I tell hyperref via \href{site}{text}that I want the HTML code to have a target="blank" inside the

<a href="site">text</a> 

in the resulting HTML?

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
Echeban
  • 605
  • 1
  • 5
  • 14

1 Answers1

2

The simple answer is: it can't be done.

hyperref can open new browser tabs/windows if the target is another PDF document. This is done using the \href feature pdfnewwindow. No similar feature exists in hyperref to open new tabs\windows for http or https web addresses. See Make hyperref links open in new browser window for easier navigation for clarification and further information.

BlackMagic
  • 349
  • 1
  • 2
  • 12
  • To be more precise, if I read correctly the PDF 1.7 specification of URI actions (links to the web), there is no option to affect how such links are opened. So hyperref cannot do anything about that. Of course, using Javascript works but only in Acrobat Reader. – Bruno Le Floch Oct 06 '16 at 00:20
  • I think this answer might be correct but for the wrong question. OP is generating a HTML document using e.g. plasTeX, not hyperref. – user202729 May 14 '23 at 10:07