---
title: How to change alignment of  LaTeX equations in Jupyter notebooks
date: "2022-09-11"
topics:
    - data
url: https://www.codymd.com/left-align-latex-equation-in-jupyter-notebook/
---

# How to change alignment of  LaTeX equations in Jupyter notebooks

Math can be inserted into Jupyter notebook markdown cells with LaTeX.

The following works for Jupyter Notebooks in VS Code

### Center align with $$ math blocks

![](https://www.codymd.com/left-align-latex-equation-in-jupyter-notebook/images/image-1.png)

$$
\Large\frac{N(t) - E(t)} {N(t)}
$$

### Left align with $ math blocks

![](https://www.codymd.com/left-align-latex-equation-in-jupyter-notebook/images/image-2.png)

$\Large\frac{N(t) - E(t)} {N(t)}$

### Align on an equals sign with "&=" and an align block

![](https://www.codymd.com/left-align-latex-equation-in-jupyter-notebook/images/image.png)

Use the "&" at the equals sign that you want to align at.  
The "\\ " adds spaces in the LaTeX

<div>
$$
\begin{align*}
let\ \theta &= 1\ x\ n \\
let\ X &= m\ x\ n\ or\ 1\ x\ n \\
z &= X^T\theta \\
sigmoid(z) &= \frac{1}{1 + e^-z} \\
preds &= m\ x\ 1
\end{align*}
$$
</div>

**Hope this was helpful :)**

###
