Dave Pereira
March 7, 2025

Math Typesetting

Posted on March 7, 2025  •  One minute  • 134 words
Table of contents

The theme now supports server side rendering of math equations via hugo’s built-in KaTeX rendering engine. No manual activation is needed, you can start using LaTeX math expressions in your Markdown content right away.

Prerequisites

Please enable and configure the passthrough extension in the Hugo configuration file:

markup:
  goldmark:
    extensions:
      passthrough:
        delimiters:
          block: [['\[', '\]'], ['$$', '$$']]
          inline: [['\(', '\)']]
        enable: true

Examples

Both inline and separate paragraph LaTeX math expressions are supported in the Markdown content.

Inline math

Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\)

will be rendered as:

Inline math: (\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…)

Block math

$$\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }$$

will be rendered as:

$$\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }$$

Supported functions

Note: Use the online reference of Supported TeX Functions and the support table for reference.

Follow me

Alittle about me