hugo-theme-minima/exampleSite/content/math-typesetting.md

44 lines
988 B
Markdown
Raw Normal View History

2021-07-18 10:34:01 +02:00
---
2022-11-10 08:09:45 +01:00
author: Mivinci
2021-07-18 10:34:01 +02:00
title: Math Typesetting
date: 2021-07-18T10:52:59+08:00
2022-11-10 08:09:45 +01:00
description: A brief guide to write mathematical notation.
2021-07-18 10:34:01 +02:00
math: true
2022-11-09 09:03:19 +01:00
tags:
- KaTex
2021-07-18 10:34:01 +02:00
---
2022-11-10 08:09:45 +01:00
Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries like [KaTeX](https://katex.org) the one that Minima uses. Here's what you can do in the configuration file to enable it.
2021-11-27 06:48:40 +01:00
2022-11-10 08:09:45 +01:00
```
math:
enable: false
provider: katex
2021-07-18 10:34:01 +02:00
```
2022-11-10 08:09:45 +01:00
## Examples
2021-07-18 10:34:01 +02:00
2022-11-10 08:09:45 +01:00
The following are some examples of mathematical notations with KaTeX that are pretty much like LaTeX's.
2021-07-18 10:34:01 +02:00
2022-11-10 08:09:45 +01:00
### Block
2021-11-27 06:48:40 +01:00
2022-11-10 08:09:45 +01:00
```
\varphi = 1+\frac{1}{1+\frac{1}{1+\frac{1} {1+\cdots}}}
```
2021-11-27 06:48:40 +01:00
2022-11-10 08:09:45 +01:00
wiil be rendered as:
2021-07-18 10:34:01 +02:00
2022-11-10 08:09:45 +01:00
$$
\varphi = 1+\frac{1}{1+\frac{1}{1+\frac{1} {1+\cdots}}}
$$
### Inline
2021-07-18 10:34:01 +02:00
2022-11-10 08:09:45 +01:00
```
Pythagorean theorem can be written as $a^2+b^2=c^2$ where *a*, *b* and *c* are the length of legs of a triangle.
```
2021-11-27 06:48:40 +01:00
2022-11-10 08:09:45 +01:00
will be rendered as:
2021-07-18 10:34:01 +02:00
2022-11-10 08:09:45 +01:00
Pythagorean theorem can be written as $a^2+b^2=c^2$ where *a*, *b* and *c* are the length of legs of a triangle.