撰写毕业论文文件包括一个主文件main.tex以及多个由独立章节构成的子文件chapter01.tex chapter02.tex等,用sublime Text3编译main.tex时完全没有任何问题,但编译子文件chapter02时报错,代码如下: C:\Users\aogu2\Desktop\nwafuthesis-2.2.14\nwafuthesis-2.2.14\demo\contents\chap02.tex:4: Undefined control sequence. [\chapter] C:\Users\aogu2\Desktop\nwafuthesis-2.2.14\nwafuthesis-2.2.14\demo\contents\chap02.tex:4: LaTeX Error: Missing \begin{document}. [\chapter{材] C:\Users\aogu2\Desktop\nwafuthesis-2.2.14\nwafuthesis-2.2.14\demo\contents\chap02.tex:6: Undefined control sequence. [\section] C:\Users\aogu2\Desktop\nwafuthesis-2.2.14\nwafuthesis-2.2.14\demo\contents\chap02.tex:6: LaTeX Error: Missing \begin{document}. [\section{试] C:\Users\aogu2\Desktop\nwafuthesis-2.2.14\nwafuthesis-2.2.14\demo\contents\chap02.tex:8: Undefined control sequence. [\section] C:\Users\aogu2\Desktop\nwafuthesis-2.2.14\nwafuthesis-2.2.14\demo\contents\chap02.tex:10: Undefined control sequence. [\section] C:\Users\aogu2\Desktop\nwafuthesis-2.2.14\nwafuthesis-2.2.14\demo\contents\chap02.tex:12: Undefined control sequence. [\section] C:\Users\aogu2\Desktop\nwafuthesis-2.2.14\nwafuthesis-2.2.14\demo\contents\chap02.tex:15: Undefined control sequence. 我之前一直用的TexStudio写的,没有任何问题,听说sublime Text在插入文献的时候的自动补全功能比前者更好用,就来试试sublime Text,结果遇到如此问题,请各位大神解答,感激不尽!

2 回答2

0
texstudio 没把整个文件建立起统一的项目而已。 你在 `chapter02.tex` 第一行加 ``` % !TeX root = main.tex ``` 可能会解决这个问题。 当然如果 `main.tex` 没和 `chapter02.tex` 在同文件夹,你上面的代码还要写相对路径。
0
打开main.tex编译,每次编译都编译这个main.tex。

你的回答

请登录后回答

你的回答将会帮助更多人,请务必认真回答问题。