sean-fitzpatrick / Math3410

Open textbook on linear algebra featuring python code.
0 stars 4 forks source link

Failed to generate the workable jupyter notebooks based on this project with xsltproc. #2

Closed hongyi-zhao closed 3 years ago

hongyi-zhao commented 3 years ago

Dear Dr. Sean Fitzpatrick,

I noticed your lecture notes for Math 3410 in PreTeXt on the Open Math Textbooks website here. On Ubuntu 20.04, I try to generate the corresponding Jupyter notebooks of the chapter (or section) which include python codes the latest git master version of mathbook and libxslt as shown below:

$ xsltproc --version
Using libxml 20910, libxslt 10134-GITv1.1.34-71-g5430f5d7 and libexslt 820
xsltproc was compiled against libxml 20910, libxslt 10134 and libexslt 820
libxslt 10134 was compiled against libxml 20910
libexslt 820 was compiled against libxml 20910

$ git clone https://github.com/sean-fitzpatrick/Math3410.git sean-fitzpatrick/Math3410.git
$ cd Math3410.git
$ mkdir jupyter
$ cd jupyter
$ pyenv shell datasci
$ xsltproc --stringparam publisher ../publication/publication.xml --stringparam jupyter.kernel python --xinclude ../../../rbeezer/mathbook.git/xsl/pretext-jupyter.xsl ../ptx/3410notes.ptx
********************************************************************************
Jupyter notebook conversion is experimental and incomplete
Requests to fix/implement specific constructions welcome
********************************************************************************
$ ls
backmatter-1.ipynb           preface-1.ipynb                     sec-orthogonal-sets.ipynb    video-1.html
ch-change-basis.ipynb        sec-complex.ipynb                   sec-ortho-projection.ipynb   worksheet-dual-basis.ipynb
ch-computation.ipynb         sec-dimension.ipynb                 sec-python-basics.ipynb      worksheet-dual-basis-standalone.ipynb
ch-diagonalization.ipynb     sec-direct-sum.ipynb                sec-quadratic.ipynb          worksheet-recurrence.ipynb
ch-linear-trans.ipynb        sec-gen-eigen.ipynb                 sec-span.ipynb               worksheet-recurrence-standalone.ipynb
ch-orthogonality.ipynb       sec-independence.ipynb              sec-subspace.ipynb           worksheet-span.ipynb
ch-vector-space.ipynb        sec-isomorphism.ipynb               sec-sympy.ipynb              worksheet-span-standalone.ipynb
colophon-1.ipynb             sec-jordan-form.ipynb               section-jupyter.ipynb        worksheet-svd.ipynb
frontmatter-1.ipynb          sec-kernel-image.ipynb              section-matrix-factor.ipynb  worksheet-svd-standalone.ipynb
geogebra-basis-cube.html     sec-lin-tran-intro.ipynb            sec-vec-sp.ipynb             worksheet-transformations.ipynb
geogebra-basis-cube-if.html  sec-matrix-of-transformation.ipynb  subsec-eigen-basics.ipynb    worksheet-transformations-standalone.ipynb
linear-algebra.ipynb         sec-matrix-operator.ipynb           subsec-ortho-diag.ipynb

As you can see, it will generate so many ipynb files. But I just want to obtain the specific ipynb files which indeed including some python commands. Any hints will be highly appreciated.

OTOH, though I've generated ipynb files listed above, when opened with jupyter notebook, they are all invalid, the error is as follows:

Unreadable Notebook: /home/werner/Public/repo/github.com/sean-fitzpatrick/Math3410.git/jupyter/sec-matrix-operator.ipynb NotJSONError('Notebook does not appear to be JSON: \'{\\n"cells": [\\n{"cell_type": "code",...')

Any hints for fixing these problems are highly appreciated.

Regards, HY

NB. I also reported this issue on the pretext-support google group as a follow-up.

sean-fitzpatrick commented 3 years ago

Most sections are not meant to produce functional notebooks. You can look here if you want pre-built notebooks.

hongyi-zhao commented 3 years ago

Got it. Thank you very much.