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.

  • 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 at 19:03
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

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

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.