I am copying and pasting paragraphs into a LaTeX document from a report that contains frequent $ signs. I would like any unescaped $ to result in an error and perhaps a reminder to escape them. (Math mode could still be accessed through \( ... \), though the absence of math mode is acceptable.)

My motivation behind this is that I am frequently missing things like:

There were 150 accounts with a balance of between $1000 and $2000 in this year.

which results in a short, valid math mode section that is easy to overlook.

I know I can use the text editor with a regex to solve this problem, but if I am giving the task to a LaTeX novice (who doesn't know regex), I would prefer they are reminded than trying to teach them regular expressions.

  • 1
    you could make an error or you could use \catcode`\$=12 so the $ just work as normal punctuation. – David Carlisle Jun 6 '16 at 7:58

Adding somewhere after \begin{document}

 \catcode`$=15 % for example - PS

gives what is expected in your question.

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.