quartz icon indicating copy to clipboard operation
quartz copied to clipboard

Anchor on LaTeX Block Math does not work

Open NeumoNeumo opened this issue 2 months ago • 1 comments

Describe the bug The block-ref anchor like ^285714 after a math block does not take effect.

To Reproduce Steps to reproduce the behavior:

  1. Create a new quartz project
  2. Write the following in the index.md
$a^2 + b^2 = c^2$ ^142857

$$
\sum_{n\ge 1} \frac {|\sin (n)|^n} n
$$

^285714

^428571

  1. Build and open the index page. The formulae are rendered correctly as shown in
Image

But the html is like Image

-- My ^285714 disappears.

Expected behavior <span class="katex-display"> should be <span class="katex-display" id="285714"> .

Desktop:

  • Quartz Version: v4.5.2
  • node Version: v24.1.0
  • npm version: 11.3.0
  • OS: Debian GNU/Linux 12 (bookworm)
  • Browser: Brave 1.83.120

NeumoNeumo avatar Oct 29 '25 07:10 NeumoNeumo

not really a bug, limitation of rehype-katex. you can probably write a small parser in latex.ts

aarnphm avatar Nov 12 '25 02:11 aarnphm