6

I use \over even though it is a bad practice (yes, yes, I know I shouldn't). Whenever I compile a LaTeX file using it, I get the message:

Foreign command \over; \frac or \genfrac should be used instead.

Is there a way to get LaTeX to ignore this warning, so that it doesn't appear in the output? I'm using the amsmath package, if that's relevant.

13
  • P.S. If there's a way to get the same syntax as \over that is considered less "evil," I'd be glad to hear about that as well. – jasonhansel Apr 25 '15 at 2:38
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Symbol 1 Apr 25 '15 at 2:49
  • Two ways: ① unpack \over and repeat its definition without \message-relevant macros. ② pack \over with \def\message#1{}. – Symbol 1 Apr 25 '15 at 2:59
  • Can you give an example of how to do this properly? I'm relatively new to LaTeX. – jasonhansel Apr 25 '15 at 3:09
  • 1
    The warning indeed comes from the amsmath package. The \over syntax causes technical difficulties for writers of math packages, so the amsmath folks are venting their frustration by redefining \over to print a message, and then act normal. The simplest way to stop this warning from appearing in the output is restore the original definition of \over. Luckily for us, LaTeX saved the original definition of over in \@@over. So, near the end of your preamble, (in particular, after loading amsmath), just say \makeatletter\let\over\@@over\makeatother – Mark Apr 25 '15 at 4:01
6

The warning indeed comes from the amsmath package. The \over syntax causes technical difficulties for writers of math packages, so the amsmath folks are venting their frustration by redefining \over to print a message, and then act normal.

The simplest way to stop this warning from appearing in the output is restore the original definition of \over. Luckily for us, LaTeX saved the original definition of over in \@@over. So, near the end of your preamble, (in particular, after loading amsmath), just say

\makeatletter
\let\over\@@over
\makeatother
1

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.