The line of text I want to underline includes in-text citation. My problem is that \uline only works on this line when I use \mbox(I get an error without \mbox), which makes it impossible to wrap the text. Note that when I remove the \cite command, \uline works perfectly. How can I underline and wrap text that includes citation?
\documentclass[12pt]{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Article{ hermes2008a,
author = {Hermes, Juliet C. and Reason, C. J C},
journal = {Journal of Geophysical Research: Oceans},
number = {4},
pages = {1--10},
title = {{Annual cycle of the South Indian Ocean
(Seychelles-Chagos) thermocline ridge in a regional ocean
model}},
volume = {113},
year = {2008}
}
\end{filecontents*}
\usepackage{geometry}
\geometry{a4paper,total={170mm,257mm},left=18mm,right=18mm,top=27mm,bottom=27mm}
\usepackage[comma,authoryear]{natbib}
\bibliographystyle{agsm}
\usepackage[utf8]{inputenc}
\usepackage[normalem]{ulem}
\usepackage{usebib}
\bibinput{\jobname}
\begin{document}
\subsubsection*{\uline{~\mbox{\cite{hermes2008a}: ~\mbox{\usebibentry{hermes2008a}{title}}}}}
\subsubsection*{\uline{Hermes and Reason (2008): Annual cycle of the South Indian Ocean (Seychelles-Chagos) thermocline ridge in a regional ocean model}}
\subsubsection*{\cite{hermes2008a}: \usebibentry{hermes2008a}{title}}
\bibliography{\jobname}
\end{document}

\subsubsectionhere? – TeXnician Jun 14 '18 at 10:36ulem's\ulineandsoul's\ulhave severe limitations in what they can accept as arguments: Plain text and some simple macros are usually fine, but more complicated macros like\citeoften either cause errors or don't come out as expected (no underlining, no line breaks). The contents of some boxes cannot be broken across lines, that's why you can't get a line break here. BTW: The use of\subsectiondoes not make the problem easier. – moewe Jun 14 '18 at 10:50\luaunderlinecommand that can accept\citeetc. in its argument. but of course that requires LuaLaTeX. – moewe Jun 14 '18 at 11:03\underline{}? – naphaneal Jun 14 '18 at 12:16\underlinedoes not do line breaks. The result will be similar to the first line in the screenshot. That's one of the reasons whyulem's andsoul's underline commands exist in the first place: They allow for line breaks. – moewe Jun 14 '18 at 12:20