2

in my document I have 2 types of enumerate lists. I use enumerate for lists like:

1. Item

2. Item

3. ...

And enumerate* for lists like:

(a) Item, (b) Item, (c) ...

I set globally the enumerate using \setlist[enumerate]{label=\bfseries\arabic*.} but I can't set globally the enumerate* using \setlist[enumerate*]{label=\bfseries(\alph*)}. How can I set globally the enumerate* environment label?

Extra question: How can I set globally enumerate* for to add automatically a comma after every item and the word "and" before the last item?

\documentclass[12pt,a4paper]{article}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[inline]{enumitem}
\setlist[enumerate]{label=\bfseries\arabic*.}
%\setlist[enumerate*]{label=\bfseries(\alph*)}
\begin{document}
\begin{enumerate}
\item Item 1
\item Item 2
\item Item 3
\end{enumerate}

\begin{enumerate*}
\item Item 1
\item Item 2
\item Item 3
\end{enumerate*}

\begin{enumerate*}[label=\bfseries(\alph*)]
\item Item 1
\item Item 2
\item Item 3
\end{enumerate*}
\end{document}
  • 1
    The correct syntax is \setlist*[enumerate]{label=\bfseries(\alph*)}. – Troy Sep 27 '17 at 15:43
  • @Troy Perfect, however the enumerate environment switch the numeric label to letters. I want to keep the label of enumerate numeric while the enumerate* with letters – Daniel Valencia C. Sep 27 '17 at 17:58
5

The key itemjoin sets the format for in between the items, while the key itemjoin* sets the format for before the last item, overriding the itemjoin setting.

In order to keep the displayed list numeric while the inline list alphabetical, you would have to create a new list, as the \enumerate and \enumerate* environments share the same settings.

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{enumitem}
\newlist{inlinelist}{enumerate*}{1}
\setlist[inlinelist]{label=\bfseries(\alph*), itemjoin={{, }}, itemjoin*={{, and }}} % <-------------
\setlist[enumerate]{label=\bfseries\arabic*.}

\begin{document}
    \begin{enumerate}
        \item Item 1
        \item Item 2
        \item Item 3
    \end{enumerate}

    \begin{inlinelist}
        \item Item 1
        \item Item 2
        \item Item 3
    \end{inlinelist}

    \begin{inlinelist}
        \item Item 1
        \item Item 2
        \item Item 3
    \end{inlinelist}
\end{document}

enter image description here

  • It solved the problem parcially, thanks! however I'd like to set the vertical enumerate list with numbers, while the horizontal enumerate* list with letters. There is a way to do this? Your answers turn the number into letters – Daniel Valencia C. Sep 27 '17 at 17:52
  • 1
    @DanielValenciaC. see update. – Troy Sep 28 '17 at 0:07

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.