Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

加入tex root #13

Closed
wants to merge 2 commits into from
Closed

Conversation

qiaojunfeng
Copy link
Contributor

加上%!TEX root = ../Template.tex可以方便编译。

../Template.tex这种写法在Windows下会有问题吗?Linux可以通过。

@weiquanmao
Copy link
Member

weiquanmao commented Dec 18, 2018 via email

@qiaojunfeng
Copy link
Contributor Author

%!TEX root = ../Template.tex有什么作用?方便讲解一下吗? From Quanmao Wei. 在 2018年12月18日,16:59,Junfeng Qiao <[email protected]mailto:[email protected]> 写道: 加上%!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进行编译了。

@weiquanmao
Copy link
Member

最新版已更新 d365a45

@weiquanmao weiquanmao closed this Dec 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants