slidev icon indicating copy to clipboard operation
slidev copied to clipboard

KaTeX rendering error

Open ChiMaoShuPhy opened this issue 2 years ago • 1 comments

The katex inline math and display math failed to rendering expressions like ${{C}_0}$, ${{C}^0}$. It is the curly braces around C causing this problem, although in the example the curly braces can be dropped but not in the actual slide code. A work around is to insert space such as ${{ C }_0}$.

To Reproduce Steps to reproduce the behavior:

  1. slidev to initialize a slide
  2. put ${{C}_0}$ in the md file
  3. See the error in attached picture 2022-07-27_00-56

Desktop (please complete the following information):

  • OS: Kubuntu-22.04 LTS
  • Browser: Firefox, Chromium
  • Slidev version: v0.34.3

ChiMaoShuPhy avatar Jul 26 '22 16:07 ChiMaoShuPhy

The issue comes from the fact that katex generates code that (also) contains the raw typed expression, so it contains {{ that is used for vue expressions.

To be sure, can you confirm that what works around the problem is to add a space between the two { (I still get an error with the workaround mentioned in the issue description).

twitwi avatar Sep 09 '22 08:09 twitwi

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 08 '22 09:11 stale[bot]