MathJax Cheat Sheet: Unterschied zwischen den Versionen

Aus Matts Wiki
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
 
(21 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
This is a cheat sheet on which code / markdown notation leads to which MathJax output. As MathJax seems to be somewhat compatible to LaTeX, some LaTeX Keywords seem to work too.
This is a cheat sheet on which code / markdown notation leads to which MathJax output.  


When using inside Obsidian.md the code representing the MathJax formular needs start and end with the dollar sign, i.e.: <code>$a_1..a_n$</code>
[https://www.mathjax.org/ MathJax] is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all modern browsers.


== Sources ==
== MathJax in Obsidian.md ==
I found the following sources which helped me out:
When using MathJax inside Obsidian.md the markdown code representing the MathJax formula needs start and end with the dollar sign, i.e.: <code>$a_1..a_n$</code>
 
In order to show fractions a little bit bigger and centered use two dollar signs, i.e.: <code><nowiki>$$a = \frac{\sqrt{b^2 + c^2}}{2}$$</nowiki></code>
 
Printing little bigger works too with <code>$\displaystyle$</code> ahead of the fraction


* https://de.wikipedia.org/wiki/Liste_mathematischer_Symbole (German)
== Cheatsheet ==
* https://en.wikipedia.org/wiki/Glossary_of_mathematical_symbols
* https://easy-copy-mathjax.nakaken88.com/en/matrix/
* https://bearnok.com/grva/en/knowledge/software/mathjax
* https://jojozhuang.github.io/tutorial/mathjax-cheat-sheet-for-mathematical-notation/


== Subscript and Superscript ==
=== Formatting ===
{|
{| class="wikitable" style="background-color:#ffffff;"
|+
!Description
!Description
!Example
!Example
!Code / Markdown
!LaTeX Code / Markdown
|-
|Fractions
|<math>\frac{km}{h}</math>
|<code>\frac{km}{h}</code>
|-
|Text with spaces
|<math>\text{kilometers or miles}</math>
|<code>\text{kilometers or miles}</code>
|-
|Superscript / Exponent
|<math>a^2 + b^2 = c^2</math>
|<code>a^2 + b^2 = c^2</code>
|-
|-
|Subscript
|Subscript
|<math>a_1..a_n</math>
|<math>a_1..a_n</math>
|
|<code>a_1..a_n</code>
a_1..a_n
|-
|-
|Double Subscript
|Double Subscript
|<math>r_{0_1} + r_{0_2} + ... + r_{0_n}</math>
|<math>r_{0_1} + r_{0_2} + ... + r_{0_n}</math>
|<syntaxhighlight lang="latex">
|<code>{r_{0_1}​​ + r_{0_2} ​+ ... + r_{0_n}</code>
{r_{0_1}​​ + r_{0_2} ​+ ... + r_{0_n}
|}
</syntaxhighlight>
 
=== Arithmetic ===
{| class="wikitable" style="background-color:#ffffff;"
!Description
!Example
!LaTeX Code / Markdown
|-
|times
|<math>a \cdot b</math>
|<code>a \cdot b</code>
|-
|times
|<math>a \times b</math>
|<code>a \times b</code>
|-
|divided by
|<math>a \div b</math>
|<code>a \div b</code>
|-
|plus minus
|<math>\pm x</math>
|<code>\pm x</code>
|-
|minus plus
|<math>\mp x</math>
|<code>\mp x</code>
|-
|equal
|<math>=</math>
|<code>\=</code>
|-
|not equal
|<math>\neq</math>
|<code>\neq</code>
|-
|around
|<math>\approx</math>
|<code>\approx</code>
|-
|less than or equal
|<math>a \le b</math>
|<code>a \le b</code> or <code>a \leq b</code>
|-
|less than or equal
|<math>a \leqq b</math>
|<code>a \leqq b</code>
|-
|greater than or equal
|<math>a \ge b</math>
|<code>a \ge b</code> or <code>a \geq b</code>
|-
|greater than or equal
|<math>a \geqq b</math>
|<code>a \geqq b</code>
|}
 
=== Symbols ===
{| class="wikitable" style="background-color:#ffffff;"
!Description
!Example
!LaTeX Code / Markdown
|-
|Infinity
|<math>\infty</math>
|<code>\infty</code>
|-
|Absolute
|<math>\vert x \vert</math>
|<code>\vert x \vert</code>
|-
|Overline one character
|<math>\overline a</math>
|<code>\overline a</code>
|-
|Overline multiple characters
|<math>\overline {AB}</math>
|<code>\overline {AB}</code>
|-
|Hat over one character
|<math>\hat a</math>
|<code>\hat a</code>
|-
|Hat over two characters
|<math>\widehat {ab}</math>
|<code>\widehat {ab}</code>
|-
|Summation of a set
|<math>\sum_{i=1}^n a_i</math>
|<code>\sum_{i=1}^n a_i</code>
|-
|Summation of a set (printed larger)
|<math>\displaystyle \sum_{i=1}^n a_i</math>
|<code>\displaystyle \sum_{i=1}^n a_i</code>
|}
 
=== Greek Alphabet ===
{| class="wikitable" style="background-color:#ffffff;"
!Letter
!Greek Notation
!LaTeX Code / Markdown
|-
|Alpha
|
|
|-
|Beta
|
|
|-
|Gamma
|
|
|-
|Delta
|
|
|-
|Epsilon
|<math>\Epsilon, \epsilon</math>
|<code>\Epsilon</code> , <code>\epsilon</code>
|-
|Zeta
|
|
|-
|Eta
|
|
|-
|Theta
|
|
|-
|Iota
|
|
|-
|Kappa
|
|
|-
|Lambda
|
|
|-
|Mu
|
|
|-
|Nu
|
|
|-
|Xi
|
|
|-
|Omicron
|
|
|-
|Pi
|<math>\Pi, \pi</math>
|<code>\Pi</code> , <code>\pi</code>
|-
|Rho
|
|
|-
|Sigma
|<math>\Sigma, \sigma, \varsigma</math>
|<code>\Sigma</code> , <code>\sigma</code> , <code>\varsigma</code>
|-
|Tau
|
|
|-
|Upsilon
|
|
|-
|-
|Superscript / Exponent
|Phi
|<math>a^2 + b^2 = c^2</math>
|<math>\Phi, \phi</math>
|a^2 + b^2 = c^2
|<code>\Phi</code> , <code>\phi</code>
|-
|Chi
|
|
|-
|Psi
|
|
|-
|Omega
|
|
|}
 
=== Constants ===
{| class="wikitable" style="background-color:#ffffff;"
!Description
!Example
!LaTeX Code / Markdown
|-
|Pi
|<math>\pi</math>
|<code>\pi</code>
|-
|Euler's Number
|<math>\mathrm{e}</math>
|<code>\mathrm{e}</code>
|}
 
=== Matrices ===
{| class="wikitable" style="background-color:#ffffff;"
!Description
!Example
!LaTeX Code / Markdown
|-
|-
|Matrix
|Matrix with Parentheses
|<math>\begin{pmatrix}
0 & 1 \\
1 & 0
\end{pmatrix}</math>
|
|
\begin{pmatrix}
0 & 1 \\
1 & 0
\end{pmatrix}
|-
|Matrix with Brackets
|<math>\begin{bmatrix}
0 & 1 \\
1 & 0
\end{bmatrix}</math>
|
|
\begin{bmatrix}
0 & 1 \\
1 & 0
\end{bmatrix}
|-
|-
|Complex Matrix
|Complex Matrix with Parentheses
|<math>\begin{pmatrix}
|<math>\begin{pmatrix}
& Bob & Alice \\
& Bob & Alice \\
Zeile 44: Zeile 285:
Alice & 1 & 0
Alice & 1 & 0
\end{pmatrix}</math>
\end{pmatrix}</math>
|\begin{pmatrix} & ​Bob & Alice \\\ Bob & 0 & 1 \\\​Alice & 1 & 0  \end{pmatrix}
|
\begin{pmatrix}
  & ​Bob & Alice \\
Bob & 0 & 1 \\
Alice & 1 & 0   
\end{pmatrix}
|}
|}


=== Subscript ===
a_1..a_n
<math>a_1..a_n</math>


=== Double Subscript ===
== Sources ==
{r_{0_1}​​ + r_{0_2} ​+ ... + r_{0_n}
I found the following sources which helped me out:
<math>r_{0_1} + r_{0_2} + ... + r_{0_n}</math>​​​


=== Superscript / Exponents ===
* https://de.wikipedia.org/wiki/Liste_mathematischer_Symbole (German)
a^2 + b^2 = c^2
* https://en.wikipedia.org/wiki/Glossary_of_mathematical_symbols
<math>a^2 + b^2 = c^2</math>
* https://oeis.org/wiki/List_of_LaTeX_mathematical_symbols
 
* https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference
== Matrix / Matrices ==
* https://easy-copy-mathjax.nakaken88.com/en/matrix/
\begin{pmatrix}
* https://jojozhuang.github.io/tutorial/mathjax-cheat-sheet-for-mathematical-notation/
  & ​Bob & Alice \\\
* https://bearnok.com/grva/en/knowledge/software/mathjax
Bob & 0 & 1 \\\
​Alice & 1 & 0 
\end{pmatrix}
<math>\begin{pmatrix}
& Bob & Alice \\
Bob & 0 & 1 \\
Alice & 1 & 0
\end{pmatrix}</math>

Aktuelle Version vom 3. Mai 2026, 16:07 Uhr

This is a cheat sheet on which code / markdown notation leads to which MathJax output.

MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all modern browsers.

MathJax in Obsidian.md

When using MathJax inside Obsidian.md the markdown code representing the MathJax formula needs start and end with the dollar sign, i.e.: $a_1..a_n$

In order to show fractions a little bit bigger and centered use two dollar signs, i.e.: $$a = \frac{\sqrt{b^2 + c^2}}{2}$$

Printing little bigger works too with $\displaystyle$ ahead of the fraction

Cheatsheet

Formatting

Description Example LaTeX Code / Markdown
Fractions kmh \frac{km}{h}
Text with spaces kilometers or miles \text{kilometers or miles}
Superscript / Exponent a2+b2=c2 a^2 + b^2 = c^2
Subscript a1..an a_1..a_n
Double Subscript r01+r02+...+r0n {r_{0_1}​​ + r_{0_2} ​+ ... + r_{0_n}

Arithmetic

Description Example LaTeX Code / Markdown
times ab a \cdot b
times a×b a \times b
divided by a÷b a \div b
plus minus ±x \pm x
minus plus x \mp x
equal = \=
not equal \neq
around \approx
less than or equal ab a \le b or a \leq b
less than or equal ab a \leqq b
greater than or equal ab a \ge b or a \geq b
greater than or equal ab a \geqq b

Symbols

Description Example LaTeX Code / Markdown
Infinity \infty
Absolute |x| \vert x \vert
Overline one character a \overline a
Overline multiple characters AB \overline {AB}
Hat over one character a^ \hat a
Hat over two characters ab^ \widehat {ab}
Summation of a set i=1nai \sum_{i=1}^n a_i
Summation of a set (printed larger) i=1nai \displaystyle \sum_{i=1}^n a_i

Greek Alphabet

Letter Greek Notation LaTeX Code / Markdown
Alpha
Beta
Gamma
Delta
Epsilon E,ϵ \Epsilon , \epsilon
Zeta
Eta
Theta
Iota
Kappa
Lambda
Mu
Nu
Xi
Omicron
Pi Π,π \Pi , \pi
Rho
Sigma Σ,σ,ς \Sigma , \sigma , \varsigma
Tau
Upsilon
Phi Φ,ϕ \Phi , \phi
Chi
Psi
Omega

Constants

Description Example LaTeX Code / Markdown
Pi π \pi
Euler's Number e \mathrm{e}

Matrices

Description Example LaTeX Code / Markdown
Matrix with Parentheses (0110)
\begin{pmatrix}
0 & 1 \\ 
1 & 0
\end{pmatrix}
Matrix with Brackets [0110]
\begin{bmatrix}
0 & 1 \\ 
1 & 0
\end{bmatrix}
Complex Matrix with Parentheses (BobAliceBob01Alice10)
\begin{pmatrix}
 & ​Bob & Alice \\
Bob & 0 & 1 \\
Alice & 1 & 0  
\end{pmatrix}


Sources

I found the following sources which helped me out: