[Tex/LaTex] Dollar sign in URL in Texmaker

symbolstexmakerurls

I am trying to format a URL using the url package. My URL has a dollar sign ($) in it.

This line

\url{\\000.000.000.00\ Redirected$ \DBLocker}

compiles correctly and the result is what I want.

However, the text editor in Texmaker highlights everything after the dollar sign (until the end of the document!) in green (eg. math mode format) which is obviously very annoying .

I can't just add another dollar somewhere to close math mode as it isn't actually open, so the .tex file wouldn't compile!

It's as if Texmaker doesn't appreciate that $ signs are not escaped in URLs.

Things I have tried:

  1. Escaping the dollar sign with a backslash. This doesn't work as the backslash shows in the URL.
  2. Using \textbackslash and similar. Also doesn't work, they appear as literal strings in the URL.

Any suggestions?

Best Answer

You could add an $ after a comment sign: %$