Dollar signs in live documentation

5 views
Skip to first unread message

Håkan Granath

unread,
Oct 3, 2009, 4:49:35 AM10/3/09
to sage-devel
I am trying to update the doc string of sage/server/notebook/config.py
to make the dollar signs show up correctly (due to the changes in
#6892), but if I try e.g.

r"""
Notebook Keybindings

<snip>

- *Insert New HTML Cell:* Shift click between cells to create a new
HTML cell. Double click on existing HTML to edit it. Use \$...\$ and \$
\$...\$\$ to include typeset math in the HTML block.
"""

they will show up correctly in the static html and pdf files, but not
in the live html page. I also tried other variations, but could not
make it work on all three places. Am I missing something?

/Håkan

Mike Hansen

unread,
Oct 3, 2009, 5:21:12 AM10/3/09
to sage-...@googlegroups.com
On Sat, Oct 3, 2009 at 3:49 PM, Håkan Granath
<hakan....@googlemail.com> wrote:
> they will show up correctly in the static html and pdf files, but not
> in the live html page. I also tried other variations, but could not
> make it work on all three places. Am I missing something?

All of the docstrings need to be processed by the proccess_docstring*
functions in sage/doc/common/conf.py file. These are what's used to
convert the dollar signs in to the appropriate restructured text
format.

--Mike

Håkan Granath

unread,
Oct 3, 2009, 6:02:25 AM10/3/09
to sage-devel
Thank you for the reply! I see now that I mistakenly assumed that
#6892 was merged into sage-4.1.2.rc0. But then something else must
have changed. In sage-4.1.1 I could write simply

"""
Notebook Keybindings

<snip>

- *Insert New HTML Cell:* Shift click between cells to create a new
HTML cell. Double click on existing HTML to edit it. Use $...$ and $
$...$$ to include typeset math in the HTML block.
"""

and it worked both in the live and static html documentation. In
sage-4.1.2.rc0 this typesets the ... as math in the live doc. (Well,
mayby not always, sometimes it shows correctly until I press the
refresh button in the browser). This is with

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) Gecko/20090824
Firefox/3.5.3

Any advice what is the correct way to write to get this right for
sage-4.1.2 ?

/Håkan

John H Palmieri

unread,
Oct 3, 2009, 11:21:57 AM10/3/09
to sage-devel
On Oct 3, 3:02 am, Håkan Granath <hakan.gran...@googlemail.com> wrote:
> Thank you for the reply! I see now that I mistakenly assumed that
> #6892 was merged into sage-4.1.2.rc0. But then something else must
> have changed. In sage-4.1.1 I could write simply
>
> """
> Notebook Keybindings
>
> <snip>
>
> - *Insert New HTML Cell:* Shift click between cells to create a new
> HTML cell. Double click on existing HTML to edit it. Use $...$ and $
> $...$$ to include typeset math in the HTML block.
> """
>
> and it worked both in the live and static html documentation. In
> sage-4.1.2.rc0 this typesets the ... as math in the live doc. (Well,
> mayby not always, sometimes it shows correctly until I press the
> refresh button in the browser). This is with
>
>   Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) Gecko/20090824
>   Firefox/3.5.3

I'm seeing the same thing, more or less, with Safari on a Mac: in the
live documentation, both sets of ... are in math mode, and in the
static, only the $$...$$ ends up in math mode. It's strange; I wonder
if it has to do with jsMath somehow. I was trying ``$`` ... ``$``
(with spaces around ... so it gets parsed correctly), but even this
doesn't seem to work.

John

Pat LeSmithe

unread,
Oct 4, 2009, 9:12:22 PM10/4/09
to sage-...@googlegroups.com
John H Palmieri wrote:
> I'm seeing the same thing, more or less, with Safari on a Mac: in the
> live documentation, both sets of ... are in math mode, and in the
> static, only the $$...$$ ends up in math mode. It's strange; I wonder
> if it has to do with jsMath somehow. I was trying ``$`` ... ``$``
> (with spaces around ... so it gets parsed correctly), but even this
> doesn't seem to work.

The following

`\$...\$` and `\$\$...\$\$`

almost works for me in both live and static docs with Sphinx 0.6.3:

http://trac.sagemath.org/sage_trac/ticket/6586

But the dollar signs appear to be slightly different.

I think the discrepancy stems from our current use of jsMath's

* easy/load.js for the static docs
* jsMath.js for the live docs

and whether/how the tex2math plug-in runs:

http://www.math.union.edu/~dpvc/jsMath/authors/easy-config.html
http://www.math.union.edu/~dpvc/jsMath/authors/autoload.html
http://www.math.union.edu/~dpvc/jsMath/authors/tex2math.html

Relevant tickets for equalizing the behavior:

http://trac.sagemath.org/sage_trac/ticket/4714
http://trac.sagemath.org/sage_trac/ticket/6673

I don't know which settings are best for us.

Reply all
Reply to author
Forward
0 new messages