%!TEX root = ../main.tex 说 ! 未定义的控制序列

%!TEX root = ../main.tex 说 ! 未定义的控制序列

我有以下目录结构:

main.tex
content/
       intro.tex
       something.tex

我想从任何 tex 文件进行编译。因此,我有以下行(如建议的那样这里) 位于内容文件夹内所有文件的开头。

%!TEX root = ../main.tex

其内容intro.tex如下:

%!TEX root = ../main.tex

\section{Introduction}
some text .........

我正在使用 TexMaker,当我尝试从构建时intro.tex,出现以下错误。

LOG FILE :
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex 2017.9.27) 30 JAN 2018 14:37
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**intro.tex
(./intro.tex
LaTeX2e <2016/02/01>
Babel <3.9q> and hyphenation patterns for 81 language(s) loaded.
! Undefined control sequence.
l.3 \section
{Introduction}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.

! Emergency stop.
<*> introduction.tex
*** (job aborted, no legal \end found)
Here is how much of TeX's memory you used:
11 strings out of 493029
236 string characters out of 6136234
53072 words of memory out of 5000000
3646 multiletter control sequences out of 15000+600000
3948 words of font info for 15 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
20i,2n,26p,731b,93s stack positions out of 5000i,500n,10000p,200000b,80000s
! ==> Fatal error occurred, no output PDF file produced!

有什么帮助吗?

相关内容