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:


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.

  • 3
    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
  • 1
    @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.

enter image description here

\usepackage{mathtools}           % for '\DeclarePairedDelimiter' macro
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert} % define '\abs' macro
$\frac{\abs{\lambda_f}}{8\pi^2}$\quad $\dfrac{\abs{\lambda_f}}{8\pi^2}$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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