Series on Blogging with LaTeX

This is the 2nd post in the series. Previous one:

This series shows my first experiences with using the mathematical expressions handling tools provided by WordPress for blogging. They use a version of the LaTeX syntax.

Many of the examples shown here were adapted from the Wikipedia article Displaying a formula, which is actually about formulas in Math Markup.

.

Accents – Diacritics

Examples on how to put accents in mathematical expressions:

\acute{a} \grave{a} \hat{a} \tilde{a} \breve{a}

\acute{a} \grave{a} \hat{a} \tilde{a} \breve{a}

\check{a} \bar{a} \ddot{a} \dot{a}

\check{a} \bar{a} \ddot{a} \dot{a}

x’, y”

x', y''

.

Superscript and subscript

How to display subscripts and superscripts, indexes and exponents:

Subscripts:

  • a_i gives a_i
  • b_{ij} gives b_{ij}
  • C_{m,n} gives C_{m,n}
  • \delta_{j+k} gives \delta_{j+k}

Superscripts:

  • x^y gives x^y
  • a^{j2\pi} gives a^{j2\pi}
  • x^2_3 gives x^2_3
  • C^k_{\mu,\nu} gives C^k_{\mu,\nu}

Composition with preceding indexes: {}_1^2 \Psi_3^4 gives {}_1^2 \Psi_3^4

.

Underlines, overlines and stackings

Includes vectors

\hat a \ \bar b \ \vec c

\hat a \ \bar b \ \vec c

\overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f}

\overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f}

\overline{g h i} \ \underline{j k l}

\overline{g h i} \ \underline{j k l}

\overbrace{ 1+2+\cdots+100 }^{5050}

\overbrace{ 1+2+\cdots+100 }^{5050}

\underbrace{ a+b+\cdots+z }_{26}

\underbrace{ a+b+\cdots+z }_{26}

A \xleftarrow{n+\mu-1} B \xrightarrow[T]{n\pm i-1} C

A \xleftarrow{n+\mu-1} B \xrightarrow[T]{n\pm i-1} C

\overset{\alpha}{\omega} \underset{\mu}{\nu} \overset{\beta}{\underset{\Delta}{\tau}} \stackrel{\zeta}{\eta}

\overset{\alpha}{\omega} \underset{\mu}{\nu} \overset{\beta}{\underset{\Delta}{\tau}}\stackrel{\zeta}{\eta}

.

Sets

Sets operations and related symbols.

\in \ni \notin \varnothing \complement

\in \ni  \notin  \varnothing \complement

\subset \subseteq \subsetneq \supset \supseteq \supsetneq

\subset \subseteq \subsetneq \supset \supseteq \supsetneq

\cap \bigcap \cup \bigcup

\cap \bigcap \cup \bigcup

\ell \mho \Finv \Re \Im \wp

\ell \mho \Finv \Re \Im \wp

Others – examples using the calligraphic font (\cal) and the Greek font for designating sets:

{\cal A} \setminus {\cal B} gives {\cal A} \setminus {\cal B}

\Omega \smallsetminus \omega gives \Omega  \smallsetminus \omega

.

Logic

Logical operators and relations:

\forall \exists \nexists \bar{A} \mid

\forall \exists \nexists \bar{A}  \mid

\And \wedge \vee \neg \to \gets \iff

\And \wedge \vee \neg \to  \gets \iff

\bigwedge \bigvee \diamond \lozenge

\bigwedge \bigvee \diamond \lozenge

\vdash \Vdash \vDash \Vvdash \models \dashv

\vdash \Vdash \vDash \Vvdash \models  \dashv

Examples:

  • \forall p,q \, \exists q \mid \bar{q} \to p gives \forall p,q \, \exists q \mid \bar{q} \to p
  • \bigwedge _{x \in A} gives \bigwedge _{x \in A}
  • \bigwedge \limits _{x \notin A} gives \bigwedge \limits_{x \notin A}
  • \bar{A \vee B} = \bar{A} \wedge \bar{B} gives \bar{A \vee B} = \bar{A} \wedge \bar{B}
  • A \iff B = A \to B \wedge A \gets B gives A \iff B = A \to B \wedge A \gets B
  • \bigcap \limits _{i=1}^n \bigcup \limits _{j=1}^n {\cal B}_{i,j} gives \bigcap \limits _{i=1}^n \bigcup \limits _{j=1}^n {\cal B}_{i,j}

Obs – the statement \limits shown in the examples above puts the indexes exactly above and / or below the symbol. In the first example, \, is used to put an extra space. .

Operators

Several types of operators:

+ \oplus \bigoplus \pm \mp –

+ \oplus \bigoplus \pm \mp -

\times \otimes \bigotimes \cdot \circ \bullet \bigodot

\times \otimes \bigotimes \cdot \circ \bullet \bigodot

\star * / \div \frac{1}{2}

\star * / \div \frac{1}{2}

\sqrt{2} \sqrt[n]{x}

\sqrt{2} \sqrt[n]{x}

\nabla \partial x \dot x \ddot y

\nabla  \partial x  \dot x \ddot y

Examples:

  • \rho = \sqrt{x^2 + y^2} gives \rho = \sqrt{x^2 + y^2}
  • \nabla \phi (x,y) = \frac{\partial \phi}{\partial x} + \frac{\partial \phi}{\partial y} gives \nabla \phi (x,y) = \frac{\partial \phi}{\partial x} +  \frac{\partial \phi}{\partial y}
  • \nabla^2 \phi (x,y) = \frac{\partial^2 \phi}{\partial x^2} + \frac{\partial^2 \phi}{\partial y^2} gives \nabla^2 \phi (x,y) = \frac{\partial^2 \phi}{\partial x^2} +  \frac{\partial^2 \phi}{\partial y^2}
  • \frac{\partial^2 \phi}{\partial x \partial y} = \frac{\partial^2 \phi}{\partial y \partial x} gives \frac{\partial^2 \phi}{\partial x \partial y} = \frac{\partial^2 \phi}{\partial y \partial x}

.

Relations and definitions

To specify relations, mappings and definitions

\sim \approx \simeq \cong \dot =

\sim \approx \simeq \cong \dot =

< > \le \ge \ll \gg

< > \le \ge  \ll \gg

\lessgtr \lesseqgtr \lesseqqgtr

\lessgtr \; \lesseqgtr  \; \lesseqqgtr

\equiv \not\equiv \ne \propto

\equiv \not\equiv \ne  \propto

\mapsto \longmapsto

\mapsto  \; \longmapsto

.

Geometric

Geometric symbols

\circ \bigcirc \Diamond \Box \triangle

\circ \bigcirc \Diamond \Box \triangle

\vartriangle \triangledown \triangleleft \triangleright \vartriangleright \vartriangleleft

\vartriangle \triangledown  \triangleleft \triangleright \vartriangleright \vartriangleleft

\angle \sphericalangle \measuredangle 45^\circ

\angle \sphericalangle \measuredangle 45^\circ

\perp \mid \nmid \| \asymp \parallel

\perp \; \mid \; \nmid \; \|   \; \asymp  \; \parallel

.

Arrows

Some more frequent types of arrows (there are many more – see in Wikipedia article)

\leftarrow \rightarrow \leftrightarrow \Leftarrow \Rightarrow \Leftrightarrow

\leftarrow \rightarrow \leftrightarrow \Leftarrow \Rightarrow \Leftrightarrow

\leftarrow \gets \rightarrow \to \not\to \leftrightarrow \longleftarrow \longrightarrow

\leftarrow \gets \rightarrow \to \not\to \leftrightarrow \longleftarrow \longrightarrow

\rightleftharpoons \leftleftarrows \leftrightarrows \Lleftarrow \leftarrowtail

\rightleftharpoons  \leftleftarrows \leftrightarrows \Lleftarrow \leftarrowtail

\uparrow \downarrow \updownarrow \Uparrow \Downarrow \Updownarrow\uparrow \downarrow \updownarrow \Uparrow \Downarrow \Updownarrow

.

Special symbols

Some special symbols. There are many more in Wikipedia article

\S \P \% \dagger \ddagger \ldots \cdots

\S \P \% \dagger \ddagger \ldots \cdots

\smile \frown \wr \triangleleft \triangleright \infty \bot \top

\smile \frown \wr \triangleleft \triangleright \infty \bot \top

\imath \hbar \jmath \surd \ast \amalg \therefore \backepsilon \sharp

\imath \hbar \jmath \surd \ast \amalg \therefore \backepsilon \sharp

.

Summations, Integrals and Products

Several cases, including limits, sequences and series. Notice in the examples below that when you want to put the limits with the same vertical alignment of the math symbol, you must use the \limits declaration. Otherwise, the limits will be put ahead of the symbol.

\lim \limits_{n \to \infty}x_n

\lim \limits_{n \to \infty}x_n

\lim _{n \to \infty}x_n

\lim _{n \to \infty}x_n

\sum_{k=1}^N k^2

\sum_{k=1}^N k^2

\sum \limits_{k=1}^N k^2

\sum \limits_{k=1}^N k^2

\prod_{i=1}^N x_i

\prod_{i=1}^N x_i

\prod \limits_{i=1}^N x_i

\prod \limits_{i=1}^N x_i

\coprod_{i=1}^N x_i

\coprod_{i=1}^N x_i

\coprod \limits_{i=1}^N x_i

\coprod \limits_{i=1}^N x_i

\int_{-N}^{N} e^x\, dx

\int_{-N}^{N} e^x\, dx

\int \limits_{-N}^{N} e^x\, dx

\int \limits_{-N}^{N} e^x\, dx

\iint_{D}^{W} \, dx\,dy

\iint_{D}^{W} \, dx\,dy

\iiint_{E}^{V} \, dx\,dy\,dz

\iiint_{E}^{V} \, dx\,dy\,dz

\iiiint_{F}^{U} \, dx\,dy\,dz\,dt

\iiiint_{F}^{U} \, dx\,dy\,dz\,dt

\oint_{C} x^3\, dx + 4y^2\, dy

\oint_{C} x^3\, dx + 4y^2\, dy

Obs – the declaration \, in the above integrals puts extra spaces between consecutive letters. See more about alignement on this post : LaTeX – Fine-tunning and some extras.

.

Binomials

Binomials only. For matrices, see next post.

\binom{n}{p} = \frac{n!}{p!(n-p)!}

\binom{n}{p} = \frac{n!}{p!(n-p)!}