Skip to content
David Ketcheson edited this page Mar 20, 2017 · 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:

  • 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

Examples

CSS Styles
Clawpack notebooks

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

Interactive phase plane demonstration

http://nbviewer.ipython.org/github/maojrs/ipynotebooks/blob/master/PPlane_GUI.ipynb

Hyperlinks between notebooks

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

Clone this wiki locally