Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This is for use in work assignments for math students. I'd like to post multiple parts for a given question, without sacrificing too much space for this. So I want a bunch of equations arrayed horizontally. Each equation should be labeled as a), b) and so on. The labels should be aligned with the top of (the largest of) the boxes. And it would be nice if the space between equations were maximized to fill the whole width of the page.

At the moment, I use a single align* environment, with the spacing between colums that this provides. I use a \raisebox with a manually tuned length to create place the labels in front of each. I haven't managed to span the whole width yet. The result looks like this:

Sample image

I thought that maybe the adjustbox package might be able to help me automate the vertical alignment, and allow me to put \hfill between boxes to use the whole width, but so far I haven't managed to get my equations into such boxes.

Do you have any experience in putting display math into an adjustbox?
Do you know of any other package or environment which might help me in this task?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

The flalign environment, with some help if you want a padding on either side show to be useful; I have hardcode \footnotesize for the matrices, it's easily modifiable.

\documentclass{article}
\usepackage{geometry}
\usepackage{amsmath,adjustbox}
\usepackage{lipsum} % just for the example

\newenvironment{exercise}[1]
 {\text{#1) }
  \begin{adjustbox}{valign=t}\footnotesize$\displaystyle}
 {$\end{adjustbox}}


\begin{document}
\lipsum*[2]
\begin{flalign*}
\quad&
\begin{exercise}{a}
\begin{pmatrix}
3 & 4 & 1 & 3\\
2 & 1 & 2 & 1\\
2 & 6 &-2 & 1\\
5 & 5 & 2 & 3
\end{pmatrix}
\cdot x =
\begin{pmatrix}
3\\9\\-9\\11
\end{pmatrix}
\end{exercise}
&&
\begin{exercise}{b}
\begin{pmatrix}
3 & 3 & 0 & 0\\
2 & 4 & 2 & 0\\
5 & 4 &-1 & 0\\
3 & 6 & 1 & 2
\end{pmatrix}
\cdot x =
\begin{pmatrix}
0\\10\\-5\\11
\end{pmatrix}
\end{exercise}
&&
\begin{exercise}{c}
\begin{pmatrix}
2 & 0 & 0 & 2\\
4 & 4 & 0 & 0\\
3 & 2 & 1 &-1\\
5 & 4 & 0 & 1
\end{pmatrix}
\cdot x =
\begin{pmatrix}
2\\0\\3\\1
\end{pmatrix}
\end{exercise}
\quad\\[3ex]
\quad&
\begin{exercise}{d}
\begin{pmatrix}
3 & 4 & 1 & 3\\
2 & 1 & 2 & 1\\
2 & 6 &-2 & 1\\
5 & 5 & 2 & 3
\end{pmatrix}
\cdot x =
\begin{pmatrix}
3\\9\\-9\\11
\end{pmatrix}
\end{exercise}
&&
\begin{exercise}{e}
\begin{pmatrix}
3 & 3 & 0 & 0\\
2 & 4 & 2 & 0\\
5 & 4 &-1 & 0\\
3 & 6 & 1 & 2
\end{pmatrix}
\cdot x =
\begin{pmatrix}
0\\10\\-5\\11
\end{pmatrix}
\end{exercise}
&&
\begin{exercise}{f}
\begin{pmatrix}
2 & 0 & 0 & 2\\
4 & 4 & 0 & 0\\
3 & 2 & 1 &-1\\
5 & 4 & 0 & 1
\end{pmatrix}
\cdot x =
\begin{pmatrix}
2\\0\\3\\1
\end{pmatrix}
\end{exercise}
\quad
\end{flalign*}
\lipsum[3]
\end{document}

enter image description here

share|improve this answer
    
I thought your way of putting the math into the adjustbox was what I had tried, but apparently not, as this does work. Probably forgot a $ somewhere. But I'm glad I asked, because flalign* is really useful for more than one row. Thanks a lot! For reference: that environment is shipped and documented with amsmath. Although the documentation doesn't look much more than a single example, but that's enough. –  MvG Dec 14 '12 at 16:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.