Hi Jean and Tassilo, >>>>> jfbu writes: >> Now that you've mentioned it, I remember I wanted to do that change also >> in the past and Keita-san stopped me from doing so for exactly this >> reason. Yes, I did. ;-) > Would it make sense to apply these rules: > 1. a $ in comments can never start math mode > 2. but it can and will always stop math mode That is a clean idea and, fortunately, easy to implment. Could you test the attached patch? One remark: This patch does not follow rigorously your proposition. A $ in comments does not stop math mode if it is preceded by odd numbers of $'s like this: foo bar blah % \$ Regards, Ikumi Keita