cp
If a user has their cursor placed on a typeset formula and *manually* presses a keyboard shortcut the formula is *replaced* with a source view of that one formula. After editing, they have to press the keyboard shortcut *again* and the TeX source is replaced with the retypeset formula. The same keyboard shortcut could also be used to insert new formulas.
Given these constraints, I think the only UI that can be implemented with a reasonable amount of work is the following:If a user has their cursor placed on a typeset formula and *manually* presses a keyboard shortcut the formula is *replaced* with a source view of that one formula. After editing, they have to press the keyboard shortcut *again* and the TeX source is replaced with the retypeset formula. The same keyboard shortcut could also be used to insert new formulas.Now:* Do you think this user experience is reasonably attractive? Do you have suggestions how to improve it?* Do you think this is feasible to implement? Or do you see problems down the road?Cheers,Felix
Since it is too late to get anything actually sanctioned by JMM, it seems likely it will be something anyone can attend. One person knows a nearby pub that might work. If you are over 21, that should work! LOL
Paul
cp
> Also, is <script type="math/tex"> the proper way to do this? It seems
> to work fine, but I'm new to mathjax. Does anyone know why there
> aren't any indents in Mathjax.js, it makes it impossible to read.
There are two different types of equations: in-line and displayed
equations. The in-line equations are those that form part of a
paragraph and fit into the rest of the text of the sentence in which
they are used, whereas displayed equations are offset on their own
line, often centered, with space above and below. These are usually
longer equations that would cause line-break problems if they appeared
within the text.
In TeX and LaTeX, the difference between these is indicated by the
delimiters used: $...$ or \(...\) for in-line equations, and $$...$$
or \[...\] for displayed equations. In MathJax, these are represented
by <script type="math/tex">...</script> and <script type="math/tex;
mode=display">...</script>.
You are using only the in-line form, so the things that should be
displayed equations are being represented as in-line equations, so
they are not centered by MathJax, and will not use the displayed
equation spacing rules.
You probably need to give your users two choices for math (in-line or
display). Or you could perhaps make some guesses about which is
needed, depending on whether the equation is in a paragraph by itself,
but that would be more fragile.
Davide
Thank you for the response, you were absolutely correct, only inline
equations were implemented in the patched mediawiki Visual Editor.
This was actually by design because I thought displayed/centered
equations would be better defined using the dropdown menu at the top
of the editor. However, I certainly didn't state this in the original
email.
I've added in displayed/centered equations the way I was thinking and
I'd love to hear your feedback. I've also changed the leftside
display of the inline equations from italic to a box around the
equations. A shortcut to inline equations was added as Ctrl-Win-M,
which is close to lyx's command. (See attached patch)
Of course the end goal is for the user to have an option not to have
to input tex equations, but instead use some sort of an equation
editor which would be similar to lyx. Then on the backend it would
convert that to tex and bring it over to the right side as either
wikitext, json, html, or rendered.
From the mathjax perspective, I've noticed that the mathjax script is
able to find equations that are outside the <script> tags (ie
http://www.mathjax.org/demos/tex-samples/). Since the mathjax script
has to run often using the MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
command, is it possible to tell it to only check <script
type="math/tex"> tags and ignore all other text? Would this be
reasonable and how much time would it save during the render?
Thanks,
John
There are two problems currently:
1) We need to find a way to disable the other formatting options when
either the inline equation or centered equations are in use. To see
what happens, create a new centered equation and make it bold. You'll
notice the <b><\b> tags will show up in the equation.
2) The next problem is a bigger Visual Editor problem and the fix
should go upstream, but if you click away from an inline equation and
click back in the middle of the equation, the new text does not get
included within the equation. The same thing happens with bolds and
italics, so it's not specific to the new work. By selecting the new
text and selecting the inline equation button, everything works fine.
Next there are design decisions for the left side panel. We have to
decide what gets displayed. I think we'll need to use something
similar to how it handles internal and external links, where more
options are available below the equation. I'd like to see the ability
to input an equation as tex, mathml, or some sort of lyx type input.
For example if you check out the first equation at
https://jalto.net/equationdb/working/ , you can see that
contenteditable really can be used to change a lot of values within an
equation. If we have a script watching user input, and they type
something like \frac then the equation on the left hand side could be
updated to include the horizontal bar and the numerator and
denominator could be editable. The same could be true for entering
greek leters, ie if someone typed \pi and then space, it should be
replaced with a pi symbol.
That's probably enough rambling for this evening. Thanks for listening.
John
New Problem: Highlighting and replacing text causes the new text to
loose the annotation type (math formatting). This occurs with all
annotation types (bold, italic, etc) as well.