Skip to main content
Post Closed as "Duplicate" by Roland, José Carlos Santos, dexteritas, Willoughby, Stefan Pinnow
Added example
Source Link
Sverre
  • 21.2k
  • 18
  • 96
  • 219

While there's normally no problem with having the pound sign # in an \href link (see Hyperlink with # (number sign)), it does not work within a frame environment in beamer.

\documentclass{beamer} \usepackage{hyperref} \begin{document} \begin{frame} \href{http://de.wikipedia.org/wiki/Hybridorbital#Beispiele}{Wiki} \end{frame} \end{document} 

This results in the error ! Illegal parameter number in definition of \iterate.

Remove the frame environment, though, and it compiles fine. So my question is, how can I include an \href link with the symbol # in a frame environment in beamer?


EDIT: A comment suggests to add the option [fragile] to the frame environment. While that takes care of the MWE above, it won't fix the fact the MWE below also crashes because of the pound sign # in the \href link:

\documentclass{beamer} \usepackage{hyperref} \begin{document} \begin{frame}[fragile] \only<1>{\href{http://de.wikipedia.org/wiki/Hybridorbital#Beispiele}}{Wiki} \end{frame} \end{document} 

This gives the error ! Illegal parameter number in definition of \beamer@doifinframe. Remove the pound sign # from the link, though, and it compiles without error.

While there's normally no problem with having the pound sign # in an \href link (see Hyperlink with # (number sign)), it does not work within a frame environment in beamer.

\documentclass{beamer} \usepackage{hyperref} \begin{document} \begin{frame} \href{http://de.wikipedia.org/wiki/Hybridorbital#Beispiele}{Wiki} \end{frame} \end{document} 

This results in the error ! Illegal parameter number in definition of \iterate.

Remove the frame environment, though, and it compiles fine. So my question is, how can I include an \href link with the symbol # in a frame environment in beamer?

While there's normally no problem with having the pound sign # in an \href link (see Hyperlink with # (number sign)), it does not work within a frame environment in beamer.

\documentclass{beamer} \usepackage{hyperref} \begin{document} \begin{frame} \href{http://de.wikipedia.org/wiki/Hybridorbital#Beispiele}{Wiki} \end{frame} \end{document} 

This results in the error ! Illegal parameter number in definition of \iterate.

Remove the frame environment, though, and it compiles fine. So my question is, how can I include an \href link with the symbol # in a frame environment in beamer?


EDIT: A comment suggests to add the option [fragile] to the frame environment. While that takes care of the MWE above, it won't fix the fact the MWE below also crashes because of the pound sign # in the \href link:

\documentclass{beamer} \usepackage{hyperref} \begin{document} \begin{frame}[fragile] \only<1>{\href{http://de.wikipedia.org/wiki/Hybridorbital#Beispiele}}{Wiki} \end{frame} \end{document} 

This gives the error ! Illegal parameter number in definition of \beamer@doifinframe. Remove the pound sign # from the link, though, and it compiles without error.

Source Link
Sverre
  • 21.2k
  • 18
  • 96
  • 219

Pound sign # in \href link in beamer's frame environment

While there's normally no problem with having the pound sign # in an \href link (see Hyperlink with # (number sign)), it does not work within a frame environment in beamer.

\documentclass{beamer} \usepackage{hyperref} \begin{document} \begin{frame} \href{http://de.wikipedia.org/wiki/Hybridorbital#Beispiele}{Wiki} \end{frame} \end{document} 

This results in the error ! Illegal parameter number in definition of \iterate.

Remove the frame environment, though, and it compiles fine. So my question is, how can I include an \href link with the symbol # in a frame environment in beamer?