[OS X TeX] [TeXShop] input file and master doc compilation

Alain Schremmer schremmer.alain at gmail.com
Wed Feb 3 18:34:21 EST 2010

On Feb 3, 2010, at 5:34 PM, Sylvain CHAMBON wrote:

> howdy (again) !
> i have a document (book class) in which i input files for each  
> chapter in order to work only on the chapter in process. this  
> chapter file is not indeed a tex document, just a piece of text.
> now imagine i have in the master document the line '\input{./ 
> chapitres/3e-trigo}' among other things and i'm working on this  
> file '3e-trigo'. is there a way to compile this file _without_  
> opening the master document ? in fact, i have actually to do  
> backwards and forwards all the time between the master document and  
> the file of the chapter to see the result of what i'm writing...  
> which it's quite boring !!!

Here is the way I do it with the magnum opus.

I have three folders:

A) The files in Chapters-contents are numbered, say, 1, 2, 3 and they  
all start with the same first line:

File 1 starts as:
	%!TEX root = ../Chapters-controls/\jobname.tex
		\chapter{Blah Blah Of The First Kind}
		Blah Blah

File 2 starts as:
	%!TEX root = ../Chapters-controls/\jobname.tex
		\chapter{Blah Blah Of The Second Kind}
		Blah Blah


B) The files in Chapters-control are numbered the same way and are  
all copies of the single:


		\addtocounter{page}{0}%adjusted manually after a typesetting of the  
whole book.
		\addtocounter{chapter}{0}%adjusted when the chapter is being begun.

	%	\printindex

No more, no less.

C) The third folder consists of only one .tex file together with its  

		. . .

		%1 - Blah Blah Of The First Kind:

		%2 - Blah Blah Of The Second Kind:
		%3 - Blah Blah Of The Third Kind:
		. . .

I can thus typeset a chapter from both the Content file and from the  
Control file. I typeset the whole book once in a while to update the  
\addtocounter{page} in the control files.

There are other possibilities as well. For instance, until I  
developed the above, I used the package "askinclude" which asks you  
interactively which chapter(s) to include.

My separation of contents and controls, though, comes in very handy  
when you want to give the reader the freedom of choice among  
different options such as to how to format Exercises, Exams. etc More  
details should you be interested. (An old implementation of this  
"system" can be found on http://www.freemathtexts.org but the new  
improved version of the system has yet to get there--but will be  


More information about the MacOSX-TeX mailing list