Featured Book

LaTeX Beginners Guide

Who is online

In total there are 4 users online :: 1 registered, 0 hidden and 3 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: Bing [Bot] and 3 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

Equation Alignment causes several Errors

Add tags Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).

Equation Alignment causes several Errors

Postby Wenneguen on Sun Jan 20th, 2013

Hello,

LaTeX tells me there are 12 errors in there :
Code: Select all  •  Open in writeLaTeX
\begin{aligned}
  $|a_n| \sim |b_n| &\iff |a_n| - |b_n| = o(|a_n|) \\
&\iff \forall \varepsilon > 0, \exists N \in \mathbb{N}, \forall n \ge N, |a_n| - |b_n| \le \varepsilon |a_n|$

\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 20th, 2013, edited 1 time in total.
Reason: Longer passages of source code are tagged as code block, not as in-line code.
Wenneguen
 
Posts: 1
Joined: Sun Jan 20th, 2013

Re: Equation Alignment causes several Errors

Postby localghost on Sun Jan 20th, 2013

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.
Code: Select all  •  Open in writeLaTeX
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools
}  % loads »amsmath«

\begin{document}
  \begin{equation}
    \begin{aligned}
      |a_n| \sim |b_n| &\iff |a_n| - |b_n| = o(| :D a_n|) \\
      &\iff \forall \varepsilon > 0, \exists N \in \mathbb{N}, \forall n \ge N, |a_n|-|b_n| \le \varepsilon |a_n|
    \end{aligned}
 
\end{equation}
\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
Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany


Return to Math & Science

Who is online

Users browsing this forum: Bing [Bot] and 3 guests