vases, are Laur Hows We Manso & Laon The apr Naat ty Kral Abas Asa] Tar Daa Sone
CE sinin (Getstated) @
eerie
‘You have 2 free member-only stories left this month. Sign up for Medium and get an extra one
Learn How to Write Markdown &
LaTeX in The Jupyter Notebook
Not only Jupyter. Google Colab, R Markdown, and much more.
Background by JESHOOTS.COM on Unsolash
nteractive notebooks are experiencing a rise in popularity. Why?
Simply because it’s a great teaching environment, powerful, shareable,
and provides the ability to perform data visualization in the same
environment. Which interactive notebooks should I use? I recommend:
+ ‘The Jupyter Notebook is an open-source web application that allows
you to create and share documents that contain live code, equations,
ive text.
visualizations, and narra
stonarddntaeencacomwrtecaroun neh ar obsk OS kt weLe oor con Lakin Th yoo hy Kall Anad Az Temas Soca
* Colaboratory is a free Jupyter notebook environment that requires no
setup and runs entirely in the cloud.
Both of them support
1. Markdown which is a markup language that is a superset of HTML.
2. Latex to render mathematical and scientific writing.
Markdown
It’s very simple language that allows you to write HTML in a shortened
way. It can be used on some websites like Stack Overflow or to write
documentations (essentially on GitHub).
Markdown file extension is .md
When you write in Markdown, you use shortened notations which are
replaced by the corresponding HTML tags. Each time, Iwill tell you the
HTML equivalent of the Markdown notation to show you how Markdown
made our life easier than ever.
Even web developers, now, use Markdown then convert it to HTML using
some websites.
+ Headings
You make titles using hashtags ¥ . A single hashtag gives you a title (h1),
‘two hashtags give you a subtitle (h2) and so on as shown below:
# Heading
48 dead:
HEF Hea
HEEF Heading 4
HHHEE Heading 5
HEF He
6
HTML equivalent:
cvapeaeing Be/N>
crooheacing 22>
cpootiscing ae/ha>
eheseaeng c/s
ensseaaing S/S
eroomeacing Cit
easing hem hostes with © by Gita vero
Heading 1
Headina 2
stonarddntaeencacomwrearoun neh ar ohh OSprions comrtemarcoan intense
Lau Howto We Manso Laon The par Naat oy Kral Abas Asa] Tar Daa Soence
Heading 3
Heading 4
Heading 5
Heading 6
headings md hosted with © by Gud ewer
‘Output Result: Colab Notebook
* Paragraphs
Paragraphs are represented by the
tag in HTML. In Markdown, they're
separated by one or more blank lines. Like HTML, whitespace is ignored. So
if you add 10 blank lines, you're still only going to have one paragraph.
his is a paragraph of text
This is another paragraph of text.
HTML equivalent:
paragrphitnthosted with © by Gita ewer
This is a paragraph of text.
This is another paragraph of text.
paragrphid hosted with © by Gud
‘Output Result, Colab Notebook
«Line breaks
Just end a line with two or more spaces. , then type return. Or leave an
empty line.
his is a text spa
This is another tex:
HTML equivalent:
2 GooThis As a text. chro Tals ds another text.
ine break html hose with) by ib vor
This isa text
This is another text.vases, sare arn Howto We Mars Laon The nar Nata Oy Kal A
breaking md hosted with by Ge viene
‘Output Result, Colab Notebook
+ Mark emphasis
You can add emphasis by making text bold or italic.
Emphasis, aka italics, with *asterisks* or underscores,
Strong enphasis, aka bold, with *tasteriske** or _ underscores.
Combined emphasis with *¥asterisks and _underscores_**.
Strikethrough uses co tildes ~ . ~-Serateh this.~~
HTML equivalent
copeaghasis, ake italics, with strike tag
emphasiahtm! hoses with © by GitHub view
lcs, with asterisks or underscores.
Emphasis, aka it
Strong emphasis, aka bold, with asterisks or underscores
Combined emphasis with asterisks and underscores.
Strikethrough uses two tides ~ .Seratehrthisr
cemphasiemahosted with © by Gu
(Output Result, Colab Notebook
+ Lists
Creating lists in Markdown is a real pleasure, you will see that there is
nothing simpler!
1, Tem 2
2. Ttem 2 ( we can type 1
nunerate then)
* iret item
* Nested item 1
* Nested item 2
1. Keep going
1. Yes
and the markdown witl automatically
* second Item
- First Item
= Second Item
HTML equivalent
pstonarddntaeenca conrad noha oabsk OS aetsitonarddntaeenca coments asses
Lau Howto We Maro Laon The par Naat oy Kal Abas Asa] Tare Daa Soence
asecond Teene/1>
4. ttem 1
2, Item 2 ( we can type 1. and the markdown will automaticaly numerate them)
* First tem
© Nested item 1
© Nested item 2
1. Keep going
2Yes
Second tem
First tem
= Second tem
Output Result, Colab Notebook
* Links and Images
To create a link, you must place the text of the link in square brackets
followed by the URL in parentheses. Images are almost inserted in the same
way as links, add an exclamation mark ( : ), followed by alt text in brackets,
and the path or URL to the image asset in parentheses.
[link Text] (https://nediun,com/dahnedazizkhelifi "optional Title")
"optional Title"
(i[Alt Text] (image path "title")] (Link) -->(! (ale
ini ro medium com/nax/80/0*PaNVeTIn F F043 1pm.pag
(attps
Title")] (https: //mediun.con/@ahnedazizkheliti)
‘optional
HTML equivalent:
2 tee (reeey (tink) =>
2 «epee nneta"netps://nedtum.con/@anmedaziaahelsft™ Ut
sone) TEEle" Link Texte/ene>cing sree": /nkro.mediun,con/nan/96/@*PRWVCTD;FF82}2pm.ong" aILATAL Text” titlee"options
5) cles [I[ANt Taxt)Qinage path “t4ele")] snk) =>
cpsen hrese"heps://nettom.con/Bahnedaeszehelif "seine eroo"hetps:/ nie. meciun-con/n3k/ 86/9°PRNV
LUnkimage hunthosted with © by Gu view ow
Link Tew
Output Res
* Horizontal Rule
‘To create a horizontal rule, use three or more asterisks (+** ), dashes (
-), orunderscores (__) ona line by themselves.
Reading articles on Medium is awesome.
HTML equivalent:
1 epoReading articles on Medion ts avesone.
heh hosted with © by Gab vie om
Reading articles on Medium is awesome.
Sure !
* Table
It’s so freaking easy. And you can use this website to generate them.
Use \ before the dollar signs =, on your Notebook, otherwise, you'll enter
the math display mode (check it out on the LaTeX side).sua 927M aun Howto We Mars Laon The nar Naat Oy Kral An
| 02 | as | \s12 1
| 03 | awesome | \$993 |
HTML Equivalent
eemtabel>
cemrrscec/u>
2 eeappiseeete>
26 eebeneyeds
28 awa
22 cebawesoneestd>
2 eabsoaeete>
tablet hosted wth © by Gti ewer
Id Label Price
01 Markdown $1600
2 is $12
03 AWESOME $999
tablemd hoses wih © by Gita —
‘Output Result. Colab Notebook
* Code and Syntax Highlighting
> python
def staySafe (Coronavirus)
if not home:
return home
HTML Equivalent:
1 epoesecode clasee"iang-pythen">eapan clas"hje-functSon">eapan classe hl je-keynord"odet/span>
2 Capon clasae"nfeckeyword”2ifreturre/span> hone
4 leoseressre>
psitonarddntaeencacomwrtearoun nen ayer oibsh OS kt mesua 927M Lau Howto We Maro Laon The pr Naat ty Kral Abas Asa] Tnars Daa Soence
code td hose with by itd vow
fet stayitelcroerire)
coded hosted with by Git oe
output Result. Cal
= Blockquotes
Blockquotes work like replies to e-mails: you must precede the quoted lines
witha >.
> This is a blockquote.
> This is part of the same blockquote.
Quote break
>This is a new blockquote.
HTML Equivalent:
eovIhis 4s 2 bloekquate.
sfoxoekowote>
prQiate breake/>
alocequote>
2 Ggothis is » new blockquote.()
5. For indices (subscripts) use _()
6. For roots use \sqre(n} are)
The (nj is optional.
ss
\eraetarg 2){are 2) \\
AN
een
AN
HIN
\sorstnitare)
ss
Note hosted wih © by Stab view
argl
ang
oetowaraeserc corte natn nein anys 16a avevases, sare Lau Howto We Manso Laon The par Naat oy Kral Abas Asa] Tears Daa Soence
ae
Ai
By
wera
(Output Example: Colab Notebook
LaTeX file extension is tex
* Greek Letters
To write greek letters, type \ and the letter name:
‘ven ¢ Spt =
ss
onesa = 2\pi #
# = \eracfe){\ianode)\\
\anbda_eu\ehetst2e\genta\\
wosta\tanbas « \eeae(a){\2onbd0"2)
ss
08, Salpha = \erac(a\eiHten\s rads
Given: =3.14,a = rad
‘Output Result, Colab Notebook
Important Note:
‘To write Capital Greek Letter, type the first case after the backslash \ as an
uppercase, for example:
\delta >>> 8
\elta >>> a
\omega >>> 6
Nomega >>> 0
ate
va
‘output Example Cola Notebook
As shown in this figure:
co \alpha, G2 aiLaur Howto We Maro Laon The par Naat oy Kal Abas Asa] Tare Daa Soence
2 \bota oo
4,0 \gamma, \Gamma x, I \pi, \Pi
5A \dolta, Delta 2 \varpi
© \epsiton p \the
& \Wwarepeilon & \vareko
¢ \zera 2,32) \aigna, \Signa
eta ©) \warsigna
G0 \theta, \meta + \tan
@ \varthota tT \upsilon, \Upeiton
t \iora phi, \Phi
fe \kappa ¢ \warphi
OA \lambda, \Lantda y \cht
a \m w, \psd, \Psi
Now ao, Nonega, \Onega
Ful Groek eter Uist. So
Ls
2 \sin(telnayestn(agnan
3 \arccostadsarcsin(ep\\
4 Moen
Seanad = \rac(sirGanCveostn?
oss
remantex hosted wih © by ts —
sin(—a) = —sin(a)
arccos(r) = aresin(u)
Tog,,(n) = 1
tan(z) sin(z)
coa(r)
Output Result Cala Norebook,
sin \ein sinh Nein aesin \areain
cos \cos cosh \cosh arcam \arccos
tan \tan tinh \eankarclan \arctan
sec \sec col \coth min \nin
se \enc det \det mae \max
cot \cot dim \din inf \inf
exp \exp ler \ker up. \eup
log Mog deg \deg latin \Limin
in \an arg. \arg sup \lameup
ly \ig ged \ged lim \Lin
+ Other Symbols
1 other symois
2 a8 rates:
2 ate ange : Sanetes
5 AUght angle + S\rangues
7 angle vetwen two vectors u andy: A\langle ecto) \wect\ranelek
9 $8 \wecthay \, \edot Ay \wec(ED} - \RENEarroW \wec(AB) \y \perp\y \weeCCODSS
St ausets and topic
22 ss\nacnooin subset \natnob{z) \subset \nathab(O} \subser \nathb(Q) \sudset \nathbo{R) \subset
ox towardadatascencecomwrte-arcaawn inarnneiynatabookO68Secb te sevases, sare Laur Howse Maro Laon The par Naa oy Kal Abas Asa] Tar Daa Soence
Angles:
Lett angle: {
Right angle: )
Angle between two vectors u and v: (2)
Sets and logic
(Output Result: Colab Not
\cup
\cap
\subset
\subseteq
\supset
\supseteq
\in
\ae
\netin
\aot\in
aRuauuaAns
+ \rightarrow, \to
\mnenbota} Y \foralt
% \wathbbiZ? 4 \exiote
Q \watnep(a) > \neg
Ni \maembin} Vv \wee
© \wamnboic A \wedge
© \varnothing | \vdaah
© \eapryser \nodels
X \atepa, > \Rightarzow
\ \seeminus \nRightarrox
\oquiv
Sets and Logie: Sauree
> \mapsto
\longmapsto
* \nrightarrow os
—+ \longrightarrow
> \Rightarrow
#% \nRightarrow
= \Longri,
~~ \leadsto
\teq
\eeq
\noq,
Mn
Nes
\approx
\asymp
\equiv
\prec
\preceq
\euec
\succeq
\propte
\aoteg
4
«
=
RYYAR
* Vertical curly braces:
< \leftarrow
+ \leftrightarrow
| \downarrow
ghtarrow \uparrow
{ \updownarrow
crows
2 \angie
4 \weasuredangle
\en
il. \paratier
49° 45°{\cie)
\cong
= \ncong
~ \sim
~ \simeg
\nsiv
© \oplus
© Nonims
© Nodot
@ \otimes
@ \oeiash
| \upbarpoonright
Other Symbols: Sour.
\edot
+ \pa
+ \mp
x \tines,
\aiv
* Nast
\mid
To define a left vertical curly brace we use the attribute
Mest
prions comirtemarcoun intensearn How oe Mario Laon The npr Noa by Kt Ab
to close it we use
\right\)
a
2 signtay = \eee\e
2 array}
‘ 2-8 YaboxGS } Vx Min \Ratnbeenpe™ 1h
5 8 montie Pe = 2 MN
. 218 \pboxGanse.)
7 vendanray?
Brien
oss
w
ass
8 Mere
s ifaeray) \\
Aatphar2 = \aaees VV
2 \aipra \geq @
Aenatarrayy
\rtghe Us\aloha =
vo ss
Vorcetex hore win © by Gt view
1 ifeeN*
sign(c)=0 if 2=0
1 else,
os }ens
a20
Output Result, Colab Notebook
+ Horizontal curly braces
For horizontal curly braces, we use :
\underbrace(...}
Noverbrace{...}
1s
2 \unaerbracet\n \LeFe( \fractS}{6) \right)) {\sSteg [email protected])
3 « \overbracet exe (2)}*{\sineg 7.3890)
as
Horacestexhosted with © by Gt eter
wr2800
w(@) <3
sitonarddntaeencacomwrtecnaroun neh alr obsk Osasua 927M Laon Hows We Maro Laon The par Nant oy Kral Abas Asa] Tare Daa Soence
im
‘Output Resut, Coa
sb Notebook
+ Derivative
1 First onder derivative £ $$9°(0)88
2 kath onder derivative: S$ (WISE
5) Partial firt onéen cetvative | $s\éract\partial #}{\partial 08s
Desnatve tex hosted with by Gus
First order derivative
Kcth order derivative
Partial fit order derivative
Partial kth order derivative:
‘Output Resut Coa
Partial keth onder Genivative + $#\¢rac{\partial*(k) #2{\partial 285
f(@)
I)
of
Or
akg
xk
bp Notebook
Limit
2 Lindt ot plus infinity. = $8\1ingx (to #\anrty) #088
3) Lindt at adnus Enfindty ¢ $8\1in {x \to -\intty) #0088
4 Linke at Salohes + SB\LIN_G \to \atpha) #0085
5 Maw FBR Min [3 BIDEN
7 Min + $8\ein_G& \in [stp etal FOO
8 Sup + $8\sup_ Oe Vin \eathabcep Fons
9 Inf» $8\nF Ge > speCaDSS
Vitter hosted with © by itu
imi at plus nny
alin fle) Min
Lm atmnusinsty
im fe)
Se.
Lum ater
sim f(e)
ox wo
sang f(2)
‘Output Result: Cota Notebook
*Sum
2 SS\aum_GeOrCe\inrty) AUIS
Double sums
stonarddntaeenca correction nen ar obsk OS it
aia, fe)
susie)
inf f(@)Lau Howto We Manso Laon The par Naat oy Kral Abas Asa] Tar Daa Soence
© SS\sumrh_ (et) sur) Set) AIS
9 Taylor expansion of Sane:
2058 ex = sun (tp, Vere eHDRt) + 06H) $6
Sum from 010 inf
245
=
Double sum:
kts
ev 44,
aia
Taylor expansion of e*
yo an
e=) tote")
ca
‘output Result Calab Notebook
+ Product
2 S8\proq (ate Ao 88
2 boubte produ:
2 Ssuproch CO) prot SADA AIS
rodectinr ated wih © by Gb a
Product:
.
T]4s,
rl
Double product:
kt
IM 44;
ma
‘Output Result: Colab Notebook
+ Integral
1 Stnpe sregra:
2 s8\ine (a> eos
4 ashe snteral
5 $8\ine Op BUlnk CE flay eas
7 Trap sregra:
8 sissinss
18 uasrple sneer:
si shutliniss
22, muntiole sntegral =
Me Ssiscotsinss
27 shointss
sitonardntaeencacomwrearoun nen har oebsh OSS ktLau Hows We Maro Laon The par Naot oy Kral Abas Ae] Tar Daa Soence
Simple integral:
Double integral:
Triple integral
Quadruple integral
Multiple integral
Contour integral
[tee
Lf sesnee
I
Il
I]
f
‘Output Result: Colab Notebook
+ Matrix
ain
\popingnatess)
paren,
\enateatetay
foun brackets:
eopingpnatrsxy
rarerny
\enatonatetny
‘unly brackets:
bate)
rararny
\enatonatesxy
parany
\enatvmatetxy
Double pines
inated)
rarany
\enatymateiny
matitex hosted with by Gus
Plain
Ronind hrarkets