File tree Expand file tree Collapse file tree 2 files changed +46
-3
lines changed
Expand file tree Collapse file tree 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
88
99<!-- more-->
1010
11- ``` yaml {filename="Markdown "}
11+ ``` yaml {filename="page.md "}
1212---
1313title : " My Page with LaTeX"
1414math : true
@@ -40,6 +40,43 @@ will be rendered as:
4040
4141$$ F(\omega) = \int_{-\infty}^{\infty} f(t) e^{-j\omega t} \, dt $$
4242
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+ $$
4380
4481## Supported Functions
4582
Original file line number Diff line number Diff line change @@ -44,11 +44,17 @@ module:
4444 - path : github.com/imfing/hextra
4545
4646markup :
47+ highlight :
48+ noClasses : false
4749 goldmark :
4850 renderer :
4951 unsafe : true
50- highlight :
51- noClasses : false
52+ extensions :
53+ passthrough :
54+ delimiters :
55+ block : [['\[', '\]'], ['$$', '$$']]
56+ inline : [['\(', '\)']]
57+ enable : true
5258
5359enableInlineShortcodes : true
5460
You can’t perform that action at this time.
0 commit comments