]> gitweb.michael.orlitzky.com - sage.d.git/blob - mjo/misc.py
Add the misc module with the legend_latex() function.
[sage.d.git] / mjo / misc.py
1 """
2 Stuff that doesn't fit anywhere else.
3 """
4
5 from sage.all import *
6
7 def legend_latex(obj):
8 """
9 Return the LaTeX representation of `obj`, but wrap it in dollar
10 ($) signs so that we can pass it directly to plot() et al. as a
11 legend label.
12 """
13 return '$%s$' % latex(obj)