Latex教程


魔法注释

% !TEX root = ./main.tex
% !TEX program = xelatex
% !BIB program = bibtex
% !TeX spellcheck = de_DE
Defines the language used for spell checking of the document. This overrides the global spellchecking settings. Nevertheless, an appropriate dictionary has to be installed.

% !TeX encoding = utf8
Defines the character encoding of a document.

% !TeX root = filename
Defines the root document for this file (i.e. the file which will be passed to the LaTeX compiler when building). This setting override the automatic root detection in TeXstudio. In turn, it’s overridden, if an explict root document is set at Options -> Root Document.

% !TeX program = pdflatex
Defines the compiler to be used for the document. To be precise, it overrides the default compiler (command txs:///compile) which is used in the actions “Build & View” as well as “Compile”.

% !TeX TXS-program:bibliography = txs:///biber
This is a TeXstudio-specific setting. It overrides the build-system command specified to the left by the one on the right. In the example, we tell TXS to use the biber command (txs:///biber) for the general “Bibliography command (txs:///bibliography). See also the description of the build system.

% !TeX TXS-SCRIPT = foobar
% //Trigger = ?load-this-file
% app.load(“/tmp/test/test.tex”);
% app.load(“/tmp/test/a.tex”);
% TXS-SCRIPT-END
This defines a temporary script macro which is executed, when the file is loaded, and which in turns loads the two files in /tmp/test. .

The macros defined via TXS-SCRIPT are active in all files of a document (e.g. included files). You cannot run them manually. They are run via the trigger (regular expression or special trigger, see section on triggers). The macro is just read once, when the file is opened. Changes during an edit session will only take effect when you reopen the file.

% !BIB program = biber
The special % !BIB program command is understood for compatibility with TeXShop and TeXWorks (also in the variant % !BIB TS-program). This is equivalent to % !TeX TXS-program:bibliography = txs:///biber


Author: Song Pengfei
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source Song Pengfei !
评论
  TOC