Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Embedded list item numbers

82 views
Skip to first unread message

Peter Flynn

unread,
Sep 12, 2022, 5:18:13 AM9/12/22
to
I'm trying to use the enumitem package to get this format:

============================================================
1 This is the first item in the list. The number is NOT
in the margin, but embedded in the 1em indentation, in bold.
2 This is the second item. The remainder of the text in
the item wraps to the left-hand edge of the text area.
The list itself is flush with the left-hand edge also.
============================================================

I have managed to get it to look right, but the log file says

> Package enumitem Warning: Negative labelwidth. This does not make much
> (enumitem) sense, on input line 60.

Line 60 says

\begin{enumerate}[label=\textbf{\arabic*},
labelwidth=-1em,itemindent=0pt,
leftmargin=0pt,noitemsep]

Before I start stripping the file down to a MWE, is there a
better way to do this?

Peter

Peter Flynn

unread,
Sep 12, 2022, 5:36:47 AM9/12/22
to
On 12/09/2022 10:18, Peter Flynn wrote:
[...]
> Before I start stripping the file down to a MWE, is there a
> better way to do this?

Here's the MWE

=============================================================
\documentclass{article}
\usepackage{enumitem,parskip}
\begin{document}
Left
\begin{enumerate}[label=\textbf{\arabic*},
labelwidth=-1em,itemindent=0pt,
leftmargin=0pt,noitemsep]
\item This is the first item in the list. The number is NOT
in the margin, but embedded in the 1em indentation, in bold.
\item This is the second item. The remainder of the text in
the item wraps to the left-hand edge of the text area.
The list itself is flush with the left-hand edge also.
\end{enumerate}
Left
\end{document}
=============================================================

Peter

Athel Cornish-Bowden

unread,
Sep 12, 2022, 8:44:13 AM9/12/22
to
It produces exactly the result you describe on my system (Mac OS
10.14.6; TexShop 4.21), but with no complaint in the log.


--
Athel -- French and British, living mainly in England until 1987.

Ulrich D i e z

unread,
Sep 12, 2022, 11:28:24 AM9/12/22
to
Peter Flynn wrote:

> Here's the MWE
>
> =============================================================
> \documentclass{article}
> \usepackage{enumitem,parskip}
> \begin{document}
> Left
> \begin{enumerate}[label=\textbf{\arabic*},
>     labelwidth=-1em,itemindent=0pt,
>     leftmargin=0pt,noitemsep]
> \item This is the first item in the list. The number is NOT
> in the margin, but embedded in the 1em indentation, in bold.
> \item This is the second item. The remainder of the text in
> the item wraps to the left-hand edge of the text area.
> The list itself is flush with the left-hand edge also.
> \end{enumerate}
> Left
> \end{document}
> =============================================================


In the first line TeX goes itemindent to the right. For placing
the label of the item TeX from there goes labelsep to the left
and places a box of width labelwidth which sticks towards the left
edge/margin.

I suggest giving itemindent and labelwith the same value and
setting labelsep to 0pt and having item-labels aligned at the
left edge of the box of width labelwidth that holds the
item-label:


\documentclass{article}
\usepackage{enumitem,parskip}
\begin{document}
Left
\begin{enumerate}[label=\textbf{\arabic*},align=left,
itemindent=1em,labelsep=0em,labelwidth=1em,
leftmargin=0pt,noitemsep]
\item This is the first item in the list. The number is NOT
in the margin, but embedded in the 1em indentation, in bold.
\item This is the second item. The remainder of the text in
the item wraps to the left-hand edge of the text area.
The list itself is flush with the left-hand edge also.
\end{enumerate}
Left
\end{document}


If the item numbers can't be just single digits, I suggest
choosing itemindent and labelwidth slightly larger than
just 1em.


Sincerely

Ulrich

Alain Ketterlin

unread,
Sep 12, 2022, 12:12:20 PM9/12/22
to
Peter Flynn <pe...@silmaril.ie> writes:

> I'm trying to use the enumitem package to get this format:
>
> ============================================================
> 1 This is the first item in the list. The number is NOT
> in the margin, but embedded in the 1em indentation, in bold.
> 2 This is the second item. The remainder of the text in
> the item wraps to the left-hand edge of the text area.
> The list itself is flush with the left-hand edge also.
> ============================================================
>
> I have managed to get it to look right, but the log file says
>
>> Package enumitem Warning: Negative labelwidth. This does not make much
>> (enumitem) sense, on input line 60.
>
> Line 60 says
>
> \begin{enumerate}[label=\textbf{\arabic*},
> labelwidth=-1em,itemindent=0pt,
> leftmargin=0pt,noitemsep]

It seems to me that what you want is provided by the [wide] option,
which, according to the manual, means

align=left, leftmargin=0pt, labelindent=\parindent,
listparindent=\parindent, labelwidth=0pt, itemindent=!

-- Alain.

Peter Flynn

unread,
Sep 13, 2022, 3:30:55 PM9/13/22
to
On 12/09/2022 11:18, Peter Flynn wrote:
> I'm trying to use the enumitem package to get this format:

Thank you all for your help.

Peter
0 new messages