File tree 2 files changed +46
-3
lines changed
2 files changed +46
-3
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ $\KaTeX$ is used for rendering LaTeX math expressions. It can be enabled per pag
8
8
9
9
<!-- more-->
10
10
11
- ``` yaml {filename="Markdown "}
11
+ ``` yaml {filename="page.md "}
12
12
---
13
13
title : " My Page with LaTeX"
14
14
math : true
@@ -40,6 +40,43 @@ will be rendered as:
40
40
41
41
$$ F(\omega) = \int_{-\infty}^{\infty} f(t) e^{-j\omega t} \, dt $$
42
42
43
+ > [ !IMPORTANT]
44
+ > Please enable and configure the [ passthrough extension] ( https://gohugo.io/content-management/mathematics/ ) in the Hugo configuration file. It preserves raw content within the delimiters to avoid rendering issues for complex expressions.
45
+
46
+ ``` yaml {filename="hugo.yaml"}
47
+ markup :
48
+ goldmark :
49
+ extensions :
50
+ passthrough :
51
+ delimiters :
52
+ block : [['\[', '\]'], ['$$', '$$']]
53
+ inline : [['\(', '\)']]
54
+ enable : true
55
+ ` ` `
56
+
57
+ For example, using the aligned environment:
58
+
59
+ ` ` ` latex {filename="page.md"}
60
+ $$
61
+ \begin{aligned}
62
+ \nabla \cdot \mathbf{E} &= \frac{\rho}{\varepsilon_0} \\
63
+ \nabla \cdot \mathbf{B} &= 0 \\
64
+ \nabla \times \mathbf{E} &= -\frac{\partial \mathbf{B}}{\partial t} \\
65
+ \nabla \times \mathbf{B} &= \mu_0 \left( \mathbf{J} + \varepsilon_0 \frac{\partial \mathbf{E}}{\partial t} \right)
66
+ \end{aligned}
67
+ $$
68
+ ```
69
+
70
+ will be rendered as:
71
+
72
+ $$
73
+ \begin{aligned}
74
+ \nabla \cdot \mathbf{E} &= \frac{\rho}{\varepsilon_0} \\
75
+ \nabla \cdot \mathbf{B} &= 0 \\
76
+ \nabla \times \mathbf{E} &= -\frac{\partial \mathbf{B}}{\partial t} \\
77
+ \nabla \times \mathbf{B} &= \mu_0 \left( \mathbf{J} + \varepsilon_0 \frac{\partial \mathbf{E}}{\partial t} \right)
78
+ \end{aligned}
79
+ $$
43
80
44
81
## Supported Functions
45
82
Original file line number Diff line number Diff line change @@ -44,11 +44,17 @@ module:
44
44
- path : github.com/imfing/hextra
45
45
46
46
markup :
47
+ highlight :
48
+ noClasses : false
47
49
goldmark :
48
50
renderer :
49
51
unsafe : true
50
- highlight :
51
- noClasses : false
52
+ extensions :
53
+ passthrough :
54
+ delimiters :
55
+ block : [['\[', '\]'], ['$$', '$$']]
56
+ inline : [['\(', '\)']]
57
+ enable : true
52
58
53
59
enableInlineShortcodes : true
54
60
You can’t perform that action at this time.
0 commit comments