uline 不显示在行末

uline 不显示在行末

这是最小的工作示例

\documentclass{article}
\usepackage{ulem} 
\begin{document}
one two three  one two three one two three one two three one two three one two three one two three one two three 

one two three one two three one two three one two three one two three \uline{\hspace{5em}}  %no underline showing
\end{document}

结果是

在此处输入图片描述

但是应该有 5em 长度的下划线。这是ulem软件包的 bug 吗?

答案1

这种行为似乎正如您所期望的,\uline{\hspace产生相同的空间,\hspace但有下划线

在此处输入图片描述

\documentclass{article}
\usepackage{ulem} 
\begin{document}
one two three  one two three one two three one two three one two three one two three one two three one two three 

one two three one two three one two three one two three one two three \uline{\hspace{5em}}  %no underline showing



one two three one two three one two three one two three one two three \uline{\hspace{5em}}  %no underline showing



one two three one two three one two three one two three one two three \hspace{5em}x1

one two three one two three one two three one two three one two three \uline{\hspace{5em}}x2 

one two three one two three one two three one two three one two three \hspace*{5em}x3 

one two three one two three one two three one two three one two three \uline{\hspace*{5em}}x4 
\end{document}

通常在换行符处会丢弃空格,因此左边距会被保留,因此您会看到 x1 和 x2 发生这种情况,\hspace*强制保留空格,因此您会看到 x3 和 x4 中的空格,在 x4 的情况下带下划线。

相关内容