texlive[60440] Master/texmf-dist: crumbs (6sep21)

commits+karl at tug.org commits+karl at tug.org
Mon Sep 6 23:17:15 CEST 2021


Revision: 60440
          http://tug.org/svn/texlive?view=revision&revision=60440
Author:   karl
Date:     2021-09-06 23:17:15 +0200 (Mon, 06 Sep 2021)
Log Message:
-----------
crumbs (6sep21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/crumbs/crumbs.pdf
    trunk/Master/texmf-dist/doc/latex/crumbs/crumbs.tex
    trunk/Master/texmf-dist/tex/latex/crumbs/crumbs.sty

Modified: trunk/Master/texmf-dist/doc/latex/crumbs/crumbs.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/crumbs/crumbs.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/crumbs/crumbs.tex	2021-09-06 21:16:58 UTC (rev 60439)
+++ trunk/Master/texmf-dist/doc/latex/crumbs/crumbs.tex	2021-09-06 21:17:15 UTC (rev 60440)
@@ -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 @@
 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}

Modified: trunk/Master/texmf-dist/tex/latex/crumbs/crumbs.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/crumbs/crumbs.sty	2021-09-06 21:16:58 UTC (rev 60439)
+++ trunk/Master/texmf-dist/tex/latex/crumbs/crumbs.sty	2021-09-06 21:17:15 UTC (rev 60440)
@@ -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



More information about the tex-live-commits mailing list.