I want to display the literal underscore character
_ in math mode because it is used in defining a variable name. I'm using the LaTeX parser that the Python Sphinx documentation generator uses, and in trying to parse a
\_ in math mode it gives this error:
System Message: ERROR/3 (/home/svc_citest/.hudson/jobs/build_doc/workspace/Research/Projects/doc/factors/crspAccruals/AccrualsImplementor.rst, line 83) Syntax error: "\_" Accruals = PreAccruals/AVG\_ASSETS
I would have thought that
\_ would work in math mode as it does in text mode, but I'm getting the error...
Here is the relevant doc page for Sphinx math mode: http://sphinx.pocoo.org/ext/math.html. It is mirroring AMS LaTeX, so if you need minimal working examples in which to insert the underscores, try there.