In addition to Werner's answer, I would also like my list labels to use tabular numbers.
I would have thought that the first approach below would work, but the list labels are slightly in the left margin.
However, the second more cumbersome approach seems to work. It is as if the tabular numbers aren't applied until after the width of the last label has been measured.
Is there some way to make the first approach work without resorting to the second? Or is there a better way to achieve this?
First approach
\documentclass{article}
\usepackage{showframe}
\usepackage{calc}
\usepackage{fontspec}
\setmainfont{EBGaramond-Regular}[
Numbers={Proportional, OldStyle},
]
\usepackage{enumitem}
\setlist[enumerate]{font=\normalfont\addfontfeatures{Numbers=Tabular}}
\begin{document}
\begin{enumerate}[
labelindent=0pt,
labelwidth=\widthof{\ref{last-item}},
label={\arabic*.},
leftmargin=!,
]
\item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
\item Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
\item Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \addtocounter{enumi}{9997}
\item Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \label{last-item}
\end{enumerate}
\end{document}
Second approach
\documentclass{article}
\usepackage{showframe}
\usepackage{calc}
\usepackage{fontspec}
\setmainfont{EBGaramond-Regular}[
Numbers={Proportional, OldStyle},
]
\usepackage{enumitem}
\setlist[enumerate]{font=\normalfont\addfontfeatures{Numbers=Tabular}}
\begin{document}
\begin{enumerate}[
labelindent=0pt,
labelwidth=\widthof{\ref{last-item}},
label={\addfontfeatures{Numbers=Tabular}\arabic*.},
leftmargin=!,
]
\item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
\item Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
\item Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \addtocounter{enumi}{9997}
\item Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \label{last-item}
\end{enumerate}
\end{document}