0

MWE:

\documentclass{article}
\usepackage{enumitem}
\newcommand{\bulletlabel}{\raisebox{0.2ex}{\small$\bullet$}}

\begin{document}

\begin{enumerate}[label=\bulletlabel, topsep=0pt, leftmargin=0.3in, rightmargin=0.3in]
    \item One
    \item Two
\end{enumerate} 
\end{document}

As you can see, I've parameterised my enumerate environment to get the formatting I want. I use this set of parameters fairly often in my document, together with 2 other sets of parameters.

Is there a quick way for me to replicate this without having to copy/paste or type it out every time? I don't want to redefine the default enumerate environment, as there are 2 other sets of parameters that I need to handle as well. I'm just looking for a quick way to do it.

I tried this:

\newcommand{\paramone}{label=\bulletlabel, topsep=0pt, leftmargin=0.3in, rightmargin=0.3in}

But when I use:

\begin{enumerate}[\paramone]

It fails because it processes it as one parameter rather than 4.

How can I achieve this?

Thev
  • 1,568
  • These are expansion issues, I think. You could make it work using \newcommand{\paramone}{label=\noexpand\bulletlabel, topsep=0pt, leftmargin=0.3in, rightmargin=0.3in} \edef\temp{\noexpand\begin{enumerate}[\paramone]} \temp \item One \item Two \end{enumerate} Of course this is not necessarily elegant. (I am also surprised to see how quickly this got closed, and am not convinced that the correct "partner" post has been identified.) –  Dec 27 '18 at 00:14
  • @marmot I have made it work using \newlist{intextbullets}{enumerate}{6} \setlist[intextbullets]{label=\bulletlabel, topsep=0pt, leftmargin=0.3in, rightmargin=0.3in}. – Thev Dec 27 '18 at 00:28
  • I think my first comment identifies the correct post to refer to, rather than the one it was marked as a duplicate of. – Thev Dec 27 '18 at 00:30
  • Yes, your way more elegant and I did not close your question. –  Dec 27 '18 at 00:33

0 Answers0