The ulem package provides several commands for underlining text. I tried all of these commands to style the label in my enumerate environment. Some of the commands work, some of them do not. I'm afraid these ones I want to use for my document doesn't work.
- what works:
\uline{},\uuline{},\uwave{},\sout{},\xout{} - what doesn't work:
\dashuline{},\dotuline{}
The following code works
\documentclass[12pt, a4paper]{article}
\usepackage{enumitem}
\usepackage{ulem}
\begin{document}
\begin{enumerate}[label = \uline{\textit{Step \arabic*:}}]
\item First item.
\item Second item
\item A third item
\end{enumerate}
\end{document}
The following code doesn't work
\documentclass[12pt, a4paper]{article}
\usepackage{enumitem}
\usepackage{ulem}
\begin{document}
\begin{enumerate}[label = \dashuline{\textit{Step \arabic*:}}]
\item First item.
\item Second item
\item A third item
\end{enumerate}
\end{document}
Additional information
Thanks to Christan's answer even underlining with TikZ is no problem anymore. In my case I'll use TikZ (instead of the ulem package) which allows to easily modify the style of underlining (like mentioned in this post: https://tex.stackexchange.com/a/27260/101831).
\documentclass[12pt, a4paper]{article}
\usepackage{enumitem}
\usepackage{ulem}
\usepackage{tikz}
\newcommand{\udot}[1]{
\tikz[baseline=(todotted.base)]{
\node[inner sep=1pt,outer sep=0pt] (todotted) {#1};
\draw[dotted] (todotted.south west) -- (todotted.south east);
}
}
\begin{document}
\begin{enumerate}[label =\protect\udot{\textit{Step \arabic*:}}]
\item First item.
\item Second item
\item A third item
\end{enumerate}
\end{document}
