Skip to content

Commit 5040dc5

Browse files
Rhythm PatelRhythm Patel
authored andcommitted
Add MathJax support for rendering mathematical equations in documentation
- Add pymdownx.arithmatex extension to enable LaTeX-style math processing - Include MathJax 3 CDN scripts for client-side equation rendering - Update r.gwflow.md as example with properly formatted LaTeX equations This enables proper rendering of mathematical equations in MkDocs documentation using standard LaTeX syntax ($...$ for inline, $$...$$ for display equations). Fixes issue where equations were not rendering correctly in documentation pages.
1 parent 7ad4664 commit 5040dc5

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

man/mkdocs/mkdocs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ hooks:
7878
extra_css:
7979
- grassdocs.css
8080

81+
# MathJax configuration
82+
extra_javascript:
83+
- https://polyfill.io/v3/polyfill.min.js?features=es6
84+
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
85+
8186
# Plugins
8287
plugins:
8388
- search
@@ -115,6 +120,8 @@ markdown_extensions:
115120
format: !!python/name:pymdownx.superfences.fence_code_format
116121
- pymdownx.tabbed:
117122
alternate_style: true
123+
- pymdownx.arithmatex:
124+
generic: true
118125

119126
# Navigation
120127
nav:

raster/r.gwflow/r.gwflow.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,28 @@ indicator of the quality of the numerical result.
3030

3131
The groundwater flow calculation is based on Darcy's law and a numerical
3232
implicit finite volume discretization. The discretization results in a
33-
symmetric and positive definite linear equation system in form of *Ax =
34-
b*, which must be solved. The groundwater flow partial differential
33+
symmetric and positive definite linear equation system in form of $Ax =
34+
b$, which must be solved. The groundwater flow partial differential
3535
equation is of the following form:
3636

37-
(dh/dt)\*S = div (K grad h) + q
37+
$$
38+
\frac{dh}{dt} \cdot S = \text{div}(K \nabla h) + q
39+
$$
3840

3941
In detail for 2 dimensions:
4042

41-
(dh/dt)\*S = Kxx \* (d^2h/dx^2) + Kyy \* (d^2h/dy^2) + q
43+
$$
44+
\frac{dh}{dt} \cdot S = K_{xx} \frac{\partial^2 h}{\partial x^2} + K_{yy} \frac{\partial^2 h}{\partial y^2} + q
45+
$$
4246

43-
- h -- the piezometric head im \[m\]
44-
- dt -- the time step for transient calculation in \[s\]
45-
- S -- the specific storage \[1/m\]
46-
- Kxx -- the hydraulic conductivity tensor part in x direction in
47-
\[m/s\]
48-
- Kyy -- the hydraulic conductivity tensor part in y direction in
49-
\[m/s\]
50-
- q - inner source/sink in meter per second \[1/s\]
47+
- $h$ -- the piezometric head in [m]
48+
- $dt$ -- the time step for transient calculation in [s]
49+
- $S$ -- the specific storage [1/m]
50+
- $K_{xx}$ -- the hydraulic conductivity tensor part in x direction in
51+
[m/s]
52+
- $K_{yy}$ -- the hydraulic conductivity tensor part in y direction in
53+
[m/s]
54+
- $q$ -- inner source/sink in meter per second [1/s]
5155

5256
Confined and unconfined groundwater flow is supported. Be aware that the
5357
storativity input parameter is handled differently in case of unconfined
@@ -75,7 +79,7 @@ Additionally the linear equation system will be allocated, so the memory
7579
consumption of this module rapidely grow with the size of the input
7680
maps.
7781

78-
The resulting linear equation system *Ax = b* can be solved with several
82+
The resulting linear equation system $Ax = b$ can be solved with several
7983
solvers. An iterative solvers with sparse and quadratic matrices support
8084
is implemented. The conjugate gradients method with (pcg) and without
8185
(cg) precondition. Additionally a direct Cholesky solver is available.

0 commit comments

Comments
 (0)