/home

Using LaTeX to Write Mathematical Equations

Created: Monday 8 July 2024 at 9:00 am

Updated: Monday 8 July 2024 at 9:00 am

A sample file to show how to use LaTeX in CaC.


LaTeX is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. LaTeX is the de facto standard for the communication and publication of scientific documents. LaTeX is available as free software.

LaTeX in CaC

You can use LaTeX to write mathematical equations in CaC, here is some examples of how it works and how is can be used in CaC, you can also read more about LaTeX.

Math Mode

To enter math mode or to write mathematical equations you need to use the following syntax:

$ \text{Inline Equation} $
$$ \text{Display Equation} $$

$$ \begin{equation} \text{Numbered Equation} \end{equation} $$

Inline Equation\text{Inline Equation}
Display Equation\text{Display Equation}

\begin{equation} \text{Numbered Equation} \end{equation}

Quotes

$$ \text{``This is a quote''} $$

“This is a quote”\text{``This is a quote''}

Basic Equations

$ x + x^2 - 3 = 0 $

x+x2−3=0x + x^2 - 3 = 0

Fractions

$ \frac{a}{b} \times \frac{c}{d} = \frac{a \times b}{c \times d}$

ab×cd=a×bc×d \frac{a}{b} \times \frac{c}{d} = \frac{a \times b}{c \times d}

Roots

$ \sqrt{a} \sqrt[3]{a} $

aa3\sqrt{a} \sqrt[3]{a}

Greek Letters

$ \alpha, \beta, \theta, \lambda, \pi, \omega $

α,β,θ,λ,π,ω\alpha, \beta, \theta, \lambda, \pi, \omega

Relations

$ \times \div \pm + -$

×÷±+− \times \div \pm + -

Arrows

$ \leftarrow \rightarrow \uparrow \downarrow \leftrightarrow \Leftarrow \Rightarrow \Uparrow \Downarrow \Leftrightarrow$

←→↑↓↔⇐⇒⇑⇓⇔ \leftarrow \rightarrow \uparrow \downarrow \leftrightarrow \Leftarrow \Rightarrow \Uparrow \Downarrow \Leftrightarrow

Tables

$$
\begin{array}{|c|c|c|}
\hline
\text{Column 1} & \text{Column 2} & \text{Column 3} \\ \hline
\text{Row 1} & \text{Row 1} & \text{Row 1} \\ \hline
\text{Row 2} & \text{Row 2} & \text{Row 2} \\ \hline
\text{Row 3} & \text{Row 3} & \text{Row 3} \\ \hline
\end{array}
$$
Column 1Column 2Column 3Row 1Row 1Row 1Row 2Row 2Row 2Row 3Row 3Row 3\begin{array}{|c|c|c|} \hline \text{Column 1} & \text{Column 2} & \text{Column 3} \\ \hline \text{Row 1} & \text{Row 1} & \text{Row 1} \\ \hline \text{Row 2} & \text{Row 2} & \text{Row 2} \\ \hline \text{Row 3} & \text{Row 3} & \text{Row 3} \\ \hline \end{array}

Matrix

$$
\begin{bmatrix}
a & b \\[0.3em]
c & d
\end{bmatrix}
$$
[abcd]\begin{bmatrix} a & b \\[0.3em] c & d \end{bmatrix}

Some Complex Equations Example

$$ \begin{equation} \frac{d}{dx} \sqrt{x} = \frac{1}{2 \sqrt{x}} \end{equation} $$

$$ \begin{equation} x^2 + 2x + 1 = 0 \end{equation} $$

$$ \begin{equation} \frac{1}{2} \times \frac{1}{2} = \frac{1}{4} \end{equation}$$

$$ \begin{equation} \mathbb{N} = \{ a \in \mathbb{Z} : a > 0 \} \end{equation}$$

$$
\begin{equation}
M =
\begin{bmatrix}
\frac{5}{6} & \frac{1}{6} & 0 \\[0.3em]
\frac{5}{6} & 0 & \frac{1}{6} \\[0.3em]
0 & \frac{5}{6} & \frac{1}{6}
\end{bmatrix}
\end{equation}
$$

\begin{equation} \frac{d}{dx} \sqrt{x} = \frac{1}{2 \sqrt{x}} \end{equation}

\begin{equation} x^2 + 2x + 1 = 0 \end{equation}

\begin{equation} \frac{1}{2} \times \frac{1}{2} = \frac{1}{4} \end{equation}

\begin{equation} \mathbb{N} = \{ a \in \mathbb{Z} : a > 0 \} \end{equation}

M=[561605601605616]\begin{equation} M = \begin{bmatrix} \frac{5}{6} & \frac{1}{6} & 0 \\[0.3em] \frac{5}{6} & 0 & \frac{1}{6} \\[0.3em] 0 & \frac{5}{6} & \frac{1}{6} \end{bmatrix} \end{equation}