I am trying to use the same type of formatting for all enumerated lists, so I thought it would had been easier to write a macro with the formatting, and then to just write in the macro every time I had to use a list, so to avoid repeating myself and messing up the formatting, here's the code.
\documentclass[11pt, a4paper]{article}
\usepackage{enumitem}
\setlist[itemize]{noitemsep, topsep=0pt}
\newcommand{\enumFormatting}{topsep=0pt,itemsep=-1ex,partopsep=1ex,parsep=1ex}
\begin{document}
\begin{enumerate}[\enumFormatting]
\item first item
\item second item
\item third item
\item fourth item
\end{enumerate}
\end{document}
Unluckly this didn't work out since an error is returned when I use \enumFormatting as an argument, I must be getting something wrong. Hopefully you can help me fix this, thanks.
\setlistas you did foritemize:\setlist[enumerate]{topsep=0pt,itemsep=-1ex,partopsep=1ex,parsep=1ex}– Phelype Oleinik Apr 18 '21 at 20:55