2024-05-15

I want to display mathematical formulas with SSG, so I'm having trouble using it in conjunction with the KaTeX plugin.


I want to display mathematical formulas in SSG, so I have installed the KaTeX plugin.

In the case of SSG (honkit) that I use, I want to convert the part to a mathematical formula into

Enclose it in $ (dollar mark) and write the contents in so-called TeX.

In fact, the github site also supports math rendering.

I think it's pretty familiar.

I wanted to mention Excel's built-in functions. What are Excel functions?

I use the dollar mark when I want to keep the cell fixed even if it gets copied and pasted.

I want the dollars to remain dollars inside the code block.

Problems/Errors occurring

For example on the markdown source side

```markdown

=\$A\$2

````

I thought I could escape it by adding a backslash, so that's what I did.

In the case of the SSG that I use, when converted to html,

````

\{% math_inline %}A\{% endmath_inline %}2

````

It will become. _| ̄|○

As for the hosting method, I also store the html files in a GIT repository and host them on the `vercel.app` site. Regarding markdown → html, I do it in the local environment instead of using GitHub Actions.

Things I tried myself

I confirmed that if I use full-width instead of half-width for the dollar, it would not be recognized, so I confirmed that it would work.

But this isn't a fundamental solution, is it?

Also, open the html file and use the batch replacement function to replace `{% math_inline %}` and `{% endmath_inline %}` with dollars. It seems that you need some wisdom to selectively replace only the fence code blocks at once.

Do I have no choice but to ask the plugin author?

https://github.com/zimmem/honkit-plugin-katex

Markdown's fence code block is a guy who repeats backticks three times.

In some cases, the only option is to ask the author to ignore the dollar sign conversion.

Don't you have any hands?

The author of the plugin seems to have stopped development a long time ago.

It seems like they won't be able to respond.

Also, in the case of inline math, it says to surround it with two dollars each, and in the case of block math, it says to surround it with two dollars + a new line, which is different from the normal syntax. I'm curious.

However, it will work even if you write it in the md source using normal syntax.

記事への反応(ブックマークコメント)

ログイン ユーザー登録
ようこそ ゲスト さん