#10624: Slashes disappear in docstrings
-----------------------------+----------------------------------------------
Reporter: novoselt | Owner: mvngu
Type: defect | Status: new
Priority: major | Milestone: sage-4.6.2
Component: documentation | Keywords: notebook help docstring
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
Consider functions
{{{
def g1():
r"""
S \ E
S \\ E
S \\\ E
S \\\\ E
S \\\\\ E
S \\\\\\ E
S \\\\\\\ E
"""
pass
def g2():
r"""
S \ E
S \\ E
S \\\ E
S \\\\ E
S \\\\\ E
S \\\\\\ E
S \\\\\\\ E
``x``
"""
pass
}}}
i.e. they have the same docstrings but the second one has a code block
(the same happens with math blocks).
When I type g1? in the notebook, I get pretty much the docstring as it is
written, except for a couple of extra blank lines on top. When I type g2?,
I get
{{{
S E S E S \ E S \ E S \E S \E S \\ E x
}}}
on a single line. I don't think that the treatment of slashes should
depend on the presence of extra blocks in the docstring.
While removing slashes may be done for "deLaTeXifying" purposes, it is
actually done (at least partially) ''before'' LaTeX processing. The
docstring of
{{{
def g3():
r"""
.. MATH::
a \\ b
.. MATH::
c \\\ d
"""
pass
}}}
in the notebook shows a and b on the same line while c and d on different.
For HTML documentation the first block works as it should - a and b are on
different lines.
This problem came up on #10479 in the math block of `NefPartition?`.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10624>
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.