I define an underline (based on the following site: https://alexwlchan.net/2017/10/latex-underlines/).
This was my initial code:
\usepackage{ulem}
\renewcommand{\ULdepth}{1.8pt}
\contourlength{0.8pt}
\newcommand{\myuline}[1]{%
\uline{\phantom{#1}}%
\llap{\contour{white}{#1}}%
}
The problem with the code is that it doesn't allow linebreaks nor hyphenations if I underline a lot of text. I made some research and found that \phantom and \contour could be the problem, so I replace \phantom with \textcolor in white, and add the following (to allow contour break lines):
\usepackage{ulem}
\renewcommand{\ULdepth}{1.8pt}
\contourlength{0.8pt}
% contour each word to allow linebreaks
\RequirePackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\MIR}{m}
{
\seq_set_split:Nnn \l_tmpa_seq { ~ } { #1 }
\seq_map_inline:Nn \l_tmpa_seq { \contour{white}{##1} ~ } \unskip
}
\ExplSyntaxOff
% define underline
\newcommand{\myuline}[1]{%
\uline{\textcolor{white}{#1}}%
\llap{\contour{white}{#1}}%
}
but this didn't solve my problem, and now I realized that \llap doesn't allow linebreaks nor hyphenation too ... then, I don't know how can I solve the problem. Please help.
