# hyperlink with beamer using lyx

I am using LyX to build a beamer presentation that has hyperlinks. I create the hyperlink in the following manner:

\hyperlink{test}{\beamerbutton{mybutton}}


Then, there is a frame after the \appendix command in my file which (from LyX source has):

\lyxframe{Test Slide\label{test}}
hello lyx!
\lyxframeend{}


However, the link seems to go to the slide after this one. What is going on here? However, using the \hypertarget command works fine:

\lyxframe{Test Slide}
\hypertarget{test}{}
hello lyx!
\lyxframeend{}

• What happens if you put the label after \lyxframe{blurgh}, like this: \lyxframe{Test Slide}\label{test}hello lyx\lyxframeend{}? – moewe Oct 16 '13 at 6:11
• Alex, for him/her to be notified of your comment, you should poke him with @moewe – scottkosty Oct 16 '13 at 17:55
• @moewe: your comment worked, turn it into an answer – Alex Oct 16 '13 at 18:16

To get proper hyperlinks you need to use \label{test} after \lyxframe{blurgh}.
\lyxframe{Test Slide}\label{test}

If LaTeX encounters a \label, it sets a link to where the last counter-modification appeared. If you use \label within the command modifying the counter alls sorts of things may happen, but probably not what you expect.