From 8c11fe37546bc263967ee51a315a45ed9ed17f78 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 8 Oct 2019 18:47:54 +0900 Subject: aeb-minitoc (20191008) --- texmf-dist/tex/latex/aeb-minitoc/aeb-minitoc.sty | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'texmf-dist/tex') diff --git a/texmf-dist/tex/latex/aeb-minitoc/aeb-minitoc.sty b/texmf-dist/tex/latex/aeb-minitoc/aeb-minitoc.sty index 2f0cd2f1..9c3643fb 100644 --- a/texmf-dist/tex/latex/aeb-minitoc/aeb-minitoc.sty +++ b/texmf-dist/tex/latex/aeb-minitoc/aeb-minitoc.sty @@ -19,7 +19,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{aeb-minitoc} - [2018/09/29 v1.7 Creates a simple mini-toc] + [2019/10/06 v1.9 Creates a simple mini-toc] \newif\ifMiniTocListings \MiniTocListingstrue \DeclareOption{nominitocs}{\AtEndOfPackage{\MiniTocListingsfalse \let\insertminitoc\insertminitocNOT}} @@ -124,11 +124,17 @@ \AtEndDocument{\mtoc@start@toc} \def\mtoc@TOC{toc} \def\mtocCL#1#2{#1} -\newcommand\addtocontents@mtoc[2]{% - \def\mt@rgi{#1}\ifx\mt@rgi\mtoc@TOC - \global\advance\@minitocCnt\@ne - \mtoc@addtocontents{#1}{\protect\mtocCL{#2}{\the\@minitocCnt}}\else - \mtoc@addtocontents{#1}{#2}\fi} +\@ifundefined{add@percent@to@temptokena} + {\let\protected@file@percent\@empty\def\mtoc@protect{}} + {\def\mtoc@protect{\protect}} +\newcommand\addtocontents@mtoc[2]{\bgroup + \let\protected@file@percent\@empty + \def\mt@rgi{#1}\ifx\mt@rgi\mtoc@TOC + \global\advance\@minitocCnt\@ne + \mtoc@addtocontents{#1}{\protect + \mtocCL{#2}{\the\@minitocCnt}\mtoc@protect + \protected@file@percent}\else + \mtoc@addtocontents{#1}{#2}\fi\egroup} \AtBeginDocument{\let\mtoc@addtocontents\addtocontents \let\addtocontents\addtocontents@mtoc} \def\tableofcontents{% -- cgit v1.2.3