select sub-region of mathField that matches latex string?
See original GitHub issuewhat is the most straightforward way to search for a latex string (e.g. \frac{2}{4}
) in an active MathField and if found, select the occurrence of subexpression in the mathField. I can think of a way of creating a DOM-detached mathField just with $$\frac{2}{4}$$
and then doing a deep comparison of the resulting spans with the existing active mathField, but that sounds painful. Also, not clear how i would select a specific portion programmatically after the span section is found. search probably needs to be done on MathAtom internal representation, but those traversal functions are not in documentation.
Any help would be greatly appreciated. i’m working on a speech driven selection and this is a key missing component.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Selecting a string beginning with $ and ending with $ - TeX
This script assumes (i) your cursor is lying inside the math environment $..$ already, and that (ii) the whole $...$ content lies within...
Read more >MathLive - CortexJS
Set the content of the mathfield to the text interpreted as a LaTeX expression. ... Return a nested mathfield element that match the...
Read more >How to render substrings of a LaTeX string, in different colors ...
I need to change the color of substrings within a LaTeX string for a plot title. I have tried several different approaches, most...
Read more >Text rendering with LaTeX — Matplotlib 3.6.2 documentation
Text rendering with LaTeX#. Matplotlib can use LaTeX to render text. This is activated by setting text.usetex : True in your rcParams, or...
Read more >The stringstrings Package - CTAN
Abstract. The stringstrings package provides a large and sundry array of routines for the manipulation of strings. The routines are developed not only...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, the current template type (
string | RegExp
) will be expanded to include aMathJson
expression. Same thing for the replacement pattern, you will be able to return either a Latex string or aMathJson
expression.@arnog that’s awesome. Things will be so much cleaner with this. thanks for adding it.