GNU TeXmacsUser manualReferenceAboutEnglish·Français·Deutsch·Español·Italiano·Português·Polski·中文
书籍和多文件的文档

当文档变得非常大时,你可能希望将其拆分成几个小文档。这既使各个部分更容易在其他作品中复用,又能够提高编辑器的响应能力。使用插入\(\rightarrow\)链接\(\rightarrow\)包含文件,可以将整个文件插入到另一个文件中。为了加快对被包含文档的处理,这些文档会被缓冲。为了更新所有被包含的文档,您应该使用工具\(\rightarrow\)更新\(\rightarrow\)包含文件。

在写一本书时,人们通常将会各个章节放在文件 c1.tm、c2.tm 直到 cn.tm 中。

在写书时,我们通常会以章为单位,把整本书拆分为多个文件:c1.tm、c2.tm……cn.tm。下一步是为整本书创建一个文件 book.tm ,并在其中使用上述机制来包含 c1.tm、c2.tm……cn.tm。目录、参考文献等通常会放在 book.tm 中。

为了在编辑特定章节 ci.tm 时查看与其他章节的交叉引用,可以使用工具\(\rightarrow\)项目\(\rightarrow\)关联主文件将 book.tm 指定为文件 c1.tm 到 cn.tm 的“主文件”。目前,该机制不会处理章节编号,也就是说插入文件时,章节编号不会自动累加,因此您可能需要在每个章节文件的开头手动设置环境变量 chapter-nr 以便在编辑时获得正确的章节编号。

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".