Conditional Batch File Editing

Adopted Mmark for Math Posts

Problem

During the adoption of Mmark for math posts on this blog, I had to insert markup: mmark at the last line of front matter of the source file of each math post.

Seek help

I separated this into two SO questions

  1. Sed conditional match and execute command with offset, and
  2. A question about AWK multiple line recognition.

Solution

From #1., I learnt the use of variables in AWK scripts. From #2, some users explained how these variables can be used for multi-line regex search.

[Read More]
awk  sed  Mmark 

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.

hugo local preview no KaTeX macro

public Hugo blog KaTeX auto-renderer error

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