General ⇒ URL with % included, doesn't compile with Overleaf
URL with % included, doesn't compile with Overleaf
I am using the URL package, and here is what I am having trouble with:
--figure here--
\caption{stuff \protect \footnotemark}
--figure end here--
\footnotetext{ITER Organization \url{https://www.iter.org/album/Media/7%20-%20Technical} (2018/5/29)}
Since I am using the URL package, if I try to escape the % as in \%, the resulting PDF will show the \ as well which is not ideal. When I have it in the form I posted above, the % is considered a start of a comment line even though it's inside a \url{}.
I haven't had this issue on my local TeX Live install, so I'm confused. What is going on, and how can I fix it?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
URL with % included, doesn't compile with Overleaf
in general it would be good if you would post a small piece of (compilable) code that shows the issue. So we can test it and fix it. Otherwise every reader has to build a test example on his own and possibly simply skips the topic if there's not much time.
Here is a solution: using
\urldef
to define the URL in advance:Code: Select all
\documentclass{article}
\usepackage{url}
\urldef{\technical}\url{https://www.iter.org/album/Media/7%20-%20Technical}
\begin{document}
\begin{figure}[!htbp]
--figure here--
\caption{stuff \protect \footnotemark}
\end{figure}
\footnotetext{ITER Organization \technical (2018/5/29)}
\end{document}

Stefan
URL with % included, doesn't compile with Overleaf
I'll try to post a full working piece of code next time. Thanks for the advice as well
