Screenshot:
I have the following code:
\uline{No underlining for \colorbox{lightgray}{everything} inside the colorbox.}
Which looks like this:
How can I get a continuous line for the text inside \colorbox, too?
MCVE:
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{xcolor}
\usepackage[normalem]{ulem}
\begin{document}
\uline{No underlining for \colorbox{lightgray}{everything} inside the colorbox.}
\end{document}
Constraints:
I cannot use soul and I think plain \underline doesn't look very good. (By the way, those who can use soul should have a look at Underline text with background (soul and ulem nesting) )


\colorboxis inside of\uline, I thought there would be a simple way to raise the "z-index" of the line or something like that... Can you explain why the line doesn't show up in front of the colorbox? – finefoot Jan 02 '19 at 16:44\ulineI'm afraid. Do you think there is hope for a solution without nesting? – finefoot Jan 02 '19 at 19:13\uline so that locally\colorboxis defined as I show above, or (given the\ulineworks with\fbox` someone may suggest a different extension so that it works directly with colorbox.. – David Carlisle Jan 02 '19 at 19:15\ulineso\colorboxis locally defined to have underlined text, too – finefoot Jan 02 '19 at 19:27