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.

2 Answers 2


is missing.


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.

You must log in to answer this question.

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