#11498: Improve LaTeXing of strings
---------------------------+------------------------------------------------
Reporter: novoselt | Owner: jason, mpatel, was
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.7.1
Component: notebook | Keywords: sd31
Work_issues: | Upstream: N/A
Reviewer: | Author: Andrey Novoseltsev
Merged: | Dependencies:
---------------------------+------------------------------------------------
Comment(by novoselt):
Thanks for the comments!
I don't know why there are differences for different modes, this is the
first time I am working with these modules. I agree that the fewer are
differences the better and will also remove the extra space.
Here is the reason for extra string conversion:
{{{
sage: s = "asdf fs"
sage: l = latex(s)
sage: print l
sage: print latex(l)
sage: print latex(str(l))
\verb|asdf|\phantom{x}\verb|fs|
\verb|asdf|\phantom{x}\verb|fs|
\verb"\verb|asdf|\phantom{x}\verb|fs|"
}}}
As I understand, the idea is that when user types `latex(x)` in the
notebook, then (s)he wants to see the actual LaTeX code. So it will be
wrapped the second time and displayed.
Regarding `<` - it is not produced in normal LaTeX but can happen only
in jsMath. For some reason it parses `<` even inside verb and the old
solution was to insert extra spaces (which somehow prevents it from this
mistake), but this alters the output and looks especially bad on
typesetting things like `>=`. Replacing it with HTML code seems to work, I
don't know why and I don't really care - once it is fixed upstream, we
will see a doctest break and can remove this workaround. (Hopefully we can
also get rid of phantoms eventually, but in !MathJax the problem was still
present two weeks ago. I don't think it is possible to write a doctest
that will detect fixing the spacing issue upstream.)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11498#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.