[Tex/LaTex] How to continue thick underline beyond text

soul

Here's my code:

\documentclass[12pt]{article}  
\usepackage{soul}
\begin{document}
\setul{}{2pt}
\ul{\Huge\textbf{Some text}}
\underline{\Huge\textbf{Some text \hspace{1in}}}
\ul{\Huge\textbf{Some text \hspace{1in}}} % This line causes error
\end{document}

The command \underline{\Huge\textbf{Some text \hspace{1in}}} produces the result

enter image description here

I want the underline to be thicker though, so I tried using the soul package, setting the thickness, and then \ul{Some text}

This gives me the desired underline thickness

enter image description here

The problem occurs when I try to combine the two to get a thick line extending beyond the text. The command \ul{\Huge\textbf{Some text \hspace{1in}}} produces an error, "Missing number, treated as zero."

Any ideas why or how to fix it? Or better ways of underlining text with a bold line that extends an arbitrary distance beyond the text?

Best Answer

You have to read the fine print in the soul manual http://texdoc.net/texmf-dist/doc/latex/soul/soul.pdf You have to protect with \mbox{}.

\documentclass[10pt,letterpaper]{article}
\usepackage{soul}
\begin{document}
\ul{\Huge\textbf{Some text\mbox{\hspace{1in}}}}
\end{document}
Related Question