Latex newcommand underlined section
I recommend you change the definition of \specsection
to
\newcommand\specsection[1]{%
\par\noindent{\raggedright
\emph{\uline{#1}}
\par}}
This requires loading the ulem
package -- preferably with the option normalem
.
A full MWE (minimum working example):
\documentclass{article}
\usepackage[normalem]{ulem}
\setlength{\parindent}{0pt} % just for this example
\newcommand\specsection[1]{%
\par\noindent{\raggedright
\emph{\uline{#1}}
\par}}
\begin{document}
\sffamily % optional
Here you have normal text.
\specsection{Work package 1: One problem is that header lines sometimes become very long and you need two lines for them.}
Here you have normal text.
\end{document}