honkit / honkit

:book: HonKit is building beautiful books using Markdown - Fork of GitBook

Home Page:https://honkit.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LaTeX-incompatible input and strict mode is set to 'warn': Unrecognized Unicode character "–" (8211) [unknownSymbol]

YutaroIshihama opened this issue · comments

Summary

I am encountering a Katex plugin error

  • HonKit version: 5.1.4

Step to reproduce

    1. Type $$H_{R}(\omega )={\frac{2}{\pi}}{P}\int_{0}^{\infty}{\frac{\omega^\prime H_{I}(\omega^\prime)}{{\omega^\prime}^{2}-\omega^{2}}}d\omega^\prime$$ and save it in a markdown file

And then, I included this into SUMMARY.md.

I checked the above math can be rendered properly even on Katex online site.

Katex-plugin-github repo. does not have issues.

Expected results

Math parts should be rendered properly.

Actual results

error: error while generating page "optical_constant.md":
Template render error: (D:\Plan\optical_constant.md) [Line 32, Column 118]
  expected variable end
    at Object._prettifyError (D:\Plan\node_modules\nunjucks\src\lib.js:32:11)
    at Template.render (D:\Plan\node_modules\nunjucks\src\environment.js:442:21)
    at Environment.renderString (D:\Plan\node_modules\nunjucks\src\environment.js:313:17)
    at Promise.apply (D:\Plan\node_modules\q\q.js:1185:26)
    at Promise.promise.promiseDispatch (D:\Plan\node_modules\q\q.js:808:41)
    at D:\Plan\node_modules\q\q.js:1411:14
    at runSingle (D:\Plan\node_modules\q\q.js:137:13)
    at flush (D:\Plan\node_modules\q\q.js:125:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
LaTeX-incompatible input and strict mode is set to 'warn': Unrecognized Unicode character "–" (8211) [unknownSymbol]

Please help me.

commented

{{ is conflict to https://honkit.netlify.app/templating/ syntax.

Escaping allow you to ignore any of the special templating tags.

{% raw %}
$$H_{R}(\omega )={\frac{2}{\pi}}{P}\int_{0}^{\infty}{\frac{\omega^\prime H_{I}(\omega^\prime)}{{\omega^\prime}^{2}-\omega^{2}}}d\omega^\prime$$
{% endraw %}

thanks. I found that the Katex plugin dislikes the duplicate use of the hat like\omega^\prime}^{2} so that changing to \omega^{\prime 2} eliminated the error.