sympy-live icon indicating copy to clipboard operation
sympy-live copied to clipboard

dir returns unrendered TeX

Open Krenair opened this issue 11 years ago • 3 comments

Sorry if this is the wrong place to report this issue (Might be MathJax?), but running dir() on something (e.g. '') makes it show plain, unrendered, TeX.

dir('') \begin{equation_}\begin{bmatrix}add, & class, & contains, & delattr, & doc, & eq, & format, & ge, & getattribute, & getitem, & getnewargs, & getslice, & gt, & hash, & init, & le, & len, & lt, & mod, & mul, & ne, & new, & reduce, & reduce_ex, & repr, & rmod, & rmul, & setattr, & sizeof, & str, & subclasshook, & _formatter_field_name_split, & formatter_parser, & capitalize, & center, & count, & decode, & encode, & endswith, & expandtabs, & find, & format, & index, & isalnum, & isalpha, & isdigit, & islower, & isspace, & istitle, & isupper, & join, & ljust, & lower, & lstrip, & partition, & replace, & rfind, & rindex, & rjust, & rpartition, & rsplit, & rstrip, & split, & splitlines, & startswith, & strip, & swapcase, & title, & translate, & upper, & zfill\end{bmatrix}\end{equation}

Krenair avatar Feb 04 '14 21:02 Krenair

Thanks for reporting it. Looks like a bug.

certik avatar Feb 04 '14 21:02 certik

MathJax doesn't like the unescaped underscores in SymPy Live's LaTeX, so it shows the raw TeX instead. I'm not sure if this is due to how Live is using SymPy's LaTeX printer or if the printer should escape underscores.

lidavidm avatar Feb 04 '14 23:02 lidavidm

Really, we shouldn't use LaTeX to render things that aren't math. There is already logic for this in the ipython printing code.

asmeurer avatar Feb 05 '14 02:02 asmeurer