Jupyter Latex Cheat Sheet
- Latex In Jupyter Notebook
- Jupyter Latex Package
- Jupyter Latex Cheat Sheet
- Latex Equations In Jupyter Notebook
Jupyter may not be the most straightforward way to create presentation slides and handouts. Download Cheat Sheets. But Beamer requires custom LaTeX, and that. Jupyter Notebook Keyboard Shortcuts by weidadeyue - Cheatography.com Created Date: 5718Z. It provides a very easy-to-use interface and lots of other functionalities like markdown, latex, inline plots, etc. Apart from these, it even provides a list of useful magic commands which let us perform a bunch of tasks from the jupyter notebook itself which developers need to do in the command prompt/shell.
Jupyter Book comes with a command-line interface that makes it easy tobuild your books and run a few common functions. This page contains informationon what you can do with the CLI.
This page is a complete reference for the CLI. For newcomers who would like toget started with the Jupyter Book CLI, we recommend starting with Overview
Note
You may also use jb
as shorthand for jupyter-book
in the command-line.For example: jupyter-bookbuildmybook/
is equivalent to jbbuildmybook/
.
See below for the full command-line reference
jupyter-book¶
Build and manage books with Jupyter.
Options
--version
¶Show the version and exit.
build¶
Convert your book’s or page’s content to HTML or a PDF.
Options
--path-output
<path_output>
¶Path to the output artifacts
--config
<config>
¶Path to the YAML configuration file (default: PATH_SOURCE/_config.yml)
--toc
<toc>
¶Path to the Table of Contents YAML file (default: PATH_SOURCE/_toc.yml)
-W
,
--warningiserror
¶Error on warnings.
-n
,
--nitpick
¶Run in nit-picky mode, to generates warnings for all missing references.
--keep-going
¶With -W, do not stop the build on the first warning, instead error on build completion
--all
¶Re-build all pages. The default is to only re-build pages that are new/changed since the last run.
--builder
<builder>
¶Which builder to use.
html | dirhtml | pdfhtml | latex | pdflatex | linkcheck | custom
--custom-builder
<custom_builder>
¶Specify alternative builder name which allows jupyter-book to use a builderprovided by an external extension. This can only be used when using–builder=custom
-v
,
--verbose
¶increase verbosity (can be repeated)
-q
,
--quiet
¶-q means no sphinx status, -qq also turns off warnings
--individualpages
¶[pdflatex] Enable build of PDF files for each individual page
Arguments
PATH_SOURCE
¶Required argument
clean¶
Empty the _build directory except jupyter_cache.If the all option has been flagged, it will remove the entire _build. If html/latexoption is flagged, it will remove the html/latex subdirectories.
Options
-a
,
--all
¶Remove build directory.
--html
¶Remove html directory.
--latex
¶Remove latex directory.
Arguments
PATH_BOOK
¶Required argument
config¶
Inspect your _config.yml file.
sphinx¶
Generate a Sphinx conf.py representation of the build configuration.
Options
--config
<config>
¶Path to the YAML configuration file (default: PATH_SOURCE/_config.yml)
--toc
<toc>
¶Path to the Table of Contents YAML file (default: PATH_SOURCE/_toc.yml)
Arguments
PATH_SOURCE
¶Required argument
create¶
Create a Jupyter Book template that you can customize.
Options
--cookiecutter
¶Use cookiecutter to interactively create a Jupyter Book template.
Arguments
PATH_BOOK
¶Required argument
myst¶
Manipulate MyST markdown files.
init¶
Add Jupytext metadata for your markdown file(s), with optional Kernel name.
Options
--kernel
<kernel>
¶The name of the Jupyter kernel to attach to this markdown file.
Arguments
PATH
¶Optional argument(s)
toc¶
Generate a _toc.yml file for your content folder.It also generates a _toc.yml file for sub-directories.The alpha-numeric name of valid content files will be used to choose theorder of pages/sections. If any file is called “index.{extension}”, it will bechosen as the first file. Note that each folder must have at least one content filein it.
Options
--filename_split_char
<filename_split_char>
¶A character used to split file names for titles
--skip_text
<skip_text>
¶Latex In Jupyter Notebook
If this text is found in any files or folders, they will be skipped.
--output-folder
<output_folder>
¶A folder where the TOC will be written. Default is path
--add-titles
¶Whether to generate page titles from file names.
Arguments
PATH
¶Required argument
LaTeX is the de facto standard typesetting system for scientific writing. A lot of the nice looking equations you see in books and all around the web are written using LaTeX commands. Knowing a few of the mathematics commands is not only helpful if you want to write a book or an article (or do some extreme stuff), but can come in handy in a lot of places, as many systems support LaTeX. You can use LaTeX in MathJax to display expressions on the web (like here), you can make yourself good looking mathematics flashcards in Anki, you can even nerd out and send formulas built with LaTeX commands to your friends via an iMessage app. Also, Apple’s latest Pages release now supports LaTeX equations.
Reasons enough to get familiar with the standard commands!
While a lot of commands can be written out in plain (e.g. 1+1=2), there are other frequently used commands you will need to look up or memorise.
I plan to update this post continuously as I find myself looking for a common symbol I haven’t listed yet. Feel free to drop me an email or comment when you land here and don’t find the answer to a frequently used symbol.
Here is the cheat sheet (naturally incomplete):
Fractions
Command | Description | Output |
---|---|---|
frac | Build a fraction like so: frac{1}{2} | $$frac{1}{2}$$ |
frac{frac{}}{} | You can nest fractions: frac{frac{1}{2}}{2} | $$frac{frac{1}{2}}{2}$$ |
Greek letters
(capitalize by capitalizing the command)
Command | Description | Output |
---|---|---|
alpha | alpha | $$alpha$$ |
beta | beta | $$beta$$ |
gamma | gamma | $$gamma$$ |
delta | delta | $$delta$$ |
epsilon | epsilon | $$epsilon$$ |
zeta | zeta | $$zeta$$ |
eta | eta | $$eta$$ |
theta | theta | $$theta$$ |
iota | iota | $$iota$$ |
kappa | kappa | $$kappa$$ |
lambda | lambda | $$lambda$$ |
mu | mu | $$mu$$ |
nu | nu | $$nu$$ |
xi | xi | $$xi$$ |
o | omicron | $$o$$ |
pi | pi | $$pi$$ |
rho | rho | $$rho$$ |
sigma | sigma | $$sigma$$ |
tau | tau | $$tau$$ |
upsilon | upsilon | $$upsilon$$ |
phi | phi | $$phi$$ |
chi | chi | $$chi$$ |
psi | psi | $$psi$$ |
omega | omega | $$omega$$ |
Logic
Command | Description | Output |
---|---|---|
forall | For all | $$forall$$ |
exists | Exists | $$exists$$ |
lor | Or | $$lor$$ |
land | And | $$land$$ |
veebar | Xor | $$veebar$$ |
neg | Not | $$neg$$ |
Operators
Command | Description | Output |
---|---|---|
times | Times | $$times$$ |
cdot | Dot | $$cdot$$ |
div | Division | $$div$$ |
pm | Plus minus | $$pm$$ |
Relation
Command | Description | Output |
---|---|---|
neq | Not equal | $$neq$$ |
approx | Approximately equal | $$approx$$ |
leq | Less than or equal | $$leq$$ |
geq | Greater than or equal | $$geq$$ |
ll | Much less than | $$ll$$ |
gg | Much greater than | $$gg$$ |
Sets
(Often you can put an “n” before the command and get the negation)
Command | Description | Output |
---|---|---|
supset | Proper superset | $$supset$$ |
supseteq | Superset | $$supseteq$$ |
subset | Proper Subset | $$subset$$ |
subseteq | Subset | $$subseteq$$ |
in | Member | $$in$$ |
emptyset | Empty set | $$emptyset$$ |
mathbb{R} | Set of real numbers | $$mathbb{R}$$ |
cup | Set union (belonging to A OR B) | $$cup$$ |
cap | Set intersection (belonging to A AND B) | $$cap$$ |
Jupyter Latex Package
Super-/Subscript (Exponents / Indices)
Command | Description | Output |
---|---|---|
^ | Use ^ for superscript. Example: x^2 | $$x^2$$ |
^{} | Use ^{} for exponents with >1 digit. Example: x^{10} | $$x^{10}$$ |
_ | Use _ for subscript. Example: x_0 | $$x_0$$ |
_{} | Use _{} for subscript with >1 digit. Example: x_{10} | $$x_{10}$$ |
Jupyter Latex Cheat Sheet
Others
Latex Equations In Jupyter Notebook
Command | Description | Output |
---|---|---|
infty | Infinity | $$infty$$ |
partial | Partial | $$partial$$ |
hat{} | Estimator | $$hat{theta}$$ |
sqrt[root]{} | Square root | $$sqrt[3]{4}$$ |