title: Sphinx LaTeX markup limitations
body: <p>I'm trying to do three really basic things inside of a multi-line math mode in Sphinx (version 1.1.2-1).</p>
  
  <ol>
  <li>Write underscores as part of my variable names even in math mode;</li>
  <li>Use the <code>\big</code>, <code>\biggl</code>, etc., delimiters to make large brackets and parentheses;</li>
  <li>and include regular text as part of equations.</li>
  </ol>
  
  <p>Note the following two things. (1) I am using a raw string in my Python code for the Sphinx-markup documentation, so extra backslashes are not needed for escape characters, and (2) I am not doing inline math mode, which is delimited like this in Sphinx:</p>
  
  <pre><code>:math:`Some math stuff goes here` regular text could go here...
  </code></pre>
  
  <p>Instead, I am doing multi-line stuff, often like <code>eqnarray</code> in LaTeX:</p>
  
  <pre><code>.. math::
      DividendYield &amp;=&amp; \frac{DVT(t)}{CurrentMarketCap} \\
      Avg_Assets &amp;=&amp; \biggl( A/B \biggr) \textrm { when B is not zero...}
  </code></pre>
  
  <p>Currently, I get Sphinx errors (and the generated doc pages look like gibberish), that say things like: </p>
  
  <pre><code>Unknown LaTeX command: textrm
  </code></pre>
  
  <p>The same happens for <code>\biggl</code>. For the underscore, it just always interprets it as if I am denoting a subscript, but if I use <code>\textunderscore</code> or other tricks then it throws the same sorts of errors as above.</p>
  
  <p>Underscores within math mode, the <code>textrm</code> command, and big delimiters are extremely basic parts of every native TeX package I've ever used. So why are they inaccessible through Sphinx?</p>
  
  <p><strong>Update</strong></p>
  
  <p>One particular Python file that I am working on calculates Book Equity data for me. So below, when you see the stuff about BookEquity, that's the reference. I can't run our build-docs process except through a version control system, so making a reproducible error was easiest if I just modified an existing file.</p>
  
  <p>However, all I did was to add the following class function in my code, with a simple docstring.</p>
  
  <pre><code>def foo(self):
      r"""
      Sample docstring
  
      .. math::
          Ax &amp;=&amp; b \\
          Cx &amp;=&amp; \biggl(\frac{x/y}\biggr) \textrm{ if y is not zero.}
      """
      pass
  </code></pre>
  
  <p>And then the image below is the output coming from building the docs with Sphinx 1.1.2-1.</p>
  
  <p><img src="https://i.stack.imgur.com/yN9L9.png" alt="Snippet of the generated doc page showing the error exactly as it appears from Sphinx."></p>
  
  <p>If you right-click and select 'view image' you can see a better version.</p>