Skip to content

Render Katex on SVG #3288

Answered by edemaine
udaypandey asked this question in Q&A
Sep 23, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

If you look at the subsequent <span>s after the <svg>, you'll see that the KaTeX is not inside the SVG, it's just overlapping in terms of layout. This is accomplished via position: absolute to place the KaTeX labels where wanted within the containing <div> (which is position: relative).

It's hard but possible to do this type of placement by hand, but much easier to do with a tool. In this case, Khan Academy exercise figures seem to be built with a tool called Graphie that does it, though I can't find that project so it may not be open source. (Others, feel free to give a pointer if you know one.)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@udaypandey
Comment options

Answer selected by edemaine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3275 on September 27, 2021 19:58.