1

Is it possible to insert a command in LaTeX so that on the resulting PDF file the designated/default blank browser can be opened by a click?

7
  • 3
    If by "the designated browser" you mean the default browser, then there are many options via hyperref or url.
    – Werner
    May 30, 2012 at 18:16
  • 2
    Could you provide a small example (in the form of a minimal example) of the usage you're after?
    – Werner
    May 30, 2012 at 18:17
  • 1
    I am trying to use the popupmenu package tex.stackexchange.com/questions/53508/… and occasionally the links used in a menu do not open. I have not isolated the problem enough to make a MWE. I thought if the browser is already open then it might bypass whatever the issue is. So I want to put a link that just opens the default browser.
    – Maesumi
    May 30, 2012 at 19:29
  • If your question is about the link opening in a specific browser (such as Firefox), I think the answer is going to be no as the default browser is controlled by the end user, and not all browsers are available in all platforms. Otherwise this would require the PDF to launch a specific executable which could potentially be dangerous. May 30, 2012 at 19:29
  • What is the URL of about:blank? and is there a way of forcing the browser to open instead of it blinking on the tray waiting to be clicked to open. (Perhaps this is not a TeX question.)
    – Maesumi
    May 30, 2012 at 19:48

2 Answers 2

6

When the hyperlink is clicked in the following MWE, it opens up the default browser on a blank page (about:blank):

enter image description here

\documentclass{article}
\usepackage{hyperref}% http://ctan.org/pkg/hyperref
\begin{document}
This is a \href{about:blank}{blank page}.
\end{document}

enter image description here

Here's a resource motivating the above: about URI scheme

1
  • This did it! instead of browser icon blinking on the tray it just opened.
    – Maesumi
    May 30, 2012 at 19:56
5
\documentclass{article}
\usepackage{hyperref}
\begin{document}
This is an \href{http://tex.stackexchange.com/}{example link}.
\end{document}

See texdoc hyperref for more macros and options on how to change the look of such links.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.