\documentclass[a4paper,12pt]{article}
\begin{document}
\begin{enumerate}
\item \begin{enumerate}
\item
\begin{enumerate}
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt \hfill [Lorem ipsum]
\item I'm going to relate a time-traveling joke, but you didn't appreciate it. \hfill [Lorem ipsum]
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{document}
输出结果如下:
为什么第二个 [Lorem ipsum] 被拆分了,尽管该项目的措辞较少?
答案1
如果您先移除放错位置的\item
,它就会按我预期的方式工作。
\documentclass[a4paper,12pt]{article}
\begin{document}
\begin{enumerate}
\item
\begin{enumerate}
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt \hfill [Lorem ipsum]
\item I'm going to relate a time-traveling joke, but you didn't appreciate it. \hfill [Lorem ipsum]
\end{enumerate}
\end{enumerate}
\end{document}
编辑如果要进行更高级别的嵌套,我引用 egreg 的评论:
[...] TeX 更倾向于段落倒数第二行没有连字符。 \hfill 使之成为可能。
\documentclass[a4paper,12pt]{article}
\begin{document}
\begin{enumerate}
\item
\begin{enumerate}
\item
\begin{enumerate}
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt \hfill [Lorem ipsum]
\item I'm going to relate a time-traveling joke, but you didn't appreciate it. \hfill [Lorem~ipsum]
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{document}
或者看看\linepenalty
。
答案2
来自@Ulrike Fischer 的解释—— https://tex.stackexchange.com/a/16333/197451
输出和 \newcommand\quelle
此外,由于环境没有,第一个\item
应该给你一个错误- 可能你在捕获输出的屏幕截图之前已经编辑掉了第一个- 对吗?enumerate
\begin
item
\documentclass[a4paper,12pt]{article}
\begin{document}
\newcommand\quelle[1]{{%
\unskip\nobreak\hfil\penalty50
\hskip2em\hbox{}\nobreak\hfil\textbf{#1}%
\parfillskip=0pt \finalhyphendemerits=0 \par}}
\begin{enumerate}
\item fg \hfill [lorem ipsum]
\begin{enumerate}
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
\quelle {[Lorem ipsum]}
\item I'm going to relate a time-traveling joke, but you didn't
appreciate
it. \hfill [Lorem ipsum]
\end{enumerate}
\end{enumerate}
\end{document}