LaTeX 魔法注释具体是指什么意思呢?

2019-10-07 11:26发布

**魔法注释是指什么呢?和普通注释区别在哪里呢?具体怎么使用呢?** [LaTeX 源文件的命名、组织与管理](https://wenda.latexstudio.net/article-5039....

**魔法注释是指什么呢?和普通注释区别在哪里呢?具体怎么使用呢?** [LaTeX 源文件的命名、组织与管理](https://wenda.latexstudio.net/article-5039.html "LaTeX 源文件的命名、组织与管理") 写到: **在多文件结构的子文件中,可以使用魔法注释指定主文件,从而实现打开子文件也能编译的目的,如:** ```tex % 其它内容 ... % 魔法注释,指定主控文件为上一级文件夹中的“main.tex”文件 %%% Local Variables: %%% mode: latex %%% TeX-master: "../main.tex" %%% End: ``` **显然,如果主控文件采用 “main.tex” 命名,在各类子文件中用魔法注释指定主控文件及路径,则可以构造一个万能的 LaTeX 撰写文件结构框架。以后,每创建一个新的项目,只需要将该框架拷贝一下就可以了。** 完全看不懂。。。。
2条回答
啸行 - 目前是一名 LaTeX 学徒
2019-10-07 12:10 .采纳回答
截取 texworks 说明书给你看。 ### Special comment strings Special comments, at the very beginning of the files, can be used to manage two other aspects of the compilation. By default, TEXworks uses the “utf-8” encoding for loading and saving files, but some files could be saved in another encoding. Common ones are “latin1”, which is the dominant encoding on Windows when using western languages, and “Apple Roman” which is dominant on Mac OS. To set a different encoding for a specific file one can put the following at the beginning of that file: ```tex % !TeX program = ``` for example: ```tex % !TeX program = xelatex ``` Pay attention to this last instruction. You have to use the name of the programme here which should be used for the whole project, as the first encountered programme when starting typesetting is used (which is the one from the sub-document you are in). TEXworks will use that programme, even if another name appears in the main document! When opening a document which contains a `% !TeX program` line, the specified programme will become the one to use and its name will appear in the drop down menu in the toolbar; you can, however, override this by selecting a different one from the drop down list, if you want. In addition, you can set the spell checking language by a similar comment line: ```tex % !TeX spellcheck = ``` The language codes available on your system are listed in parentheses in Edit →Spelling next to the human-readable name of the language. 当然了,不同编辑器的名称不一样,功能和写法也各不相同。

一周热门 更多>