𐂠GuidesTexOptexToc

If you want a special formatting of TOC with adding more special lines (no generated as titles from chap, sec, secc), you can define addtotoc{⟨level⟩}{⟨type⟩}{⟨number⟩}{⟨o-title⟩}{⟨title⟩} macro

\def\addtotoc#1#2#3#4#5{%
\incr\_tocrefnum
\_dest[toc:\_the\_tocrefnum]%
\_ewref\_Xtoc{{#1}{#2}{#3}{#4}#5}%
}

and you can declare special lines (or something else) as an unused level (10 in the following example):

\sdef{_tocl:10}#1#2#3{medskiphbox{Blue #2}medskip}

Now, users can add a blue line into TOC by

\addtotoc{10}{blue-line}{}{relax}{⟨blue text to be added in the TOC ⟩}