<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">It seems you have to enter manually in each of the _copy_ files 1.tex. 2.tex. ... , the number of pages up to and including the last page of the preceding chapter. So then if you edit a prior chapter, you have to go back and change the value of "number" in each of the _copy_ files of the following chapters.<div><br></div><div>Is there some nice way to update the number-of-pages-up-to-now values automatically whenever you process a preceding chapter?<br><div><br><blockquote type="cite"><div>On Jul 16, 2023, at 2:28 PM, Alain Schremmer <schremmer.alain@freemathtexts.org> wrote:</div><br class="Apple-interchange-newline"><div><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">As far as that goes, I prefer my own, <i>simple minded</i>, approach: <div><br></div><div>In the whole book folder, there is only<div>— a folder that contains the graphics in the format of the graphics app.</div><div>— a folder that contains the pdfs thereof to be included in the text.</div><div>— a folder “StyleSheets” that contains the <b>Preamble</b>, the <b>GraphicPaths</b>, and such files as definitions of tcolorboxes.</div><div>—a folder that contains:</div><div><span class="Apple-tab-span" style="white-space: pre;">           </span>—a folder called Text-contents that contains the files called 1.tex, 2.tex … containing the <i><b>text</b></i> of each chapter, </div><div><span class="Apple-tab-span" style="white-space:pre">                       </span>    Each of these <i><b>text</b></i> files consists of:</div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><span class="Apple-tab-span" style="white-space:pre">              </span>%!TEX root = ../\jobname.tex </div></blockquote></div><div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><span class="Apple-tab-span" style="white-space:pre">             </span>%!TEX TS-program = pdflatexmk </div></blockquote></div><div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><span class="Apple-tab-span" style="white-space:pre">            </span>\chapter{The Name Of The Chapter}</div><div><span class="Apple-tab-span" style="white-space:pre">            </span>\ChapterToc</div><div><span class="Apple-tab-span" style="white-space: pre;">                </span>Followed by the <i><b>text</b></i> of the chapter.<span class="Apple-tab-span" style="white-space: pre;">   </span></div></blockquote></div></blockquote><div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>—for each of the above text files, a <b style="font-style: italic;">copy</b>, also called 1.tex, 2.tex …, of the single following file:</div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><span class="Apple-tab-span" style="white-space:pre">                </span>% !TEX TS-program = pdflatexmk
\documentclass[11pt]{book} </div><div><span class="Apple-tab-span" style="white-space:pre">          </span>\usepackage{../StyleSheets/<b>Preamble</b>}
<span class="Apple-tab-span" style="white-space:pre"> </span></div><div><span class="Apple-tab-span" style="white-space:pre">             </span>\usepackage{../StyleSheets/<b>GraphicsPaths}</b> </div><div><span class="Apple-tab-span" style="white-space:pre">           </span>\begin{document}</div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><span class="Apple-tab-span" style="white-space:pre">         </span>\addtocounter{chapter}{\jobname-1} (To get the Chapter Number the same as in the whole book.)</div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><span class="Apple-tab-span" style="white-space:pre">         </span>\addtocounter{page}{<i>number</i>} (To keep the pages numbers the same as in the whole book.)</div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><span class="Apple-tab-span" style="white-space:pre">             </span>\input{Text-contents/\jobname}</div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><span class="Apple-tab-span" style="white-space:pre">                </span>\printindex</div></blockquote><div><span class="Apple-tab-span" style="white-space:pre">               </span>\end{document}</div></blockquote><div><span class="Apple-tab-span" style="white-space:pre">    </span>—a <b>single file for the whole book</b> which consists of:</div><div><span class="Apple-tab-span" style="white-space:pre">                          </span>% !TEX TS-program = pdflatexmk  </div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>\documentclass[11pt]{book} </div><div><span class="Apple-tab-span" style="white-space:pre">                             </span>\usepackage{../StyleSheets/Preamble}</div><div><span class="Apple-tab-span" style="white-space:pre">                         </span>\usepackage{../StyleSheets/GraphicsPaths}</div><div><span class="Apple-tab-span" style="white-space:pre">                            </span>\begin{document}</div><div><span class="Apple-tab-span" style="white-space:pre">                             </span>         \toc</div><div><span class="Apple-tab-span" style="white-space:pre">                                       </span> \input{Text-contents/1}</div><div><div><span class="Apple-tab-span" style="white-space: pre;">                                   </span> \input{Text-contents/2}</div><div><span class="Apple-tab-span" style="white-space: pre;">                                      </span>...</div></div><div><div><span class="Apple-tab-span" style="white-space:pre">                                   </span>\printindex</div></div><div><span class="Apple-tab-span" style="white-space:pre">                              </span>\end{document}</div><div><br></div><div>So, the only files I actually open to work are the <b><i>text file(s)</i></b>. </div><div><br></div><div>Clicking on either one of the two tex files for a chapter will open both together with the pdf of that chapter so I "<i>can edit and typeset the subfiles by themselves</i>” which indeed “<i>can be much faster and is better for your own mental focus.</i>” and “<i>Of course [I] can also typeset the entire document</i>” by typesetting that <b>single file for the whole book</b>.</div><div><div><br></div><div><br></div></div></div></div></div></blockquote></div><br><div>
<div>---<br>Murray Eisenberg<span class="Apple-tab-span" style="white-space: pre;">               </span>murrayeisenberg@gmail.com<br>Mobile (413)-427-5334<br>503 King Farm Blvd #101<span class="Apple-tab-span" style="white-space: pre;">         </span><br>Rockville, MD 20850-6667<span class="Apple-tab-span" style="white-space: pre;">        </span></div><div><br></div><br class="Apple-interchange-newline">

</div>
<br></div></body></html>