Make math equations in Obidian bigger
Tags: katex, mathjax, obsidian, equation
Published: 2024-03-20 04:49:23

I find that math equations in Obsidian are too small to see clearly.

Here are the solutions,

## Change `\frac` to `\dfrac`
"d" means "display"

```
This is a inline fraction $\frac{x^2-3x+2}{x^2-1}$ in the middle
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w9hz9b3d49q78r68bfwz.png)


```
This is a inline fraction $\dfrac{x^2-3x+2}{x^2-1}$ in the middle
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3xdh1ezsq691lw1ntlej.png)

## Change `\binom` to `\dbinom`

```
This is a inline binomial $\binom{n}{m}$ in the middle
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5byroostb5y64q0cgwjw.png)

```
This is a inline binomial $\dbinom{n}{m}$ in the middle
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e06f8vwmyztn3yj5xwym.png)

## General method (applicable to all functions)
Just add `\displaystyle` to the front of each function

note: it's also ok to add `\displaystyle` to `\frac` or `\binom`.
The effect of `\displaystyle\frac` equals to `\drac`
The effect of `\displaystyle\binom` equals to `\dbinom`

1. 
```
This is a inline sum $\sum_{k=1}^n \frac{1}{k+\frac{1}{k + \frac{1}{k}}}$ in the middle
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8y2g2wqak17zu0hnxm25.png)


2. Add `\displaystyle` before `\sum`
```
This is a inline sum $\displaystyle \sum_{k=1}^n \frac{1}{k+\frac{1}{k + \frac{1}{k}}}$ in the middle
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rjflgn1tuxm6pja6bmpj.png)

3. Add `\displaystyle` before `\sum` and change each `\frac` to `dfrac`


```
This is a inline sum $\displaystyle\sum_{k=1}^n \dfrac{1}{k+\dfrac{1}{k + \dfrac{1}{k}}}$ in the middle
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5fhx2qow35w45eemj521.png)

## Edit CSS snippet
```css
mjx-math {
  font-size: 140% !important;
}
```

## Make it even bigger
Use `\Huge`, `\huge`, `\LARGE`, `\Large` or `\large` in front  of the function that you want to enlarge.

```
This is a inline binomial $\huge \dbinom{n}{m}$ in the middle
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gr13gnb8dpc6jrrgthm9.png)

Note:
Obsidian use MathJax to display math equations.
You can see [MathJax - Supported TeX/LaTeX commands](https://docs.mathjax.org/en/latest/input/tex/macros/index.html) for more information.

Katex's syntax is very similar, the above methods apply to Katex too. 


ref:


- [MathJax - Supported TeX/LaTeX commands](https://docs.mathjax.org/en/latest/input/tex/macros/index.html)
- [KaTex - Supported Functions](https://katex.org/docs/supported)
- [KaTex - Options](https://katex.org/docs/options.html)

- [stack overflow - LaTeX: How to adjust how the Sum symbol turns out](https://stackoverflow.com/questions/1471023/latex-how-to-adjust-how-the-sum-symbol-turns-out)
- [reddit - Increase font size of mathematical and/or chemical formula?](https://www.reddit.com/r/ObsidianMD/comments/zzuna0/increase_font_size_of_mathematical_andor_chemical/)
- [reddit - Any way to increase the size of LaTex expression](https://www.reddit.com/r/ObsidianMD/comments/qo2ayx/any_way_to_increase_the_size_of_latex_expression/)