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}
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

  • 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 Nov 28 '14 at 3:34
  • @Harish Kumar With tasks, Can I get numberate has the form 1) 2) ...? – minthao_2011 Nov 28 '14 at 7:36
  • @minthao_2011: Add ,counter-format=tsk) to the options. – user11232 Nov 28 '14 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}
  • 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 Nov 28 '14 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 – David Carlisle Nov 28 '14 at 8:26

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.