From a7ef56f18421a8ffb9d34c16ff9f017e45e4e6d3 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 7 Sep 2021 03:03:54 +0000 Subject: CTAN sync 202109070303 --- macros/latex/contrib/crumbs/crumbs.pdf | Bin 332170 -> 332623 bytes macros/latex/contrib/crumbs/crumbs.sty | 70 ++++++++++++++++----------------- macros/latex/contrib/crumbs/crumbs.tex | 9 ++++- 3 files changed, 42 insertions(+), 37 deletions(-) (limited to 'macros/latex/contrib/crumbs') diff --git a/macros/latex/contrib/crumbs/crumbs.pdf b/macros/latex/contrib/crumbs/crumbs.pdf index f930fb6401..51b6922ad5 100644 Binary files a/macros/latex/contrib/crumbs/crumbs.pdf and b/macros/latex/contrib/crumbs/crumbs.pdf differ diff --git a/macros/latex/contrib/crumbs/crumbs.sty b/macros/latex/contrib/crumbs/crumbs.sty index 9c29b5dc78..89126af2fb 100644 --- a/macros/latex/contrib/crumbs/crumbs.sty +++ b/macros/latex/contrib/crumbs/crumbs.sty @@ -21,7 +21,7 @@ % SOFTWARE. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{crumbs}[2021/09/04 0.1.0 Navigation Crumbs] +\ProvidesPackage{crumbs}[2021/09/06 0.2.1 Navigation Crumbs] \RequirePackage{etoolbox} @@ -49,44 +49,44 @@ \fi } +\NewCommandCopy\crumbsoldsection\section +\renewcommand\section[2][]{ + \def\temp{#1} + \ifx\crumbs\empty + \appendtofile{\jobname.crumbs}{ + \back ifx \back crumbs \back empty + \back gappto \back crumbs{\back setcounter{crumbi}{0}} + \back fi + \back gappto\back crumbs{\back stepcounter{crumbi}\back crumb{\ifx\temp\empty #2\else #1\fi}{#2}} + } + \fi + \crumbsoldsection{#2} +} + +\NewCommandCopy\crumbsoldsubsection\subsection +\renewcommand\subsection[2][]{ + \def\temp{#1} + \ifx\crumbs\empty + \appendtofile{\jobname.crumbs}{ + \back ifcsname crumbs\romannumeral\the\value{section}\back endcsname\back else + \back expandafter\back newcommand\back csname crumbs\romannumeral\the\value{section}\back endcsname{% + \back setcounter{subcrumbi}{0} + } + \back fi + \back expandafter\back gappto\back csname crumbs\romannumeral\the\value{section}\back endcsname{% + \back stepcounter{subcrumbi} + \back subcrumb{\ifx\temp\empty #2\else #1\fi}{#2} + } + } + \fi + \crumbsoldsubsection{#2} +} + \newcommand\crumb[2]{#1} \newcommand\subcrumb[2]{#1} \newcommand*\crumbs{} \newcounter{crumbi} \newcounter{subcrumbi} -\AtBeginDocument{ - \let\oldsection\section% - \renewcommand\section[2][]{ - \def\temp{#1} - \ifx\crumbs\empty - \appendtofile{\jobname.crumbs}{ - \back ifx \back crumbs \back empty - \back gappto \back crumbs{\back setcounter{crumbi}{0}} - \back fi - \back gappto\back crumbs{\back stepcounter{crumbi}\back crumb{\ifx\temp\empty #2\else #1\fi}{#2}} - } - \fi - \oldsection{#2} - }% - \let\oldsubsection\subsection - \renewcommand\subsection[2][]{ - \def\temp{#1} - \ifx\crumbs\empty - \appendtofile{\jobname.crumbs}{ - \back ifcsname crumbs\romannumeral\the\value{section}\back endcsname\back else - \back expandafter\back newcommand\back csname crumbs\romannumeral\the\value{section}\back endcsname{% - \back setcounter{subcrumbi}{0} - } - \back fi - \back expandafter\back gappto\back csname crumbs\romannumeral\the\value{section}\back endcsname{% - \back stepcounter{subcrumbi} - \back subcrumb{\ifx\temp\empty #2\else #1\fi}{#2} - } - } - \fi - \oldsubsection{#2} - }% - \IfFileExists{\jobname.crumbs}{\input{\jobname.crumbs}}{}% -} +\AtBeginDocument{\IfFileExists{\jobname.crumbs}{\input{\jobname.crumbs}}{}} \endinput diff --git a/macros/latex/contrib/crumbs/crumbs.tex b/macros/latex/contrib/crumbs/crumbs.tex index b80776ffcb..250be01c66 100644 --- a/macros/latex/contrib/crumbs/crumbs.tex +++ b/macros/latex/contrib/crumbs/crumbs.tex @@ -42,7 +42,7 @@ \title{\ff{crumbs}: \LaTeX{} Package \\ for Navigation Crumbs} \author{Yegor Bugayenko} -\date{0.1.0 2021/09/04} +\date{0.2.1 2021/09/06} \begin{document} \pagenumbering{gobble} @@ -99,8 +99,13 @@ The same for \ff{\char`\\subcrumb\{\}}, but the comparison should be done not between \ff{section} and \ff{crumbi}, but between \ff{subsection} and \ff{subcrumbi} counters. +The first parameter of both \ff{\char`\\crumb\{\}} and \ff{\char`\\subcrumb\{\}} +is the optional parameter of \ff{\char`\\section\{\}} and \ff{\char`\\subsection\{\}} +calls respectively. The second one is the mandatory parameter of them, which +is the full text of the section and sub-section. + You can use \ff{\char`\\section} and \ff{\char`\\subsection} with -an option argument, which will be used in the crumbs, e.g.: +an optional argument, which will be used in the crumbs, e.g.: \begin{ffcode} \section[Details]{More Details About The Method} -- cgit v1.2.3