# Indentation of the align environment

TeX - LaTeX Asked by raf on August 29, 2020

My code:

begin{itemize}
item Case $1$ :
begin{align*}
& 2^x-1 =0\
implies & 2^x = 1 \
implies & ln(2^x) = ln(1)  & text{ [taking natural  logarithm on both sides]} \
implies & x ln2 = 0 \
therefore & quad x = 0
end{align*}
item Case $2$ :
begin{align*}
& x+3 =0\
therefore & quad x = -3
end{align*}
item Case $3$ :
begin{align*}
& x-1 =0\
therefore &  quad x = 1
end{align*}
end{itemize}


Now the problem is I don’t want to center the equations in the cases 2 and 3. I want to keep them along the red line I have marked on its output.

How can I prove my code for such desired output?

One can use flalign to NOT center equations, but you need an extra && in at least one line to take up the right side of the page. The indentation is achieved using a minipage, effectively reducing textwidth to the remaining space.

documentclass{article}
usepackage{mathtools, amssymb}
usepackage{showframe}% alignment tool

newlength tempwidth
settowidth{tempwidth}{Case $2$ :}

begin{document}

begin{itemize}
item Case $1$ :begin{minipage}[t]{dimexpr linewidth-tempwidth}
abovedisplayskip=0pt% or even -baselineskip
begin{flalign*}
& 2^x-1 =0 &&\
implies & 2^x = 1 \
implies & ln(2^x) = ln(1) & text{ [taking natural logarithm on both sides]} \
implies & x ln2 = 0 \
therefore & quad x = 0
end{flalign*}end{minipage}
item Case $2$ :begin{minipage}[t]{dimexpr linewidth-tempwidth}
abovedisplayskip=0pt
begin{flalign*}
phantom{implies} & x+3 =0 &&\
therefore & quad x = -3
end{flalign*}end{minipage}
item Case $3$ :begin{minipage}[t]{dimexpr linewidth-tempwidth}
abovedisplayskip=0pt
begin{flalign*}
phantom{implies} & x-1 =0 &&\
therefore & quad x = 1
end{flalign*}end{minipage}
end{itemize}

end{document}


Answered by John Kormylo on August 29, 2020

Like this?

documentclass{article}
usepackage{mathtools, amssymb}

begin{document}

begin{itemize}
item Case $1$ :
begin{aligned}[t] \ & 2^x-1 =0\ implies & 2^x = 1 \ implies & ln(2^x) = ln(1) & text{ [taking natural logarithm on both sides]} \ implies & x ln2 = 0 \ therefore & quad x = 0 end{aligned}
item Case $2$ :
begin{aligned}[t] \ phantom{implies} & x+3 =0\ therefore & quad x = -3 end{aligned}
item Case $3$ :
begin{aligned}[t] \ phantom{implies} & x-1 =0\ therefore & quad x = 1 end{aligned}
end{itemize}

end{document}


Answered by Bernard on August 29, 2020

## Related Questions

### Table horizontal lines are incomplete

1  Asked on October 18, 2020 by miguelpiquet

### How do I duplicate a dotted path over another?

3  Asked on October 18, 2020

### Thoughts about taking LaTeX’s protect-mechanism into account?

1  Asked on October 18, 2020 by ulrich-diez

### Alphabetical sorting of a sequence of names

4  Asked on October 18, 2020

### Wrong LaTeX output in arxiv

1  Asked on October 17, 2020 by youngmath

### Footer items don’t appear with the existing preamble

1  Asked on October 17, 2020 by quantas

### include sql files and use minted for highlighting

1  Asked on October 17, 2020 by volker-raschek

### Why is my photo on the wrong side?

1  Asked on October 16, 2020 by muhashka

### How to customize line spacing on the ToC

1  Asked on October 16, 2020

### Rounded corner in xy package and ellipse shape

0  Asked on October 16, 2020

### Issue combining makecell and cellcolor

2  Asked on October 15, 2020 by netim

### Convert B5 to A4

1  Asked on October 15, 2020

### Alignment of subscripts and superscripts that employ mathchoice

1  Asked on October 15, 2020

### How can I change the line spacing in a multiline caption within the list of figures/tables?

0  Asked on October 14, 2020 by yune

### How to define section to compile conditionally

1  Asked on October 14, 2020 by canaryyellow

### Modifying trad-alpha to remove year from the bibliography item

1  Asked on October 13, 2020

### KOMA-Script and quote environments in footnotes

1  Asked on October 13, 2020 by lawman

### Coloring all nodes that follow to a specific terminal node

1  Asked on October 13, 2020 by utku-trk