c-w / mathquill4quill

Power-up Quill's formula editing via the MathQuill editor
https://justamouse.com/mathquill4quill
Apache License 2.0
139 stars 33 forks source link

Example formula #20

Closed tipoc123 closed 5 years ago

tipoc123 commented 5 years ago

From documentation:

enableMathQuillFormulaAuthoring(quill, {
  operators: [["\\sqrt[n]{x}", "\\nthroot"], ["\\frac{x}{y}","\\frac"]]
});
The first value is the latex that gets rendered as the value on the button, and the second value is the latex that gets inserted into the MathQuill editor.

Why is the first value 'sqrt' different than right 'nthroot'? Is this latex syntax or katex? Could you provide more operators (in the documentation or in your demo)?

I want to add more operators for filling a full panel (I estimate another 3 operators).

boomanaiden154 commented 5 years ago

\\nthroot is a command specific to Math Quill, the editor that replaces the textbox for the default formula editor that quill provides. \\nthroot is not actually a latex command, and thus the text inside the operator button cannot be rendered using it. That is why \\sqrt[n]{x} is used. The operators option is an array of arrays, with each array within the full array containing two values, the first being the value that gets rendered inside the button, and the second being the value that gets inserted into the Math Quill editor when the operator button is clocked.

tipoc123 commented 5 years ago
\\nthroot is a command specific to Math Quill

Where is official documentation for mathquill commands? I can't find it.

boomanaiden154 commented 5 years ago

I couldn't find it in the official documentation either, but it is mentioned in several GitHub issues that I was able to find(for example here).

c-w commented 5 years ago

Resolving since the question seems to have been answered. If there's any more help you need with the project, don't hesitate to reach out!

ninbit commented 4 years ago

Isn't it better to have the full list of MathQuill Commands on the docs? I think the most loved feature of Mathquill4quill is visualizing the formulas. If there is not such list, we can start by writing to this topic as soon as we find them. Then we have the list eventually.

c-w commented 4 years ago

@ninbit Thanks for the suggestion. If you'd like to see additional buttons documented in mathquill4quill, this would be a great community contribution!

The new formula buttons can be added relatively easily by appending to the data-value attribute in the demo page here: https://github.com/c-w/mathquill4quill/blob/5d719bc525f770ccc1bffe417f269e3af6f19a19/index.html#L43-L47