lzanini / mdbook-katex

A preprocessor for mdBook, rendering LaTex equations to HTML at build time.
MIT License
205 stars 34 forks source link

`\\` line separators invalid in matrix environments #106

Closed Dewedseed closed 9 months ago

Dewedseed commented 9 months ago

Hello. I got a issue when using some matrix environment (matrix pmatrix bmatrix vmatrix etc.) The \\ line separators seems to be invalid.

For example:

$$\begin{pmatrix}
   a & b & c \\
   c & d & e \\
\end{pmatrix}$$

Rendering result: (a b c c d e)

And \cr does work but i have to make a lot of modifications. Is there any way to solve this problem? I will be grateful for your reply.

SichangHe commented 9 months ago

What I get:

image

Could you provide OS, versions, how you got mdBook-KaTeX?

Dewedseed commented 9 months ago

I used the Windows OS and got it from Github. Here is the version information:

I added the path of .exe files to the environment variable and then created a simplest book by commands mdbook init and mdbook serve --open.

[book]
authors = []
language = "en"
multilingual = false
src = "src"
title = "testbook"

[output.html]
mathjax-support = true

[preprocessor.katex]
after = ["links"]
# Chapter 1

$$\begin{pmatrix}
   a & b & c \\
   c & d & e \\
\end{pmatrix}$$

What I get in Microsoft Edge:

katex

It also doesn't work when copying the .exe files to the path. Is there anything wrong with my computer :sob:

SichangHe commented 9 months ago

Could you please read this: https://github.com/lzanini/mdbook-katex?tab=readme-ov-file#windows-users

Dewedseed commented 9 months ago

Oh, I didn't notice this and made the mistake. I used to think that mdbook-katex needed to use the same version as mdbook.
Thank you very much! 💓

SichangHe commented 9 months ago

Ah, no, the problem is that you should use the GNU build.

Dewedseed commented 9 months ago

Yes, it does work normally now. Thank you again for your help.

katex

SichangHe commented 9 months ago

You're welcome.