Skip to content
Randall J. LeVeque edited this page Jul 5, 2020 · 14 revisions

Riemann_book wiki

A mini-wiki to add helpful links and comments for the Riemann book.

Backward compatibility?

Equation numbering:

  • http://stackoverflow.com/questions/18823779/ipython-notebook-and-mathjax-labeled-equations

  • Min: Enabling equation numbers is easy with one big caveat: MathJax numbers equations as they render, which means you get weird out-of-order numbers when you are editing equations in the live notebook, unless you reset the index and re-render all markdown every time you edit a single equation. Numbering works fine in a static export, such as on nbviewer. There’s even a PR currently under discussion that would enable it on nbviewer by default.

  • To enable, use this function in the notebook...

      from IPython.display import display, Javascript
    
      def enable_equation_numbers():
          display(Javascript("""
          MathJax.Hub.Config({
             TeX: {
                 equationNumbers: {
                     autoNumber: "AMS",
                     useLabelIds: true
                 }
             },
          })"""))
          
      enable_equation_numbers()
    

    Then in a markdown cell:

    \begin{equation}
    x = 5
    \end{equation}
    

Citations in Jupyter notebooks:

For what we are actually using, see https://github.com/clawpack/riemann_book/wiki/Citations

Older notes:

Turning into a book:

We are now using bookbook. See the make_pdf.py script and riemann.tplx.

Older notes:

  • Regarding CSS, Min's comment: The HTML and CSS of the notebook display is similarly not a stable or public API. Changing some fonts and colors is reasonably straightforward, but more subtle adjustments of layout or inner items is likely to break, especially as we are planning to completely rewrite how our layout is done with phosphor.

  • To export to pdf for printing as a book? Fernando's suggestions:

    1. Export to LaTeX with custom templates and do the heavy-duty customization in LaTeX.

    2. See Hans Petter's DocOnce: https://github.com/hplgit/doconce, http://hplgit.github.io/doconce/doc/web/index.html.

DocOnce cheat sheet

Turning into html files:

  • Check out the FA16 or master branch and run the script make_html.py after editing to indicate the desired set of notebooks. This creates build_html containing the html files.
  • To post on the webpage, check out the gh-pages branch, copy the files from build_html to html directory, commit, and push. They show up at http://www.clawpack.org/riemann_book/.

Interactive phase plane plots

Interactive javascript GUI's for exploring the phase place are shown on this page and in Acoustics.ipynb, for example.

The code that generates these can be found at http://nbviewer.ipython.org/github/maojrs/ipynotebooks/blob/master/PPlane_GUI.ipynb

Examples

CSS Styles
Clawpack notebooks

http://www.clawpack.org/gallery/notebooks.html

Hyperlinks between notebooks

http://www.davidketcheson.info/2014/05/28/hyperpython.html