Latex and gitbook
A collection of recipes about gitbook and tex friendship š
Quantum computing
Brackets
\left\langle \frac{1}{2} \middle| 1 \right\rangle
āØ21āā1ā©
Diagrams
\begin{matrix}
&& \Bbb Q(\sqrt{2},i) & \\
&\huge\diagup & \huge| & \huge\diagdown \\
\Bbb Q(\sqrt{2}) & & \Bbb Q(i\sqrt{2})& & \Bbb Q(i)\\
&\huge\diagdown & \huge| & \huge\diagup \\
&&\Bbb Q
\end{matrix}
Q(2ā)āā±ā²āQ(2ā,i)ā£Q(i2ā)ā£Qāā²ā±āQ(i)ā
Mathematics
Fractions and brackets
\left( \begin{array}{cc} 2\tau & 7\phi-frac5{12} \\
3\psi & \frac{\pi}8 \end{array} \right)
\left( \begin{array}{c} x \\ y \end{array} \right)
\mbox{~and~} \left[ \begin{array}{cc|r}
3 & 4 & 5 \\ 1 & 3 & 729 \end{array} \right]
\left( \begin{array}{cc} 2\tau & 7\phi-frac5{12} \\ 3\psi & \frac{\pi}8 \end{array} \right) \left( \begin{array}{c} x \\ y \end{array} \right) \mbox{~and~} \left[ \begin{array}{cc|r} 3 & 4 & 5 \\ 1 & 3 & 729 \end{array} \right]
Function definition
f(z) = \left\{ \begin{array}{rcl}
\overline{\overline{z^2}+\cos z} & \mbox{for}
& |z|<3 \\ 0 & \mbox{for} & 3\leq|z|\leq5 \\
\sin\overline{z} & \mbox{for} & |z|>5
\end{array}\right.
f(z) = \left\{ \begin{array}{rcl} \overline{\overline{z^2}+\cos z} & \mbox{for} & |z|<3 \\ 0 & \mbox{for} & 3\leq|z|\leq5 \\ \sin\overline{z} & \mbox{for} & |z|>5 \end{array}\right.
Equations align
\eqalign{
(a+b)^2 &= (a+b)(a+b) \\
&= a^2 + ab + ba + b^2 \\
&= a^2 + 2ab + b^2
}
\eqalign{ (a+b)^2 &= (a+b)(a+b) \\ &= a^2 + ab + ba + b^2 \\ &= a^2 + 2ab + b^2 }
Hat
\hat\imath
\hat\jmath
\hat ab
\hat{ab}
ī±^ī·^āa^bab^
Matrices
Type 1
\begin{matrix}
\hline
x_{11} & x_{12} \\
x_{21} & x_{22} \strut \\
\hdashline
x_{31} & x_{32} \strut
\end{matrix}
\begin{matrix} \hline x_{11} & x_{12} \\ x_{21} & x_{22} \strut \\ \hdashline x_{31} & x_{32} \strut \end{matrix}
Type 2
A = \pmatrix{
a_{11} & a_{12} & \ldots & a_{1n} \cr
a_{21} & a_{22} & \ldots & a_{2n} \cr
\vdots & \vdots & \ddots & \vdots \cr
a_{m1} & a_{m2} & \ldots & a_{mn} \cr
}
A = \pmatrix{ a_{11} & a_{12} & \ldots & a_{1n} \cr a_{21} & a_{22} & \ldots & a_{2n} \cr \vdots & \vdots & \ddots & \vdots \cr a_{m1} & a_{m2} & \ldots & a_{mn} \cr }
Limits
āk=1nāakā
References
A complete list is available at https://www.onemathematicalcat.org/MathJaxDocumentation/TeXSyntax.htm