0%

LaTex Notes

Here are some notes I find useful for using LaTex

  1. Force limits to the top and bottom side of inline sum : \(\sum\limits_{i=1}^{N} i\), use \sum\limits instead of \sum alone.
  2. Force limits to the top and bottom side of inline integral : \(\int \limits_{x=1}^{3} xdx\), use \int\limits instead of \int alone.
  3. Hat:
    1. Fitted value: \(\hat{y}\), use \hat{}
    2. Widehat: \(\widehat{\nabla f }\), use \widehat{}
  4. Italic: \(\mathcal{L}\), it only works for upper-case letters, use \mathcal{}
  5. Underset: \(\underset{x}{argmin}\), use \underset{x}{formula}
  6. Gradient: \(\nabla f\), use \nabla
  7. Field representation: the complex field \(\mathbb{C}\), the real field \(\mathbb{R}\), use \mathbb{}
  8. Logical operator
    • P and Q: \(P \land Q\), \land
    • P or Q: \(P \lor Q\), \lor
    • not P: \(\neg P\), \neg, or \(\bar{P}\), \bar{P}
    • P xor Q: \(p \oplus Q\), \oplus
    • if P then Q: \(P \rightarrow Q\), \rightarrow
    • P iff Q: \(P \leftrightarrow Q\), \leftrightarrow
  9. Set notation
    • \(\mathbb{R}\), \mathbb{R}
    • \(a \in A\): a \in A
    • \(a \notin A\): a \notin A
    • \(\emptyset\): \emptyset
    • \(A \cap B\): \cap
    • \(A \cup B\): \cup
    • \(\mathcal{P}(A)\) \mathcal{P} (power set)
    • \(A \times B\): \times
    • \(A \setminus B\): \setminus
    • \(A \subseteq B\): \subseteq
    • \(A \subset B\): \subset
    • \(\bigcup\limits_{i=1}^{n}\): \bigcup\limits_{i=1}^{n}
    • \(\bigcap\limits_{i=1}^{n}\): \bigcap\limits_{i=1}^{n}
  10. Make equation smaller: \scriptstyle
  11. Isomorphism and approximate equality
  • \(G_1 \cong G_2\): \cong
  • \(a \approx b\): \approx
  • \(a \approxeq b\): \approxeq
  1. Add label to equation: \tag{N}
  2. How to write text inside equation: \text{text}
  3. Multline equations \[\begin{align*} a &= b \\ &= c \\ &= d \end{align*}\]

allign* has no equation label, align has equation label, use &= to align equations marks, use \ \ to separate lines

  1. function composition \(g \circ f\), \circ
  2. multinomial coefficient: \(\binom{n}{k_1,k_1,\dots,k_m} = \frac{n!}{k_1 ! k_2 !\dots k_m !}\), \binom {n}{k_1,k_1,\dots,k_m}, use binom{}{} for combinations
  3. Multi conditions in summation: \(\sum\limits_{\substack{i=0 \\ i\neq j}}^{n}a_i\), \substack{i=0 \ \ i \neq j}, use substack{} for multi conditions, use \\to separate the lines
  4. Arrows
    • \(\leftarrow\) \leftarrow, \(\Leftarrow\) \Leftarrow
    • \(\longleftarrow\) \longleftarrow, \(\Longrightarrow\) \Longrightarrow
    • \(\rightarrow\) \rightarrow, \(\Rightarrow\) \Rightarrow
    • \(\longrightarrow\) \longrightarrow, \(\Longrightarrow\) \Longrightarrow
    • \(\leftrightarrow\) \leftrightarrow, \(\Leftrightarrow\) \Leftrightarrow
    • \(\longleftrightarrow\) \longleftrightarrow, \(\Longleftrightarrow\) \Longleftrightarrow
  5. The does not prove sign (appeared in Gödel's incompleteness theorems)
    • \(\nvdash\) \nvdash
    • \(\not\vdash\) \not\vdash