Additional Documentation?

135 views
Skip to first unread message

Mamix Dev

unread,
Dec 7, 2019, 2:31:44 PM12/7/19
to desmos-api-discuss
I've seen a few posts that have syntax that can't be found on the Desmos API v1.3 documentation. For example...

calculator.setExpression({id: 'dotplot', latex: '\\operatorname{dotplot}\\left(A\\right)', color: '#2d862d'});

I can't find this in the documentation of Desmos's API, and I can't find this in Mathquill's documentation. Any ideas where I can find it?

Jason Merrill

unread,
Dec 7, 2019, 2:46:14 PM12/7/19
to desmos-api-discuss
Do you mean the

\operatorname

syntax?

This is used for function names that are not built into TeX/LaTeX (like "dotplot") to cause them to be typeset in a similar way to function names that are built in (like "cos" or "log"). The contents of an operatorname are typeset in a roman font (instead of italics), and certain spacing conventions are applied.

Mathquill has a configuration option called autoOperatorNames that allows saying which sequences of characters should automatically be interpreted as operator names, which you can read about here:

http://docs.mathquill.com/en/latest/Config/#autooperatornames

The easiest way to learn what LaTeX to use to produce a given result in the calculator is to type the desired expression into the calculator, select it, and copy the result into a text editor. Expressions are copied as LaTeX.

Remember that if you want to put the result in a JS string, you will need to escape all of the backslashes.

Best,

Jason

Mamix Dev

unread,
Dec 7, 2019, 4:45:24 PM12/7/19
to desmos-api-discuss
It's beautiful. That one link...so helpful. I'm still pretty new to JS and the Desmos API, so learned a bit of JS and a bit more about LaTeX.

Thank you for the help.
Reply all
Reply to author
Forward
0 new messages