Skip to content

Possible to parse expressions between delimiters inside of math environments? #111

Answered by wooorm
mattvague asked this question in Q&A
Discussion options

You must be logged in to vote

Heya!

e.g. What is $1 + 1$ ➡️ What is <Katex>{1 + 1}</Katex>, I'll try and post how I accomplished as a follow up answer once I'm done.

I’m not sure what you did, but this is very close to what remark-math already exposes, plus a small tree transform afterwards? Is that what you’re doing (and if not, why are you doing more complicated things?)

how to map something like What is $<a> + <b>$ ➡️ What is <Katex>{${a} + ${b}}</Katex> where < and > are arbitrary delimiters.

It would help a lot here if I know what your actual input is, and your expected output. What is the syntax of your variables? What are the limitations? Is it JavaScript? Can they include complete programs? Statements? Are…

Replies: 1 comment 13 replies

Comment options

You must be logged in to vote
13 replies
@mattvague
Comment options

@wooorm
Comment options

@mattvague
Comment options

@wooorm
Comment options

@mattvague
Comment options

Answer selected by mattvague
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