Closed qiaojunfeng closed 5 years ago
%!TEX root = ../Template.tex有什么作用?方便讲解一下吗?
From Quanmao Wei.
在 2018年12月18日,16:59,Junfeng Qiao notifications@github.com<mailto:notifications@github.com> 写道:
加上%!TEX root = ../Template.tex可以方便编译。
../Template.tex这种写法在Windows下会有问题吗?Linux可以通过。
You can view, comment on, or merge this pull request online at:
https://github.com/CheckBoxStudio/BUAAThesis/pull/13
Commit Summary
File Changes
Patch Links:
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/CheckBoxStudio/BUAAThesis/pull/13, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APcO-v-2vp--9Xy0E4p4hLeAZBwYG3Qdks5u6K5SgaJpZM4ZX251.
%!TEX root = ../Template.tex有什么作用?方便讲解一下吗? From Quanmao Wei. 在 2018年12月18日,16:59,Junfeng Qiao notifications@github.com<mailto:notifications@github.com> 写道: 加上%!TEX root = ../Template.tex可以方便编译。 ../Template.tex这种写法在Windows下会有问题吗?Linux可以通过。 … ____ You can view, comment on, or merge this pull request online at: #13 Commit Summary add tex root File Changes M tex/chap_achievement.texhttps://github.com/CheckBoxStudio/BUAAThesis/pull/13/files#diff-0 (3) M tex/chap_acknowledge.texhttps://github.com/CheckBoxStudio/BUAAThesis/pull/13/files#diff-1 (3) M tex/chap_appendix.texhttps://github.com/CheckBoxStudio/BUAAThesis/pull/13/files#diff-2 (3) M tex/chap_biography.texhttps://github.com/CheckBoxStudio/BUAAThesis/pull/13/files#diff-3 (3) M tex/chap_instruction.texhttps://github.com/CheckBoxStudio/BUAAThesis/pull/13/files#diff-4 (1) M tex/chap_intro.texhttps://github.com/CheckBoxStudio/BUAAThesis/pull/13/files#diff-5 (1) M tex/chap_sample.texhttps://github.com/CheckBoxStudio/BUAAThesis/pull/13/files#diff-6 (3) M tex/chap_summary.texhttps://github.com/CheckBoxStudio/BUAAThesis/pull/13/files#diff-7 (1) Patch Links: https://github.com/CheckBoxStudio/BUAAThesis/pull/13.patch * https://github.com/CheckBoxStudio/BUAAThesis/pull/13.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub<#13>, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APcO-v-2vp--9Xy0E4p4hLeAZBwYG3Qdks5u6K5SgaJpZM4ZX251.
TeX root
是一种magic comments
,好处在于可以引导texstudio等ide寻找最主要的tex文件。
比如在texstudio里打开chap_achievement.tex
,如果没有tex root
,直接编译会报错Undefined control sequence. \achievement
。如果加入tex root
后,texstudio会从../Template.tex
开始编译,不会有报错了。
我之前使用Sublime的latex插件的时候也需要加入tex root
它才能正确从头编译,否则每次必须从主文件比如Template.tex
编译。
按照这里的解释
https://tex.stackexchange.com/questions/287056/how-to-compile-from-a-subchapter-or-how-to-set-root-file/287057
http://texstudio.sourceforge.net/manual/current/usermanual_en.html#SECTION_TEXCOM
tex root
并不是一个标准的指令,但是很多IDE都实现了这个功能,所以应该没有负面影响。
我的一点疑虑是Windows下能否识别../Template.tex
?还是要写成..\Template.tex
?
我觉得正常的IDE应该都可以识别../Template.tex
。
目前我这里没有Windows的编译环境,你有没有windows环境可以试一试?
如果Windows也可以编译的话,编译的时候会方便许多,不用每次回到Template.tex
进行编译了。
最新版已更新 d365a45cfe0476785f5d69ab7faa9bbc218187aa
加上
%!TEX root = ../Template.tex
可以方便编译。../Template.tex
这种写法在Windows下会有问题吗?Linux可以通过。