Links

Latex and gitbook

A collection of recipes about gitbook and tex friendship 💚

Quantum computing

Brackets

\left\langle \frac{1}{2} \middle| 1 \right\rangle
​
⟨12|1⟩\left\langle \frac{1}{2} \middle| 1 \right\rangle

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,i)╱∣╲Q(2)Q(i2)Q(i)╲∣╱Q\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}

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]
​

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.
​
​

Equations align

\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^\hat\imath \\ \hat\jmath \\ \hat ab \\ \hat{ab}

Matrices

Type 1

​
\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
}
​
​

Limits

\sum_{k=1}^n a_k
​
∑k=1nak\sum_{k=1}^n a_k

References