2022.2

Table Of Contents
Notethatevenifasectionisnotenabled(soitwillnotbeoutputted),itsrestartPageNumberflagis
stilltakenintoaccountforcomposingthepagenumbersequences.
Bydefault,eachsectionhasrestartPageNumber = falsewhenthefirstcontrolscriptruns.
Tip: Ifyouarelookingtocreateashort,simpletableofcontentsinone section,youcouldadda
StandardScriptthatusesthepageRef()function.Foranexample,see"pageref()"on
page805.
Foramulti-page,cross-sectiontableofcontentsyoumustuseaPostPaginationScript;see
"CreatingaTableOfContents"onpage411.
Examples
Restarting the page numbers several times
Assumethatatemplatehasfoursections(of1pageeach)inthePrintcontextandaControlScriptsets
thepagenumberingasfollows:
1. SectionA(1page)restartPageNumber=true
2. SectionB(1page)restartPageNumber=true
3. SectionC(1page)restartPageNumber=false
4. SectionD(1page)restartPageNumber=true
Thecodewouldlooklikethis:
if (merge.context.type == ContextType.PRINT) {
merge.context.sections['Section A'].restartPageNumber = true;
merge.context.sections['Section B'].restartPageNumber = true;
merge.context.sections['Section C'].restartPageNumber = false;
merge.context.sections['Section D'].restartPageNumber = true;
}
Thepagenumberingintheoutputwillbe:
1. SectionApage1
2. SectionBpage1
3. SectionCpage2
4. SectionDpage1
Disabled section
Whenasectionisdisabled,itwillnotbeoutputted,butitsrestartPageNumberflagwillstillbetaken
intoaccountforcomposingthepagenumbersequences.So,iftherestartPageNumberflagsareset
asfollows:
Page 401