I migrated my blog from Jekyll to Hugo, mainly because I have no experience with Ruby and don’t have the time to stay up to date with another language and framework.

I did most of the migration in a mega-commit.

I went with the Hugo-Coder theme, only making one minor tweak for the width of content:

 .container {
   margin: 1rem auto;

   max-width: 120rem; /* max-width: 90rem; */
 }

I only had one issue with LaTeX equations, which I reported in this issue: Single equal symbol is parsed as a Markdown header inside a $$ block. #17.

The maths block

$$
P
=
Q
$$

unexpectedly renders to

<h1>$$
P</h1>
<p>Q
$$</p>

because the P is interpreted as a header due to the equals sign on the following line. This seems to be a quirk of the Goldmark parser, which runs “block” parsers first.

One workaround is to indent the = by four spaces:

$$
P
    =
Q
$$

which renders as:

$$ P = Q $$

Another option is to use empty braces {} which are like a no-op in LaTeX:

$$
P
{}=
Q
$$

This renders as expected:

$$ P {}= Q $$

Yet another option is to use an align* environment:

$$
\begin{align*}
P
&=
Q
\end{align*}
$$

which renders as:

$$ \begin{align*} P &= Q \end{align*} $$

This is all about avoiding the = being interpreted as a Markdown header block.

In my case, $P$ and $Q$ were large matrices in the post Knight on a chess board.

For anyone that comes across this, I’m using KaTeX

[params]
katex = true
math = true