3

I am using the multicols package in combination with enumerate environment, with equations in each item. Each item is aligned horizontally with its equation, and I like that. Whay I dont like is that items are not aligned horizontally between them. There a solution for align items horizontally between them, with this package, or another one?

This is a MWE:

\documentclass[12pt]{article}
\usepackage{multicol}
\begin{document}
\begin{multicols}{4}
\begin{enumerate}
\item $\displaystyle \frac{1}{1+\frac{1}{x}}$
\item $\displaystyle \frac{1}{1+\frac{1}{x}}$
\item $\displaystyle 1+x$
\item $\displaystyle 1+x$
\end{enumerate}
\end{multicols}
\end{document}

2 Answers 2

6

May be you are safe with tasks

\documentclass{article}
\usepackage[more]{tasks}
\begin{document}
  \begin{tasks}[style=enumerate](4)
  \task $\displaystyle \frac{1}{1+\frac{1}{x}}$
  \task $\displaystyle \frac{1}{1+\frac{1}{x}}$
  \task $\displaystyle 1+x$
  \task $\displaystyle 1+x$
  \end{tasks}
\end{document}

enter image description here

Or with enumitem

\documentclass[12pt]{article}
\usepackage[inline]{enumitem}
\begin{document}
\begin{enumerate*}[itemjoin=\hfill]
\item $\displaystyle \frac{1}{1+\frac{1}{x}}$
\item $\displaystyle \frac{1}{1+\frac{1}{x}}$
\item $\displaystyle 1+x$
\item $\displaystyle 1+x$
\end{enumerate*}

\end{document}

enter image description here

3
  • Thanks, this is the first time I heard about tasks package, and this is exactly I want. All the others solutions also are good, but this one solves my problem in a better way.
    – Gitano
    Commented Nov 28, 2014 at 3:34
  • @Harish Kumar With tasks, Can I get numberate has the form 1) 2) ...? Commented Nov 28, 2014 at 7:36
  • @minthao_2011: Add ,counter-format=tsk) to the options.
    – user11232
    Commented Nov 28, 2014 at 7:45
8

This numbers horizontally rather than in columns, but doesn't need any packages:

enter image description here

\documentclass[12pt]{article}

\newcommand\z[1]{%
\baselineskip3\normalbaselineskip
\makebox[.25\textwidth][l]{%
\refstepcounter{enumi}%
\makebox[2em][l]{\theenumi.}%
$\displaystyle#1$}\linebreak[0]\hfill\ignorespaces}

\begin{document}


\begin{center}
\z{\frac{1}{1+\frac{1}{x}}}
\z{\frac{1}{1+\frac{1}{x}}}
\z{1+x}
\z{1+x}
\z{\frac{19}{1+\frac{1}{xkkk}}}
\z{\frac{1}{1+\frac{1}{x}}}
\z{\frac{1+x}{2}}
\z{z+x}
\end{center}

\end{document}
2
  • Thanks, the code works perfect, but I have several sistems of equations (in line), with different number of equations in the same document, so I need to modify the code with different name in the same document.
    – Gitano
    Commented Nov 28, 2014 at 3:42
  • you only need to modify the code if you want a different number of columns you can use \newenvironment to make yourself an environment that sets \setcounter{enumi}{0} then does the above center if you need different number of columns make that #1 and replace .25\textwidth by \dimexpr\textwidth/#1 Commented Nov 28, 2014 at 8:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .