2

I'm having some problems using the path command from the url package with my beamer slides. Providing the MWE below to pdflatex on 64-bit Ubuntu 18.10 produces the error: ! LaTeX Error: Option clash for package url. Is there a recommended workaround?

\documentclass{beamer}

\usepackage[obeyspaces]{url} % Preserve spaces in \path command

\begin{document}

\begin{frame}{Test}
Navigate to \path{C:\Program Files\}
\end{frame}

\end{document}

1 Answer 1

3

Instead of loading the url package yourself, you can just pass the obeyspaces to the package and let beamer load it for you.

In addition you need to use the fragile frame option.

\PassOptionsToPackage{obeyspaces}{url}

\documentclass{beamer}

\begin{document}

\begin{frame}[fragile]{Test}
Navigate to \path{C:\Program Files\}
\end{frame}

\end{document}

enter image description here

5
  • The space in the path isn't there in your output.
    – user4417
    Commented Jan 18, 2019 at 19:43
  • 1
    @user4417 Upps, I'll investigate! Commented Jan 18, 2019 at 19:44
  • @user4417 I made a stupid typo, please check again Commented Jan 18, 2019 at 19:45
  • Thanks. I didn't realise that Beamer loads the url package.
    – user4417
    Commented Jan 18, 2019 at 19:51
  • 1
    @user4417 Rule of thumb: beamer loads basically every package that can't run away fast enough :) Commented Jan 18, 2019 at 19:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .