Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I was trying to align the following equations but alas. Could someone guide?

\begin{flalign}
x \in A \cap (B \cup C)
& \Rightarrow (x \in A) \lambda \Big( (x \in B)\vee(x \in C) \Big) & \\
& \Rightarrow \Big( (x \in A) \lambda (x \in B) \Big) \vee \Big( (x \in A) \lambda (x \in C) \Big) & \\
& \Rightarrow (x \in A \cap B) \lambda ( x \in A \cap C) & \\
& \Rightarrow x \in (A \cap B) \cup (A \cap C) 
\end{flalign}

to look like

a => b
  => c
  => d
  => e

Here's the preamble that I used:

\documentclass[oneside]{book}

\title{Basic Typesetting of Mathematics}
\usepackage[fleqn]{amsmath}
\setlength{\mathindent}{0pt}

I am using Texmaker and it's not recognising \begin{flalign*} or \end{flalign*}. Gives weird compilation errors. Any ideas?

share|improve this question

migrated from programmers.stackexchange.com Feb 21 at 9:53

This question came from our site for professional programmers interested in conceptual questions about software development.

add comment

3 Answers 3

up vote 2 down vote accepted

Your code is compiling just fine.

I've made the parentheses a bit smaller and used the left/right versions of them to get better horizontal spacing. Also, there were unnecessary ampersands.

Version 1:

\documentclass[oneside]{book}

\usepackage[fleqn]{amsmath}
\setlength\mathindent{0pt}

\begin{document}

\begin{flalign}
x \in A \cap (B \cup C)
&\Rightarrow (x \in A) \lambda \bigl((x \in B) \vee (x \in C)\bigr)\\
&\Rightarrow \bigl((x \in A) \lambda (x \in B)\bigr) \vee \bigl((x \in A) \lambda (x \in C)\bigr)\\
&\Rightarrow (x \in A \cap B) \lambda (x \in A \cap C)\\
&\Rightarrow x \in (A \cap B) \cup (A \cap C) 
\end{flalign}

\end{document}

output1

Version 2: Using daleif's suggestion from the comment to this answer, you get

\documentclass[oneside]{book}

\usepackage[fleqn]{amsmath}
\setlength\mathindent{0pt}

\newcommand*\implic{\quad\Rightarrow\quad}

\begin{document}

\begin{flalign}
x \in A \cap (B \cup C)
&\implic  (x \in A) \lambda \bigl((x \in B) \vee (x \in C)\bigr)\\
&\implic \bigl((x \in A) \lambda (x \in B)\bigr) \vee \bigl((x \in A) \lambda (x \in C)\bigr)\\
&\implic (x \in A \cap B) \lambda (x \in A \cap C)\\
&\implic x \in (A \cap B) \cup (A \cap C) 
\end{flalign}

\end{document}

output2

share|improve this answer
add comment

This code works. I removed big brackets to have the same space between equations

\documentclass[oneside]{book}
\usepackage[fleqn]{amsmath}
\setlength{\mathindent}{0pt}
\begin{document}
\begin{flalign}
     x \in A \cap (B \cup C)
        & \Rightarrow (x \in A) \lambda \left( (x \in B)\vee(x \in C) \right) & \\
        & \Rightarrow \left( (x \in A) \lambda (x \in B) \right) \vee \left( (x \in A)\lambda (x \in C) \right) & \\
        & \Rightarrow (x \in A \cap B) \lambda ( x \in A \cap C) & \\
        & \Rightarrow x \in (A \cap B) \cup (A \cap C) 
\end{flalign}
\end{document}

enter image description here

share|improve this answer
    
Thank you !! ++1 –  Abi Feb 21 at 10:44
    
@Abi: the best way to thank others is not saying +1, but rather upvoting the answers and accepting the best one; have a look to TeX.SX tour. –  Claudio Fiandrino Feb 21 at 12:39
    
Oh @ClaudioFiandrino I had less reputation :P here so wanted to thank anyways regardless of that.. But now I did.. Thank you again :* –  Abi Feb 22 at 20:01
add comment

This code works for me:

\documentclass[oneside]{book}
\usepackage[fleqn]{amsmath}
\setlength{\mathindent}{0pt}
\begin{document}
\begin{flalign}
 x \in A \cap (B \cup C)
  & \Rightarrow (x \in A) \lambda \Big( (x \in B)\vee(x \in C) \Big) & \\
  & \Rightarrow \Big( (x \in A) \lambda (x \in B) \Big) \vee \Big( (x \in A)\lambda (x \in C) \Big) & \\
  & \Rightarrow (x \in A \cap B) \lambda ( x \in A \cap C) & \\
  & \Rightarrow x \in (A \cap B) \cup (A \cap C) 
\end{flalign}
\end{document}
share|improve this answer
    
Thank you !! It works perfectly the way I wanted :) +++1 –  Abi Feb 21 at 10:45
2  
Might look better if you added extra space around the \Rightarrow, I usually use \Rightarrowx as a short for \quad\Rightarrow\quad –  daleif Feb 21 at 11:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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