7

I guess an example is the quickest way to understand my problem: Consider the following enumerate environment using package enumerate

\documentclass{article}
\usepackage{enumerate}
\begin{document}
    \begin{enumerate}[$f_1:x\mapsto$]
    \item $x$
    \item $x^2$
    \item $x^3$
    \item $x^4$
    \item $x^5$
    \item $x^6$
    \item $x^7$
    \item $x^8$
    \item $x^9$
    \item $x^{10}$
    \end{enumerate}
\end{document}

And I obtain $f_10$ which is not $f_{10}$.

However if I write

  \begin{enumerate}[$f_{1}:x\mapsto$]
    \item $x$
    \item $x^2$
    \end{enumerate}

Then the "1" is not recognized as the incremented element. (I have a warning telling me the counter will not be printed, but I am not sure how to change that.)

MWE

Enter image description here

user42070
  • 342

3 Answers3

12

Use \bgroup and \egroup:

\documentclass{article}
\usepackage{enumerate}
\begin{document}
\begin{enumerate}[$f_\bgroup1\egroup:x\mapsto$]
\item $x$
\item $x^2$
\item $x^3$
\item $x^4$
\item $x^5$
\item $x^6$
\item $x^7$
\item $x^8$
\item $x^9$
\item $x^{10}$
\end{enumerate}
\end{document}
Hood Chatham
  • 5,467
8

You need the enumitem package, since it allows more freedom for specifying the appropriate label and formatting:

enter image description here

\documentclass{article}

\usepackage{enumitem}

\begin{document}

\begin{enumerate}[label = {$f_{\arabic*}:x\mapsto{}$}, labelsep = 0pt]
  \item $x$
  \item $x^2$
  \item $x^3$
  \item $x^4$
  \item $x^5$
  \item $x^6$
  \item $x^7$
  \item $x^8$
  \item $x^9$
  \item $x^{10}$
\end{enumerate}

\end{document}
Werner
  • 603,163
2

With the shortlabelsoption of enumitem, and two different alignments:

\documentclass{article}

\usepackage[shortlabels]{enumitem}
\usepackage[showframe]{geometry}
\usepackage{calc} 

\begin{document}

\begin{enumerate}[$f_\bgroup1\egroup\colon x\mapsto$, labelwidth=\widthof{$f_{99}\colon x\mapsto$}, leftmargin=!, labelsep =0.28em]
\item $x$
\item $x^2$
\item $x^3$
\item $x^4$
\item $x^5$
\item $x^6$
\item $x^7$
\item $x^8$
\item $x^9$
\item $x^{10}$
\end{enumerate}
\vspace{1cm}
\begin{enumerate}[$f_\bgroup1\egroup\colon x\mapsto$, wide=0pt, leftmargin=!, labelsep =0.28em]
\item $x$
\item $x^2$
\item $x^3$
\item $x^4$
\item $x^5$
\item $x^6$
\item $x^7$
\item $x^8$
\item $x^9$
\item $x^{10}$
\end{enumerate}

\end{document} 

enter image description here

Torbjørn T.
  • 206,688
Bernard
  • 271,350
  • I simply cannot understand why one might want to use the shortlabels option in a case like this… – GuM Nov 08 '17 at 00:54