# Is there a package that can automatically align and number a series of calculations?

This is what I am currently doing with the alignat environment of the amsmath package. But I find the syntax heavy and not very user-friendly. I would like the numbering to be automatic a) ... b) ... c) on each line and that the spacing between the columns is easy to configure.

Is there a package that can automatically align and number a series of calculations with a simple and user-friendly syntax?

\documentclass[french,landscape]{article}
\usepackage[margin=6mm]{geometry}
\usepackage{amsmath}
\usepackage{multicol}
\setlength\columnsep{10mm}
\setlength\columnseprule{.4pt}
\raggedcolumns

\begin{document}
\pagestyle{empty}

\setlength{\abovedisplayskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\begin{multicols*}{2}
Effectuer:
\begin{alignat*}{3}
\end{alignat*}
\columnbreak

Effectuer:
\begin{alignat*}{3}
\end{alignat*}
\end{multicols*}
\end{document}

• Use enumerate and multicols. May 2, 2021 at 7:35
• @KimJongUn, multicols will give columns, not rows though. How about tex.stackexchange.com/a/324740/87678 ? May 2, 2021 at 7:36
• @DavidPurton: Thank you. I see. May 2, 2021 at 7:38
• @DavidPurton I feel like task does the job. Can you write a response? May 2, 2021 at 7:39
• I can have a go at a comparison later tonight May 2, 2021 at 9:35

Here's a go at comparing four different packages. I think I like tasks best.

\documentclass{article}

\usepackage{url}
\usepackage{shortlst}
\usepackage{hlist}
\usepackage{multienum}

\begin{document}

\section*{A comparison of horizontal list packages}

\subsection*{shortlst}

\texttt{shortlst} has a non-free licence, so you will need to grab it from
CTAN at \url{https://ctan.org/pkg/shortlst}.

Also, it uses the standard \LaTeX{} labels without easy customisation, so you
have to use a hook to redefine them if you want something else.

\renewcommand\theenumi{\alph{enumi}}%
\renewcommand\labelenumi{\emph{\theenumi})}}

The width of items is calculated automatically to maximise the number of items
per line, but you can set the item width manually using
\verb|\shortitemwidth|.

\begin{shortenumerate}
\item $(+7)+(-12)$
\item $(-7)+(+12)$
\item $(-7)+(-12)$
\item $(+9)+(-5)$
\item $(-4)+(+10)$
\item $(-12)+(-10)$
\item $(+9)+(-9)$
\item $(+12)+(-18)$
\item $(-20)+(+16)$
\end{shortenumerate}

\subsection*{hlist}

\texttt{hlist} seems to work pretty well and his a flexible interface to set
the list parameters. The defaults are not very much like the default \LaTeX{}
lists so I had to fiddle with them a bit.

\sethlist{label sep=0.5em, item offset=2.5em, label width=2em, pre label={},
label={\emph{\alph{hlisti}})}, label align=right}

\begin{hlist}3
\hitem $(+7)+(-12)$
\hitem $(-7)+(+12)$
\hitem $(-7)+(-12)$
\hitem $(+9)+(-5)$
\hitem $(-4)+(+10)$
\hitem $(-12)+(-10)$
\hitem $(+9)+(-9)$
\hitem $(+12)+(-18)$
\hitem $(-20)+(+16)$
\end{hlist}

\texttt{tasks} seems to be the most actively maintained package and has a good
interface for modifying list settings. Default settings are reasonably close
to the standard \LaTeX{} lists.

after-item-skip=-\parsep}

\task $(+7)+(-12)$
\task $(-7)+(+12)$
\task $(-7)+(-12)$
\task $(+9)+(-5)$
\task $(-4)+(+10)$
\task $(-12)+(-10)$
\task $(+9)+(-9)$
\task $(+12)+(-18)$
\task $(-20)+(+16)$

\subsection*{multienum}

\texttt{multienum} uses a somewhat different interface, but still seems to
work fairly well.

There's no interface to customise labels and spacing though, so need to
redefine things manually. Except I couldn't find an easy way of modifying the
spacing between rows.

\renewcommand{\regularlisti}{%
\setcounter{multienumi}{0}%
\renewcommand{\labelenumi}{%

\begin{multienumerate}
\setlength{\parskip}{0pt}%
\setlength{\itemsep}{0pt}%
\mitemxxx{$(+7)+(-12)$}{$(-7)+(+12)$}{$(-7)+(-12)$}
\mitemxxx{$(+9)+(-5)$}{$(-4)+(+10)$}{$(-12)+(-10)$}
\mitemxxx{$(+9)+(-9)$}{$(+12)+(-18)$}{$(-20)+(+16)$}
\end{multienumerate}

\end{document}


• How to make the decimal separator appear as a comma but be written with a point? For example write 3.2 + 1.5 but display 3,2 + 1,5 ? May 15, 2021 at 8:07
• @AndréC you should ask a new question for this. May 15, 2021 at 10:01

What about the tasks package?

\documentclass{article}
\usepackage{amsmath}
\begin{document}

Effectuer:

\end{document}

• This package is great. But it would be even better if you didn't have to write every item in the math mode. Let it be automatic. May 2, 2021 at 8:20
• @AndréC: I just edited my answer to include the item-format=\ensuremath option. If you want all tasks environment in your document to be in math mode automatically, you can use \settasks{item-format = \ensuremath} in the preamble instead. May 2, 2021 at 8:28
• And if I want to number differently i) ii) or 1) 2) is it possible? May 2, 2021 at 8:42
• The tasks package offers the label option which is similar to enumitem's label option. For i) ii) use label=\roman*) and for 1) 2) use label=\arabic*). May 2, 2021 at 8:46
• It's great. Thanks a lot. This package deserves to be known. May 2, 2021 at 8:49

The last resort, maybe!

\documentclass[12pt]{article}
\usepackage[a5paper,margin=1cm,landscape]{geometry}
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage{multicol}
\begin{document}

Effectuer:
\begin{multicols}{3}
\begin{enumerate}[label=\alph*)]
\item $K+i+m$
\item $J+o+n+g$
\item $U+n$
\item $P+e+a+c+e$
\item $B+e$
\item $U+p+o+n$
\item $M+e$
\item $\cdots$
\item $\cdots$
\end{enumerate}
\end{multicols}

\end{document}


• My handouts consist of an A4 sheet of paper divided into two columns (A5) on a landscape layout with the multicols environment. Is it possible to use your solution in this case? May 2, 2021 at 7:54
• @AndréC: I think it is always possible to configure my solution to conform to your requirement. May 2, 2021 at 7:58
• Can you show this in your answer? May 2, 2021 at 8:00
• @AndréC: Hahaha... :-) May 2, 2021 at 9:20