MathJax - what syntax can I use?
Hi, everyone. I'm very new to Marked, and even newer to MathJax. Is it correct that some of the expressions of LaTex can be used (interpreted by?) MathJax, but not all of them?
I went to mathjax.org but I cannot find a list of all the expressions that can be used. I only found a few formulas there (http://www.mathjax.org/demos/tex-samples/).
I downloaded a LaTex guide with all the symbols and expressions, but many of them don't work in Marked.
Can someone point me to a list of all the accepted MathJax expressions?
Thanks!
David
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Brett on 06 Aug, 2012 11:24 AM
I'm afraid I don't have a complete list handy. I know very little about Mathjax formulae, I include it because it's commonly requested. I do know that the syntax differs for MultiMarkdown 3 slightly:
Hope that helps, I'll keep looking for a complete guide.
2 Posted by dcollett.seattl... on 06 Aug, 2012 05:12 PM
Hi, Brett.
Thanks for your reply. But there must be hundreds of other expressions I can use in MathJax. I've tried some LaTEX and they work, others don't. I'm a beginner, so I have no way to tell what will and won't work in MathJax.
Also, concerning the syntax in Marked, please look at the attached png. Some equations seem to work in Marked using the \\ prefix, some with the $$ prefix, and still others only using the <p>...</p> tags (see attached screenshot, please).
Now I'm very confused as to which ones to use and when. Also, when do I use opening/closing brackets [...] and when don't I?
Can someone please help? Thanks very much.
David
3 Posted by Peter Krautzber... on 06 Aug, 2012 06:24 PM
Hi,
The full syntax overview can be found in our documentation at http://www.mathjax.org/docs/2.0/tex.html
Essentially, MathJax currently implements the math syntax of TeX/LaTeX as well as the well-known AMS packages. You can also define your own LaTeX macros but I don't know if Marked has a solution beyond adding them manually to each document.
@Bret could you post the MathJax configuration used in Marked?
Support Staff 4 Posted by Brett on 06 Aug, 2012 07:26 PM
Marked currently loads MathJax from the CDN with:
If there's a better configuration that won't break anyone's existing work, I'm definitely open to it.
5 Posted by Peter Krautzber... on 07 Aug, 2012 07:17 PM
I think that's fine for most users. The only you don't get with that combined config file is asciimath-input as an option -- just in case somebody requests it.
If there's no way for users to modify the configuration or store their macros within the app, there's really nothing else practical (they can add raw html to configure it on their own as I've seen somebody on the forum suggest).
Have you considered shipping a copy of MathJax so that people can get a preview when offline? I don't know your internals (i.e. browser engine), but I'm guessing you could shrink MathJax to <2MB without loss. Just a thought.
Support Staff 6 Posted by Brett on 07 Aug, 2012 07:59 PM
I'd be interested in learning more about the logistics of that. Marked is a web view and has no server-specific capabilities, and in my toying with it I wasn't able to get it working as an embedded package.
Adding options is a possibility as well. Easily done, I just know so little about MathJax that I have thus far felt it safest to offer what seemed like the most universal configuration. Suggestions as to what options various types of more advanced users would appreciate?
7 Posted by Peter on 13 Aug, 2012 11:46 PM
Hi Brett.
The only structured information on "shrinking" MathJax is described at https://github.com/mathjax/MathJax/wiki/Shrinking-MathJax-for-%22lo... -- this will be tidied up a bit to go into the regular documentation soon(ish). Since marked works on macs, your users probably have STIX fonts installed (they come with newer Safari versions) -- so you don't need any webfonts etc but you don't have to use SVG output (most people prefer fonts to SVG).
For configuration, I think the best option might be to allow users to add to the MathJax configuration. MathJax can handle calling multiple configuration files (see our documentation at http://www.mathjax.org/docs/2.0/configuration.html#using-a-local-co...). That way, users could store their personal preference for math delimiters, TeX-macros etc in a reusable configuration file that marked simply adds to the mathjax call.
If you have more questions, feel free to stop by our User Group https://groups.google.com/forum/?fromgroups#!forum/mathjax-users
Support Staff 8 Posted by Brett on 26 Aug, 2012 07:59 PM
This sounds good, and I'll work on adding an option to preferences to allow custom configurations to be added. Thanks for the info.
Brett closed this discussion on 26 Aug, 2012 07:59 PM.