texlive[60429] Master: crumbs (5sep21)

commits+karl at tug.org commits+karl at tug.org
Sun Sep 5 22:39:04 CEST 2021


Revision: 60429
          http://tug.org/svn/texlive?view=revision&revision=60429
Author:   karl
Date:     2021-09-05 22:39:04 +0200 (Sun, 05 Sep 2021)
Log Message:
-----------
crumbs (5sep21)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/crumbs/
    trunk/Master/texmf-dist/doc/latex/crumbs/DEPENDS.txt
    trunk/Master/texmf-dist/doc/latex/crumbs/README.md
    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/
    trunk/Master/texmf-dist/tex/latex/crumbs/crumbs.sty
    trunk/Master/tlpkg/tlpsrc/crumbs.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/crumbs/DEPENDS.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/crumbs/DEPENDS.txt	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/crumbs/DEPENDS.txt	2021-09-05 20:39:04 UTC (rev 60429)
@@ -0,0 +1,2 @@
+hard etoolbox
+hard catchfile


Property changes on: trunk/Master/texmf-dist/doc/latex/crumbs/DEPENDS.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/crumbs/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/crumbs/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/crumbs/README.md	2021-09-05 20:39:04 UTC (rev 60429)
@@ -0,0 +1,31 @@
+[![make](https://github.com/yegor256/crumbs/actions/workflows/latexmk.yml/badge.svg)](https://github.com/yegor256/crumbs/actions/workflows/latexmk.yml)
+[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/crumbs/blob/master/LICENSE.txt)
+
+This LaTeX package adds nagivation crumbs to your document, which
+may be very useful for presentation and slide decks.
+
+First, [install it](https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages)
+from [CTAN](https://ctan.org/pkg/crumbs) 
+and then use in the preamble:
+
+```tex
+\documentclass{article}
+\usepackage{crumbs}
+\usepackage{fancyhdr}
+\fancyhead[L]{\crumbs}
+\begin{document}
+\section{Introduction}
+Some text here.
+\section{Related Works}
+Some other text here.
+\end{document}
+```
+
+The full example and all commands are available in the 
+[`crumbs.tex`](https://github.com/yegor256/crumbs/blob/master/crumbs.tex) file.
+
+If you want to contribute yourself, make a fork, then create a branch, 
+then run `make` in the root directory.
+It should compile everything without errors. If not, submit an issue and wait.
+Otherwise, make your changes and then run `make` again. If the build is
+still clean, submit a pull request.


Property changes on: trunk/Master/texmf-dist/doc/latex/crumbs/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/crumbs/crumbs.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/crumbs/crumbs.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/crumbs/crumbs.pdf	2021-09-05 20:37:35 UTC (rev 60428)
+++ trunk/Master/texmf-dist/doc/latex/crumbs/crumbs.pdf	2021-09-05 20:39:04 UTC (rev 60429)

Property changes on: trunk/Master/texmf-dist/doc/latex/crumbs/crumbs.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/crumbs/crumbs.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/crumbs/crumbs.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/crumbs/crumbs.tex	2021-09-05 20:39:04 UTC (rev 60429)
@@ -0,0 +1,129 @@
+% (The MIT License)
+%
+% Copyright (c) 2021 Yegor Bugayenko
+%
+% Permission is hereby granted, free of charge, to any person obtaining a copy
+% of this software and associated documentation files (the 'Software'), to deal
+% in the Software without restriction, including without limitation the rights
+% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+% copies of the Software, and to permit persons to whom the Software is
+% furnished to do so, subject to the following conditions:
+%
+% The above copyright notice and this permission notice shall be included in all
+% copies or substantial portions of the Software.
+%
+% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+% SOFTWARE.
+
+\documentclass[12pt]{article}
+\usepackage[T1]{fontenc}
+\usepackage[tt=false,type1=true]{libertine}
+\usepackage{ffcode}
+\usepackage{xcolor}
+\usepackage{crumbs}
+\usepackage{fancyhdr}
+  \fancyhf{}
+  \setlength{\headheight}{1.2in}
+  \renewcommand{\headrulewidth}{1pt}
+  \renewcommand\crumb[2]{{\sffamily[{\ifnum\value{section}=\value{crumbi}\color{orange}\fi#1}]\quad}}
+  \renewcommand\subcrumb[2]{{\sffamily[{\ifnum\value{subsection}=\value{subcrumbi}\color{orange}\fi#1}]$\;$}}
+  \fancyhead[L]{
+    \ff{\char`\\crumbs}: \crumbs
+    \\[3pt]
+    \small\ff{\char`\\subcrumbs}: \subcrumbs
+    \\[3pt]
+    \footnotesize\ttfamily section=\the\value{section}, crumbi=\the\value{crumbi}, subcrumbi=\the\value{subcrumbi}
+  }
+
+\title{\ff{crumbs}: \LaTeX{} Package \\ for Navigation Crumbs}
+\author{Yegor Bugayenko}
+\date{0.1.0 2021/09/04}
+
+\begin{document}
+\pagenumbering{gobble}
+\raggedbottom
+\setlength{\parindent}{0pt}
+\setlength{\columnsep}{32pt}
+\setlength{\parskip}{6pt}
+
+\maketitle
+\pagestyle{fancy}
+\thispagestyle{fancy}
+
+Before the first \ff{\char`\\section} command:
+
+\ff{\char`\\crumbs}: \crumbs
+\\[3pt]
+\small\ff{\char`\\subcrumbs}: \subcrumbs
+
+\section[Intro]{Introduction}
+
+This package helps you add navigation crumbs to your document,
+which is most useful for presentation and slide decks:
+
+\begin{ffcode}
+\documentclass{article}
+\usepackage{crumbs}
+\usepackage{fancyhdr}
+  \fancyhf{}
+  \pagestyle{fancy}
+  \fancyhead[L]{\crumbs / \subcrumbs}
+\begin{document}
+\section{Introduction}
+Some text here.
+\section{Related Works}
+Some other text here.
+\end{document}
+\end{ffcode}
+
+You may redefine \ff{\char`\\crumb\{\}} and \ff{\char`\\subcrumb\{\}}
+commands, if you want your crumbs to look nicer, for example:
+
+\begin{ffcode}
+\renewcommand\crumb[2]{
+  {
+    \ifnum\value{section}=\value{crumbi}
+      \color{orange}
+    \fi
+    #1
+  }
+}
+\end{ffcode}
+
+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.
+
+You can use \ff{\char`\\section} and \ff{\char`\\subsection} with
+an option argument, which will be used in the crumbs, e.g.:
+
+\begin{ffcode}
+\section[Details]{More Details About The Method}
+\subsection[SLR]{Systematic Literature Review}
+\end{ffcode}
+
+\subsection{How to Contribute}
+
+More details about this package you can find
+in the \ff{yegor256/crumbs} GitHub repository.
+
+If you want to add a feature or fix a bug, you are welcome
+to submit an issue or make a pull request.
+
+\section{How It Works}
+
+On the first run, a new file \ff{\char`\\jobname.crumbs} is created,
+where all \ff{\char`\\section} and \ff{\char`\\subsection} commands
+are being logged.
+
+On the second run, the file is loaded and two commands are being
+created: \ff{\char`\\crumbs} and \ff{\char`\\subcrumbs}. The first
+one is a collection of \ff{\char`\\crumb\{\}} calls, while the second
+one is a collection of \ff{\char`\\subcrumb\{\}} ones.
+
+\end{document}
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/crumbs/crumbs.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/crumbs/crumbs.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/crumbs/crumbs.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/crumbs/crumbs.sty	2021-09-05 20:39:04 UTC (rev 60429)
@@ -0,0 +1,92 @@
+% (The MIT License)
+%
+% Copyright (c) 2021 Yegor Bugayenko
+%
+% Permission is hereby granted, free of charge, to any person obtaining a copy
+% of this software and associated documentation files (the 'Software'), to deal
+% in the Software without restriction, including without limitation the rights
+% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+% copies of the Software, and to permit persons to whom the Software is
+% furnished to do so, subject to the following conditions:
+%
+% The above copyright notice and this permission notice shall be included in all
+% copies or substantial portions of the Software.
+%
+% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+% SOFTWARE.
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{crumbs}[2021/09/04 0.1.0 Navigation Crumbs]
+
+\RequirePackage{etoolbox}
+
+% see https://tex.stackexchange.com/a/12414/1449
+\makeatletter\newcommand\back{\@backslashchar}\makeatother
+\makeatletter\newcommand\percent{\@percentchar}\makeatother
+\RequirePackage{catchfile}
+  \newwrite\appendwrite
+  \newcommand*\appendtofile[2]{%
+    \begingroup
+    \IfFileExists{#1}%
+      {\CatchFileDef{\filecontent}{#1}{\endlinechar=`^^J\catcode\endlinechar=12\relax}}% keep existing end-of-lines
+      {\let\filecontent\empty}%
+    \immediate\openout\appendwrite=#1\relax
+    \immediate\write\appendwrite{\unexpanded\expandafter{\filecontent} #2}%
+    \immediate\closeout\appendwrite
+    \endgroup
+  }
+
+\newcommand\subcrumbs{
+  \ifnum\value{section}=0\else
+    \expandafter\ifcsname crumbs\romannumeral\the\value{section}\endcsname
+      \csname crumbs\romannumeral\the\value{section}\endcsname{}
+    \fi
+  \fi
+}
+
+\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}}{}%
+}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/crumbs/crumbs.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2021-09-05 20:37:35 UTC (rev 60428)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2021-09-05 20:39:04 UTC (rev 60429)
@@ -218,7 +218,7 @@
     cprotect cqubeamer cquthesis
     crbox crimson crimsonpro crop
     crossreference crossreftools crossrefware crossword crosswrd
-    cryptocode cryst
+    crumbs cryptocode cryst
     cs csbulletin cslatex csplain csquotes csquotes-de
     css-colors cstex cstypo csvmerge csvsimple
     ctan-o-mat ctan_chk ctanbib ctanify ctanupload

Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2021-09-05 20:37:35 UTC (rev 60428)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2021-09-05 20:39:04 UTC (rev 60429)
@@ -246,6 +246,7 @@
 depend crbox
 depend crossreference
 depend crossreftools
+depend crumbs
 depend csquotes
 depend css-colors
 depend csvmerge

Added: trunk/Master/tlpkg/tlpsrc/crumbs.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/crumbs.tlpsrc	                        (rev 0)
+++ trunk/Master/tlpkg/tlpsrc/crumbs.tlpsrc	2021-09-05 20:39:04 UTC (rev 60429)
@@ -0,0 +1,2 @@
+depend etoolbox
+depend catchfile



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