Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Ryan Higginbottom
January 17, 2012
Using hyperref
Introduction to
hyperref
A First Example
The Setup
Configuration Options
General Options
PDF-Specific Options
PDF Display Options
Using hyperref
A Sample Preamble
Commands in
hyperref
Revisit Example #1
Cross-referencing (1)
Cross-referencing (2)
Back to Example #1
Again
Practice
Introduction to hyperref
Using hyperref
Introduction to
hyperref
A First Example
The Setup
Configuration Options
General Options
PDF-Specific Options
With more and more reading taking place electronically, we are very
used to having a clickable reference right next to (or in the middle
of) a sentence. Making HTML files with LATEX can be done, but its
tricky. So, we can take advantage of the interactive nature of
hyper-referenced PDF files instead.
hyperref
Revisit Example #1
Cross-referencing (1)
Cross-referencing (2)
Back to Example #1
Again
Practice
A First Example
Using hyperref
Introduction to
hyperref
A First Example
The Setup
Open the first example file (.tex). This file will have an image
included, so make sure to grab circles.png as well and put
these two files in the same folder.
Configuration Options
General Options
PDF-Specific Options
PDF Display Options
A Sample Preamble
Build this file twice, then view it to see some of how hyperref
works.
Commands in
hyperref
Revisit Example #1
Cross-referencing (1)
Cross-referencing (2)
Back to Example #1
Again
Practice
The Setup
Using hyperref
Introduction to
hyperref
A First Example
The Setup
Configuration Options
General Options
PDF-Specific Options
PDF Display Options
A Sample Preamble
Commands in
hyperref
Revisit Example #1
Cross-referencing (1)
\usepackage[lots of options]{hyperref}
Cross-referencing (2)
Back to Example #1
Again
Practice
Configuration Options
Using hyperref
Introduction to
hyperref
If you are using the build LaTeX => PDF, then you should use the
pdftex option.
A First Example
The Setup
\usepackage[pdftex]{hyperref}
Configuration Options
General Options
PDF-Specific Options
PDF Display Options
If you are using the build LaTeX => PS => PDF, then you should
use the ps2pdf option.
A Sample Preamble
Commands in
hyperref
\usepackage[ps2pdf]{hyperref}
Revisit Example #1
Cross-referencing (1)
Cross-referencing (2)
Back to Example #1
Again
Practice
\usepackage[pdftex,breaklinks]{hyperref}
General Options
Using hyperref
Introduction to
hyperref
A First Example
The Setup
Configuration Options
Option
colorlinks
Default
false
General Options
PDF-Specific Options
PDF Display Options
A Sample Preamble
Commands in
hyperref
linkcolor
anchorcolor
citecolor
red
black
green
urlcolor
cyan
Revisit Example #1
Cross-referencing (1)
Cross-referencing (2)
Function
Colors the text of the links and
anchors
Color for normal internal links
Color for anchor text
Color for bibliographic citations
in text
Color for linked URLs
Back to Example #1
Again
Practice
PDF-Specific Options
Using hyperref
Introduction to
hyperref
A First Example
The Setup
Configuration Options
General Options
Option
bookmarks
Default
true
PDF-Specific Options
PDF Display Options
A Sample Preamble
bookmarksopen
false
bookmarksnumbered
false
Commands in
hyperref
Revisit Example #1
Cross-referencing (1)
Cross-referencing (2)
Back to Example #1
Again
Function
Writes a set of Acrobat
bookmarks
If bookmarks are requested,
starts document with all
subtrees expanded
Include section numbers in
bookmarks
Practice
hyperref
A First Example
The Setup
Option
Function
Configuration Options
pdftitle
pdfauthor
pdfsubject
pdfcreator
pdfproducer
pdfkeywords
pdfstartpage
pdfdisplaydoctitle
General Options
PDF-Specific Options
PDF Display Options
A Sample Preamble
Commands in
hyperref
Revisit Example #1
Cross-referencing (1)
Cross-referencing (2)
Back to Example #1
Again
Practice
A Sample Preamble
Using hyperref
Introduction to
hyperref
A First Example
The Setup
Configuration Options
General Options
PDF-Specific Options
PDF Display Options
\usepackage[pdftex,breaklinks,colorlinks,
citecolor=blue,
urlcolor=blue,
pdftitle={Lecture 9},
pdfauthor={Ryan Higginbottom},
pdfsubject={LaTeX}]{hyperref}
A Sample Preamble
Commands in
hyperref
Revisit Example #1
Cross-referencing (1)
Cross-referencing (2)
Back to Example #1
Again
Practice
10
Commands in hyperref
Using hyperref
Introduction to
hyperref
Here are some of the commands youll need in the body of your
document when using hyperref.
A First Example
The Setup
Configuration Options
General Options
PDF-Specific Options
PDF Display Options
A Sample Preamble
Commands in
hyperref
Revisit Example #1
Cross-referencing (1)
Cross-referencing (2)
Back to Example #1
Again
Practice
Contents.
11
Revisit Example #1
Using hyperref
Introduction to
hyperref
I have used all of the commands from the previous slide on the first
example file. Take a close look at this file using TeXnicCenter.
A First Example
The Setup
Configuration Options
General Options
PDF-Specific Options
PDF Display Options
A Sample Preamble
Commands in
hyperref
Revisit Example #1
Cross-referencing (1)
Cross-referencing (2)
Back to Example #1
Again
Practice
12
Cross-referencing (1)
Using hyperref
Introduction to
hyperref
A First Example
The Setup
Configuration Options
General Options
PDF-Specific Options
PDF Display Options
A Sample Preamble
Commands in
hyperref
Revisit Example #1
Cross-referencing (1)
\begin{theorem} \label{T:main}
...
\end{theorem}
...
Look at \autoref{T:main} ...
Cross-referencing (2)
Back to Example #1
Again
Practice
Look at Theorem 2 . . .
13
Cross-referencing (2)
Using hyperref
Introduction to
hyperref
A First Example
The Setup
Configuration Options
General Options
PDF-Specific Options
Commands in
hyperref
Revisit Example #1
Cross-referencing (1)
Cross-referencing (2)
Back to Example #1
Again
Practice
\ref*{label}
\pageref*{label}
\autoref*{label}
\autopageref*{label}
14
hyperref
A First Example
The Setup
Configuration Options
General Options
PDF-Specific Options
PDF Display Options
A Sample Preamble
Commands in
hyperref
Revisit Example #1
Cross-referencing (1)
Cross-referencing (2)
Build this example twice and view it to see the effect of these new
commands.
Back to Example #1
Again
Practice
15
Practice
Using hyperref
Introduction to
hyperref
A First Example
Lets practice!
Open the second example file (.pdf) and reproduce it.
The Setup
Configuration Options
General Options
PDF-Specific Options
PDF Display Options
A Sample Preamble
Commands in
hyperref
Revisit Example #1
Cross-referencing (1)
Cross-referencing (2)
Back to Example #1
Again
Practice
16