[OS X TeX] !TEX root

Alain Schremmer schremmer.alain at freemathtexts.org
Sun Jul 16 20:28:43 CEST 2023


As far as that goes, I prefer my own, simple minded, approach: 

In the whole book folder, there is only
— a folder that contains the graphics in the format of the graphics app.
— a folder that contains the pdfs thereof to be included in the text.
— a folder “StyleSheets” that contains the Preamble, the GraphicPaths, and such files as definitions of tcolorboxes.
—a folder that contains:
		—a folder called Text-contents that contains the files called 1.tex, 2.tex … containing the text of each chapter, 
			    Each of these text files consists of:
		%!TEX root = ../\jobname.tex 
		%!TEX TS-program = pdflatexmk 
		\chapter{The Name Of The Chapter}
		\ChapterToc
		Followed by the text of the chapter.	
—for each of the above text files, a copy, also called 1.tex, 2.tex …, of the single following file:
		% !TEX TS-program = pdflatexmk \documentclass[11pt]{book} 
		\usepackage{../StyleSheets/Preamble} 	
		\usepackage{../StyleSheets/GraphicsPaths} 
		\begin{document}
		\addtocounter{chapter}{\jobname-1} (To get the Chapter Number the same as in the whole book.)
		\addtocounter{page}{number} (To keep the pages numbers the same as in the whole book.)
		\input{Text-contents/\jobname}
		\printindex
		\end{document}
	—a single file for the whole book which consists of:
				% !TEX TS-program = pdflatexmk  
				\documentclass[11pt]{book} 
				\usepackage{../StyleSheets/Preamble}
				\usepackage{../StyleSheets/GraphicsPaths}
				\begin{document}
				         \toc
					 \input{Text-contents/1}
					 \input{Text-contents/2}
					...
					\printindex
				\end{document}

So, the only files I actually open to work are the text file(s). 

Clicking on either one of the two tex files for a chapter will open both together with the pdf of that chapter so I "can edit and typeset the subfiles by themselves” which indeed “can be much faster and is better for your own mental focus.” and “Of course [I] can also typeset the entire document” by typesetting that single file for the whole book.



> On Jul 16, 2023, at 11:28, Paul Dulaney <pmdulaney at gmail.com> wrote:
> 
> If the idea is to have a main file which includes other files (one for each chapter), I recommend the subfiles package. A really nice feature of the subfiles package is that you can edit and typeset the subfiles by themselves, which can be much faster and is better for your own mental focus. Of course you can also typeset the entire document.
> 
> Here is a sample MAIN file:
> 
> % /Users/drofnats/Documents/LaTeXDocs/MyMasterpiece.tex
> 
> % This is the main document for
> %     My Masterpiece, a tome of many chapters
> %
> % I am using the subfiles pkg which allows each subfile (e.g., Preface, Chapter 1, etc.)
> % to be compiled and viewed separately
> 
> \documentclass[12pt]
> 
> % begin preamble       *    *    *    *    *    *    *    *    *    *    *    *    *
> 
> % packages (in general) go here, but I've put font-related commands together further down
> 
> \usepackage{marginnote}
> 
> \newcommand{\vskipp}{\par\vspace{10pt}\noindent}
> 
> 
> % ** start ********************** FONT-RELATED COMMANDS *****************************
> 
> \usepackage{fontspec}
> 
> \setmainfont{charis-sil}    % For now, my default font
> 
> % **  end  ********************** FONT-RELATED COMMANDS *****************************
> 
> % The subfiles package MUST be the last package in the preamble
> \usepackage{subfiles}
> % end preamble    *    *    *    *    *    *    *    *    *    *    *    *    *    *
> \begin{document}
> \title{My MasterPiece: In which many mental knots are untied}
> \author{D. E. K. Drofnats}
> 
> \maketitle
> %
> % OUTLINE
> %
> % My Masterpiece
> %
> %       Preface
> %    1. Mathematical revelations
> %    2. Philosophical revelations
> %    3. Spiritual revelations
> %    
> 
> \subfile{Masterpiece_Preface}
> \subfile{Masterpiece_Chap01}
> \subfile{Masterpiece_Chap02}
> \subfile{Masterpiece_Chap03}
> 
> \end{document} 
> 
> 
> 
> And here is a sample file to be included:
> 
> % /Users/drofnats/Documents/LaTeXDocs/Masterpiece_Chap01.tex
> 
> \documentclass[MyMasterpiece]{subfiles}
> \begin{document}
> 
> \chapter{}
> 
> \noindent
> The story of my mathematical excellence begins in my sixth year. Much like my
> hero, Norbert Wiener, it is my father I have to thank for my introduction to
> mathematics.
> 
> \end{document}
> 
> 
> On Sat, Jul 15, 2023 at 5:10 PM Herbert Schulz via MacOSX-TeX <macosx-tex at email.esm.psu.edu <mailto:macosx-tex at email.esm.psu.edu>> wrote:
> 
> 
> > On Jul 15, 2023, at 5:14 PM, Nitecki, Zbigniew H. <Zbigniew.Nitecki at tufts.edu <mailto:Zbigniew.Nitecki at tufts.edu>> wrote:
> > 
> > I’m simultaneously working on two projects.  One is a book-length project while the other is a single, short article. 
> > For each one, I have a root file and then separate files for individual chapters (resp sections).
> > 
> > I’ve been using method described in section 2.4 of the TexShop Tips and Tricks file for a long time on the book project, but am puzzled by a different behavior by the (very recent) article project. 
> > 
> > Setup:
> > The root file for the book project, Couer.tex,  is in a Dropbox folder  Books->Couer. The chapter files are also all in this folder. The first line of each reads
> > % !TEX root = Coeur.tex
> > and the root file calls them via an \input{filename} command.
> > 
> > The root file for the article, SpaceFillCurve.tex, is in a different Dropbox folder, MyPapers->SpaceFill, and the section files (so far, just one) are in that folder. The first line of each reads
> > % !TEX root = SpaceFillCurve.tex
> > and the root file calls them via an \include{filename} command (I wanted to see how the include option works).
> > 
> > 
> > The style files I am using are in a texmf folder in my Library.
> > 
> > Behavior:
> > In both cases, a command-T on the root file or the output file results in typesetting.
> > In the (older) book project, if I am displaying an individual chapter source file and I click either command-T or the “typeset” button the whole thing typesets.
> > In the new article project when I do this nothing happens, unless I am in the root file.
> > 
> > I should mention, if it is relevant, that I have root/source/output/console files for both projects open simultaneously.
> > 
> > Any suggestions where to look for a fix?  It is relevant if I want, for example, to do bibtex or makeindex.
> > 
> > 
> > 
> > 
> > 
> > Zbigniew Nitecki
> > Professor Emeritus
> > Department of Mathematics
> > Tufts University
> > Medford, MA 02155
> > 
> > telephones:
> > Dept.    (617)627-3234
> > Dept. fax    (617)627-3966
> > http://www.tufts.edu/~znitecki/ <http://www.tufts.edu/~znitecki/>
> 
> Howdy,
> 
> What happens if you copy the DropBox folder to the your conputer? Does everything work as expected? What happens if you create a symbolic link to the DropBox folders on your computer? I guess I don't trust DropBox since I've heard of strange things happening.
> 
> Good Luck,
> 
> Herb Schulz
> herbs2 at mac.com <mailto:herbs2 at mac.com>
> 
> 
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: https://www.tug.org/mactex/faq/index.html <https://www.tug.org/mactex/faq/index.html>
> List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/TeX/ <https://sites.esm.psu.edu/~gray/TeX/>
> List Archives: http://dir.gmane.org/gmane.comp.tex.macosx <http://dir.gmane.org/gmane.comp.tex.macosx>
>                 https://email.esm.psu.edu/pipermail/macosx-tex/ <https://email.esm.psu.edu/pipermail/macosx-tex/>
> TeX on Mac OS X Website: https://www.tug.org/mactex/index.html <https://www.tug.org/mactex/index.html>
> List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex <https://email.esm.psu.edu/mailman/listinfo/macosx-tex>
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: https://www.tug.org/mactex/faq/index.html
> List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/TeX/
> List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
>                https://email.esm.psu.edu/pipermail/macosx-tex/
> TeX on Mac OS X Website: https://www.tug.org/mactex/index.html
> List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/macostex-archives/attachments/20230716/f1cc5c43/attachment-0001.htm>
-------------- next part --------------
----------- Please Consult the Following Before Posting -----------
TeX FAQ: https://www.tug.org/mactex/faq/index.html
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/TeX/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: https://www.tug.org/mactex/index.html
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex


More information about the macostex-archives mailing list.