Latex Markdown Jupyter

Posted on  by 



In this post, I am gonna show you how to write Mathematic symbols in markdown. 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.

Includes Markdown and IpyWidgets!! Cozy and warm place.

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.

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

Latex Markdown Jupyter

SymbolScript
$sqrt{k}$sqrt{k}
$sqrt[n]{k}$sqrt[n]{k}

Sums and Integrals

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

Wiki Latex Mathematics - introduction to math symbols in latex

Github tables - Github Flavored Markdown

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:

[ int_0^infty frac{x^3}{e^x-1},dx = frac{pi^4}{15}]

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:

[begin{gather*}a_1=b_1+c_1a_2=b_2+c_2-d_2+e_2end{gather*}]
(2)¶[begin{align}a_{11}& =b_{11}& a_{12}& =b_{12}a_{21}& =b_{21}& a_{22}& =b_{22}+c_{22}end{align}]

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

Latex Markdown Jupyter Online

(3)¶[w_{t+1} = (1 + r_{t+1}) s(w_t) + y_{t+1}]

Alternatively you can use the dollar math syntax with a prefixed label:

Latex Markdown Jupyter Editor

which generates

(4)¶[ w_{t+1} = (1 + r_{t+1}) s(w_t) + y_{t+1}]

Note

Latex Markdown Jupyter Code

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:

results in

Latex table in markdown jupyter
  • A link to an equation directive: (3)

  • A link to a dollar math block: (4)

Jupyter Markdown Reference

Note

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)!





Coments are closed