1

I want to do this:

enter image description here

But all I can do is:

\documentclass[14pt]{extreport}
\usepackage[normalem]{ulem}

\begin{document}
\hfill\begin{minipage}[t]{0.7\textwidth}
\begin{flushleft}
Lorem:~\uline{ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed 
diam voluptua.\hfill}
\end{flushleft}
\end{minipage}
\end{document}  

enter image description here

How can I fill ragged side with empty underlines?

1

I have found solution with kindly help of Donald Arseneau, author of ulem package. So here it is:

\documentclass[14pt]{extreport}
\usepackage[normalem]{ulem}

\newcommand\s{\nobreak \hskip\fill \allowbreak \space \hskip-\fill \relax}

\begin{document}
\hfill\begin{minipage}[t]{0.7\textwidth}
 \begin{flushleft}
 \obeyspaces\let =\s
 Lorem:~\uline{ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.\hfill}
 \end{flushleft}
\end{minipage}
\end{document} 

and here is result: enter image description here

but when I try to write environment like this

\newenvironment{under}
{\obeyspaces\let =\s}
{}

\begin{document}
\hfill\begin{minipage}[t]{0.7\textwidth}
 \begin{flushleft}
 \begin{under}
Lorem:~\uline{ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.\hfill}
 \end{under}
 \end{flushleft}
\end{minipage}
\end{document} 

there is an error appearing

! Missing control sequence inserted. <inserted text> \inaccessible l.13 \begin{under}

Why?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.