Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Is it possible to define in LaTeX documents Latex Help

  1. 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
  2. jcsd
  3. Aug 26, 2008 #2

    cristo

    User Avatar
    Staff Emeritus
    Science Advisor

    Re: Latex Help

    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.
     
  4. Aug 26, 2008 #3
    Re: Latex Help

    Awesome, thanks!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Is it possible to define in LaTeX documents Latex Help
Loading...