Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions docs/how-to/use-relearn-theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ categories:
- how-to
date: 2025-12-15T00:00:00Z
description: Relearn theme overview
fingerprint: cad2b47a3afbbaf3e8f319d590ab1cf4d438535b3359485a2f8ca82a61db435e
lastmod: "2026-01-22"
fingerprint: 39f4157cdb927c0f651edabb9972670c6f58507b3f9bc8ec6d8e6e5f77d4ecaf
lastmod: "2026-06-12"
tags:
- themes
- relearn
Expand Down Expand Up @@ -275,6 +275,29 @@ DocBuilder automatically configures these defaults for Relearn:

All defaults can be overridden in your configuration's `hugo.params` section.

## Math Support

Relearn renders mathematical notation through MathJax. DocBuilder wires up the standard delimiter pairs so the following forms all work out of the box:

| Form | Type | Example |
|------|------|---------|
| `$x + y$` | inline | The sum $x + y$ is positive. |
| `\(x + y\)` | inline | The sum \(x + y\) is positive. |
| `$$x + y$$` | display (block) | $$x + y$$ |
| `\[x + y\]` | display (block) | \[x + y\] |

### Escaping literal `$` characters

The `$...$` form is recognised as math whenever a paired `$` is found, so prose that contains a `$` character (currency, shell variables, etc.) will be misread as math. Escape a literal `$` with a backslash when it is **not** meant to start a math span:

```markdown
It costs \$5 and \$10.

Use \$HOME or \$TMPDIR for paths.
```

If you cannot escape at the source (for example, the `$` appears inside a code-incompatible position), wrap the text in inline code with backticks (`` `$HOME` ``).

## Hugo Module Configuration

DocBuilder uses Hugo Modules to automatically install Relearn. The theme is configured as:
Expand Down
2 changes: 1 addition & 1 deletion internal/hugo/models/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (rc *RootConfig) EnableMathPassthrough() {
ext["passthrough"] = map[string]any{
"delimiters": map[string]any{
"block": [][]string{{"\\[", "\\]"}, {"$$", "$$"}},
"inline": [][]string{{"\\(", "\\)"}},
"inline": [][]string{{"\\(", "\\)"}, {"$", "$"}},
},
"enable": true,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/golden/cross-repo-links/hugo-config.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/golden/deep-nesting/hugo-config.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/golden/image-paths/hugo-config.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/golden/menu-generation/hugo-config.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/golden/only-readme/hugo-config.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/golden/section-indexes/hugo-config.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/golden/sidebar-group-by/hugo-config.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/golden/special-chars/hugo-config.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/golden/two-repos/hugo-config.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/golden/unicode-names/hugo-config.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ markup:
inline:
- - \(
- \)
- - $
- $
enable: true
parser:
attribute:
Expand Down
Loading