Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
4 of 7 Damn you, whomever made me aware of the slanted `\TeX` output!!!

Can custom TeX/MathJax commands be defined by default for a site?

Recently SE.QuantumComputing started private beta (bit of a misnomer, as users can join freely), and we started a $\TeX$-tutorial Meta discussion like the one found here at SE.Math.

Since quantum computing makes frequent use of bra-ket notation and it's a bit tedious to type out the $\rm\TeX$ for it constantly, it'd be nice if we could auto-include custom $\rm\TeX$ definitions for it, along with other common quantum-computing concepts, in our MathJax implementation.

For example, it'd be cool if we could auto-include

\newcommand{\bra}[1]{\left< #1 \right|}
\newcommand{\ket}[1]{\left| #1 \right>}
\newcommand{\bk}[2]{\left< #1 \middle| #2 \right>}
\newcommand{\bke}[3]{\left< #1 \middle| #2 \middle| #3 \right>}

, so then users could type

  • $\bra{x}$ to get $\left<x\right|$;

  • $\ket{y}$ to get $\left|y\right>$;

  • $\bk{x}{y}$ to get $\left<x\middle|y\right>$;

etc..

Questions:

  1. Does SE.Math or any other SE have such custom-defined $\rm\TeX$ commands?

    • As pointed out by @Quasicoherent in the comments, this has been proposed before and rejected. However, still curious about whether or not it's technically possible in the case that there's broad community agreement on common $\rm\TeX$ commands for specialized SE's.
  2. If not, is it something that could be reasonably done if the community agrees on a set of highly useful commands?