3

I'm looking to make assignments and tests in latex article class. I want to be able to do the following very easily:

enter image description here

Couple things: I would like the text in a) or c) to wrap around the imaginary "break" between the two columns. Also, it would be nice if the procedure kept track of the counters together for both columns; otherwise, this might as well be done in MS Word - I'm porting over to LaTeX for the math mode.

3

You can use tasks for the inner list.

\documentclass{article}
\usepackage{enumitem}
\usepackage[more]{tasks}

\NewTasks[style=enumerate,counter-format=tsk[a]),label-width=2.6ex,column-sep=2ex,before-skip=2pt,item-indent = {1em}]
                        {questions}[\subquestion](2)
\begin{document}
\begin{enumerate}[nosep]
  \item Answer any  of the following questions as you wish.
  \begin{questions}
    \subquestion How are you doing? If doing well, answer this question.
    \subquestion How are you doing? If doing well, answer this question.
    \subquestion How are you doing? If doing well, answer this question. How are you doing? If doing well, answer this question.
    \subquestion How are you doing? If doing well, answer this question.
  \end{questions}
  \item You don't have to answer any of these questions as they may be difficult.%  << this % is needed
  \begin{questions}
    \subquestion How are you doing? If doing well, answer this question.
    \subquestion How are you doing? If doing well, answer this question.
    \subquestion How are you doing? If doing well, answer this question. How are you doing? If doing well, answer this question.
    \subquestion How are you doing? If doing well, answer this question.
  \end{questions}
  \item You don't have to answer any of these questions as they may be difficult.%  << this % is needed
  \begin{questions}
    \subquestion How are you doing? If doing well, answer this question.
    \subquestion How are you doing? If doing well, answer this question.
    \subquestion How are you doing? If doing well, answer this question. How are you doing? If doing well, answer this question.
    \subquestion How are you doing? If doing well, answer this question.
  \end{questions}
\end{enumerate}
\end{document}

enter image description here

  • Hey thanks that's an awesome solution; however I can't seem to compile it or really find out why this isn't working. I get a couple of errors: LaTeX error: "kernel/key-unknown" The key 'tasks/list/column-sep' is unknown and is being ignored. Any thoughts? Really would like to get this to work thank! – Dan P. Sep 1 '15 at 1:02
  • @DanP. You need an up to date tex distribution. Please update and it will work. – user11232 Sep 1 '15 at 1:09
  • Awesome! Everything works perfectly now. Thank you very much! – Dan P. Sep 8 '15 at 1:25
1

A solution with the shortlst and enumitem packages. You can choose the number of columns (key nc, 3 by default), the interlining to take into account big formulae (key il, 1 by default) and the distance between item label and item body (key ls, 0.6em by default). If necessary, an item will automatically use more than one column.

Example:

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{shortlst, setspace, amsmath}
\usepackage{enumitem} 
\newlist{exercises}{enumerate}{2}
\setlist[exercises,1]{label=\arabic*. , wide=0pt}
\usepackage{etoolbox}

\AtBeginEnvironment{tabenumerate}{\renewcommand\theenumi{\alph{enumi})}
\settowidth{\labelwidth}{\mbox{(m)}}}


\makeatletter
\newcounter{ncol}
\define@key{lex}{nc}[3]{\setcounter{ncol}{#1}}%% 3 columns by default
\define@key{lex}{il}[1.5]{\def\@intln{#1}}% interlining![1]
\define@key{lex}{ls}[0.6em]{\setlength{\labelsep}{#1}}%%distance between label and item body
\newenvironment{tabenumerate}[1][]{%\setlength\labelsep{0.6em}
\setkeys{lex}{nc,il,ls, #1}
\setlength{\leftmargini}{\dimexpr\labelwidth+\labelsep\relax}%[1][3]
\setlength{\shortitemwidth}{\dimexpr\linewidth/\value{ncol}-\labelwidth-2\labelsep\relax}%
\setstretch{\@intln}
\begin{shortenumerate}\everymath{\displaystyle}}%
{\end{shortenumerate}
 }%
 \newcommand\paritem[2][1]{\item \parbox[t]{#1\shortitemwidth}{\setstretch{1}#2\medskip}}
\makeatother

\begin{document}

\vspace*{1cm}
\begin{exercises}
\item For the following questions, \&c. \vspace{-\baselineskip}
 \begin{tabenumerate}[nc=3, il =2.5, ls =1em]
 \item $ a_n = \frac{4n^3 - (-1)^nn^2}{5n + 2n^3}$
 \item $ b_n = \frac{(n^3 - 5n)^4 - n^{12}}{n^{11}}$
 \item $ c_n = \frac{n^{n + 1}}{n!}$\label{q-3}
 \item $ e_n = \frac{2^{(n^3)}}{n!5^{(n^2)} - n^n}$
 \item $ f_n = \sqrt{n + \sqrt{2n}} - \sqrt{n + \sqrt{2n}}\mkern1mu x$
 \end{tabenumerate}
\end{exercises}
See question \ref{q-3}.

\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.