# Arranging exercises row-wise on the page

I have been using tabularx to arrange practice exercises on the page, like this:

\documentclass[12pt]{exam}
\usepackage{amsmath}
\usepackage{kpfonts}
\usepackage{tabularx}
\usepackage{titlesec}

\footer{}{}{}
\parindent=0in
\titleformat{\section}[block]{\large\bfseries\filcenter}{}{1em}{}
\setcounter{secnumdepth}{0}

\begin{document}

\section{More Practice With Trig Identities}
Establish each identity.
\begin{questions}
\newlength{\spacer}
\setlength{\spacer}{1in}

\begin{tabularx}{\textwidth}{ XX }
\question $\left(\sec\theta+\tan\theta\right)\left(\sec\theta-\tan\theta\right)=1$
& \question $\dfrac{1-\sin\theta}{1+\sin\theta} = \left(\sec\theta-\tan\theta\right)^2$     \\ [\spacer]
\question $\tan^2\theta\cos^2\theta+\cot^2\theta\sin^2\theta=1$
& \question $\sec^4\theta - \sec^2\theta= \tan^4\theta + \tan^2\theta$  \\ [\spacer]
\question $\sec\theta-\tan\theta=\dfrac{\cos\theta}{1+\sin\theta}$
& \question $3\sin^2\theta+4\cos^2\theta=\cos^2\theta+3$    \\ [\spacer]
\question $1-\dfrac{\sin^2\theta}{1+\cos\theta} = \cos\theta$
&    \question $\cos^2\theta\left(1+\tan^2\theta\right)=1$ \\ [\spacer]
\end{tabularx}
\end{questions}
\end{document}


I know that this is not what tabular environments were designed for, and it's obviously less than ideal, especially when things have different heights. But what should I be using instead of tabular?

-
tabularx isn't needed there you just have XX so tex sets the teable multiple times and does lots of calculations just to work out the width of X which you know in advance is half \textwidth -2\tabcolsep) so you could just use p{(\textwidth-2\tabcolsep)/2} (calc package), or you could simply use two minipages and no tabular at all. your equations would be better in display mode so [] rather than – David Carlisle Aug 17 '13 at 11:13 @DavidCarlisle However, using two minipages will change how exercises are numbered (column-wise rather than row-wise, as desired). – Jubobs Aug 17 '13 at 11:17 @Jubobs why? two X is two minipages more or less, it is the same thing. – David Carlisle Aug 17 '13 at 11:18 p{(\textwidth-4\tabcolsep)/2} (correction to what I wrote above:-) – David Carlisle Aug 17 '13 at 11:20 @kmacinnis you really want the equation numbers on each row to be aligned, hang on I'll post some code in an answer – David Carlisle Aug 17 '13 at 11:33 ## 3 Answers Here's another proposal using my tasks package: \documentclass[12pt]{article} \usepackage{tasks} \usepackage{amsmath} \usepackage{kpfonts} \usepackage{titlesec} \setlength\parindent{0in} \titleformat{\section}[block]{\large\bfseries\filcenter}{}{1em}{} \setcounter{secnumdepth}{0} \newlength{\spacer} \setlength{\spacer}{1in} \begin{document} \section{More Practice With Trig Identities} Establish each identity. \begin{tasks}[counter-format=tsk.](2) \task(\sec\theta+\tan\theta)(\sec\theta-\tan\theta)=1$\task$\dfrac{1-\sin\theta}{1+\sin\theta} = (\sec\theta-\tan\theta)^2 $\vspace{\spacer} \task$\tan^2\theta\cos^2\theta+\cot^2\theta\sin^2\theta=1 $\task$\sec^4\theta - \sec^2\theta= \tan^4\theta + \tan^2\theta $\vspace{\spacer} \task$\sec\theta-\tan\theta=\dfrac{\cos\theta}{1+\sin\theta} $\task$3\sin^2\theta+4\cos^2\theta=\cos^2\theta+3 $\vspace{\spacer} \task$1-\dfrac{\sin^2\theta}{1+\cos\theta} = \cos\theta $\task$\cos^2\theta(1+\tan^2\theta)=1\$

\end{document}


-
+1 for also getting rid of the unneeded \left and \right directives. :-) – Mico Aug 17 '13 at 13:27
exsheets looks great! I'm going to check it out. – Jubobs Aug 17 '13 at 15:00
@Jubobs this answer doesn't actually use it, though, but only its sub-package tasks... – clemens Aug 17 '13 at 16:46
Wow-- exsheets (and tasks), where have you been all my life?! After reviewing the documentation, it's even better-- I can set after-item-skip instead of doing the \spacer nonsense. Thank you! – kmacinnis Aug 17 '13 at 17:09

Although I, too, would opt for exsheets, this is a solution that exploits the \question command of the exam class you're using already and minipages.

You must use, in this case, the new defined environment myquestion

\documentclass[12pt,leqno]{exam}
\usepackage{amsmath}
\usepackage{kpfonts}

\usepackage{titlesec}

\footer{}{}{}
\parindent=0in
\titleformat{\section}[block]{\large\bfseries\filcenter}{}{1em}{}
\setcounter{secnumdepth}{0}

\newlength{\spacer}
\setlength{\spacer}{0.5in}

\newenvironment{myquestion}{%
\begin{minipage}{0.45\textwidth}
\question
}{%
\end{minipage}
\vspace{\spacer}
}

\begin{document}

\section{More Practice With Trig Identities}
Establish each identity.

\raggedright

\begin{questions}
\begin{myquestion}
$$(\sec\theta+\tan\theta)(\sec\theta-\tan\theta)=1$$
\end{myquestion}
\begin{myquestion}
$$\dfrac{1-\sin\theta}{1+\sin\theta} = (\sec\theta-\tan\theta)^2$$
\end{myquestion}
\begin{myquestion}
$$\tan^2\theta\cos^2\theta+\cot^2\theta\sin^2\theta=1$$
\end{myquestion}
\begin{myquestion}
$$\sec^4\theta - \sec^2\theta= \tan^4\theta + \tan^2\theta$$
\end{myquestion}
\begin{myquestion}
$$\sec\theta-\tan\theta=\dfrac{\cos\theta}{1+\sin\theta}$$
\end{myquestion}
\begin{myquestion}
$$3\sin^2\theta+4\cos^2\theta=\cos^2\theta+3$$
\end{myquestion}
\begin{myquestion}
$$1-\dfrac{\sin^2\theta}{1+\cos\theta} = \cos\theta$$
\end{myquestion}
\begin{myquestion}
$$\cos^2\theta(1+\tan^2\theta)=1$$
\end{myquestion}
\end{questions}

\end{document}


-

An alternative to tables, just set the whole thing as a paragraph:

\documentclass[12pt,leqno]{exam}
\usepackage{amsmath}
\usepackage{kpfonts}

\usepackage{titlesec}

\footer{}{}{}
\parindent=0in
\titleformat{\section}[block]{\large\bfseries\filcenter}{}{1em}{}
\setcounter{secnumdepth}{0}

\begin{document}

\section{More Practice With Trig Identities}
Establish each identity.

\raggedright
\setlength\baselineskip{1in plus \fill}

\begin{minipage}{.45\textwidth}
$$\left(\sec\theta+\tan\theta\right)\left(\sec\theta-\tan\theta\right)=1$$
\end{minipage}
\begin{minipage}{.45\textwidth}
$$\dfrac{1-\sin\theta}{1+\sin\theta} = \left(\sec\theta-\tan\theta\right)^2$$
\end{minipage}
\begin{minipage}{.45\textwidth}
$$\tan^2\theta\cos^2\theta+\cot^2\theta\sin^2\theta=1$$
\end{minipage}
\begin{minipage}{.45\textwidth}
$$\sec^4\theta - \sec^2\theta= \tan^4\theta + \tan^2\theta$$
\end{minipage}
\begin{minipage}{.45\textwidth}
$$\sec\theta-\tan\theta=\dfrac{\cos\theta}{1+\sin\theta}$$
\end{minipage}
\begin{minipage}{.45\textwidth}
$$3\sin^2\theta+4\cos^2\theta=\cos^2\theta+3$$
\end{minipage}
\begin{minipage}{.45\textwidth}
$$1-\dfrac{\sin^2\theta}{1+\cos\theta} = \cos\theta$$
\end{minipage}
\begin{minipage}{.45\textwidth}
$$\cos^2\theta\left(1+\tan^2\theta\right)=1$$
\end{minipage}

\end{document}

-