1

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.

enter image description here

How can I prove my code for such desired output?

0

2 Answers 2

2

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} 

enter image description here

14
  • 1
    Add a blank line after Case 1: , &c. In my opinion, it looks better without the newline.
    – Bernard
    Aug 13, 2020 at 10:59
  • 1
    A better idea: insert an empty line at the beginning of each aligned environment , like this: \begin{aligned}[t] \\\phantom{\implies} & x+3 =0\\\therefore & \quad x = -3 \end{aligned}.
    – Bernard
    Aug 13, 2020 at 11:06
  • 1
    My last comment supposed there was no blank line after Cas 1: and the like.
    – Bernard
    Aug 13, 2020 at 11:13
  • 1
    I've updated the code and the resulting screenshot. Is it like you want now?
    – Bernard
    Aug 13, 2020 at 11:18
  • 1
    Not here, but I load it systematically for myself in the place of amsmath as it is a quite useful extension of the latter, and I completed your snippet with one of my preambles.
    – Bernard
    Aug 13, 2020 at 11:45
2

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} 

demo

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.