# absolute value in numerator of fraction

I am having trouble writing a term of an equation which is fractional where only the numerator is inside the absolute value symbol. The syntax I used is:

\frac{\abs{\lambda_f}}{8\pi^2}


But I keep getting an error saying, "Undefined control sequence". I think the nested curly braces is the problem but not sure how to fix it.

• Did you define\abs{}? You can use |\lambda_f|. – Sigur Feb 9 '16 at 1:20
• I believe \abs is part of the base latex package. Right, I could use the absolute value symbol directly. Thanks. – user3922546 Feb 9 '16 at 1:29
• @user3922546 - A macro named \abs is not defined by the LaTeX kernel. – Mico Feb 9 '16 at 1:30
• there is an \abs macro defined in the preamble of all the "example" files for ams document classes. (too) many people take those files and use them as the base for constructing new documents, leaving behind definitions that were there only to illustrate how to use the document classes. this (mis)use of example files might be what's leading to the misconception that \abs is defined as part of the base latex. – barbara beeton Feb 9 '16 at 16:43

Make sure the \abs macro is defined.
\documentclass{article}
$\frac{\abs{\lambda_f}}{8\pi^2}$\quad $\dfrac{\abs{\lambda_f}}{8\pi^2}$