Dragonfall Messages 1,023 Reaction score 5 Thread starter Aug 26, 2008 #1 Is it possible to define in LaTeX documents something like \ket{X} to be \left| X\right> so I don't have to type that every time? Last edited by a moderator: Oct 18, 2011
Is it possible to define in LaTeX documents something like \ket{X} to be \left| X\right> so I don't have to type that every time?
cristo Staff Emeritus Science Advisor Messages 8,145 Reaction score 75 Aug 26, 2008 #2 If you put this in your preamble \newcommand{\ket}[1]{{\left| {#1} \right>}}, then you can use the command \ket{X}: [tex]\newcommand{\ket}[1]{{\left| {#1} \right>}} \ket{X}[/tex] You can write similar commands for \bra and \braket, say.
If you put this in your preamble \newcommand{\ket}[1]{{\left| {#1} \right>}}, then you can use the command \ket{X}: [tex]\newcommand{\ket}[1]{{\left| {#1} \right>}} \ket{X}[/tex] You can write similar commands for \bra and \braket, say.