Document ClassesBeamer linking within document

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
workerbee
Posts: 43
Joined: Sat Nov 22, 2008 1:53 am

Beamer linking within document

Post by workerbee »

Hi All,

I was wondering how to link to other frames within the same Beamer document? (Similar to adding hyperlinks within Power Point to other slides in the same presentation.)

Any feedback would be helpful and appreciated, thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Beamer linking within document

Post by frabjous »

Sure. The easiest way would be something like this. First, put:

\usepackage{hyperref}

in the preamble.

Then give the frame you want to link to a label, e.g.

Code: Select all

\begin{frame}[label=GO_HERE]
(This is the destination frame.)
\end{frame}
Replace the label with whatever seems appropriate.

Then create the link wherever you want it to be using a code like this:

Code: Select all

\hyperlink{GO_HERE}{\beamergotobutton{Go to my frame}}
Replace "Go to my frame" with whatever you want the link text to be.
workerbee
Posts: 43
Joined: Sat Nov 22, 2008 1:53 am

Beamer linking within document

Post by workerbee »

Thanks for the quick response! I tried this out and unfortunately keep getting an error message. Should the

Code: Select all

\usepackage{hyperref}
command be placed in a certain order in the preamble?

Currently this is my preamble:

Code: Select all

\documentclass{beamer}
\usepackage{graphicx}
\usepackage{makeidx,epsfig,lscape}
\usepackage{colortbl}
\usepackage{array}
\usepackage{float}
\usepackage{longtable}
\usepackage{mathptmx}
\usepackage{mdwlist}
\usepackage{times}
\usetheme{default}
\usefonttheme{serif}
\usepackage{hyperref}
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Beamer linking within document

Post by frabjous »

Actually looking again at the beamer documentation, it says that it loads hyperref by default, so I think you can just leave that out.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Beamer linking within document

Post by Stefan Kottwitz »

Hi,
workerbee wrote:I tried this out and unfortunately keep getting an error message.
why don't you tell us the error message?
Yes, hyperref will already be loaded by the beamer class.

Stefan
LaTeX.org admin
workerbee
Posts: 43
Joined: Sat Nov 22, 2008 1:53 am

Beamer linking within document

Post by workerbee »

I tried leaving it out and for some reason I still keep getting errors.

Here's my sample:

(frame #3)

Code: Select all

\begin{frame}
\frametitle{Data set 1, analysis step 3: missing data modeling}
\begin{eqnarray}
[y, m] &=& [y] \; [m | y], \label{selection} \\
& =& [m] \; [y|m], \label{pmm}
\end{eqnarray}
\begin{equation}
[y, m] = \sum_{c} [c] \; [m|c] \; [y|c], \label{shared}
\end{equation}
\hyperlink{frame6}{\beamergotobutton{Go to frame 6}}
\end{frame}
and this is the target/destination frame (#6):

Code: Select all

\begin{frame}[label=frame6]
\frametitle{Table 4: Summary of joint missing data indicator and outcome analyses for data set 1}
\begingroup
\begin{center}
 \setlength\extrarowheight{2pt}
 \begin{tabular}{ l c c c }
 \hline
 \\[-2.3mm]
 Model & LL & \# par.'s & BIC \\
 \\[-2.3mm]
 \hline
 \\[-2.3mm]
 MAR (23 class) & -6487 & 55 & 13271 \\
 Pattern-Mixture (23 class) & -6403 & 165 & 13699 \\
 Latent Class Pattern-Mixture (2-class) & -6491 & 56 & 13286 \\
 \\[-2.3mm]
 \hline
 \end{tabular}
\end{center}
\endgroup
\end{frame}
Did I do this correctly? Sorry for the constant barrage of questions.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Beamer linking within document

Post by Stefan Kottwitz »

workerbee wrote:I tried leaving it out and for some reason I still keep getting errors.
As long as you don't tell us the error messages it's hard to help. The code pieces above are compilable. Consider to post a complete minimal example that's bringing the error.

By the way you should use the align environment of amsmath instead of the obsolete eqnarray environment. Compare the spaces around the equal signs of the 3 formulas in frame #3 or have a look at eqnarray vs. align.

Stefan
LaTeX.org admin
workerbee
Posts: 43
Joined: Sat Nov 22, 2008 1:53 am

Re: Beamer linking within document

Post by workerbee »

This was the error message:

This is BibTeX, Version 0.99c (Web2c 7.5.2)
The top-level auxiliary file: skip-sample.aux
I found no \citation commands---while reading file skip-sample.aux
I found no \bibdata command---while reading file skip-sample.aux
I found no \bibstyle command---while reading file skip-sample.aux
(There were 3 error messages)


*** BibTeX produced the following log file "skip-sample.blg":

This is BibTeX, Version 0.99c (Web2c 7.5.2)
The top-level auxiliary file: skip-sample.aux
I found no \citation commands---while reading file skip-sample.aux
I found no \bibdata command---while reading file skip-sample.aux
I found no \bibstyle command---while reading file skip-sample.aux
You've used 0 entries,
0 wiz_defined-function locations,
83 strings with 496 characters,
and the built_in function-call counts, 0 in all, are:
= -- 0
> -- 0
< -- 0
+ -- 0
- -- 0
* -- 0
:= -- 0
add.period$ -- 0
call.type$ -- 0
change.case$ -- 0
chr.to.int$ -- 0
cite$ -- 0
duplicate$ -- 0
empty$ -- 0
format.name$ -- 0
if$ -- 0
int.to.chr$ -- 0
int.to.str$ -- 0
missing$ -- 0
newline$ -- 0
num.names$ -- 0
pop$ -- 0
preamble$ -- 0
purify$ -- 0
quote$ -- 0
skip$ -- 0
stack$ -- 0
substring$ -- 0
swap$ -- 0
text.length$ -- 0
text.prefix$ -- 0
top$ -- 0
type$ -- 0
warning$ -- 0
while$ -- 0
width$ -- 0
write$ -- 0
(There were 3 error messages)
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: Beamer linking within document

Post by Stefan Kottwitz »

Use pdflatex (or latex) to compile, not bibtex.

Stefan
LaTeX.org admin
workerbee
Posts: 43
Joined: Sat Nov 22, 2008 1:53 am

Re: Beamer linking within document

Post by workerbee »

Sorry, found the error. I forgot to place the image files in the same folder as the tex file.
Post Reply