![]() There is very little relation between the encoding directive and what option you pass to the inputenc package (other than the fact that they should be identical). (I'm not sure if TeXworks behaves the same way.) But again, if you do need to work on files with multiple encodings (for example if you are collaborating with others who don't use UTF-8) it might be useful since when you save the file the encoding specification will override the default save encoding of TeXShop. I can see very little need for this, and don't use it myself, mainly because I use only UTF-8 for all my documents. This tells TeXShop to save the file using the specified encoding. On the other hand, if you share documents with others, it might still be useful, since it will override their defaults (if they are using TeXShop/TeXworks) or minimally give them some indication of how they need to compile the shared file (if they are using another editor). If you only use one engine in your work, and you set TeXShop up to use that as its default then there is no real advantage to having the directive. It's much more annoying to have to choose the engine manually from the pull down menu. I use a mixture of pdflatex, LuaTeX, XeTeX and LaTeX+dvips in my documents depending on a variety of factors, so for me this is extremely useful, since I just specify the engine in the file and TeXShop automatically does the right thing with a single keystroke. The default engine in TeXShop is pdfLaTeX. This is mainly useful if you use multiple engines in your work. This directive allows you to choose the engine that will process the file directly in the file itself. As he also points out, there are also two other useful directives that you can also use in TeXShop and TeXWorks. Salomon's answer gives the details for TeXWorks. My comments apply in principle to both TeXShop and TeXworks. I'll comment on each directive separately, since I think they are not equally useful. (Other editors have similar kinds of metadata). The TS stands for TeXShop which was the IDE that first implemented them on the Mac. The directives are understood by TeXShop, TeXWorks and TexStudio. I just wanted to provide a question that allows for a maximal amount of information on this subject matter. I guess I know some partial answers to some of my questions, but I'll leave that up for people who have experience with these expressions. Meta: Even though it technically contains multiple questions, I'm pretty sure this question conforms with our standards as a catch-all question on a narrow topic. Are there any downsides to using them or reasons not to use them?. ![]() What additional value does the encoding line provide if I'm already using inputenc?.What does the "TS" in TS-program stand for?.pdflatex -enable-write18 or xelatex -interaction=nonstopmode? Can I add options to the compilation engine, e.g.Is there any "documentation" of possible values etc.? Are there more such expressions? Are they standardized in any way?.Which editors/programs pick up on these directives?.How can I compile without determining which engine I want to use so that I would even need that comment?.More detailed questions on this subject matter would be: It's not clear to me, however, when and why I should use such expressions. It's clear to me that the first line declares the engine that should be used for compilation, and the second lines states the text encoding of the input file. Occasionally, I see other people's documents starting with two lines like that: % !TEX TS-program = xelatex
0 Comments
Leave a Reply. |