HackMD 是透過 MathJax 支援 $\LaTeX$ ,雖未支援所有語法,對多數人應已足夠,一起把 Web 上醜死的公式換成美美的吧~
$\LaTeX$ 語法筆記
\[\LaTeX % 大小寫須正確\]1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
\(\not\in, \not\gt, \not\lt, \not=\)
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
Operator/Relation
- $A\times B$ = A\times B
- $a\cdot b$ = a\cdot b
- $\div$ = \div
- $\pmod n$ = \pmod n
- $\pm$ = \pm (plus and minus)
- $\partial$ = \partial
- $\oplus$ = \oplus
- $\&$= \&
- $\gt$ = \gt (greater than)
- $\lt$ = \lt (less than)
- $\ge$ = \ge (greater or equal)
- $\le$ = \le (less or equal)
- $\lhd$ = \lhd (normal subgroup)
- $\unlhd$ = \unlhd
- $\ne$ = \ne (not equal)
- $\approx$ = \approx (approximate to)
- $\sim$ = \sim (similar)
- $\cong$ = \cong (congruent)
- $\equiv$ = \equiv (equivalent)
- $\ll$ = \ll, much less than
- $\gg$ = \gg, much greater than
- $\nless$ = \nless, not less than
- $\ngtr$ = \ngtr, not greater than
- $\cap$ = \cap, 像帽子, intersection
- $\cup$ = \cup, 像杯子, union
- $\subset$ = \subset, or implied
- $\supset$ = \superset, or implies
- $\subseteq$ = \subseteq
- $\supseteq$ = \supseteq
- $\land$ = \land (logical and); \wedge (wedge product)
- $\lor$ = \lor (logical or)
Function
$\binom{a}{b}$ = \binom{a}{b}
Binomial : $\frac{C!}{n!(n-k)!}, where\ (n+k) = constant$ 或 \binom a b 或 { a \choose b } \tbinom a b (t for \textstyle) \dbinom a b (d for \displaystyle)
- $\cos{\theta}$ = \cos{\theta}
- $\sin{\theta}$ = \sin{\theta}
- $\log_{b}{x}$ = \log_{b}{x}
- $\ln{x}$ = \ln{x}
- $\lceil x \rceil$ = \lceil x \rceil
- $\lfloor x \rfloor$ = \lfloor x \rfloor
Matrix
\[\begin{pmatrix}A\\B\end{pmatrix}\]1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
Greek
- $\alpha$ = \alpha
- $\beta$ = \beta
- $\Delta$ = \Delta, $\delta$ = \delta
- $\epsilon$ = \epsilon, $\varepsilon$ = \varepsilon
- $\gamma$ = \gamma
- $\theta$ = \theta
- $\sigma$ = \sigma
- $\pi$ = \pi
- $\mu$ = \mu
- $\lambda$ = \lambda
- $\omega$ = \omega
- $\phi$ = \phi
- $\varphi$ = \varphi
- $\rho$ = \rho
Misc
- $\angle$ = \angle
- $\triangle$ = \triangle
- $\square$ = \square
- $\quad (space)$ = \quad (space)
-
$\propto$ = \propto (propotional to)
- $\because$ = \because
- $\therefore$ = \therefore
- $\mathbb{Z}$ = \mathbb{Z}
- $\mathbb{P}$ = \mathbb{P}
- $\mathbb{R}$ = \mathbb{R}
- $\mathbb{C}$ = \mathbb{C}
- $\Im$ = \Im (Imaginary Space)
-
$\Re$ = \Re (Real Space)
- $\emptyset$ = \emptyset
- $\varnothing$ = \varnothing (以此表示空集合較好看)
- $\in$ = \in
- $\not\in$ = \not\in
- $\langle S\rangle$ = \langel S\rangle (generator)
- $\chi$ = \chi
- $\circlearrowleft$ = \circlearrowleft
- $\circlearrowright$ = \circlearrowright
- $\curvearrowleft$ = \curvearrowleft
- $\curvearrowright$ = \curvearrowright
- $\hbar$ = \hbar (Planck’s Constant)
https://oeis.org/wiki/List_of_LaTeX_mathematical_symbols#Set_and.2For_logic_notation
Format
Style
\[\style{background-color:#eeeeee}{\frac{x+1}{y+2}}\]1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
\(\text{text $E=mc^2$}\)
1 |
|
1 |
|
1 |
|
\(\min\limits_{n}\)
1 |
|
Automatic Sizing
\[\{x \mid x\gt 1\}\text{ 與 }\{x | x\gt 1\}\]1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
Alignment
\[\begin{aligned} f(x) &= ax + by + cz + d \\ &= 2x + 3y + 5z + 1 \end{aligned}\]1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
Advanced
\[\overset{上組合技}{\implies} 或\underset{下組合技}{\impliedby}\]1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
微調字體、字距
Font
\[\mathbb{ABCDE12345abcde}\]\mathbb - Used to turn on blackboard-bold for uppercase letters and lowercase ‘k’.
\[\mathbf{ABCDE12345abcde}\]\mathbf - Used to turn on boldface for uppercase and lowercase letters and digits.
\[\mathit{ABCDE12345abcde}\]\mathit - forces the math italic mode.
\[\mathcal{ABCDE12345abcde}\]\mathcal - Used to turn on calligraphic font for uppercase letters and digits.
\[\mathfrak{ABCDE12345abcde}\]\mathfrak - turn on fraktur font for uppercase and lowercase letters and digits (and a few other characters).
\[\mathrm{ABCDE12345abcde}\]\mathrm - Used to turn on roman typestyle for uppercase and lowercase letters.
\[\mathscr{ABCDE12345abcde}\]\mathscr - Used to turn on script typestyle for uppercase letters. If lowercase script letters are not available, then they are typeset in a roman typestyle.
\[\mathsf{ABCDE12345abcde}\]\mathsf - Used to turn on sans serif typestyle for uppercase and lowercase letters and digits; also affects uppercase greek.
\[\mathtt{ABCDE12345abcde}\]\mathtt - Used to turn on typewriter typestyle for uppercase and lowercase letters and digits.
\[\oldstyle{ABCDE12345abcde}\]\oldstyle - Used to turn on oldstyle font.
Operator (Class Assignment)
- \mathord - forces the argument to be treated in the ‘ordinary’ class.
- \mathrel - forces the argument to be treated in the ‘relation’ class.
- \mathinner - forces the argument to appear ‘inside’ other formulas, and should be surrounded by additional space in certain circumstances.
- \mathbin - Used to give the correct spacing to make an object into a binary operator.
- \mathstrut - Used to achieve more uniform appearance in adjacent formulas as an invisible box whose width is zero.
- \mathpunct
- \mathopen
- \mathclose
- \mathop
1 |
|
- \mathchoice - provides content that is dependent on the current style (display, text, script, or scriptscript).
1
\mathchoice{D}{T}{S}{SS}
More
- https://en.wikibooks.org/wiki/LaTeX/Mathematics
- https://en.wikibooks.org/wiki/LaTeX/Advanced_Mathematics#Custom_operators
- https://en.wikibooks.org/wiki/LaTeX/Mathematics#Adding_text_to_equations
- MathJax Tutorial
- https://tex.stackexchange.com/
- 手寫辨認查詢
- MathJax Commands
- LaTeX Arrows
- https://en.wikipedia.org/wiki/List_of_logic_symbols
- $\LaTeX$ for Twitch Chat