Katex Boxed Equations

Goal To render a bordered box with multiple equations. Background My previous article about dot products contains some boxed math expressions: some are inline and some take up the whole line. For inline math, that’s simple: either $\fbox{text}$ or $\boxed{a=1}$ will do. For displayed math, these two KaTeX commands will ignore the newline command \\. Solution A simple Google search ‘“katex” AND “box”’ saved the day. It led me to this relevant Stack Overflow question, whose accepted answer suggested the use of custom CSS. [Read More]
KaTeX  CSS 

Improved Integration of Hugo and $\KaTeX$

Problem There’s no custom $\KaTeX$ macro in local preview since I’ve merged some recent commits from the upstream of this blog’s theme, in particular, Beautiful Hugo’s pull requests #246 and #255, which allowed self-hosting the theme’s static JS, CSS and font files. This self-hosted option is particularly useful in case of slow response from Cloudflare’s CDN. Even they do appear on the public GitLab site, the final rendered Markdown + $\TeX$ code would be succumb to syntax errors due to their absence in the preview process. [Read More]
KaTeX  Mmark  Hugo 

Custom $\KaTeX$ Macros

More efficient math editing

Background Same as the last section in Beautiful Hugo Improvements. Goal To write math efficiently by automatically loading longer code with shorter macro code. For example, when I wrote Some Infinite Cardinality Identities, it would be ten times more quicker and efficient to type \card{C} than to write \mathop{\mathrm{card}}(C) all the time. Changes committed to my repo The current version of Beautiful Hugo is still using $\KaTeX$┬áv0.7, which doesn’t support macros in auto-rendering. [Read More]
Hugo  KaTeX  math