KaTeX on Solarized Sublime Sekai
https://vincenttam.gitlab.io/tags/katex/
Recent content in KaTeX on Solarized Sublime SekaiHugo -- gohugo.ioenTue, 18 Oct 2022 13:46:01 +0200Showdown KaTeX With mhchem
https://vincenttam.gitlab.io/post/2022-10-18-showdown-katex-with-mhchem/
Tue, 18 Oct 2022 13:46:01 +0200https://vincenttam.gitlab.io/post/2022-10-18-showdown-katex-with-mhchem/Background I’ve written about bringing user-defined KaTeX macros into Hugo a few years ago. Looking back, I realized that I only knew how to copy code at that time.
Goal To replace the current code for my math editor with Showdown-KaTeX. To bring mhchem into my LaTeX + Markdown sandbox. Motivation To get the benefits of the three free (as in “freedom”) technologies.
Markdown syntax is (much) simple(r than its LaTeX equivalent, especially for tables, ordered/unordered lists, etc).Katex Boxed Equations
https://vincenttam.gitlab.io/post/2022-09-07-katex-boxed-equations/
Wed, 07 Sep 2022 01:39:20 +0200https://vincenttam.gitlab.io/post/2022-09-07-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.Improved Integration of Hugo and $\KaTeX$
https://vincenttam.gitlab.io/post/2019-04-29-improved-integration-of-hugo-and-katex/
Mon, 29 Apr 2019 09:48:32 +0200https://vincenttam.gitlab.io/post/2019-04-29-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.Custom $\KaTeX$ Macros
https://vincenttam.gitlab.io/post/2018-09-27-custom-katex-macros/
Thu, 27 Sep 2018 19:32:58 +0200https://vincenttam.gitlab.io/post/2018-09-27-custom-katex-macros/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.