I am using MathJax to display equations on the web. I want to be able to click a generated symbol and retrieve the contents of that symbol (okey pure javascript...) but also the position and the code which the symbol was generated from. With this information, my goal is to implement a cursor which can be used to insert more mathjax objects.
I do not have any code to show you since my intention is to see if it is even possible using mathjax.
Any ideas?
/ Anders
I am not quite sure how those would work with my interface. The knowl is interesting since you can hide information in a single element and the forminput may be good if you could insert it dynamically.
I think I should describe my project a little bit further. It is kind of a WYSIWYG LaTeX editor. I have a model with an expression represented by a list of symbols or sub expressions. Every symbol or expression have zones around them (for sub- and superscript etc.). The model generates LaTeX which I want to display visually by MathJax. To be able to edit an expression I want to put a cursor to the left of a symbol when it is clicked (both visually and in my model). But since my model and MathJax are logically separated I need to insert some logic to be able to change the position of the cursor in my model.
I started digging in MathJax and found a macro called cssId, which inserts an ID to a symbol or a whole expression. I could probably insert some info in the ID and analyze it later, but in my opinion this is a hacky solution. So I'm looking for alternatives.
I hope that gives you clarity. Do you still think I can work with those extensions, or is cssId best for me? Anything even better?
/ Anders
https://groups.google.com/d/msg/mathjax-users/fRGv6pcCXiA/-ZBPBOVcbjMJ
and the rest of that discussion for some ideas about getting mouse
clicks from MathJax. There is also a discussion at
https://groups.google.com/d/topic/mathjax-dev/4W4Gp6x2w2M/discussion
about some of the difficulties of trying to map back to original TeX
code.
Davide
On Mar 23, 2012, at 11:31 AM, <anders...@gmail.com> <anders...@gmail.com
I think this is probably the best approach. What sort of alternative
did you have in mind?
Currently there is no API to subexpressions, only to the equation as a
whole. So there is no direct way to get information about the sizes
of subexpressions, for example. Note that (in the HTML-CSS output)
the elements are stored in span's so their offsetWidth values will be
correct, but their heights may not correspond to the actual heights of
the contents (and indeed, MathJax uses zero-height boxes in some
places to make alignment to the baseline possible). So it is not easy
to get the actual bounding box of the subexpressions.
Davide
--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.