jlt199 jlt199 -4 years ago 419
LaTeX Question

Python - Printing a latex string to the console

Morning,

I would like to print a latex string, or at least a latex symbol to my console window in Python something like:

print('Percentage of points within $\pm$ 8% = {:.2f}%'.format(percent_in_region))


At the minute I just want the plus-minus symbol, but I can see that knowing how to do this would be useful in the longer term too.

Is someone able to help me please?

Answer Source

To print a plus-minus symbol you can do:

print(chr(177))

which will print the unicode character 177 which is the plus-minus symbol.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download