0

When I try to write the following list of equations, I get too much spacing between certain elements.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

    \begin{flalign*}
        \Rightarrow & \quad 1-p(1+\beta) \quad & \geq & \quad\frac{c+u}{W} &\\
        \Rightarrow & \quad (1+\beta) & \leq & \quad\frac{1}{p}-\frac{c+u}{Wp} &\\
        \Rightarrow & \quad \beta & \leq & \quad\frac{1-p}{p}-\frac{c+u}{Wp} & \\
        \Rightarrow & \quad \beta_{max} & = & \quad \frac{1-p}{p}-\frac{c+u}{Wp} &
    \end{flalign*}

\end{document}

Whatever I try I can't remove the unnecessary spacing before the inequality sign.enter image description here

  • Why do you add all those \quads? Isn't the default spacing enough? – Bernard Nov 27 '17 at 10:49
  • I thought it looked better. However the problem is not there. With or without those \quad the problem remains. – Yohan Obadia Nov 27 '17 at 10:51
4

You forgot that when there are k columns of alignment, you need 2k-1 &: one for the new column (exceptthe first), and one for the alignment point in this column.

Here are two suggestions:

\documentclass{article}
\usepackage{amsmath}
\usepackage[showframe]{geometry}

\begin{document}

    \begin{flalign*}
        & \Rightarrow & 1-p(1+\beta) & \geq\frac{c+u}{W} &\\
         & \Rightarrow & (1+\beta) & \leq \frac{1}{p}-\frac{c+u}{Wp} &\\
         & \Rightarrow & \beta & \leq \frac{1-p}{p}-\frac{c+u}{Wp} & \\
         & \Rightarrow & \beta_{\max} & = \frac{1-p}{p}-\frac{c+u}{Wp} &
    \end{flalign*}

    \begin{alignat*}{2}
        & \Rightarrow & \qquad 1-p(1+\beta) & \geq\frac{c+u}{W}\\
         & \Rightarrow & (1+\beta) & \leq\frac{1}{p}-\frac{c+u}{Wp} \\
         & \Rightarrow & \beta & \leq \frac{1-p}{p}-\frac{c+u}{Wp} \\
         & \Rightarrow & \beta_{\max} & =  \frac{1-p}{p}-\frac{c+u}{Wp}
    \end{alignat*}

\end{document} 

enter image description here

Addendum:

If you want the block of equations to be aligned on the left, you can use the fleqn option from amsmath (in which case all equations will be left-aligned. If you want only some equations to be left-aligned, you can nest athe alignat* environment in a fleqn environment (from package nccmath). The environment can take an optional argument, which is the distance from the left margin (0pt by default).

Here is an example:

\documentclass{article}
\usepackage{amsmath, nccmath}
\usepackage[showframe]{geometry}

\begin{document}

\begin{fleqn}[1em]
        \begin{alignat*}{2}
            & \Rightarrow & \quad 1-p(1+\beta ) & \geq\frac{c+u}{W}\\
             & \Rightarrow & (1+\beta ) & \leq\frac{1}{p}-\frac{c+u}{Wp} \\
             & \Rightarrow & \beta & \leq \frac{1-p}{p}-\frac{c+u}{Wp} \\
             & \Rightarrow & \beta_{\max} & = \frac{1-p}{p}-\frac{c+u}{Wp}
        \end{alignat*}
\end{fleqn}

\end{document} 

enter image description here

  • I am looking for something with the flalign* command like the first one you suggested. However, I don't want the huge spacing that you got between the \Rightarrow and the rest of the equation... I just need to move the right part of the equation much closer to the left one. The left one should remain aligned left. – Yohan Obadia Nov 27 '17 at 11:11
  • I give you a +1 for the k columns explanation. However I can't accept the answer as it is since it does not solve my issue. I will validate it if you can show me a solution that allows to align everything to the left without the huge spacing that you get in your first solution. – Yohan Obadia Nov 27 '17 at 13:09
  • Oh! I didn't understand you wanted everything on the left. I suppose you don't want all your equations aligned to the left? – Bernard Nov 27 '17 at 18:32
  • @YohanObadia: I've updated my answer with another example. Is that what you want? – Bernard Nov 27 '17 at 18:50
  • Yes exactly ! This is not achievable with flalign ? Meanwhile I will use your solution, thanks ! – Yohan Obadia Nov 27 '17 at 19:07

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.