Home Instant Answers Jupyter Notebook Cheat Sheet Next Steps. This is the home page for your Instant Answer and can be.
Cheat Sheet - Jupyter Notebook Keyboard Shortcuts. Command Mode (Blue) Shortcut. Shows a pop-up window listing out all keyboard shortcuts cmd + shift. May 22, 2020 - A handy Jupyter Notebook Cheat Sheet that will help you get acquianted with Jupyter Notebook used to develop and share Python Programs and Documents. Jupyter Notebook Keyboard Shortcuts Command Mode (press Esc to enable) Enter enter edit mode Shift- Enter run cell, select below Ctrl-Enter run cell Alt-Enter run cell, insert below Y to code M to markdown R to raw 1 to heading 1 2,3,4,5,6 to heading 2,3,4,5,6 Up/K select cell above Down/J select cell below A/B insert cell above/ below X cut.
Jupyter Notebook is a great tool for data analysis. And one of its greatest features is that you can easily combine runnable code with rich-text annotations. Markdown cells that contain such annotations support both HTML and Markdown syntax.
Personally I prefer # Header (markdown syntax) to <h1>Header</h1> (HTML syntax) in my notebook’s cells as the former looks more human. So I use markdown syntax more often and a concise cheat sheet for Jupyter Notebook markdown is what I was missing for a long time. Yes, I’m aware of such comprehensive cheat sheets like this and this, they are great but too verbal and it’s hard to print them on one page to have it easily accessible.
Eventually, I decided to gather all crucial points of the markdown syntax that are actual for Jupyter notebook and combine them in a concise cheat sheet that I present to you. It doesn’t explain much but should be useful if you simply forgot something. Click the picture to download the PDF version.
I didn’t get into the details of LaTeX syntax (see the penultimate cell in the cheat sheet with the square root of k) since it’s well described here (get ready, it’s a very long document) and you can even download a pretty good cheat sheet here.
Jupyter Book uses MathJax for typesetting math in your HTML book build.This allows you to have LaTeX-style mathematics in your online content.This page shows you a few ways to control this.
See also
For more information about equation numbering,see the MathJax equation numbering documentation.
Tip
By default MathJax version 2 is currently used.If you are using a lot of math, you may want to try using version 3, which claims to improve load speeds by 60 - 80%:
See the Sphinx documentation for details.
In-line math¶
To insert in-line math use the $
symbol within a Markdown cell.For example, the text $this_{is}^{inline}$
will produce: (this_{is}^{inline}).
Math blocks¶
You can also include math blocks for separate equations. This allows you to focus attentionon more complex or longer equations, as well as link to them in your pages. To use a blockequation, wrap the equation in either $$
or begin
statements.
For example,
results in:
Cheat Sheet Jupyter Notebook Markdown
Latex-style math¶
You can enable parsing LaTeX-style math blocks with the amsmath
MyST extension. Enable it by adding the following to _config.yml
Once enabled, you can define math blocks like so:
which results in:
See also
The MyST guides to dollar math syntax, LaTeX math syntax, and how MyST-Parser works with MathJax.
For advanced use, also see how to define MathJax TeX Macros.
Numbering equations¶
If you’d like to number equations so that you can refer to them later, use the math directive.It looks like this:
For example, the following code:
will generate
Alternatively you can use the dollar math syntax with a prefixed label:
which generates
Note
Labels cannot start with an integer, or they won’t be able to be referenced andwill throw a warning message if referenced. For example, :label:1
and :label:1eq
cannotbe referenced.
Linking to equations¶
If you have created an equation with a label, you can link to it from within your text(and across pages!).
You can refer to the equation using the label that you’ve provided by usingthe {eq}
role. For example:
Cheat Sheet Jupiter Notebooks
results in
A link to an equation directive: (3)
A link to a dollar math block: (4)
Jupyter Notebook Tutorial Pdf
Note
Jupyter Notebook Tutorial
labels
inside LaTeX environment are not currently identified, and so cannot be referenced.We hope to implement this in a future update (see executablebooks/MyST-Parser#202)!