LaTeX forum ⇒ Math & ScienceEquation Alignment causes several Errors

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Posts: 4
Joined: Sun Jan 20, 2013 8:58 pm

Equation Alignment causes several Errors

Postby Wenneguen » Sun Jan 20, 2013 9:03 pm


LaTeX tells me there are 12 errors in there :
  1. \begin{aligned}
  2. $|a_n| \sim |b_n| &\iff |a_n| - |b_n| = o(|a_n|) \\
  3. &\iff \forall \varepsilon > 0, \exists N \in \mathbb{N}, \forall n \ge N, |a_n| - |b_n| \le \varepsilon |a_n|$
  4. \end{aligned}

I guess it is because of the stuff in the aligned environment, since it is the first time I use it. Could someone explain how to use it so that LaTeX does not detect errors ? (surprisingly LaTeX displays exactly what I want to make, but I like documents without errors :D)

Thank you ! :)
Last edited by localghost on Sun Jan 20, 2013 10:06 pm, edited 1 time in total.
Reason: Longer passages of source code are tagged as code block, not as in-line code.

User avatar
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Sun Jan 20, 2013 10:07 pm

Please always provide a self-contained and minimal example to make a problem comprehensible at all. This would also prevent others from guesswork and random shots.

The aligned environment only works in math mode, either in-line or display mode. Since you didn't provide a full example, one can only guess that you are perhaps looking for something like this.
  1. \documentclass[11pt]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{mathtools} % loads »amsmath«
  5. \begin{document}
  6. \begin{equation}
  7. \begin{aligned}
  8. |a_n| \sim |b_n| &\iff |a_n| - |b_n| = o(| :D a_n|) \\
  9. &\iff \forall \varepsilon > 0, \exists N \in \mathbb{N}, \forall n \ge N, |a_n|-|b_n| \le \varepsilon |a_n|
  10. \end{aligned}
  11. \end{equation}
  12. \end{document}

And it's not necessary to activate in-line math mode ($…$) inside another math environment.

Further reading:

Best regards and welcome to the board
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 1 guest