2

I'd like for all of my minipages to be aligned at the top, but the cases environment is causing a few issues:

enter image description here

\documentclass{exam}

\usepackage{amsmath}

\begin{document}

\begin{figure}[h]

\begin{minipage}[t]{0.0075\textwidth}
\raggedright
(a)
\end{minipage}%
\hfill
\begin{minipage}[t]{0.6\textwidth}
\raggedright
{$\begin{aligned}[t]
f(x)
&= 6\biggl[1-\frac{x}{3}+\frac{x^2}{2!3^2}-\frac{x^3}{3!3^3}+
\cdots+\frac{(-1)^n x^n}{n!3^n}+\cdots\biggl]\\[0.5em] 
&= 6-2x+\frac{x^2}{3}-\frac{x^3}{27}+\cdots+\frac{6(-1)^nx^n}{n!3^n}+\cdots
\end{aligned}$}
\end{minipage}%
\hfill
\begin{minipage}[t]{0.3\textwidth}
\raggedright
$3:\left\{\!\begin{aligned}
1 : & \text{two of}\ 6, -2x, \frac{x^2}{3}, -\frac{x^3}{27}\\
2 : & \text{remaining terms}\\
3 : & \text{general term}\\
\end{aligned}\right.$\newline

$\langle -1\rangle$ missing factor of 6
\end{minipage}

\end{figure} 

\end{document}

I'd like for the curly brace in the right minipage to be at the same height as the large brackets for the expression contained in the middle minipage. Using either aligned (which is what I have above) or cases gives me the vertical alignment issue above. Is there an easy way to fix this?

2

enter image description here

image of equations is obtain with use of \raisebox for last equation and tabularx instead of minipages (for slightly shorter code):

\documentclass{exam}
\usepackage{amsmath}
\usepackage{tabularx}

\begin{document}

\begin{figure}[ht]
\begin{tabularx}{\linewidth}{@{}l>{\hsize=0.6\hsize}X
                                 >{\hsize=0.3\hsize}X
                             @{} }
    \hline % remove in real document!
(a) &   $\begin{aligned}[t]
    f(x) & = 6\biggl[1-\frac{x}{3} + \frac{x^2}{2!3^2}-\frac{x^3}{3!3^3}+
            \cdots+\frac{(-1)^n x^n}{n!3^n}+\cdots\biggl]   \\
         &= 6-2x+\frac{x^2}{3}-\frac{x^3}{27}+\cdots+\frac{6(-1)^nx^n}{n!3^n}+\cdots
        \end{aligned}$
    &   \raisebox{-0.8\baselineskip}{$3:\begin{cases}
        1 : & \text{two of}\ 6, -2x, \frac{x^2}{3}, -\frac{x^3}{27}\\
        2 : & \text{remaining terms}\\
        3 : & \text{general term}
        \end{cases}$}
        \vspace{1ex}

        $\langle -1\rangle$ missing factor of 6
\end{tabularx}
\end{figure}

\end{document}
  • This is great but could you explain the options you used for tabularx here? I realize I'll need to read the package documentation to fully understand but thought you might be able to give me the gist. Thanks! – Daniel W. Farlow Dec 20 '17 at 2:40
  • @DanielW.Farlow, tabularx` define column type X which cells are actually \parboxes (or minipages) with automaticaly determined width. with \hsize=0.6\hsize and \hsize=0.3\hsize size are determined ratio between last two columns. – Zarko Dec 20 '17 at 2:45

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.