Broken LaTeX

14 views
Skip to first unread message

Ingo Dahn

unread,
Apr 24, 2022, 5:09:31 AM4/24/22
to CoCalc
After updating our Docker-CoCalc I noted that some LaTeX, which used to work well,now displays strange and that the same problems occur in the main Cocalc distribution. See https://cocalc.com/share/public_paths/9ed0b3dc5d54079076818e95038cf487b2d2934d
Is there a way to modify the LaTeX code to get a correct display?

Ingo Dahn

unread,
Apr 24, 2022, 5:31:41 AM4/24/22
to CoCalc
I also noted (in the docker installation) that on export as Jupyter notebook \vec becomes \\vec which leads to broken display with other tools, like vscode.

Harald Schilly

unread,
Apr 24, 2022, 6:08:52 AM4/24/22
to Ingo Dahn, CoCalc
Hi, I'm not sure what's going on. Can you give us a step by step guide of what you did?
It's definitely possible to fix the latex code. I mean, I just removed an extra escape backslash and made a newline to separate a header from the formula. 
Here is how it looks for me now:



--
CoCalc: Collaborative Calculation in the Cloud -- https://cocalc.com
---
You received this message because you are subscribed to the Google Groups "CoCalc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cocalc+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cocalc/5a3195bb-ed32-4d79-95cb-de199efa9d41n%40googlegroups.com.

Harald Schilly

unread,
Apr 24, 2022, 6:09:53 AM4/24/22
to Ingo Dahn, CoCalc
on, and just a general note, I also switched to Sage 9.5. IIRC there were some small issues with latex output of sage in earlier versions. … but in your case there is no sage, it's just the markdown text that this is about.

-- harald

Ingo Dahn

unread,
Apr 24, 2022, 6:40:39 AM4/24/22
to Harald Schilly, CoCalc
The display broke after we updated to the latest docker Cocalc. The second cell was copied over from the updated Docker Cocalc and then the first cell content was copied from a standard Latex web page.

William Stein

unread,
Apr 24, 2022, 1:49:34 PM4/24/22
to Ingo Dahn, Harald Schilly, CoCalc
Provide a minimal reproducible example and explain exactly what is
wrong with it.
> To view this discussion on the web visit https://groups.google.com/d/msgid/cocalc/595246f8-4527-4124-b20e-997ae21b9066%40gmail.com.



--
William (http://wstein.org)

Ingo Dahn

unread,
Apr 24, 2022, 2:38:10 PM4/24/22
to CoCalc
https://cocalc.com/share/public_paths/9ed0b3dc5d54079076818e95038cf487b2d2934d contains small examples of 4 different LaTeX related errors on cocalc.com
The notebook - exported from CoCalc -  is available at https://1drv.ms/u/s!AtbWaVSlne64iucuTTHKZ7laKNG2JQ?e=yrog9Z - note the many superfluous backslashes-

William Stein

unread,
Apr 24, 2022, 2:58:26 PM4/24/22
to Ingo Dahn, CoCalc
Thank you for the clarification. I've created this issue:
https://github.com/sagemathinc/cocalc/issues/5879
> To view this discussion on the web visit https://groups.google.com/d/msgid/cocalc/b48103c1-8c1d-4b2e-b793-e9811154f1cfn%40googlegroups.com.



--

Best Regards,
William Stein

CEO, SageMath, Inc.
https://cocalc.com

William Stein

unread,
Apr 26, 2022, 12:31:29 PM4/26/22
to Ingo Dahn, CoCalc
Hi,

I fixed all of the issues, which were caused by subtle shortcomings in
the "dollars" delimiters of the
https://github.com/goessner/markdown-it-texmath plugin. E.g., the
issue with missing text was caused by how that plugin defined equation
labels, so I disabled that functionality. Also, their regexp didn't
work for multiline inline math formulas, e.g.,

$x
+y$

which seems pretty annoying, so I fixed the regexp.

I did not fix "$f(x) [space]".

I'm building an updated docker image and cocalc.com, which will be
live in about 2 hours assuming nothing goes wrong.

I want to STRONGLY thank you for this excellent and very helpful bug
report! It's painful moving to a proper markdown math parser from the
horrible hacks that we used before (copied from Jupyter classic /
MathJax v2), but it will be much better in the longrun.
Reply all
Reply to author
Forward
0 new messages