# How to insert a percent symbol in url in beamer?

I found when I use the article class and hyperref package, the % can be printed by \href{url}{text}but things changes when I use beamer, for example

% Works fine
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\end{document}


and

% Doesn't work
\documentclass{beamer}
\begin{document}
\begin{frame}{test page}
\end{frame}
\end{document}


How can I include the % in the url link? Thanks a lot.

• doesn't escaping (\%) work? – chan1142 Oct 15 '16 at 2:39
• Thanks. \% works. But I want to know why it failed in beamer. – Ice0cean Oct 15 '16 at 3:20

In order to do its work, beamer has to absorb a frame environment's contents at once. This has the consequence that \href cannot perform its duty of changing the nature of %, because when the contents is absorbed, TeX does not interpret commands and % is still the comment character.
• escape % into \%
• use \begin{frame}[fragile], that's recommended whenever the frame contains verbatim material.