28.03.2013 Views

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

10.2. Portable Document Format 247<br />

\hyperbaseurl{url pre}<br />

sets a prefix for all external URLs specified by other comm<strong>and</strong>s,<br />

so that the common part of a set of URLs need only be given<br />

once; this is the same as the baseurl option, but can be changed<br />

within the document;<br />

\href{url}{text}<br />

makes text in<strong>to</strong> a link <strong>to</strong> the full URL given by url prefixed with<br />

the current base URL; special characters like # <strong>and</strong> & can be type<br />

in url directly;<br />

\hyperimage{url}{image url}<br />

inserts the image referenced by image url;<br />

\hyperdef{category}{name}{text}<br />

establishes text as a target (anchor) with name category.name;<br />

\hyperref{url}{category}{name}{text}<br />

makes text a link <strong>to</strong> url#category.name;<br />

an alternate syntax is \hyperref[key]{text} <strong>to</strong> make text an<br />

internal link <strong>to</strong> the location marked with \label{key};<br />

\hypertarget{name}{text}<br />

establishes text as an internal target (anchor) with the name<br />

#name;<br />

\hyperlink{name}{text}<br />

makes text a link <strong>to</strong> the internal target #name.<br />

The cross-referencing comm<strong>and</strong>s \ref{key} <strong>and</strong> \pageref{key} (Section<br />

9.2.1) au<strong>to</strong>matically create links <strong>to</strong> the corresponding \label{key}<br />

location. As pointed out above, one can also create a manual link with<br />

\hyperref[key]{text}.<br />

The hyperref package also provides starred versions \ref* <strong>and</strong><br />

\pageref* which function as the regular ones but without creating a<br />

link.<br />

Adding Acrobat but<strong>to</strong>ns<br />

An electronic document is active, as indicated by the links within it for<br />

jumping <strong>to</strong> other sections. But it is also possible <strong>to</strong> insert other types of<br />

‘actions’, in the form of but<strong>to</strong>ns which, when clicked, do something, like<br />

flipping <strong>to</strong> the next page, opening another document, or even quitting.<br />

The hyperref package can add such functionality for the Acrobat<br />

viewers, by means of the comm<strong>and</strong><br />

\Acrobatmenu{action}{text}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!