Skip to content

Commit

Permalink
TOC: proper rendering of list items with equations
Browse files Browse the repository at this point in the history
  • Loading branch information
deining committed Feb 14, 2025
1 parent 1c1dfd7 commit 570db2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions layouts/partials/scripts/katex.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{{/* load stylesheet and scripts for KaTeX support */ -}}
{{ $katex_css_url := printf "https://cdn.jsdelivr.net/npm/katex@%s/dist/katex%s.css" $version (cond hugo.IsProduction ".min" "") -}}

{{ warnf $katex_css_url }}
{{ with try (resources.GetRemote $katex_css_url) -}}
{{ with .Err -}}
{{ errorf "Could not retrieve KaTeX css file from CDN. Reason: %s." . -}}
Expand All @@ -23,7 +22,7 @@
{{ with .Err -}}
{{ errorf "Could not retrieve KaTeX script from CDN. Reason: %s." . -}}
{{ else with.Value -}}
{{ with resources.Copy (printf "js/katex%s.js" (cond hugo.IsProduction ".min" "")) . }}
{{ with resources.Copy (printf "js/katex%s.js" (cond hugo.IsProduction ".min" "")) . }}
{{ $secureJS := . | resources.Fingerprint "sha512" -}}
<script defer src="{{- .RelPermalink -}}" integrity="{{- $secureJS.Data.Integrity -}}" crossorigin="anonymous" ></script>
{{ end -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ chem: true

Docsy has built-in support for a number of diagram creation and typesetting tools you can use to add rich content to your site, including \(\KaTeX\), Mermaid, Diagrams.net, PlantUML, and MarkMap.

## \(\LaTeX\) support with \(\KaTeX\)
## \\(\\LaTeX\\) support with \\(\\KaTeX\\)

[\(\LaTeX\)](https://www.latex-project.org/) is a high-quality typesetting system for the production of technical and scientific documentation. Due to its excellent math typesetting capabilities, \(\TeX\) became the de facto standard for the communication and publication of scientific documents, especially if these documents contain a lot of mathematical formulae. Designed and mostly written by Donald Knuth, the initial version was released in 1978. Dating back that far, \(\LaTeX\) has `pdf` as its primary output target and is not particularly well suited for producing HTML output for the Web. Fortunately, with [\(\KaTeX\)](https://katex.org/) there exists a fast and easy-to-use JavaScript library for \(\TeX\) math rendering on the web, which was integrated into the Docsy theme.

Expand Down Expand Up @@ -58,7 +58,7 @@ In order to display mathematical formulae and/or chemical equations in your page
This [wiki page](https://en.wikibooks.org/wiki/LaTeX/Mathematics) provides in-depth information about typesetting mathematical formulae using the \(\LaTeX\) typesetting system.
{{% /alert %}}

### \(\LaTeX\) typesetting using standard syntax
### \\(\\LaTeX\\) typesetting using standard syntax

As of Hugo v0.122, \(\LaTeX\) you can enable typesetting in Markdown using the standard syntax. To do so, you need to use of the goldmark `passthrough` extension inside your `hugo.toml`/`hugo.yaml`/`hugo.json`:

Expand Down Expand Up @@ -119,7 +119,7 @@ markup:

You can edit this definition to meet your own needs. For details, see the official [Hugo docs](https://gohugo.io/content-management/mathematics/#step-1).

### Activating and configuring \(\KaTeX\) support
### Activating and configuring \\(\\KaTeX\\) support

#### Auto activation

Expand Down

0 comments on commit 570db2b

Please sign in to comment.