# [OS X TeX] TexShop Feature Request: Command-T while revising a chapter possible?

Alain Schremmer schremmer.alain at gmail.com
Wed Jun 23 19:50:32 EDT 2010

On Jun 23, 2010, at 7:00 PM, Herbert Schulz wrote:

>
> On Jun 23, 2010, at 5:05 PM, Iraj Kalantari wrote:
>
>> When working on a book with chapters to be included, I find myself
>> making repairs a chapter, saving it, and then, instinctively,
>> reaching for 'Command-T'.
>>
>> This of course won't work as one must (to the best of my
>> knowledge) go to the including 'book' source and typeset that file.
>>
>> Is it possible to arrange that when TeXShop receives a typeset
>> command on a 'chapter', it can be told (until told otherwise) to
>> run the 'book' source that is associated with it (or can be so)?
>>
>> Is such an arrangement already available?
>>
>> Iraj.

The way I use the %!TEX root tag is as follows:

First, I have two folders: Contents and Controls

---In the Contents folder I have files named 0.tex, (that's for the
Preface),1.tex, 2.tex etc each of which starts as follows:

%!TEX root = ../Controls/\jobname.tex
\chapter{My Chapter One}
Some text

---In the Controls folder, I have files also named 0.tex, 1.tex,
2.tex etc each of which is just a copy of:

\documentclass[11pt]{book}
\usepackage{xxx}
\usepackage{yyy}
\begin{document}
\include{../Contents/\jobname}
\end{document}

---Thirdly, I have a folder WholeBook which contains the file MyBook
which is the usual root file:

\documentclass[11pt]{book}
\usepackage{xxx}
\usepackage{yyy}
\begin{document}
\frontmatter
\include{../Contents/1}
\include{../Contents/2}
etc
\end{document}

Thus, 'Command-T for a chapter, whether from the Content file or the
Control file will typeset just the chapter.

In fact, for the sake of symmetry, I am now using the following
variation on the above theme

I have only the two folders: Contents and Controls in which I have
the same files as above but also, in addition:

---In the Contents folder:

The file ALL.tex:

%!TEX root = ../Controls/\jobname.tex
\include{../Contents/0}%Preface to be numbered along with the
contents, etc
\mainmatter
\include{../Contents/1}
\include{../Contents/2}
etc

---In the Controls folder

The file ALL.tex:

\documentclass[11pt]{book}
\usepackage{xxx}
\usepackage{yyy}
\begin{document}
\frontmatter
\input{../Contents/ALL}
\backmatter
\include{../Text-contents/99}%That's the GNU FDL
\printindex
\end{document}

Regards
--schremmer

P.S. I use the same scheme for the ancillaries, shortly to be