Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
haraldschilly opened this issue Feb 1, 2018 · 8 comments
Open

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

haraldschilly opened this issue Feb 1, 2018 · 8 comments

Comments

@haraldschilly
Copy link
Contributor

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
Copy link
Contributor

ping

@rbeezer
Copy link

rbeezer commented Mar 27, 2018

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
Copy link
Contributor Author

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
Copy link

rbeezer commented Apr 3, 2018

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.

  • There should not be a problem with dollar signs, so I'll see if I can get that sorted. Do you know if stock-Jupyter and CoCalc-Jupyter use different MathJax configurations? That could be the source (and perhaps trivial to fix with a switch on the PTX end). I have not yet investigated the potential for overriding/augmenting the MathJax configuration in these settings.
  • Any chance that CoCalc-Jupyter could "allow" or support bringing in our CSS? We've done a pretty good job of fencing off the necessary content-bits of PTX HTML and then making sure the PTX CSS does not bleed out onto the interface. That'd be a huge step forward, especially if the reader did not ever even see the loading of the CSS.
  • Likely the other big need (iirc) is cross-page links with fragment identifiers. I think that is still uneven.
  • We got knowls to function in a stock-Jupyter notebook, but they eventually decided against it. Just a security issue. Being able to do that in a CoCalc-Jupyter notebook would be a big advantage. You remember knowls, right? ;-)
    Whitelist <a knowl="..."> for including knowls jupyter/notebook#2947

@williamstein
Copy link
Contributor

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
Copy link

rbeezer commented Apr 3, 2018

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

@haraldschilly
Copy link
Contributor Author

haraldschilly commented Apr 3, 2018

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
Copy link

rbeezer commented Apr 4, 2018

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

  • Each page needs to run a cell at the top to load CSS. Its coming from elsewhere (ie, network), but could be bundled locally once it settles down. See first screenshot where "6.1 Cosets" is being styled, as is Example 6.1 (bold and spaced). There is a small delay to load and apply the CSS.
  • Rest of the page looks good (second screenshot), except some brownish bars I don't recall seeing anywhere. So mostly, behavior is as intended/expected.
  • I do not see any dollar-sign problems here. And I checked a couple of likely places. Can you tell me which files and/or send a screenshot?
  • Links to other files/noetbooks work great, but fragment identifiers (URLs with #) still seem to fail.

selection_001
selection_002

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants