这是最小的工作示例
\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 的情况下带下划线。