我想做这个:
但我能做的只有:
\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}
我怎样才能用空的下划线填充不规则的一侧?
答案1
在软件包作者 Donald Arseneau 的热情帮助下,我找到了解决方案ulem
。如下所示:
\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}
但是当我尝试写这样的环境时
\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}
出现错误
! Missing control sequence inserted. <inserted text> \inaccessible l.13 \begin{under}
为什么?