0
\documentclass[10pt, a4paper]{article}
\usepackage{lipsum}
\usepackage{enumitem}
\setlist{topsep=1cm}

\begin{document}

\lipsum[66]

\begin{itemize}
\item[\textbf{(P1)}:]
\end{itemize}

\end{document}

The enumitem setting makes the item lose its indentation. Why? I tried this with no success:

\documentclass[10pt, a4paper]{article}
\usepackage{lipsum}
\usepackage{enumitem}
\setlist{topsep=1cm}
\setlist{labelindent=\parindent, leftmargin=*}


\begin{document}

\lipsum[66]

\begin{itemize}
\item[\textbf{(P1)}:]
\end{itemize}

\end{document}
4
  • 1
    It seems that you're abusing the itemize label by overriding it explicitly. But this has nothing to do with using enumitem or not. Why not use an enumerate list and use label={\bfseries (P\arabic*)}?
    – Alan Munn
    Commented Apr 19, 2023 at 17:32
  • This doesn't solve the indentation issue.
    – jfk
    Commented Apr 19, 2023 at 18:49
  • You haven't really explained what that issue actually is, since as I mentioned, the format has nothing to do with enumitem, and your sample documents don't really show what kind of indentation you're expecting. A large label will overlap the left margin, unless you explicity change the margins. So describe what indentation you are looking for and then we can help you achieve it.
    – Alan Munn
    Commented Apr 20, 2023 at 1:54
  • With this minimal example, you'll see that itemize is by default indented with the first line of paragraphs. I want to keep that alignement. But if I set \setlist{topsep=1cm} with enumitem, the alignement is pulled back to the non-indented lines.
    – jfk
    Commented Apr 20, 2023 at 11:21

2 Answers 2

4

The problem you're having has nothing do do with enumitem and everything to with the fact that you're trying to fit a large label into a small space, so the label appears to change the indent but in reality it is simply expanding to the right. Presumably you expected the label to start left aligned at the indentation but that's not how list labels are usually set.

Here's your minimal example without loading enumitem and you can see that the effect is identical:

\documentclass[10pt, a4paper]{article}
\usepackage{lipsum}

\begin{document}
\lipsum[66]
\begin{itemize}
\item some text
\item[\textbf{(P1)}:] Some text
\item Some text
\end{itemize}

\end{document}

output of first example

So the solution to your problem (which is easily solved by using enumitem) is to adjust the margins of the list appropriately so that you have enough room for the larger label text and you have an indent of the items. This requires changing both the leftmargin and the labelindent parameters.

Additionally, since you are misusing the itemize list to form what looks like a numbered list, you should really format the label of the list using enumerate instead of itemize. And in general, it's almost always a bad idea to supply an explicit label to a list item, and you should avoid doing it wherever possible.

\documentclass[10pt, a4paper]{article}
\usepackage{lipsum}
\usepackage{enumitem}

\begin{document}
\lipsum[66]

\begin{enumerate}[label={\bfseries (P\arabic*):},leftmargin=3\parindent,labelindent=1.5\parindent]
\item some text
\item \lipsum[66]
\end{enumerate}

\end{document}

output of second example

2
  • Mmh OK I know what happens. The document where I wanted to apply this setting had \usepackage[french]{babel} in the preambule. I didn't think that a language package could have an implication in such a layout problem. I didn't add it to my example. But if you try your minimal example with babel loaded you'll see that the label is indented and that the addition of enumitem creates what I describe. Now if I keep babel with your solution it'll keep being non-indented.
    – jfk
    Commented Apr 20, 2023 at 15:29
  • 1
    @jfk See tex.stackexchange.com/q/683325/2693 for a solution to the babel problem. You can turn off the list modifications that babel French does.
    – Alan Munn
    Commented Apr 20, 2023 at 16:00
0

After your inputs and further investigations I managed to get what I wanted with the following code (option wide was the key to the desired indentation):

\documentclass[10pt, a4paper]{article}

\usepackage[french]{babel}
\frenchsetup{StandardLayout=true}

\usepackage{lipsum}

\usepackage{enumitem}
\setlist{topsep=1cm, wide, itemsep=0pt, leftmargin=3\parindent, rightmargin=3\parindent} 


\begin{document}

\lipsum[66]

\begin{enumerate}[label={\bfseries (P\arabic*)}:]
\item
\item
\item
\end{enumerate}

\lipsum[66]

\end{document}

enter image description here

You must log in to answer this question.

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