Ask Your Question
2

Sagemath 9.0 Markdown inconsistency Cocalc vs. Local

asked 2020-02-05 18:34:42 +0100

holistone gravatar image

updated 2020-02-06 03:56:01 +0100

I have recently installed the latest Sagemath 9.0 on a Windows 10 machine and noticed a Markdown bold formatting problem that is not present on the Cocalc.com Sagemath 9.0 version. Here is the Markdown:

For each of the 10 questions a student can choose 1 of **3** possibilities: (1) answer T, (2) answer F, or (3) omit. By the **Extended Rule of Products**, there are $3^{10}$ ways of accomplishing this, this is far more than $2^{10}$.

On the local 9.0 install it renders as:

image description

Notice that the bold is not terminated by the ** after the '3'. On the other hand, the same code on Cocalc.com renders correctly with Sagemath 9.0:

image description

Both of these use the latest Chrome browser. Is there any way to correct the Markdown rendering on the local install?

If Sagemath provides the Jupyter notebook for CoCalc is it possible for them to provide the SAME Jupyter notebook with their binary downloads for windows and other platforms? Or just update the Jupyter notebook part of the Sagemath 9.0 Windows executable?

edit retag flag offensive close merge delete

Comments

1

As a workaround, use an HTML tag, i.e., write <strong>3</strong> instead of **3**.

Juanjo gravatar imageJuanjo ( 2020-02-05 23:02:44 +0100 )edit

3 Answers

Sort by » oldest newest most voted
1

answered 2020-02-05 20:10:27 +0100

rburing gravatar image

updated 2020-02-05 20:15:54 +0100

This is a bug in Jupyter: #4259 Markdown broken for single-character bold and italics. Hopefully it will be fixed there (although it doesn't seem to be a priority), so eventually the fix will be in SageMath as well.

For now, a workaround is to write 'three' instead of '3' :)

Another idea is to try JupyterLab, where the respective issue is fixed.

edit flag offensive delete link more

Comments

If that's the case, how does it work in the Cocalc.com Sagemath 9.0 version?

Also, if a "single-character bug" I would have expected the bold to terminated by the *'s at the start of "Extended" rather that at the *'s at the end.

holistone gravatar imageholistone ( 2020-02-05 20:14:34 +0100 )edit

@rburing: I posted my answer without seeing yours...

eric_g gravatar imageeric_g ( 2020-02-05 20:20:13 +0100 )edit

@holistone: CoCalc uses a customized version of Jupyter, which may explain why the bug does not show up there.

eric_g gravatar imageeric_g ( 2020-02-05 20:21:23 +0100 )edit

On cocalc.com if you go to Help → About, it reads:

CoCalc Jupyter notebook is a complete open source rewrite by SageMath, Inc. of the classical Jupyter notebook client from the Jupyter project.

So they are not the same.

rburing gravatar imagerburing ( 2020-02-05 20:24:50 +0100 )edit

@eric_g conversely, I posted my comment without seeing yours :)

rburing gravatar imagerburing ( 2020-02-05 20:25:48 +0100 )edit
0

answered 2020-02-05 20:25:10 +0100

nbruin gravatar image

It looks like this is a problem in the markdown processor for the standard Jupyter notebook server (so for sage, it's an upstream bug). The jupyter notebook server in cocalc is a custom one. The problem seems to be that the markdown for a single bold character doesn't get processed right if there are further bold markers: in **a** and **b** the "middle" if there's another such string. The same thing seems to happen with italics, so *a* and *b* and *c* and *d* and *e* gets misrendered as (italics) a* and *b (roman) and (italics) c* and *d (roman) and (italics) e. This should definitely be reported (to jupyter). In the mean time, the workaround would be to avoid bolding single characters ... In this case, you can just spell it out as **three**, which is recommended english style anyway.

edit flag offensive delete link more
0

answered 2020-02-05 20:15:30 +0100

eric_g gravatar image

I confirm the bug with SageMath 9.0 and 9.1.beta1, running on Ubuntu 18.04 with Firefox browser.

As a workaround, you can use the alternative Markdown notation for bold characters, namely double underscores: replacing **3** by __3__ works.

edit flag offensive delete link more

Comments

That only works if you have only one single character that needs to be bolded/italicized, because then you can use a unique pair of delimiters. in __a__ and **b** and __c__ and **d** you run into the same problem again.

nbruin gravatar imagenbruin ( 2020-02-05 20:29:29 +0100 )edit

@nbruin Ah yes...

eric_g gravatar imageeric_g ( 2020-02-05 20:54:37 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-02-05 18:34:42 +0100

Seen: 485 times

Last updated: Feb 06 '20