sagemathinc / cocalc-examples

collection of example documents for use within cocalc's library
https://cocalc.com
14 stars 13 forks source link

add Thomas Judson's AATA and upcoming ODE books #1

Open haraldschilly opened 6 years ago

haraldschilly commented 6 years ago

They are only available in source files, with maybe hardcoded paths (or no setup at all).

The goal here is to write a small script to render sagews and ipynb files and add them here to this repository. Maybe I'll need @rbeezer's help :-)

williamstein commented 6 years ago

ping

rbeezer commented 6 years ago

See how far you can get with a command-line like the following (suitably adjusted)

xsltproc --stringparam chunk.level 2 mathbook/xsl/mathbook-jupyter.xsl aata.xml

Varying the "chunking level" will make bigger or smaller files, so less or more likely to be valid JSON. I've not touched this converter for a while, and it is very brittle, so post with success or failure, and questions. Locate image files in an "images" subdirectory.

There is a sagews converter but I have no idea at all if it will work right now, I've mostly been concentrating on Jupyter output.

haraldschilly commented 6 years ago

Ok, I spent a while trying to figure out what's going on with the AATA book. I was able to compile it to jupyter notebooks "manually" and copied over the files into our repository for the cocalc library. Attached is a screenshot.

Besides that, it's not "pretty". The included css formatting doesn't work on cocalc (it has its own jupyter notebook format), the html tags do not specify spacings and hence text runs together, and there are parsing errors with dollar signs (which are erroneously interpreted as being formulas. Hence I see this as a proof of concept and at some point we might want to improve this in all these aspects.

screenshot from 2018-04-02 16-34-35

rbeezer commented 6 years ago

Thanks, Harald. The makefile isn't really a traditional makefile, and there is a small file there that can be used to override the default hard-coded paths. I'm glad you made some progress manually anyway. Sorry the Jupyter conversion is not more mature yet.

williamstein commented 6 years ago

Do you know if stock-Jupyter and CoCalc-Jupyter use different MathJax configurations?

If so it is a bug. We revamped math rendering recently, and probably did introduce a bug. What is a minimal example?

rbeezer commented 6 years ago

I'll look closer tomorrow. Super-productive coding today, but now knackered. ;-)

haraldschilly commented 6 years ago

there is a small file there that can be used to override

Yes exactly, I figured out to create my own Makefile.paths file. Once I got that, everything fell into place for AATA.

... use different MathJax configurations?

I'll create issues for CoCalc. The main problem seems to be that CoCalc's parser for the markdown/html code doesn't understand any html. It treats all strings equally. So, that aspect is fine from the perspective of the AATA book.


However, what's a bit more problematic are these html tags without spacing. e.g. in the end there is <span>Section 1.2.3</span><span>Title</span> which ends up to look like Section 1.2.3Title.

I understand that the output is a one line string with XML encoding, but it should be possible to discard trimming in order to end up with <span>Section 1.2.3 </span><span>Title</span>Section 1.2.3 Title.

Screenshot:

screenshot-cocalc com-2018 04 03-15-31-54

rbeezer commented 6 years ago

I added AATA from the Library to one of my (internet-enabled) projects.

selection_001 selection_002