\:CheckOption{7} \if:Option
\expandafter\ifx \csname @chapter\endcsname\relax
<.cut toc: part.> cut toc before cutat
<.cutat: part.>
<.cut toc: sec.>
<.cutat: sec (no ch).>
<.cut toc: subsec.>
<.cutat: subsection (no ch).>
<.cut toc: subsubsec.>
<.cutat: subsubsection (no ch).>
<.cut toc: paragraph.>
<.cutat: paragraph (no ch).>
<.cut toc: subparagraph.>
<.cutat: subparagraph (no ch).>
<.tocat: part, no chapter.>
<.tocat: section.>
<.tocat: subsection.>
<.tocat: subsubsection.>
<.tocat: paragraph.>
\else
<.cut toc: part.> cut toc before cutat
<.cutat: part.>
<.cut toc: ch.>
<.cutat: chapter.>
<.cut toc: sec.>
<.cutat: sec.>
<.cut toc: subsec.>
<.cutat: subsection.>
<.cut toc: subsubsec.>
<.cutat: subsubsection.>
<.cut toc: paragraph.>
<.cutat: paragraph.>
<.cut toc: subparagraph.>
<.cutat: subparagraph.>
<.tocat: part.>
<.tocat: ch.>
<.tocat: section.>
<.tocat: subsection.>
<.tocat: subsubsection.>
<.tocat: paragraph.>
\fi
<.object tocs.>
\else\:CheckOption{6} \if:Option
\expandafter\ifx \csname @chapter\endcsname\relax
<.cut toc: part.> cut toc before cutat
<.cutat: part.>
<.cut toc: sec.>
<.cutat: sec (no ch).>
<.cut toc: subsec.>
<.cutat: subsection (no ch).>
<.cut toc: subsubsec.>
<.cutat: subsubsection (no ch).>
<.cut toc: paragraph.>
<.cutat: paragraph (no ch).>
<.tocat: part, no chapter.>
<.tocat: section.>
<.tocat: subsection.>
<.tocat: subsubsection.>
\else
<.cut toc: part.> cut toc before cutat
<.cutat: part.>
<.cut toc: ch.>
<.cutat: chapter.>
<.cut toc: sec.>
<.cutat: sec.>
<.cut toc: subsec.>
<.cutat: subsection.>
<.cut toc: subsubsec.>
<.cutat: subsubsection.>
<.cut toc: paragraph.>
<.cutat: paragraph.>
<.tocat: part.>
<.tocat: ch.>
<.tocat: section.>
<.tocat: subsection.>
<.tocat: subsubsection.>
\fi
<.object tocs.>
\else \:CheckOption{5} \if:Option
\expandafter\ifx \csname @chapter\endcsname\relax
<.cut toc: part.> cut toc before cutat
<.cutat: part.>
<.cut toc: sec.>
<.cutat: sec (no ch).>
<.cut toc: subsec.>
<.cutat: subsection (no ch).>
<.cut toc: subsubsec.>
<.cutat: subsubsection (no ch).>
<.tocat: part, no chapter.>
<.tocat: section.>
<.tocat: subsection.>
\else
<.cut toc: part.> cut toc before cutat
<.cutat: part.>
<.cut toc: ch.>
<.cutat: chapter.>
<.cut toc: sec.>
<.cutat: sec.>
<.cut toc: subsec.>
<.cutat: subsection.>
<.cut toc: subsubsec.>
<.cutat: subsubsection.>
<.tocat: part.>
<.tocat: ch.>
<.tocat: section.>
<.tocat: subsection.>
\fi
<.object tocs.>
\else\:CheckOption{4} \if:Option
\expandafter\ifx \csname @chapter\endcsname\relax
<.cut toc: part.> cut toc before cutat
<.cutat: part.>
<.cut toc: sec.>
<.cutat: sec (no ch).>
<.cut toc: subsec.>
<.cutat: subsection (no ch).>
<.tocat: part, no chapter.>
<.tocat: section.>
\else
<.cut toc: part.> cut toc before cutat
<.cutat: part.>
<.cut toc: ch.>
<.cutat: chapter.>
<.cut toc: sec.>
<.cutat: sec.>
<.cut toc: subsec.>
<.cutat: subsection.>
<.tocat: part.>
<.tocat: ch.>
<.tocat: section.>
\fi
<.object tocs.>
\else\:CheckOption{3} \if:Option
\expandafter\ifx \csname @chapter\endcsname\relax
<.cut toc: part.> cut toc before cutat
<.cutat: part.>
<.cut toc: sec.>
<.cut toc: subsec.>
<.cutat: subsection (no ch).>
<.tocat: part, no chapter.>
<.tocat: section.>
<.cutat: sec (no ch).>
\else
<.cut toc: part.> cut toc before cutat
<.cutat: part.>
<.cut toc: ch.>
<.cutat: chapter.>
<.cut toc: sec.>
<.cutat: sec.>
<.tocat: part.>
<.tocat: ch.>
\fi
<.object tocs.>
\else\:CheckOption{2} \if:Option
\expandafter\ifx \csname @chapter\endcsname\relax
<.cut toc: part.> cut toc before cutat
<.cutat: part.>
<.cut toc: sec.>
<.cutat: sec (no ch).>
<.tocat: part, no chapter.>
\else
<.cut toc: part.> cut toc before cutat
<.cutat: part.>
<.cut toc: ch.>
<.cutat: chapter.>
<.tocat: part.>
\fi
<.object tocs.>
\else\:CheckOption{1} \if:Option
<.cut toc: part.> cut toc before cutat
<.cutat: part.>
<.object tocs.>
\else
\Log:Note{for automatic sectioning
pagination, use the command line option
‘1’, ‘2’, ‘3’, ’4’, ’5’, ’6’, or ’7’}%
\fi \fi \fi \fi \fi \fi \fi -_-_-
\CutAt{part}
\CutAt{likepart}
-_-_-
\CutAt{chapter,likechapter,appendix,part}
\CutAt{likechapter,appendix,part}
\CutAt{appendix,chapter,likechapter,part}
-_-_-
\CutAt{section,likesection,chapter,likechapter,appendix,part}
\CutAt{likesection,chapter,likechapter,appendix,part}
-_-_-
\CutAt{section,likesection,part}
\CutAt{likesection,part}
-_-_-
\CutAt{subsection,section,likesection,%
chapter,likechapter,appendix,part}
\CutAt{likesubsection,section,likesection,%
chapter,likechapter,appendix,part}
-_-_-
\CutAt{subsection,section,likesection,part}
\CutAt{likesubsection,section,likesection,part}
-_-_-
\:CheckOption{sec-filename} \if:Option \else
\Log:Note{for files named derived from section
titles, use the command line option ‘sec-filename’}%
\fi
-_-_-
\:CheckOption{7}
\if:Option \else \:CheckOption{6}\fi
\if:Option \else \:CheckOption{5}\fi
\if:Option \else \:CheckOption{4}\fi
\if:Option \else \:CheckOption{3}\fi
\if:Option \else \:CheckOption{2}\fi
\if:Option \else \:CheckOption{1}\fi
\if:Option
\:CheckOption{sec-filename}
\if:Option
<.section names for cutat files.>
\else
\Log:Note{For section filenames that reflect on
their titles use the command line
option ‘sec-filename’}
\fi
\fi -_-_-
\Configure{CutAt-filename}{%
\ifx \:NxtNwFN\:Undef
<.temp := clear non-brace characters.>%
<.temp := clear brace characters.>%
\tmp:cnt=0 \uniq:fn
\fi
}
\def\uniq:fn{%
\expandafter\ifx
\csname ct:fn\:temp
\ifnum \tmp:cnt>0 \the\tmp:cnt\fi\endcsname\relax
\expandafter\global\expandafter\let
\csname ct:fn\:temp
\ifnum\tmp:cnt>0 \the\tmp:cnt\fi
\endcsname=\def
\ifx \:temp\empty \else
\NextFile{\:temp
\ifnum \tmp:cnt>0 \the\tmp:cnt\fi .\:html}%
\fi
\else
\advance\tmp:cnt by 1 \expandafter\uniq:fn
\fi
}
\NewConfigure{sec-filename*}{1} -_-_-
\tmp:toks={#2}%
\immediate\openout15=\jobname .tmp
\immediate\write15{\string\next{\the\tmp:toks}}%
\immediate\closeout15
\bgroup
\def\next{\csname no:catcodes\endcsname{92}{92}{9}%
\xdef\:temp}%
\csname no:catcodes\endcsname{32}{47}{9}%
\csname no:catcodes\endcsname{58}{64}{9}%
\csname no:catcodes\endcsname{91}{91}{9}%
\csname no:catcodes\endcsname{93}{96}{9}%
\csname no:catcodes\endcsname{126}{126}{9}%
\csname a:sec-filename*\endcsname
\input \jobname .tmp
\egroup
-_-_-
\immediate\openout15=\jobname .tmp
\immediate\write15{\string\next[\:temp]}%
\immediate\closeout15
\bgroup
\def\next{\xdef\:temp}%
\csname no:catcodes\endcsname{91}{91}{1}%
\csname no:catcodes\endcsname{93}{93}{2}%
\csname no:catcodes\endcsname{123}{123}{9}%
\csname no:catcodes\endcsname{125}{125}{9}%
\input \jobname .tmp
\egroup
-_-_-