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?

2

1 Answer 1

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.

2
  • 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. Oct 6, 2016 at 0: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, 2023 at 10:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .