I tried to use the command \href{url}{anchor text}
to link a page, but encountered the issue Illegal parameter number in definition of \test.
The error is likely caused by #
in url. Here is a MWE.
\documentclass{beamer}
\usetheme{Warsaw}
\usepackage{hyperref}
\hypersetup{
urlcolor = blue
}
\usepackage{color}
\urlstyle{same}
\begin{document}
\begin{frame}{Illegal parameter number in definition of \textbackslash test}
This works (without hash): \href{http://example.com/en/revision-control-software-managed-code-smartgit/131_Git}{Text 1}
This doesn't work (with hash): %\href{http://example.com/en/revision-control-software-managed-code-smartgit/#131_Git}{Text 1}
Error case 2: %\href{https://example.com/search?q=user%3A3067748+github}{Text 2}
\end{frame}
\end{document}
How do I slove this problem?
\#
instead of#
in the url. If you have several urls with a # in it and you want a more automated solution, you might find some inspiration here: tex.stackexchange.com/q/35310/134144