4

(I am sure somebody should have asked this before, but I cannot find it.)

Is it possible to name enumitem global setups, so that one can define multiple global setups and refer them by name?

\documentclass{article}
\usepackage{libertine}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\setlist[enumerate]{labelsep=*, leftmargin=1.5pc}

\begin{document}

\begin{enumerate}[align=left,
   leftmargin=0pt,
   labelindent=\parindent,
   listparindent=\parindent,
   labelwidth=0pt,
   itemindent=!,
   label=\alph*)]

\item test
\item test

\end{enumerate}

\begin{enumerate}[labelindent=\parindent]
    \item test
    \item test
\end{enumerate}

\end{document}
8

Just define a separate environment for each of your common configurations using \newlist:

\documentclass{article}
\usepackage{libertine}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\newlist{enumerate1}{enumerate}{4}% new enumerate-like environment
\setlist[enumerate1]{% settings for enumerate1
    labelsep=*,
    leftmargin=1.5pc,
    label=\arabic*)
}
\newlist{enumerate2}{enumerate}{4}
\setlist[enumerate2]{
    align=left,
    leftmargin=0pt,
    labelindent=\parindent,
    listparindent=\parindent,
    labelwidth=0pt,
    itemindent=!,
    label=\alph*)
}

\begin{document}

  \begin{enumerate1}
    \item test
    \item test
  \end{enumerate1}

  \begin{enumerate2}
    \item test
    \item test
  \end{enumerate2}

\end{document}

Of course, rather than enumerate1 and enumerate2, ... you can -- and should -- call them whatever you like, so you can choose more suggestive/informative names.

6

You can use \SetEnumitemKey to define a style key:

\documentclass{article}
\usepackage{libertine}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\setlist[enumerate]{labelsep=*, leftmargin=1.5pc}
\SetEnumitemKey{mystyle}{align=left,
   leftmargin=0pt,
   labelindent=\parindent,
   listparindent=\parindent,
   labelwidth=0pt,
   itemindent=!,
   label=\alph*)}


\begin{document}

\begin{enumerate}
\item test
\item test

\end{enumerate}

\begin{enumerate}[mystyle]
    \item test
    \item test
\end{enumerate}

\end{document}

enter image description here

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.