On Wednesday 21 May 2008 17:24:04 Rich Shepard wrote:
>    The 'Missing $ inserted' error message is generated when there is a math
> symbol (e.g., $) in the text string that causes LaTeX to enter math mode. I
> do not have any monetary amounts in the text. What other character might be
> seen by LaTeX as a command to enter math mode when that's not my intention?
> I don't see anything jumping out at me -- particularly in the string on
> line 1963 above -- that tells me what I need to fix.

The usual culprit in these cases is the underscore.

My suggestion is to replace the calls to str(left) and str(right) by a call to 
a new function that escapes all the usual suspects.

something like:

def latex_escape( item):
   usual_suspects = {'_' : '$_$', '$': '\$'}

   item = str(item)
   for chr in usual_suspects:
      item = item.replace(chr, usual_suspects[chr])
   return item


I am not sure if the latex code is right but you get the idea. :-)

> Rich

-- 
José Abílio

Reply via email to