I have a strange effect, when I want to typeset a URI inside a tabular in a frame.
Example:
\documentclass[10pt]{beamer}
\usepackage{hyperref}
\begin{document}
\begin{frame}
\href{http://www.mysite.de/xxx}{page 1} --
\href{http://www.mysite.de/xxx&}{page 1}
\end{frame}
\begin{frame}
\begin{tabular}{l}
\href{http://www.mysite.de/xxx}{url without \&} %ok
\end{tabular}
\end{frame}
%Error
\begin{frame}%[fragile]
\begin{tabular}{l}
\href{http://www.mysite.de/xxx&}{url with \&} %! Argument of \href@split has an extra }.
\end{tabular}
\end{frame}
\end{document}
When I translate the document, I get the error
! Argument of \href@split has an extra }.
<inserted text>
\par
l.21 \end{frame}
I have no problem with \href
in a frame (see first frame), I have no problem with \href
inside a tabular (see 2nd frame),
but I have a problem if \href
contains a &
and it is part of a tabular.
The example works fine, if the frame gets a fragile
flag.
I understand, why I need the fragile
flag, if I use verbatim text,
but why is the fragile flag needed, if there is a combination of tabular and href
-content?
Is there a way to avoid the fragile-flag in this situations?
\href
is very similar to verbatim mode.