summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-09-06 21:17:15 +0000
committerKarl Berry <karl@freefriends.org>2021-09-06 21:17:15 +0000
commit1389b7ca86a6de2edaf01df5484c3666ed9e2e51 (patch)
tree537d7bee5742617e2da28d127670edf47d087c5b /Master
parentc436984614539aca09069bca93601eb10a989422 (diff)
crumbs (6sep21)
git-svn-id: svn://tug.org/texlive/trunk@60440 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/crumbs/crumbs.pdfbin332170 -> 332623 bytes
-rw-r--r--Master/texmf-dist/doc/latex/crumbs/crumbs.tex9
-rw-r--r--Master/texmf-dist/tex/latex/crumbs/crumbs.sty70
3 files changed, 42 insertions, 37 deletions
diff --git a/Master/texmf-dist/doc/latex/crumbs/crumbs.pdf b/Master/texmf-dist/doc/latex/crumbs/crumbs.pdf
index f930fb6401f..51b6922ad51 100644
--- a/Master/texmf-dist/doc/latex/crumbs/crumbs.pdf
+++ b/Master/texmf-dist/doc/latex/crumbs/crumbs.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/crumbs/crumbs.tex b/Master/texmf-dist/doc/latex/crumbs/crumbs.tex
index b80776ffcb4..250be01c666 100644
--- a/Master/texmf-dist/doc/latex/crumbs/crumbs.tex
+++ b/Master/texmf-dist/doc/latex/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}
diff --git a/Master/texmf-dist/tex/latex/crumbs/crumbs.sty b/Master/texmf-dist/tex/latex/crumbs/crumbs.sty
index 9c29b5dc785..89126af2fb0 100644
--- a/Master/texmf-dist/tex/latex/crumbs/crumbs.sty
+++ b/Master/texmf-dist/tex/latex/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