LaTeX 抑制分页符
我正在尝试创建一个 LaTex 文档,其中包含“testday”和充满“testItemToDo”的诗句,并且我希望在“testday”之前发生任何分页符,但绝不在“testday”和“testItemToDo”诗句之间发生。如何修改我的 LaTex 文件
\documentclass{article}
\begin{document}
\LARGE
{*}{*}to do\\
\begin{verse}
{*}today\nopagebreak
\begin{verse}
testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo
\end{verse}
{*}testDay\nopagebreak
\begin{verse}
testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo
\end{verse}
{*}testDay\nopagebreak
\begin{verse}
testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo
\end{verse}
{*}testDay\nopagebreak
\begin{verse}
testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo
\end{verse}
{*}testDay\nopagebreak
\begin{verse}
testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo
\end{verse}
\end{verse}
\end{document}
I'm trying to create a LaTex document which has a "testday" and a verse full of "testItemToDo" and I want any page break to occur before the "testday" but never between a "testday" and the verse of "testItemToDo". How can I modify my LaTex file
\documentclass{article}
\begin{document}
\LARGE
{*}{*}to do\\
\begin{verse}
{*}today\nopagebreak
\begin{verse}
testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo
\end{verse}
{*}testDay\nopagebreak
\begin{verse}
testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo
\end{verse}
{*}testDay\nopagebreak
\begin{verse}
testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo
\end{verse}
{*}testDay\nopagebreak
\begin{verse}
testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo
\end{verse}
{*}testDay\nopagebreak
\begin{verse}
testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo\\*testItemToDo
\end{verse}
\end{verse}
\end{document}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
用
\begin{samepage}
和\end{samepage}
包围你的测试日和诗句,即:这仍然允许诗句很好地打破页面,前提是你摆脱一些
\\*
。Surround your testday and verse with a
\begin{samepage}
and\end{samepage}
, i.e.:This still allows the verse to break a page fine, provided you get rid of some
\\*
.\nopagebreak[number]
\nopagebreak
命令可防止 LaTeX 在该命令的位置中断当前页面。使用可选参数 number,您可以将\nopagebreak
命令从需求转换为请求。该数字必须是 0 到 4 之间的数字。数字越大,请求越强烈。或者你可以将你的
verse
更改为minipage
...但如果列表比一页长,乳胶可能会呕吐。\nopagebreak[number]
The
\nopagebreak
command prevents LaTeX from breaking the current page at the position of the command. With the optional argument, number, you can convert the\nopagebreak
command from a demand to a request. The number must be a number from 0 to 4. The higher the number, the more insistent the request is.Or you can change your
verse
to aminipage
... though if the list is longer than a page, latex will probably puke.我发现的一个非常简单的解决方案是在每个之前使用
\filbreak
(请参阅常见问题解答)。A very simple solution I've found is with
\filbreak
before each (see the FAQ).