# Can we have some MathJax functions pre-defined?

Can we have some MathJax functions pre-defined so that it is easier to write. For example:

• \ket{\psi} giving |\psi \rangle

• \braket{\psi_1}{\psi_2} giving \langle \psi_1 | \psi_2 \rangle

• \f{1}{2} giving \frac{1}{2}

• \l giving \left(

• \r giving \right)

etc

I know each one of these alone does not seem like a big save on writing time but for longer expressions they may make it less of a pain to right. If not why not?

• In real LaTeX I would suggest looking at the physics package which does brakets very well, indeed. May 12 '16 at 20:05
• @dmckee thanks for pointing this out, I didn't know it existed. It would be nice to have functions like these on physics stack exchange! May 12 '16 at 20:09
• FYI There are third party extensions for MathJax implementing parts of the physics and siunitx LaTeX packages. The extension maintainers have been looking for others to help them complete the work. May 12 '16 at 20:55
• I know these were only proposed as examples, but I would not be in favor of \f, \l, and \r. They're bad for readability. What would be nice (and has already been suggested elsewhere) is if they could localize the macro namespace to each post, and then you could define these shorthand macros yourself and use them without disrupting anyone else's math. \bra and \ket and the like would, of course, be useful. (NB \lvert\psi\rangle works better) May 13 '16 at 6:50