$\ket{\text{Since I always fight with "|\rangle" in my posts, can't we have }}$


$\ket{\text{as default, to make life easier? }}$

  • 1
    $\begingroup$ that would indeed make life easier. I don't know how much control we actually have on implementing custom macros though. Also, something should be done to prevent this from clashing with custom macros that people might have included in their posts in the meantime. If someone defined, say, \bra as something different in their post, this would break the formatting (although this is fixed by simply having macros defined in the post take precedence). I suspect this sort of thing would be better handled with some browser extension or script (e.g. a tempermonkey script) $\endgroup$
    – glS Mod
    May 9, 2020 at 12:09
  • $\begingroup$ Related: "Can custom TeX/MathJax commands be defined by default for a site?" at SE.Math.Meta. $\endgroup$
    – Nat
    May 13, 2020 at 22:43
  • 2
    $\begingroup$ I'd support this. Honestly, we're going to be replacing MathJax in the not too distant future (won't explain, just informing), so I wouldn't worry too much about over-engineering a solution in the current system. Just defining such custom commands seems like an appropriate step for now. $\endgroup$
    – Nat
    May 13, 2020 at 22:45
  • $\begingroup$ @Nat I did remember this being discussed before, though nothing came out of it. Who's "we" here? Moving away from mathjax is fine, there are already arguably better alternatives around, but I don't see moving away from a latex system supporting macros anytime soon... I mean that would break a giant amount of posts $\endgroup$
    – glS Mod
    May 13, 2020 at 22:59
  • $\begingroup$ @Nat Who said MathJax is being replaced in the near future? Do you have a reference for this? $\endgroup$ Feb 6, 2021 at 23:20

2 Answers 2


I certainly support adding a custom macro to type bras and kets faster, and I don't even see the harm in doing this network-wide, however I've noticed that requests to change anything in the StackExchange MathJax script have not got a lot of attention from the developers at SE. For example they won't even add 5 lines to allow equation numbering (without having to manually add \tag{1}, \tag{2}, etc. for every equation).


The correct solution is to enable the Physics package in Mathjax. However, I don't know how much control this site has over its own Mathjax.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .