LaTeX / Markdown - Logarithm
Logarithm base e: \ln x
1$ \ln x $
\ln x
Logarithm base 10: \lg x
1$ \lg x $
\lg x
Logarithm base a: \log_a x
1$ \log_a x $
\log_a x
LaTeX / Markdown - Matrix
Basic grammar using matrix in Markdown12345678910$$\left( \begin{matrix} a & b & c & d & e \\ f & g & h & i & j \\ k & l & m & n & o \\ p & q & r & s & t \end{matrix}\right) $$
\begin{pmatrix}
a & b & c & d & e \\ f & g & h & i & j\\
k & l & m & n & o\\
p & q & r & s & t
\end{pmatrix}
Matrix equation with color
1234567891011121314151617181920212223242526272829303132$$\left\{ \begin{m ...
LaTeX / Markdown - Sum and Integral
Sum: \sum_{0}^{2} or \sum\limits_{0}^{2}
12$\sum_{0}^{2}$$\sum\limits_{0}^{2}$
\sum_{0}^{2}
Integral: \int_{x}^{2} or \int\limits_{x}^{2}
12$\int_{x}^{2}$$\int\limits_{x}^{2}$
\int_{x}^{2}
Note: When you need in-line formulas, the \sum_{0}^{2} is $\sum_{0}^{2}$,
but the \sum\limits_{0}^{2} is $\sum\limits_{0}^{2}$.
LaTeX - Signs For Differentials And Derivatives
Signs for Differentials And Derivatives are commonly used in daily work, so I put them together as follows
Differential / Derivative 1: \partial x
12$ \frac{\partial f}{\partial x} $ % first order$ \frac{\partial ^{n} f}{\partial x^{n}} $ % nth order
\frac{\partial f}{\partial x} \quad \frac{\partial ^{n} f}{\partial x^{n}}
Differential / Derivative 2: \mathrm{d} x
12$ \frac{\mathrm{d} y }{\mathrm{d& ...
LaTeX / Markdown - Norm and Two-way arrow symbol
The Norm: \parallel x \parallel
1$ \parallel x \parallel $
\parallel x \parallel
Two-way arrow: \rightleftharpoons
1$ \rightleftharpoons $
\rightleftharpoons
LaTeX - Add color in equation
In equation environment, we can add color and background color to symbols
color: \$Y = {\color{red}{5}}x\$Y = {\color{red}{5}}x
background color: \$Y = \colorbox{red}{5}x\$Y = \colorbox{red}{5}x
Note: Adding color needs the outermost pair of curly brackets, but adding background color doesn’t need.
LaTeX - Roman Numbers
We can directly type Roman Numbers and Capital Roman Numbers without using any package.
Roman Numbers command: \romannumeral + num
Capital Roman Numbers command: \uppercase\expandafter{\romannumeral + num}
For example
123456789Some Roman Numbers: \romannumeral1, \romannumeral3, \romannumeral6.Some Capital Roman Numbers: \uppercase\expandafter{\romannumeral1}, \uppercase\expandafter{\romannumeral3}, \uppercase\expandafter{\romannumeral6}.
The result
Caps in Markdown and LaTeX
Small CapsAll caps should be in function environment
^ cap: \$\hat{x}\$\hat{x}
~ cap: \$\tilde{x}\$ \tilde{x}
inverted triangle cap 1: \$\check{x}\$ \check{x}
inverted triangle cap 1: \$\breve{x}\$ \breve{x}
tone cap 1: \$\grave{x}\$ \grave{x}
tone cap 2: \$\acute{x}\$ \acute{x}
Big Caps
^ big cap: \$\widehat{abcdefg}\$ \widehat{abcdefg}
~ big cap: \$\widetilde{abcdefg}\$ \widetilde{abcdefg}
Piecewise functions in Markdown and LaTeX
The basic piecewise function in Markdown / LaTeX is using ‘cases’ environment:
12345$$ Function = \begin{cases}Formula1 & Condition1 \\Formula2 & Condition2 \\Formula3 & Condition3 \end{cases}$$
For example:
1234567$$ (T_m,T_n) = \int_{-1}^{1}\frac{T_m(x)T_n(x)}{\sqrt {1-x^{2}}}dx = \begin{cases}0 & if m ≠ n \\\pi & if m = n =0 \\\frac{\pi}{2} & if m = n ≠ 0\end ...
How to type '~' in LaTeX
In LaTeX, ~ is used for other purpose, so it need to be typed in special ways.
We have two ways:
In Text environemnt: \textasciitilde
In Formula environment: $\sim$
Note: the second one is larger than the first one.