Jupyter Latex Cheat Sheet



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
Jupyter

Show the version and exit.

build¶

Convert your book’s or page’s content to HTML or a PDF.

Jupyter

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.

Options

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)

Jupyter Latex Cheat Sheet

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

CommandDescriptionOutput
fracBuild 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)

CommandDescriptionOutput
alphaalpha$$alpha$$
betabeta$$beta$$
gammagamma$$gamma$$
deltadelta$$delta$$
epsilonepsilon$$epsilon$$
zetazeta$$zeta$$
etaeta$$eta$$
thetatheta$$theta$$
iotaiota$$iota$$
kappakappa$$kappa$$
lambdalambda$$lambda$$
mumu$$mu$$
nunu$$nu$$
xixi$$xi$$
oomicron$$o$$
pipi$$pi$$
rhorho$$rho$$
sigmasigma$$sigma$$
tautau$$tau$$
upsilonupsilon$$upsilon$$
phiphi$$phi$$
chichi$$chi$$
psipsi$$psi$$
omegaomega$$omega$$

Logic

CommandDescriptionOutput
forallFor all$$forall$$
existsExists$$exists$$
lorOr$$lor$$
landAnd$$land$$
veebarXor$$veebar$$
negNot$$neg$$

Operators

CommandDescriptionOutput
timesTimes$$times$$
cdotDot$$cdot$$
divDivision$$div$$
pmPlus minus$$pm$$

Relation

CommandDescriptionOutput
neqNot equal$$neq$$
approxApproximately equal$$approx$$
leqLess than or equal$$leq$$
geqGreater than or equal$$geq$$
llMuch less than$$ll$$
ggMuch greater than$$gg$$

Sets

(Often you can put an “n” before the command and get the negation)

CommandDescriptionOutput
supsetProper superset$$supset$$
supseteqSuperset$$supseteq$$
subsetProper Subset$$subset$$
subseteqSubset$$subseteq$$
inMember$$in$$
emptysetEmpty set$$emptyset$$
mathbb{R}Set of real numbers$$mathbb{R}$$
cupSet union (belonging to A OR B)$$cup$$
capSet intersection (belonging to A AND B)$$cap$$

Jupyter Latex Package

Super-/Subscript (Exponents / Indices)

CommandDescriptionOutput
^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

CommandDescriptionOutput
inftyInfinity$$infty$$
partialPartial$$partial$$
hat{}Estimator$$hat{theta}$$
sqrt[root]{}Square root$$sqrt[3]{4}$$