Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error]: LaTeX-incompatible input and strict mode is set to 'warn': Unicode text character "键" used in math mode [unicodeTextInMathMode] #15

Closed
hexh250786313 opened this issue Jul 5, 2022 · 4 comments
Labels
bug Something isn't working question Further information is requested

Comments

@hexh250786313
Copy link

Description

Coc.nvim throws error when the markdown file exists string $键$ in hosting coc-markdown-preview-enhanced. It seems be relative to LaTeX's keyword. Error messages like this:

[coc.nvim]: LaTeX-incompatible input and strict mode is set to 'warn': Unicode text character "键" used in math mode [unicodeTextInMathMode]

Actually my words are $mod 键和 $sup 键 and $键$ is the shortest string to reproduce.

Reproduce

  1. Edit a markdown file and input $键$
  2. Call :CocCommand markdown-preview-enhanced.openPreview

CocInfo

## versions

vim version: NVIM v0.8.0-dev
node version: v16.10.0
coc.nvim version: 0.0.81-2522eee5 2022-06-14 19:03:29 +0800
coc.nvim directory: /home/hexh/.local/share/nvim/site/pack/packer/start/coc.nvim
term: tmux
platform: linux

## Log of coc.nvim

2022-07-05T17:21:18.394 INFO (pid:221353) [@hexuhua/coc-git] - Looking for git in: git
2022-07-05T17:21:18.484 INFO (pid:221353) [services] - registered service "eslint"
2022-07-05T17:21:18.485 INFO (pid:221353) [services] - ESLint state change: stopped => starting
2022-07-05T17:21:19.113 INFO (pid:221353) [plugin] - coc.nvim initialized with node: v16.10.0 after 897ms
2022-07-05T17:21:19.179 INFO (pid:221353) [core-watchman] - watchman watching project: /home/hexh/desktop
2022-07-05T17:21:19.251 INFO (pid:221353) [services] - ESLint state change: starting => running
2022-07-05T17:21:19.258 INFO (pid:221353) [services] - service eslint started
2022-07-05T17:21:20.463 INFO (pid:221353) [attach] - Request action: commandList [
  'markdown-preview-enhanced.openPreview',
  'CocCommand markdown-preview-enhanced.openPreview',
  48
]
2022-07-05T17:21:21.282 INFO (pid:221353) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.openPreview' ]
2022-07-05T17:21:26.468 INFO (pid:221353) [attach] - receive notification: showInfo []
@hexh250786313 hexh250786313 added the bug Something isn't working label Jul 5, 2022
@hexh250786313
Copy link
Author

@weirongxu I found coc throws error when not only use word but any chinese word or Emoji between two $. Like $😈 小恶魔$. It means that it just can not translate some unicode characters between $.

@weirongxu
Copy link
Owner

Change your katex configuration via:
:CocCommand markdown-preview-enhanced.openKaTeXConfig

katex_config.js

module.exports = {
  strict: false,
  ...
}

@weirongxu weirongxu added the question Further information is requested label Jul 7, 2022
@hexh250786313
Copy link
Author

@weirongxu THX!

@hexh250786313
Copy link
Author

By the way, anyone can use \$your words\$ to show the $ symbol when you have a format like $your words$. By default, the plugin would trans the words between $ to latex format which makes $ symbol hidden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants