I want to set (now wrong) description
environment indents the same as (already correct) enumerate
environment indents.
Note that I already use \usepackage{enumitem}
.
How?
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}
\item a.
\item b.
\end{enumerate}
\begin{description}
\item[1.] a.
\item[2.] b.
\end{description}
\end{document}
The indents of two lists are different. I want to change description
indent to become the same as enumerate
indent.
ADDENDUM
I experimented with the below amsbook
LaTeX file. In some reason, the indent of enumerate
and description
has not become the same as I desire. Please help me to find my error.
\documentclass{amsbook}
\usepackage{enumitem}
\setlist[enumerate,1]{leftmargin=1.7em,labelindent=*}
\setlist[description,1]{leftmargin=1.7em,labelindent=*}
\begin{document}
\begin{enumerate}
\item a.
\item b.
\end{enumerate}
\begin{description}
\item[1.] a.
\item[2.] b.
\end{description}
\end{document}
ADDENDUM 2
By @Harish Kumar recommendation, I've also tried the following. The result is not ideal, enumerate
and description
do not have the same left margin.
\documentclass{amsbook}
\usepackage{enumitem}
\renewcommand{\descriptionlabel}[1]{%
% \hspace\labelsep \upshape #1.%
\upshape #1.%
}
\setlist[enumerate,1]{leftmargin=2em,labelindent=*,label=\arabic*$^\circ$.,
ref=\arabic*$^\circ$}
\setlist[description,1]{leftmargin=1em,labelindent=*}
\begin{document}
\begin{enumerate}
\item \label{a} a.
\item \label{b} b.
\end{enumerate}
\begin{description}
\item[\ref{a}] a.
\item[\ref{b}] b.
\end{description}
\end{document}
Best Answer
The request being made is not at all clear: if one just wants to typeset the labels of a
description
environment as if they were part of anenumerate
environment, why should one usedescription
at all? Evidently, the question lacks some essential information. A possible interpretation is that what is actually wanted here is to typeset a regulardescription
-style label with a number sticking in the margin, with an alignment similar to that of the labels ofenumerate
. The following example clarifies what I mean.Output:![Output produced](https://i.stack.imgur.com/tvqav.png)
If this is the real issue, it involves splitting the supplied label in two components, and therefore goes beyond the mere problem of setting the margins and the label width.
In conlusion, I think that it is impossible to fully answer this question until it is made clear what the precise request is.
Addition
I'm beginning to wonder whether it couldn’t be simply this what is actually wanted:
Output:![Output of addede code](https://i.stack.imgur.com/cwR5p.png)
Of course, the hyperlins work as expected.
But indeed, this wouldn’t be worth a bounty…
Second Addition
Yet another possibility:
And here is the output #3:![Output of third sample code](https://i.stack.imgur.com/SmsH5.png)