2

Following up on this: \ref should use enumerate label name

I tried this:

\documentclass{article}
\usepackage{enumitem}

\begin{document}

\begin{enumerate}[label=\textbf{This is my label  \arabic*}]
\item a
\item \label{l} b
\item c. goto \ref{l}
\end{enumerate}

\begin{enumerate}[label=(\arabic*)]
    \item a
    \item \label{lll} b
    \item c. goto \ref{lll}
\end{enumerate}

\end{document}

But the "T" in the "This is my label" is all the way to the left. I would like it to be aligned where the (1) is in the second enumerate list.

thank you.

nox
  • 4,160
  • 12
  • 26
district9
  • 307
  • I formatted your code. If you highlight your code in the editor and click on the {} "Code Sample" button, it will be indented, so it is formatted correctly. – nox Jan 22 '19 at 19:03

2 Answers2

1

Is it something like this you want?

\documentclass{article}
\usepackage{enumitem}

\begin{document}

Some text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.

\begin{enumerate}[label=This is my label \arabic*, wide=1em, font=\bfseries]
\item a
\item \label{l} b
\item c. goto \ref{l}
\end{enumerate}

\begin{enumerate}[label=(\arabic*), wide=1em]
    \item a
    \item \label{lll} b
    \item c. goto \ref{lll}
\end{enumerate}

\end{document} 

enter image description here

Bernard
  • 271,350
0

You can use the align option from enumitem:

\documentclass{article}
\usepackage{enumitem}

\begin{document}

\begin{enumerate}[label=\textbf{This is my label  \arabic*},align=left,leftmargin=3.5em]
\item a
\item \label{l} b
\item c. goto \ref{l}
\end{enumerate}

\begin{enumerate}[label=(\arabic*)]%, left=0pt .. \parindent]
    \item a
    \item \label{lll} b
    \item c. goto \ref{lll}
\end{enumerate}

\end{document}

I only changed the sixth line, here with explanation:

\begin{enumerate}[label=\textbf{This is my label  \arabic*},
                  align=left, % aligns the label as you wish
                  leftmargin=3.5em] % puts the "T" a little further to the right.
                  % Test different/no values for leftmargin.

result

nox
  • 4,160
  • 12
  • 26