Thursday, July 03, 2008

Stack math symbols in Latex

When typing in formulas in Latex, sometimes we need to stack math symbols, especially with arrows. Here are some examples that show how to achieve this goal.
  1. Using \xleftarrow or \xrightarrow. Both of them have the same syntax.
    a=b \xleftarrow[H]{\xi+a\timesc} f=g

    a=b \xleftarrow[H]{\xi+a\timesc} f=g
  2. Using \overset
    a=b\overset{F}{\longleftarrow}c=d

    a=b\overset{F}{\longleftarrow}c=d
  3. Using \underset
    a=b\underset{F}{\longleftarrow}c=d


  4. Using \stackrel
    a=b \stackrel{F}{\longleftrightarrow}c=d

    a=b \stackrel{F}{\longleftrightarrow}c=d
  5. Using \mathop
    ab \mathop{\sum\sum\sum}_{a=\frac{1}{2}\times 100000}^{b=\frac{4}{5}}cd

    ab \mathop{\sum\sum\sum}_{a=\frac{1}{2}\times 100000}^{b=\frac{4}{5}}cd
Chinese version:Latex: 堆叠数学符号