Supporting a libre office style navigation from rendered equation

8 views
Skip to first unread message

gauta...@gmail.com

unread,
Apr 7, 2015, 10:16:25 AM4/7/15
to mathja...@googlegroups.com
Hi,

I was wondering if it is possible to make an equation editor using mathjax that can be used to make an equation editor
that can provide libre math style navigation in the code window. In libre math one can click on any part of the rendered
equation to move the cursor in the code window to the relevant code. For example, if one clicks on a square root sign, the
cursor in the command window will move to the \sqrt command that created that sign.

How can one accomplish that using javascript and mathjax?

Regards
Gaurav Gautam

Raniere Silva

unread,
Apr 7, 2015, 10:59:26 AM4/7/15
to mathja...@googlegroups.com
Hi Gaurav,

> I was wondering if it is possible to make an equation editor using mathjax
> that can be used to make an equation editor
> that can provide libre math style navigation in the code window.

Yes, it is possible. Please see my comments at the end.
If you

> In libre
> math one can click on any part of the rendered
> equation to move the cursor in the code window to the relevant code. For
> example, if one clicks on a square root sign, the
> cursor in the command window will move to the \sqrt command that created
> that sign.
>
> How can one accomplish that using javascript and mathjax?

If you restrict this feature for MathML output this should be easy.
If you want to support this feature for all MathJax outputs, HTML+CSS and SVG,
this will be a lot more complicate to implement.

If you are interested in wrote a demo for MathML let me know.

Raniere
signature.asc

Gautam

unread,
Apr 7, 2015, 11:12:11 AM4/7/15
to mathja...@googlegroups.com
Hi Raniere,

Yes I am interested in writing a demo. But I have my exams starting in a few days, so I might work slowly. So you say that I should
start with mathml? I have used mathjax once to render equations on a webpage once but I didn't go into the details and I only used
Latex commands.

Does using MathMl mean that the user has to type using the MathML tags? Because that might be very cumbersome and beat the
whole purpose. I haven't worked with MathML before. So where should I begin?


--
You received this message because you are subscribed to a topic in the Google Groups "MathJax Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mathjax-users/XwD2GftfvUI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raniere Silva

unread,
Apr 7, 2015, 11:32:50 AM4/7/15
to mathja...@googlegroups.com
Hi Gautam,

> Yes I am interested in writing a demo.

Great. If you need to ping me on GitHub, http://github.com/r-gaia-cs/.

> But I have my exams starting in a few days, so I might work slowly.

No problem for me. Just let me know of your progress and problems.

> So you say that I should start with MathML?

Yes, http://www.w3.org/Math/.

> I have used mathjax once to render equations on a
> webpage once but I didn't go into the details and I only used
> Latex commands.
>
> Does using MathML mean that the user has to type using the MathML tags?

No. There is a lot of tools to convert LaTeX to MathML
in almost all languages that you want.
MathJax can do it, but if you prefer something more small you can try
https://github.com/fred-wang/TeXZilla.
In case you want to convert full LaTeX or Markdown + LaTeX math to HTML+MathML
I recommend you to try http://pandoc.org/.

> I haven't worked with MathML before. So where should I begin?

If you already worked with Javascript to do HTML/DOM manipulation
you already have all you need to know to start.
You should start working directly with MathML
and for that you will need Firefox
(sorry but Chrome doesn't has native support for MathML).
I recommend that you start with a small MathML expression, e.g.

<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<msqrt>
<mi>x</mi>
</msqrt>
</math>

and try to do basic things, e.g.

1. Replace the "x" with 2.
2. Replace the "x" with "x + 1".
3. Remove the "sqrt".

and keeping the MathML valid.

For help you with this basic task I suggest you to take a look at
https://developer.mozilla.org/en-US/docs/Web/MathML and
https://developer.mozilla.org/en-US/docs/Mozilla/MathML_Project.

Thanks,
Raniere
signature.asc
Reply all
Reply to author
Forward
0 new messages