I know that to use \verb|...| in a beamer presentation you have to add the fragile option to the frame environment.
But if I use \verb|...| in the main \title of \titlepage it gives me the error:
Runaway argument?
guide to \relax \hbox {}#I\catcode `\ \active \<let>-command \csname\endcsname
! Paragraph ended before \HyPsd@@ProtectSpacesFi was complete.
<to be read again>
\par
l.5 \begin{document}
How can I solve it?
MWE:
\documentclass{beamer}
\usetheme{Madrid}
\title{Quack guide to \verb|\usepackage{tikzducks}|}
\begin{document}
\begin{frame}[fragile=singleslide]
\titlepage
Why this doesn't work\dots
\end{frame}
\begin{frame}[fragile=singleslide]
\dots whereas this \verb|\usepackage{tikzducks}| works?
\end{frame}
\end{document}
Quack guide to \texttt{\string\usepackage\string{tikzducks\string}}, perhaps – egreg Jan 04 '17 at 17:40\end{document}was missing :) – CarLaTeX Jan 04 '17 at 20:47