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

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

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