3

When escaping the dollar sign inside a \url{} command, as shown in my MWE, the following is displayed. (Below is what I am expecting).

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\begin{document}
\url{test \$ test}
test \$ test
\end{document}

Showing the output of my problem.

I do not have an idea what is causing this. I am using writeLaTeX to compile this - could that be the culprit?

Could this answer be the answer? How would I go about implementing that solution for a dollar sign?

  • 3
    Why not just use \url{test $ test}? – Werner Nov 10 '14 at 20:37
  • @Werner, yes, of course. That works. Sorry for wasting your time! – Doggie52 Nov 10 '14 at 20:41
6

There is no need to escape a dollar symbol in a url.

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\begin{document}
\url{test$test} 
\end{document}   
| improve this answer | |
  • 1
    True. Just noticed. Excuse the mistake! I was so used to escaping everything else inside URL's that I just assumed I needed to escape $ too! – Doggie52 Nov 10 '14 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.