1

I have a problem, maybe with indentation but I don´t sure. This the code:

\documentclass[12pt]{article}

\usepackage[letterpaper]{geometry} 
\geometry{top=1.5cm, bottom=2.5cm, hmargin=3cm}
\usepackage[fleqn]{amsmath}
\usepackage{xcolor}
\usepackage{multicol}

\begin{document}

\begin{enumerate}
\begin{multicols}{2}
\item $ \displaystyle \int e^{-x}\,dx $
\begin{align*}
\begin{cases}
& u=-x\\
& du=-dx
\end{cases}\\
& \int -e^u\,du\\
& -e^u\\
& \textcolor{red}{=-e^{-x}+c}
\end{align*}

\end{multicols}
\end{enumerate}
\end{document}

This code creates in latex the left side of the image(the before), but I need something like the right side of the image(the after).

enter image description here

Thank you :)

2

You just have to add a & before the cases environment, and remove the & inside cases. I propose a second layout which uses flalign:

\documentclass[12pt]{article}

\usepackage[letterpaper]{geometry}
\geometry{top=1.5cm, bottom=2.5cm, hmargin=3cm}
\usepackage[fleqn]{mathtools}
\usepackage{xcolor}
\usepackage{multicol}

\begin{document}
%
\begin{multicols}{2}
  \begin{enumerate}
    \item $ \displaystyle ∫ e^{-x}\,dx $
          \begin{align*}
              & \begin{cases} \phantom{d}u=-x\\
            du=-dx
            \end{cases}\\
              & ∫ -e^u\,du \\
              & -e^u \\
              & \textcolor{red}{=-e^{-x}+c}
          \end{align*}

    \item $ \displaystyle ∫ e^{-x}\,dx $
          \begin{flalign*}
            & \begin{cases}
            \phantom{d}u=-x\\
            du=-dx
            \end{cases} & & & & \\
            & ∫ -e^u\,du\\
            & -e^u\\
            & \textcolor{red}{=-e^{-x}+c}
          \end{flalign*}

  \end{enumerate}
\end{multicols}

\end{document} 

enter image description here

1

Is this what you want?

\documentclass[12pt]{article}

\usepackage[letterpaper]{geometry} 
\geometry{top=1.5cm, bottom=2.5cm, hmargin=3cm}
\usepackage[fleqn]{amsmath}
\usepackage{xcolor}
\usepackage{multicol}

\begin{document}

\begin{enumerate}
\item 
\begin{align*}
\int e^{-x}\,&dx \\
&\begin{cases}
& u=-x\\
& du=-dx
\end{cases}\\
& \int -e^u\,du\\
& -e^u\\
& \textcolor{red}{=-e^{-x}+c}
\end{align*}

\end{enumerate}
\end{document}

enter image description here

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.