5

One major limitation of the url package is that "the argument must not contain unbalanced braces.".

However I have the problem that sometimes URLs I have to include in my document do not satisfy this rule like the following example:

http://example.org/abc?param=}

Because of the balanced braces rule you can not use:

\url{http://example.org/abc?param=}}

Neither can you escape the curly brace \url{http://example.org/abc?param=\}}.

How can this URL be used in an LaTeX document?

I need to have it clickable and I need the line-breaking behavior for long URLs.

  • 1
    Is that even a legal url? – daleif Mar 18 '14 at 15:30
  • 1
    \url{http://example.org/abc?param=%7D} – egreg Mar 18 '14 at 15:51
8
\documentclass{article}
\usepackage{url}
\begin{document}

\edef\URL{http://example.org/abc?param=\string}}
\expandafter\url\expandafter{\URL}

\end{document}

enter image description here

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.