Math#

Unicode Characters vs LaTeX Commands#

Use UTF-8 unicode characters in narrative text, but LaTeX commands in math environments:

In Narrative Text#

Use UTF-8 unicode characters (α, β, γ, etc.) in all narrative text except when inside LaTeX environments:

The parameter α controls the utility function, and β represents the discount factor.
In economic models, we often see parameters like σ, θ, and ρ.

In LaTeX Math Environments#

Use LaTeX commands (\alpha, \beta, etc.) inside LaTeX environments such as $, $$, and :math::

The utility function is $u(c) = \frac{c^{1-\alpha}}{1-\alpha}$ where $\alpha > 0$.

$$
\max \mathbb{E} \sum_{t=0}^{\infty} \beta^t u(c_t)
$$

The discount factor is {math}`\beta \in (0,1)`.

In Code#

Use UTF-8 unicode characters in variable names and code (see Code Style Guide):

def utility_function(c, α=0.5, β=0.95):
    return (c**(1-α) - 1) / (1-α) * β

Note

This approach ensures proper LaTeX rendering in math environments while maintaining readability in narrative text and code.

Notation#

Use \top(e.g., \(A^\top\)) to represent the transpose of a vector or matrix.

Use \mathbb{1}(\(\mathbb{1}\)) to represent a vector or matrix of ones and explain it in the lecture (e.g., “Let \(\mathbb{1}\) be an \(n \times 1\) vector of ones…”).

Matrices always use square brackets and \begin{bmatrix} ... \end{bmatrix} should be used.

Do not use bold face for either matrices or vectors

Sequences use curly brackets, such as \{ x_t \}_{t=0}^{\infty}

The use of align environments can be done using the \begin{aligned} ... \end{aligned} when inside a math environment such as $$

Tip

PDF:

Using aligned when inside a math environment (such as $$) is important for building pdf output

$$
\begin{aligned}

\end{aligned}
$$

This is because the $$ is already a math environment and causes the LaTeX build to fail when using align due to the issue of multiple math environments.

The LaTeX aligned environment is purpose built for using within math environments.

It is also important to not use \tag in equations for manual equation numbering and instead make use of the in-built equation numbering such as

$$
x_y = 2
$$ (label)

which can be referenced using the role

and here is the reference to {eq}`label`