Markdown In Jupyter



Learning Objectives

I am able to convert part of the text in span to latex and jupyter renders the latex in red. – Shishir Pandey Aug 11 '15 at 15:59 @ShishirPandey: What I was referring to with 'conversion of the notebook to latex' is that you can normally convert a notebook to LaTex (a typesetting language) using ipython nbconvert -to latex mynotebook.ipynb. Select Jupyter Notebook. In the dialog that opens, type a filename. A notebook document has the.ipynb extension and is marked with the corresponding icon:. Switch between the available editing modes by using the corresponding icons. Edit source code in the notebook. You can add Markdown, raw, and code cells to the notebook file.

After completing this page, you will be able to:

  • Create new Code and Markdown cells within Jupyter Notebook.
  • Run Code and Markdown cells within Jupyter Notebook to execute Python code and render Markdown text.
  • List useful shortcuts for common tasks in Jupyter Notebook.

Work With Python Code and Markdown Cells in Jupyter Notebook

Recall that a Jupyter Notebook file consists of a set of cells that can store text or code.

R Markdown In Jupyter

  • Text Cells: Text cells allow you to write and render Markdown syntax. This is where you can describe and document your workflow.
  • Code Cells: Code cells allow you to write and run programming code (e.g. Python).

Create New Cells

You can use either the Menu tools or Keyboard Shortcuts to create new cells.

FunctionKeyboard ShortcutMenu Tools
Create new cellEsc + a (above), Esc + b (below)Insert→ Insert Cell Above OR Insert → Insert Cell Below
Copy CellcCopy Key
Paste CellvPaste Key

While the default cell type for new cells is Code, you can change the cell type of any existing cell by clicking in the cell and selecting a new cell type (e.g. Markdown) in the cell type menu in the toolbar.

Cell type options include Code, Markdown, Raw NBConvert (for text to remain unmodified by nbconvert), and Heading.

To use the Keyboard Shortcuts, hit the esc key. After that, you can change a cell to Markdown by hitting the m key, or you can change a cell to Code by hitting the y key.

Run Cells

Python Code Cells

You can run any cell in Jupyter Notebook (regardless of whether it contains Code or Markdown) using the Menu tools or Keyboard Shortcuts.

FunctionKeyboard ShortcutMenu Tools
Run CellCtrl + enterCell → Run Cell
Markdown

For example, you can add a new Code cell and then run the following Python code (e.g. 3 + 4). Your result, or output, will be displayed below the Code cell that you run.

Markdown Cells

You can run Markdown cells in the same way that you can run code cells. However, when you run a Markdown cell, the text formatted using Markdown syntax will be rendered as stylized text.

This means that headings are larger and bold, bulleted lists have bullets next to them instead of *, and regular text looks normal. No outputs will appear below the Markdown cell.

For example, the Markdown syntax below represents 3 headers. You can double-click in any Markdown cell to see the raw Markdown syntax, which for the cell below would appear like this raw Markdown syntax:

To see the Markdown as stylized text, run the cell. It should look like the text printed below:

This is a subtitle in Markdown

This is a smaller subtitle

This is an even smaller subtitle

Rearrange Cells in a Jupyter Notebook

You can change the order of cells within Jupyter Notebook using the up arrow and down arrow buttons on the menu bar. To do this, click inside the cell that you want to move and then press the desired arrow as many times as you need to move the Cell to the desired location.

Clear Results in Jupyter Notebook

Sometimes, you may want to clear any output results that have been produced. You can do this using the Menu:

Matrix in jupyter markdown
Menu Tools
Cell -> Current Outputs -> Clear

This will clear the current cell that you are working in, which you can activate by clicking in a cell.

You can also clear all of the output using the Menu Tools.

Menu Tools
Cell -> All Output -> Clear
Manage Directories Using Dashboard Jupyter Notebook For Python

In this post, I am gonna show you how to write Mathematic symbols in markdown. Your download is ready! verified safe and clean!untitled. since I am writing blog post that hosted by Github with Editor Atom, and use plugin markdown-preview-plus and mathjax-wrapper, and use mathjax Javascript display the math symbols on the web page.

I am not gonna to tell you how to make all these things work together, if you want to do what I am do, please take a little time and search around.

Most import, this post is showing you the basics about math symbols in Latex.

Markdown

This what wikipedia said about Latex:

One of the greatest motivating forces for Donald Knuth when he began developing the original TeX system was to create something that allowed simple construction of mathematical formulas, while looking professional when printed.

Here are some symbols I typed during the learning.

Greek Letters

SymbolScript
$alpha$alpha
$A$A
$beta$beta
$B$B
$gamma$gammma
$Gamma$Gamma
$pi$pi
$Pi$Pi
$phi$phi
$Phi$Phi
$varphi$varphi
$theta$theta

Operators

SymbolScript
$cos$cos
$sin$sin
$lim$lim
$exp$exp
$to$to
$infty$infty
$equiv$equiv
$bmod$bmod
$times$times

Power and Indices

SymbolScript
$k_{n+1}$k_{n+1}
$n^2$n^2
$k_n^2$k_n^2

Fractions and Binomials

SymbolScript
$frac{n!}{k!(n-k)!}$frac{n!}{k!(n-k)!}
$binom{n}{k}$binom{n}{k}
$frac{frac{x}{1}}{x - y}$frac{frac{x}{1}}{x - y}
$^3/_7$^3/_7

Roots

Markdown highlight text
SymbolScript
$sqrt{k}$sqrt{k}
$sqrt[n]{k}$sqrt[n]{k}

Sums and Integrals

Markdown In Jupyter

Shortcut For Markdown In Jupyter Notebook

SymbolScript
$sum_{i=1}^{10} t_i$sum_{i=1}^{10} t_i
$int_0^infty mathrm{e}^{-x},mathrm{d}x$int_0^infty mathrm{e}^{-x},mathrm{d}x
$sum$sum
$prod$prod
$coprod$coprod
$bigoplus$bigoplus
$bigotimes$bigotimes
$bigodot$bigodot
$bigcup$bigcup
$bigcap$bigcap
$biguplus$biguplus
$bigsqcup$bigsqcup
$bigvee$bigvee
$bigwedge$bigwedge
$int$int
$oint$oint
$iint$iint
$iiint$iiint
$idotsint$idotsint
$sum_{substack{0<i<m0<j<n}} P(i, j)$sum_{substack{0<i<m0<j<n}} P(i, j)
$intlimits_a^b$intlimits_a^b
SymbolScript
$a’$ $a^{prime}$a` a^{prime}
$a’’$a’’
$hat{a}$hat{a}
$bar{a}$bar{a}
$grave{a}$grave{a}
$acute{a}$acute{a}
$dot{a}dot{a}
$ddot{a}$ddot{a}
$not{a}$not{a}
$mathring{a}$mathring{a}
$overrightarrow{AB}$overrightarrow{AB}
$overleftarrow{AB}$overleftarrow{AB}
$a’’’$a’’’
$overline{aaa}$overline{aaa}
$check{a}$check{a}
$vec{a}$vec{a}
$underline{a}$underline{a}
$color{red}x$color{red}x
$pm$pm
$mp$mp
$int y mathrm{d}x$int y mathrm{d}x
$,$,
$:$:
$;$;
$!$!
$int y, mathrm{d}x$int y, mathrm{d}x
$dots$dots
$ldots$ldots
$cdots$cdots
$vdots$vdots
$ddots$ddots

Brackets etc

SymbolScript
$(a)$(a)
$[a]$[a]
${a}${a}
$langle f rangle$langle f rangle
$lfloor f rfloor$lfloor f rfloor
$lceil f rceil$lceil f rceil
$ulcorner f urcorner$ulcorner f urcorner

Reference

Atom - Atom editor for hackers

markdown-preview-plus - preview your markdown in atom

mathjax-wrapper - display math symbols in atom

mathjax - Javascript lib for browsers

Latex - Latex Homepage

How To Do Markdown In Jupyter

Wiki Latex Mathematics - introduction to math symbols in latex

Markdown Highlight Text

Github tables - Github Flavored Markdown