On 2009-09-11, Florian Lindner wrote:

> Hello,

> I try to use math in my docstrings:

>      def fp_out(self):
>          """
>          .. math::
>              M_2 = \frac{M^2 \cdot (\kappa-1)+2}{\kappa (2 M^2-1)+1}}

>          """
>          k = self.f_prop.kappa

> I've activated the pngmath extension and it works for easier examples  
> from the sphinx doc. But the code above gives using make html:

> WARNING: inline latex u'M_2 = \x0crac{M^2 \\cdot (\\kappa-1)+2}{\ 
> \kappa (2 M^2-1)+1}}\n\n': latex exited with error:

> I got no idea where \x0 comes from, I've deleted the line and typed it  
> again from scratch but nothing changed. None of the editors I tried  
> displays it like that.

Did you realize that it is ``\x0c``, the code for the character with
hex-number 0c, (sometimes written as ^L or line-feed)?

Comparing input to output you see:
  \f    \x0c
  \c    \\c
  ...

It looks like at some stage the backslash escaping is invoked.
You could try with a raw string or double backslashs.

         r"""
         .. math::
             M_2 = \frac{M^2 \cdot (\kappa-1)+2}{\kappa (2 M^2-1)+1}}

         """


Günter


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to