0

I'm using flalign* because I want everything to begin on the left instead of being centered, but the issue I'm having is that I want multiple alignment positions (in this case 3) within the flalign environment, and nothing I've tried is working.

This is the code I have so far (MWE):

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\section{Test} \label{sec:floats}
\begin{enumerate}
    \item
    \begin{flalign*}
    (BC)&\text{ For }n=4, b_4=4^2=16,c_4=4!=4\cdot3\cdot2\cdot1=24 \\[0.25em]
    &\therefore b_4 \leq c_4 \hspace{2mm} \checkmark \\[0.25em]
    (IH)&\text{ Asm for }k\geq4 \text{ that }k^2\leq k! \\[0.25em]
    &\text{WTS: }(k+1)^2\leq (k+1)! \\[0.25em]
    (IS)&\text{ Consider } n=k+1 \\[0.25em]
    (k+1)!&=(k+1)\cdot k!  \\[0.25em]
    &\geq (k+1)\cdot k^2 &&\text{(IH)} &\\[0.25em]
    &\geq (k+1)^2 \hspace{2mm}\blacksquare &&k^2\geq(k+1) &\\
    \end{flalign*}
\end{enumerate}

\end{document}

which results in:

enter image description here

What I need, though, is for the line that begins

(k+1)! = (k+1)k!

to be aligned with the lines that begin with

b_4

WTS

('for','asm', and 'consider' are intentionally one space over)

while also having the inequalities below stay aligned with the equals sign, and obviously not affecting the descriptions on the far right of those lines.

2
  • Your MWE doesn't compile because of the undefined control sequences \checkmark, \blacksquare, and \therefore. Note that the symbol for \therefore would've come before b_4: so you want the \therefore symbol to be aligned with WTS, or do you want the alignment to be at b_4? Commented Jul 1, 2022 at 13:45
  • Also, the amsmath flalign is for "full length", not "flush left". Commented Jul 1, 2022 at 13:52

1 Answer 1

1

There are some things that are unclear about your request. So I did a best guess at what you want. See comments after the code for some discussion. If you can specify a bit more intent of what you are trying to accomplish along with general guidelines of why each item should go there, maybe someone can provide better code that is not so hackish.

\documentclass{article}
\usepackage{amsmath, amssymb}

\begin{document}

\section{Test} \label{sec:floats}
\begin{enumerate}
    \item
    \begin{flalign*}
    (BC)&\text{ For }n=4, b_4=4^2=16,c_4=4!=4\cdot3\cdot2\cdot1=24 \\[0.25em]
    &\therefore b_4 \leq c_4 \hspace{2mm} \checkmark \\[0.25em]
    (IH)&\text{ Asm for }k\geq4 \text{ that }k^2\leq k! \\[0.25em]
    &\text{WTS: }(k+1)^2\leq (k+1)! \\[0.25em]
    (IS)&\text{ Consider } n=k+1 \\[0.25em]
    &\begin{aligned}
    (k+1)!&=(k+1)\cdot k!  \\[0.25em]
    &\geq (k+1)\cdot k^2 &\hspace{1in} &\text{(IH)} &\\[0.25em]
    &\geq (k+1)^2 \hspace{2mm}\blacksquare &&k^2\geq(k+1) 
    \end{aligned} && % <----- see comment 3 below
    \end{flalign*}
\end{enumerate}

\end{document}

enter image description here

Discussion:

  1. I added the amssymb package to get rid of a bunch of undefined control sequences. In the future please make sure your MWE is compileable as is (unless your intent is to show the error message).
  2. The intention of the flalign environment is not to create a "flush left" aligned environment. The letters fl stand for "full length". What it does is (from the manual)

The environment flalign (“full length alignment”) stretches the space between the equation columns to the maximum possible width, leaving only enough space at the margin for the equation number, if present.

  1. In particular, if you have only one single alignment point, then flaign functions no different from align. Since you seem to want to fake a flush left environment, I inserted an extra && at the end to make it have two equation columns (even though the second is empty).
  2. As an aside, if you just want displayed equations to be flush left for the entire document, you should just invoke the fleqn option for amsmath.
  3. To make the block starting (k+1)! aligned with the \therefore b_4, I placed it after the first alignment point & of the flalign (same point as you did for \therefore b_4. To create an internal alignment within the block, I wrapped the whole block inside an aligned environment. The alignment points within the block is computed separately from those outside the block, and the entire block is considered as one single entity by flalign.
  4. Because of the previous comment, and since you have not specified any rules about where you wanted the comments (IH) and k^2 \geq (k+1) to be located, I just padded some space (1 inch in the code above). You may want to adjust it to your liking.
  5. If this is only a portion of a bigger piece of code, and the bigger piece of code will require aligning the label (IH) and k^2 \geq (k+1) with something else, you may want to use a carefully designed alignedat instead.
  6. Trying to guess at the intent of your code, I don't think I would put the whole thing as one giant displayed math! It should probably be done as some sort of list environment instead.
  7. If you find yourself typing \\[0.25em] every single line, then you may want to just change the row spacing. See this answer for some suggestions on how you can do it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .