TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am getting bitten by the same problem from one of my previous questions: tildes are not handled properly. But now it's the PSTricks QR code package that's not working, and none of the suggestions from the other question are working. Here's an example:


When I put the result into a QR decoder, I get

http://example.com/protect unhbox voidb@x penalty @M  {}user

...which is exactly the problem I had before. But neither \textasciitilde nor \~ works; both insert weird extra bits into the file.

I can work around this instance by using a URL shortener, but really I'd like to know how to teach PSTricks the same tilde-handling magic that hyperref knows.

share|improve this question
up vote 12 down vote accepted


\string makes the active character ~ to an inactive one.

share|improve this answer
Excellent! Thanks for the quick response. – Dan Drake Sep 20 '11 at 0:18
Perfect. It also works with #. – Sigur Jul 20 '15 at 12:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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