# Buggy code
def get_text(self, client, node, replaceEnt):
    # get style for current node
    sty = client.styles.styleForNode(node)
    node_fontsize = sty.fontSize
    node_color = "#" + sty.textColor.hexval()[2:]
    mf = math_flowable.Math(
        node.math_data, label=node.label, fontsize=node_fontsize, color=node_color
    )
    w, h = mf.wrap(0, 0)
    descent = mf.descent()
    img = mf.genImage()
    client.to_unlink.append(img)
    return '<img src="%s" width=%f height=%f valign=%f/>' % (img, w, h, -descent)


# Traceback (ValueError)
What steps will reproduce the problem?
1. echo "This is :math:\`\\pi\`" > test.rst
2. rst2pdf test.rst -o test.pdf

What is the expected output? I expect a pdf with the symbol pi

What do you see instead? a python "ValueError"  (see the stack below)


Please answer the following questions, they are *very* important:

* Version of rst2pdf?
0.93.dev

* Version of reportlab?
from python, reportlab.__version__ is ' $Id$ '
and the egg says reportlab-3.1.8-py2.7-macosx-10.6-intel.egg


* Are you using wordaxe, and if true, what version?
don't think so

* Are you using rst2pdf with Sphinx, and if true, what version?
No


Please provide any additional information below.
When using inline math role, I get a python error, thus no pdf output. Because
I don't understand it, I have no idea what test to do.
I paste the error stack below. I you have some idea of test to do, please tell
me.

stack:
rst2pdf test.rst -o test.pdf
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/rst2pdf", line 9, in <module>
load_entry_point('rst2pdf==0.93.dev', 'console_scripts', 'rst2pdf')()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/rst2pdf-0.93.dev-py2.7.egg/rst2pdf/createpdf.py", line 1495, in main
compressed=options.compressed)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/rst2pdf-0.93.dev-py2.7.egg/rst2pdf/createpdf.py", line 561, in createPdf
elements = self.gen_elements(self.doctree)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/rst2pdf-0.93.dev-py2.7.egg/rst2pdf/basenodehandler.py", line 250, in elemdispatch
elements = self.getelements(client, node, style)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/rst2pdf-0.93.dev-py2.7.egg/rst2pdf/basenodehandler.py", line 225, in getelements
elements = self.gather_elements(client, node, style)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/rst2pdf-0.93.dev-py2.7.egg/rst2pdf/basenodehandler.py", line 205, in gather_elements
return client.gather_elements(node, style=style)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/rst2pdf-0.93.dev-py2.7.egg/rst2pdf/createpdf.py", line 390, in gather_elements
r.extend(self.gen_elements(n, style=style))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/rst2pdf-0.93.dev-py2.7.egg/rst2pdf/basenodehandler.py", line 250, in elemdispatch
elements = self.getelements(client, node, style)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/rst2pdf-0.93.dev-py2.7.egg/rst2pdf/basenodehandler.py", line 225, in getelements
elements = self.gather_elements(client, node, style)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/rst2pdf-0.93.dev-py2.7.egg/rst2pdf/genelements.py", line 188, in gather_elements
return [Paragraph(client.gen_pdftext(node), style)]
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/reportlab-3.1.8-py2.7-macosx-10.6-intel.egg/reportlab/platypus/paragraph.py", line 987, in __init__
self._setup(text, style, bulletText or getattr(style,'bulletText',None), frags, cleanBlockQuotedText)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/reportlab-3.1.8-py2.7-macosx-10.6-intel.egg/reportlab/platypus/paragraph.py", line 1012, in _setup
% (_parser.errors[0],text[:min(30,len(text))]))
ValueError: xml parser error (valign: invalid value -1.000000/) in paragraph
beginning
'This is <img src="/var/folders'

# Fixed code
def get_text(self, client, node, replaceEnt):
    # get style for current node
    sty = client.styles.styleForNode(node)
    node_fontsize = sty.fontSize
    node_color = "#" + sty.textColor.hexval()[2:]
    mf = math_flowable.Math(
        node.math_data, label=node.label, fontsize=node_fontsize, color=node_color
    )
    w, h = mf.wrap(0, 0)
    descent = mf.descent()
    img = mf.genImage()
    client.to_unlink.append(img)
    return '<img src="%s" width="%f" height="%f" valign="%f"/>' % (img, w, h, -descent)