3
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ In real LaTeX I would suggest looking at the physics package which does brakets very well, indeed. $\endgroup$ – dmckee May 12 '16 at 20:05
  • $\begingroup$ @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! $\endgroup$ – Quantum spaghettification May 12 '16 at 20:09
  • 2
    $\begingroup$ 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. $\endgroup$ – Peter Krautzberger May 12 '16 at 20:55
  • 2
    $\begingroup$ 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) $\endgroup$ – David Z May 13 '16 at 6:50

You must log in to answer this question.

Browse other questions tagged .