LaTeX中的\ include后如何没有分页符 [英] How to have no pagebreak after \include in LaTeX

查看:796
本文介绍了LaTeX中的\ include后如何没有分页符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的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软件包对于避免清除页面非常有用.看来,为了使\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:

\newif\ifdraft\drafttrue

\newif\ifdraft\draftfalse

\ifdraft
  \include{...}
\fi

\ifdraft
  \include{file}
\else
  \input{file}
\fi

第一行可以很容易地由makefile附加,以制作草稿或生产版本生产目标.

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.

换句话说,通过使用includeincludeonly,可以在草稿中缩短编译时间,同时具有正确的引用. 进一步阅读 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.

@威尔·罗伯逊(Will Robertson)

@Will Robertson

\include如此有用,因为它允许通过\includeonly{...}来仅构建所需的部分.在处理较长的文本时,仅包含一长篇章节的一部分,可能会在编译时间上产生很大的不同.它也非常有用,因为在某一时刻工作时不必翻阅冗长的草稿.最后,较小的源代码文件在版本管理中更易于处理,例如git.

\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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆