The braket
package defines Dirac's braket notation. To use it in Lyx, I add the line:
\usepackage{braket}
to the LaTeX preamble. Then Lyx will be able to compile commands like \bra
and \ket
. Problem is that the Lyx editor itself won't recognize this commands.
If instead of using the braket
package I had defined math-macros for the commands \bra
, \ket
, etc., I could tell Lyx how these things should look in the editor. That is, I can tell it to put an \rangle
before the argument (that Lyx knows how to draw) and a |
after.
Is there a way to use the \bra
, \ket
, etc., commands from the braket
package, and still be able to tell Lyx how these should look in the editor?
EDIT: Right after posting, I discovered this question, which mentions the Instant Preview feature of Lyx. Although this kind of fixes my issue, it's not exactly what I want. I want to be able to specify what the command should look like in the editor, in terms of other commands that Lyx already recognizes (in the editor), like I would do with a math-macro.
braket
package, that means that the LaTeX command\ket
is already defined, so I can't create a macro\ket
in this case. I could define a command with another name, like\ket2
, but that seems too ugly... isn't there a better way?\let\realket\ket
command in the LaTeX preamble. I had not seen\let
before. It defines a synonym?