MeanderingProgrammer / markdown.nvim

Plugin to improve viewing Markdown files in Neovim
MIT License
504 stars 20 forks source link

bug: LaTeX #47

Closed Kang-geophysics closed 1 week ago

Kang-geophysics commented 2 weeks ago

Neovim version (nvim -v)

0.10.0

Operating system

Windows11

Terminal emulator / GUI

Powershell

Describe the bug

Checkhealth.

Tree-sitter parser status

image

render-markdown

image

Bug

image

Expected behavior

Question.

I installed pylatexenc and latex parser for tree-sitter. As you can see, the checkhealth shows there is no problem. But, the latex equation doesn't work normally. I don't know the meaning of <a1><ee>. I expected the sqrt symbols...

How can I solve this problem?

Thank you for your time.

Sincerely.

Additional information

I use also WSL. It works well under linux. But it doesn't work in Windows 11.

MeanderingProgrammer commented 1 week ago

After spending too long getting a windows setup running I believe this is just due to encoding problems on Windows.

If you get your preferred encoding: https://docs.python.org/3/library/locale.html#locale.getpreferredencoding

python
import locale
locale.getpreferredencoding()

It'll probably give you cp1252, which can only do single byte character encodings. The square root symbol requires 2 I believe.

Following the steps here: https://stackoverflow.com/questions/31469707/changing-the-locale-preferred-encoding-in-python-3-in-windows, and restarting your computer should do the trick.

Control panel -> Clock and Region -> Region -> Administrative
-> Change system locale -> Check Beta: Use Unicode UTF-8 ...

In either case this is just a Windows thing and if this doesn't work it could be anything from the font to some other long forgotten encoding setting.