I want to define a macro for the normal ordering of operators as done in this question.

The LaTeX code produced by LyX for this macro is:


However, when I invoke it:


it gives an error:

...ven by $\norder{\hat{a}\hat{a}^{\dagger}} $ The control sequence at the end of the top line of your error message was never \def'ed.

I don't understand why it gives the error. I have more macros in the document and they work perfectly. amsmath and amssimb are loaded through LyX's "Math Options" (and I have checked that I can use commands such as \mathbb inside macros). Looks like the problem is the \vcentcolon command but I don't see why or how to fix it. Thank you!

PS. This is what I have before the begin{document} in the LaTeX source generated by LyX.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.

1 Answer 1


The command \ventcolon has not been defined. Load the package mathtools; you can load it instead of amsmath. Moreover, wrap the stuff between the colons into a \mathrel command to improve the spacing.


enter image description here

$A \norder{\hat{a}\hat{a}^{\dagger}} B$
  • Adding mathtools solved the issue. Thanks! May 1, 2017 at 15:28

You must log in to answer this question.

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