[TeXShop] input file and master doc compilation

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[TeXShop] input file and master doc compilation

Sylvain CHAMBON
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 !!!

hope i'm clear anouth. thanks for answers.

sylvain.

----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: [TeXShop] input file and master doc compilation

Peter Dyballa

Am 03.02.2010 um 23:34 schrieb Sylvain CHAMBON:

> this chapter file is not indeed a tex document, just a piece of text.


There seems to exist a texnique to dump a special FMT. AUCTeX is set  
up to work in a similiar, but I don't know whether the (La)TeX file  
needs to have the necessary preamble plus \begin and \end of  
{document). I doubt that it can work to leave these statements away...

Why can't you just comment the chapters/files you've already finished  
in your master document? Then you can easily recompile it time after  
time.

--
Greetings

   Pete

Build a man a fire and he'll be warm for a night, but set a man on  
fire and he'll be warm for the rest of his life.


----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: [TeXShop] input file and master doc compilation

Herbert Schulz
In reply to this post by Sylvain CHAMBON

On Feb 3, 2010, at 4: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 !!!
>
> hope i'm clear anouth. thanks for answers.
>
> sylvain.

Howdy,

Put the comment

% !TEX root = ../masterfile.tex

at the top of 3e-trigo.tex (it called .tex isn't it?) and when you typeset TeXShop will know which file to actually compile.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)




----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: [TeXShop] input file and master doc compilation

Alain Schremmer-2
In reply to this post by Sylvain CHAMBON

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:
        Chapters-contents
        Chapters-controls
        Textbook

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

Etc

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

        \documentclass[11pt]{book}
                \usepackage{MyPreamble}
        \begin{document}

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

                \include{../Chapters-contents/\jobname}
        % \printindex
        \end{document}

No more, no less.

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

        \documentclass[11pt]{book}
                \usepackage{MyPreamble}
        \begin{document}
                \frontmatter
                . . .
                \tableofcontents

                %1 - Blah Blah Of The First Kind:
                \include{../Chapters-contents/1}

                %2 - Blah Blah Of The Second Kind:
                \include{../Chapters-contents/2}
       
                %3 - Blah Blah Of The Third Kind:
                \include{../Chapters-contents/3}
                . . .
                \printindex
        \end{document}

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  
"soon".)

Regards
--schremmer


















----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: [TeXShop] input file and master doc compilation

Herbert Schulz

On Feb 3, 2010, at 5:34 PM, Alain Schremmer wrote:

>
> 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:
> Chapters-contents
> Chapters-controls
> Textbook
>
> 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
>
> Etc
>
> B) The files in Chapters-control are numbered the same way and are all copies of the single:
>
> \documentclass[11pt]{book}
> \usepackage{MyPreamble}
> \begin{document}
>
> \addtocounter{page}{0}%adjusted manually after a typesetting of the whole book.
> \addtocounter{chapter}{0}%adjusted when the chapter is being begun.
>
> \include{../Chapters-contents/\jobname}
> % \printindex
> \end{document}
>
> No more, no less.
>
> C) The third folder consists of only one .tex file together with its aux:
>
> \documentclass[11pt]{book}
> \usepackage{MyPreamble}
> \begin{document}
> \frontmatter
> . . .
> \tableofcontents
>
> %1 - Blah Blah Of The First Kind:
> \include{../Chapters-contents/1}
>
> %2 - Blah Blah Of The Second Kind:
> \include{../Chapters-contents/2}
>
> %3 - Blah Blah Of The Third Kind:
> \include{../Chapters-contents/3}
> . . .
> \printindex
> \end{document}
>
> 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 "soon".)
>
> Regards
> --schremmer
Howdy,

But can you start a compile from one of your chapter files? With the root set to .../\jobname... TeXshop can't possibly find the proper root file from within the Chapter file. You've always got to compile from one of your root files and those

%!TEX root = ../Chapters-controls/\jobname.tex

are not doing anything.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)




----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: [TeXShop] input file and master doc compilation

Alain Schremmer-2

On Feb 3, 2010, at 6:41 PM, Herbert Schulz wrote:

>
> On Feb 3, 2010, at 5:34 PM, Alain Schremmer wrote:
>>
>> 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.
>
> Howdy,
>
> But can you start a compile from one of your chapter files?
Yes I can. Either from the contents file whose %!TEX root = ../
Chapters-controls/\jobname.tex calls the control file (the chapter  
root file) or, of course, from the control file itself.

> With the root set to .../\jobname... TeXshop can't possibly find  
> the proper root file from within the Chapter file.

> You've always got to compile from one of your root files and those
>
> %!TEX root = ../Chapters-controls/\jobname.tex
>
> are not doing anything.

Your Honor, I am innocent: Nobody told me that so I have been doing  
it for over a year! ;-))

Best regards
--schremmer


----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: [TeXShop] input file and master doc compilation

Herbert Schulz

On Feb 3, 2010, at 6:43 PM, Alain Schremmer wrote:

>
> Yes I can. Either from the contents file whose %!TEX root = ../Chapters-controls/\jobname.tex calls the control file (the chapter root file) or, of course, from the control file itself.
>
>

Howdy,

How does TeXshop ``know'' that \jobname refers to the chapter root file if you simply open the chapter file and try to typeset? Don't you have to open the chapter-control file separately and typeset that?

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)




----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: [TeXShop] input file and master doc compilation

Alain Schremmer-2

On Feb 3, 2010, at 8:18 PM, Herbert Schulz wrote:

>
> On Feb 3, 2010, at 6:43 PM, Alain Schremmer wrote:
>
>>
>> Yes I can. Either from the contents file whose %!TEX root = ../
>> Chapters-controls/\jobname.tex calls the control file (the chapter  
>> root file) or, of course, from the control file itself.
>>
>>
>
> Howdy,
>
> How does TeXshop ``know'' that \jobname refers to the chapter root  
> file if you simply open the chapter file and try to typeset? Don't  
> you have to open the chapter-control file separately and typeset that?
No.

Because the contents file and the control file both have the same  
number, say 2.

Then, when typesetting Chapters-contents/2, the line

%!TEX root = ../Chapters-controls/\jobname.tex

calls

../Chapters-controls/2.tex

  which is the root file which contains

\include{../Chapters-contents/\jobname}

namely Chapters-contents/2

that is the original file.

I do think that it is a bit perverse but it really works beautifully.

Proud regards
--schremmer



----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: [TeXShop] input file and master doc compilation

Martin Costabel
Alain Schremmer wrote:
>
> On Feb 3, 2010, at 8:18 PM, Herbert Schulz wrote:
>
[]

>> How does TeXshop ``know'' that \jobname refers to the chapter root
>> file if you simply open the chapter file and try to typeset? Don't you
>> have to open the chapter-control file separately and typeset that?
>
> No.
>
> Because the contents file and the control file both have the same
> number, say 2.
>
> Then, when typesetting Chapters-contents/2, the line
>
> %!TEX root = ../Chapters-controls/\jobname.tex
>
> calls
>
> ../Chapters-controls/2.tex

What Herb thinks (as I did) is that this %!TEX line is executed by
TeXShop, which normally does not interpret TeX macros. Thus TeXShop
should be looking for a file with the literal file name
"Chapters-controls/\jobname.tex", which does not exist.

In reality, by some miracle the \jobname macro *is* interpreted
correctly by TeXShop. This is different from setting the project root
via the "File" menu, which creates a *.texshop file containing the file
name. There you cannot use \jobname.

>  which is the root file which contains
>
> \include{../Chapters-contents/\jobname}
>
> namely Chapters-contents/2

This one is clear, the "\include" line is executed by latex, which knows
about TeX macros.

> that is the original file.
>
> I do think that it is a bit perverse but it really works beautifully.

--
Martin


----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: [TeXShop] input file and master doc compilation

Alain Schremmer-2

On Feb 4, 2010, at 3:21 AM, Martin Costabel wrote:

> In reality, by some miracle the \jobname macro *is* interpreted  
> correctly by TeXShop.

But what a nice miracle!!!

I have always been lucky---not that I am complaining.

Best regards to all.
--schremmer

----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: [TeXShop] input file and master doc compilation

Herbert Schulz
In reply to this post by Martin Costabel

On Feb 4, 2010, at 2:21 AM, Martin Costabel wrote:

>
> What Herb thinks (as I did) is that this %!TEX line is executed by TeXShop, which normally does not interpret TeX macros. Thus TeXShop should be looking for a file with the literal file name "Chapters-controls/\jobname.tex", which does not exist.
>
> In reality, by some miracle the \jobname macro *is* interpreted correctly by TeXShop. This is different from setting the project root via the "File" menu, which creates a *.texshop file containing the file name. There you cannot use \jobname.
>
>

Howdy,

Yes, you have it exactly correct. TeXShop itself must be substituting the file name (e.g., 2) for \jobname in that comment and accidentally/on purpose :-) the actual file to compile has the same name but along the path given; quite interesting. Of course if Schremmer wants to compile the whole book he must execute that root file directly. Now I'm going to have to try that!

TeXShop keeps on amazing me!

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)




----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex