2

I want to generate an environment that allows to establish the number of columns.

I tried the following environment but I do not know if the \AtBeginEnvironment commands are compatible with \newenvironment

...

\usepackage{etoolbox}
\usepackage{multicol}

\newenvironment{ncomunas}[1][2]{%
\AtBeginEnvironment{itemize}{\begin{multicols}{#1}}%
}
{%
\AtEndEnvironment{itemize}{\end{multicols}}%
}
3
  • 1
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Sep 24, 2018 at 4:28
  • If I understand well, you're probably after the functionalities of the tasks package.
    – Bernard
    Sep 24, 2018 at 8:38
  • Have a look at the paralist package, which offers some extra lists (less space, in-line, etc.).
    – Keks Dose
    Sep 24, 2018 at 10:46

1 Answer 1

1

Just wrap multicols around itemize:

\documentclass{article}
\usepackage{multicol}
\usepackage{lipsum} % for context

\newenvironment{ncomunas}[1][2]
 {\begin{multicols}{#1}\begin{itemize}}
 {\end{itemize}\end{multicols}}

\begin{document}

\lipsum[2]

\begin{ncomunas}[3]
\item abc
\item def
\item ghi
\item jkl
\item mno
\end{ncomunas}

\lipsum[3]

\end{document}

enter image description here

You should also consider the tasks package.

You must log in to answer this question.

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