TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to define a new command for scalar product. So far, it looks like this:


However, when I was trying to put something riddiculously high in one of the fields, the separator (|) remained the same height. I tried modifying the command:


However, that doesn't work; by putting a matrix in one of the fields I get an error. Putting anything else produces an error as well. Why? I tried substituting | for other vertical lines, but it didn't help.

share|improve this question

You can use \middle:






enter image description here

Here's the definition using the mathtools package:





share|improve this answer
Thanks! It worked perfectly! – user19502 Jan 13 '13 at 2:19
@user19502: Please then accept this answer by clicking the tick mark just below the voting arrows. This will show others the answer which helped you the most (if there are multiple answers), give the answerer additional reputation and marks the question concluded. – Martin Scharrer Jul 1 '13 at 20:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.