在下面的例子中,有没有办法强制将“环境”一词合并到前一段中,以便在必要时让它渗入页边距?
换句话说,我正在寻找类似的东西\mbox{}
,但它可以在多行段落的末尾起作用。\mbox{}
(如果你把下面的段落放在所有的段落被强制放到一行,而不是最后一行;如果你只把短语“非传统环境”放在一个段落中\mbox{}
,那么两个都单词移至下一行。)
%!TEX encoding = UTF-8 Unicode
\documentclass[11pt, slidestop, compress]{beamer}
\usetheme{CambridgeUS}
\begin{document}
\begin{frame}{Frame}
Spectrum Community School was an alternative high school in Kingston, Washington, United States. It was a part of the North Kitsap School District. The school had been running for over 20 years, and earned two awards of Special Merit from the Grammy Foundation in Los Angeles. The school was designed for students searching for a nontraditional environment.
\end{frame}
\end{document}
我意识到,在上面这个虚构的例子中,有问题的那一行上并没有空间容纳“环境”这个词,但在我的真实幻灯片中,这个孤立的单词要短得多,而且是有空间。我的问题本质上是技术性的(而非美学性的)我会对因我所造成的任何丑陋的排版负全部责任。
我是不是寻找减少字母间距、文本宽度和/或字体大小的解决方案,无论是本地还是整个演示。我想要就这个词悬垂到右侧,同时保持段落其余部分的文本流相同。
\looseness=-1
作为建议在这里做不是起作用,因为它改变了字母间距,并且重新启用了连字符换行符(在我看来,这是正确的),而 Beamer 默认情况下是禁用的。
答案1
稍微作弊就足够了(我们只使用众所周知的基本命令):
%!TEX encoding = UTF-8 Unicode
\documentclass[11pt, slidestop, compress]{beamer}
\usetheme{CambridgeUS}
\begin{document}
\begin{frame}{Frame}
Spectrum Community School was an alternative high school in
Kingston, Washington, United States. It was a part of the North
Kitsap School District. The school had been running for over 20
years, and earned two awards of Special Merit from the Grammy
Foundation in Los Angeles. The school was designed for students
searching for a \makebox[0pt][l]{nontraditional environment.}
\end{frame}
\end{document}
答案2
这可能不是你想要的答案,但无论如何。我为 TUGboat 写了一篇关于各种不同段落形状的文章(https://tug.org/TUGboat/tb28-2/tb89glister.pdf)。其中之一是用于指定段落的最后一行“不太短”。我在下面使用了它。
% paraprob.tex SE 643183
\documentclass[11pt, slidestop, compress]{beamer}
\usetheme{CambridgeUS}
%%% code from "Glisterings" TUGboat 28:2 2007
\newdimen\parabout
\newdimen\about
\about=2em
\about=0.99\hsize
\newcommand*{\nottooshort}{%
\parabout=\hsize
\advance\parabout -\about
\leftskip=0pt plus 0pt minus 0pt
\rightskip=\leftskip
\parfillskip=\parabout minus \parabout
\parindent=2em}
\begin{document}
\begin{frame}{Frame}
\nottooshort
Spectrum Community School was an alternative high school in Kingston,
Washington, United States. It was a part of the North Kitsap School District.
The school had been running for over 20 years, and earned two awards of
Special Merit from the Grammy Foundation in Los Angeles. The school was
designed for students searching for a nontraditional environment.
\end{frame}
\end{document}
您可能希望将其视为解决问题的不同方法。