I am trying to write a new command that will underline the text from the first argument and add the red comment of the second argument. I think I've got this mostly, but the result does not add the appropriate break lines, and I don't understand why. Where is the problem?
Command:
\newcommand\comment[2]{\underline{#1}\textcolor{red}{\emph{\textbf{comment}: #2}}}
Code:
\comment{Only $1\%$ of the mass is comprised of the interstellar medium. The rest is in the form of interstellar gas}{interstellar medium means the interstellar gas.},

soulpackage. – egreg Dec 03 '22 at 10:42\underlineis a box like\mboxand prevents line breaks – David Carlisle Dec 03 '22 at 10:59soulpackage and\ulinstead of\underlinesolved that :) – Malvinka Dec 03 '22 at 11:06ulemdoes also support underlining with line breaks. By default it additionally replaces emphasizing by underlining. You can load it with\usepackage[normalem]{ulem}to prevent this. – cabohah Dec 03 '22 at 11:41