如何在 LaTeX 中 include 后没有分页符 [英] How to have no pagebreak after include in LaTeX
问题描述
我的 LaTeX 让我在每个小节之后分页,因为我的小节位于单独的文件中.我使用命令 include{file}
在使用后添加分页符.
My LaTeX makes me pagebreaks after each subsection because my subsections are in separate files. I use the command include{file}
which adds a pagebreak after the use of it.
我不希望因使用 include{file}
而导致分页.
I would like to have no pagebreak caused by the use of include{file}
.
使用 include
-command 后如何不分页?
How can you no pagebreak after the use of include
-command?
推荐答案
Will Robertson 建议的 newclude 包对于避免 clearpage 非常有用.看来,为了使 includeonly
工作,必须在 documentclass{...}
之后立即调用包.在我论文的复杂环境中,我也遇到了参考文献损坏的问题.
The newclude package suggested by Will Robertson is rather useful to avoid the clearpage. It appears, in order for includeonly
to work one has to call the package immediately after documentclass{...}
. In the complex environment of my dissertation I also ran into problems with broken references.
当最终版本不需要 includeonly 时,一个好的解决方法是仅在草稿中使用 include:
A good workaround, when includeonly is not needed for a final version, is to use includes only in the draft:
ewififdraftdrafttrue
或
ewififdraftdraftfalse
ifdraft
include{...}
fi
ifdraft
include{file}
else
input{file}
fi
第一行可以很容易地通过 makefile 附加,以制作草稿或生产版本的生产 make 目标.
The first line can be easily appended by a makefile, to make draft or production version production make targets.
includeonly{file1,file2,...}
允许指定用 include{file1}
调用的源文件列表(其中 file1
是一个示例),它将显示在结果文档中.其他的不会显示,但会在包含相应的辅助文件时考虑用于计数器、标签、目录.
includeonly{file1,file2,...}
allows to specify a list of source files called with include{file1}
(where file1
is an example) that will show in the resulting document. The others will not show up, but are considered for counters, labels, tables of contents when the corresponding aux files are included.
换句话说,通过使用 include
和 includeonly
可以在草稿中缩短编译时间,同时具有正确的引用.进一步阅读 Wikibooks.
In other words, by using include
and includeonly
one can keep the compile time short in a draft while having correct references.
Further reading on Wikibooks.
@威尔罗伯逊
include
非常有用,因为它允许通过 includeonly{...}
只构建需要的部分.在处理较长的文本时,仅包含冗长章节的一部分会在编译时间上产生相当大的差异.它也非常有用,因为在某个时间点工作时不必翻阅冗长的草稿.最后,较小的源代码文件在版本管理中更容易处理,例如混帐.
include
is so useful because it allows through includeonly{...}
to build only needed sections. While working on longer text it can make quite a difference in compile time to include only a section of a lengthy chapter. It is also invaluably useful as one doesn't have to page through a long draft while working at one point. Lastly, smaller files of source code are easier to handle in version management, e.g. git.
这篇关于如何在 LaTeX 中 include 后没有分页符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!