TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a newbie at LaTeX/TeXlipse/TeXShop.

I am currently writing a LaTeX document using TeXlipse plugin in Ubuntu. Due to hardware issues on the Ubuntu machine I need to port the .tex files to TeXShop on a Mac OS X. Since I was using TeXlipse, it had created all the .tex files in a project format. My entry point is document.tex


%include other pages

\pagenumbering{roman} %numbering before main content starts

\pagenumbering{arabic} %reset numbering to normal for the main content



When I try to preview this document.tex file I am able to see the corresponding PDF file. But any changes made to the introduction.tex file are not visible. I am not sure if this is because TeXShop does not support this kind of a project structure, or do I have to include all of the data into a single .tex file?

The error I see in the console is as follows:

/introduction.tex:3: LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.

Since introduction.tex is not another document but the part of a bigger document should I include \begin{document} in every .tex file?

share|improve this question
Welcome to TeX.SE. You need a \documentclass statement and your preamble (ie, the \usepackage{} statements before \begin{document}. When you say "changes made to the introduction.tex file are not visible" are you saying that when you recompile document.tex that changes from introduction.tex are not visible? If you do not want to compile introduciton.tex by itself then you don't need the \documentclass, premable, and \begin{document}, \end{document} in introduction.tex. – Peter Grill Apr 4 '12 at 14:54
You should also have a look at [the standalone package]() – Peter Grill Apr 4 '12 at 15:05
@Peter Grill Oops looks like it was a beginner's error, I was compiling the introduction.tex instead of compiling document.tex , I have added the statements you mentioned earlier and it seems to be running fine now. Thank you – bhavs Apr 4 '12 at 15:06

In TeXShop, you can add the information of the main file (the one you're actually "compiling") using the pre-processor command:

% !TEX root = mainfile.tex

(substitute "mainfile" for whatever you're calling yours). You can also add directory indications (e.g., ./mainfile.tex).

You should use this pre-processor command in all of your "child" documents (i.e., those which you call with \include or \input from your main file).

In the TeXShop menu, go to Macros->Root->Root, to create the command.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.