TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

How can I embed \lvert and \rvert into the numerator?

$1 - \frac{ \lvert 1 - t_2 \rvert}{y}$

The above line gives Undefined control sequence error.

share|improve this question
up vote 5 down vote accepted

is missing.

share|improve this answer

Herbert's answer is sufficient, but I would like to suggest \usepackage{mathtools} as well (it automatically loads amsmath), and then


The fraction can then be written as \frac{ \abs{1-t_2} }{y}.

Using \abs gives a number of advantages:

  • The code is easier to read (at least, I think so), because one recognizes "absolute value".

  • Scaling only needs to be done in one place, namely the optional argument of \abs:


\abs[\Big]{ \int_a^b f(x) }


\Bigl \lvert \int_a^b f(x) \Bigr\rvert
  • (there is also an \abs* version, which is equivalent to prepending \left and \right to \lvert and \rvert, but I think this has a tendency to produce too large delimiters; I prefer to find an appropriate size by hand)

  • It is impossible to forget the closing delimiter, since it will produce a missing right brace error.

The mathtools package also provides lots of other nice features.

share|improve this answer

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.