summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tagging
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-09 03:00:43 +0000
committerNorbert Preining <norbert@preining.info>2019-09-09 03:00:43 +0000
commitcb5ec966f1a3e9b26dcd7fc1b13998e03581b8fd (patch)
tree5808cf29f3f394729731e7ce4d2e04d27c58b076 /macros/latex/contrib/tagging
parentdce09de80c37afccb6addb25d0c7d40367059ece (diff)
CTAN sync 201909090300
Diffstat (limited to 'macros/latex/contrib/tagging')
-rw-r--r--macros/latex/contrib/tagging/README10
-rw-r--r--macros/latex/contrib/tagging/tagging.pdfbin82856 -> 111778 bytes
-rw-r--r--macros/latex/contrib/tagging/tagging.sty31
-rw-r--r--macros/latex/contrib/tagging/tagging.tex58
4 files changed, 66 insertions, 33 deletions
diff --git a/macros/latex/contrib/tagging/README b/macros/latex/contrib/tagging/README
index 4f24345ef6..2892db0cf3 100644
--- a/macros/latex/contrib/tagging/README
+++ b/macros/latex/contrib/tagging/README
@@ -1,12 +1,18 @@
The `tagging' package provides document configuration by
including or omitting tagged input.
- tagging is licenced under the LPPL. For more details,
-please see the accompanying manual: taggingmanual.pdf.
+ tagging is licenced under the LPPL. For more details,
+please see the accompanying manual: tagging.pdf.
Change History
~~~~~~~~~~~~~~
+2019-09-07 Kindly provided and inspired by Frank Mittelbach:
+
+ Bug fixes
+ Removed interference with comment environment (from verbatim package)
+ Allow initial active tag list to be passed as package options
+
2011-08-22 Initial release, providing:
\tagged{list}{y} Conditional inclusion
diff --git a/macros/latex/contrib/tagging/tagging.pdf b/macros/latex/contrib/tagging/tagging.pdf
index 0f911cdac9..986f5d141a 100644
--- a/macros/latex/contrib/tagging/tagging.pdf
+++ b/macros/latex/contrib/tagging/tagging.pdf
Binary files differ
diff --git a/macros/latex/contrib/tagging/tagging.sty b/macros/latex/contrib/tagging/tagging.sty
index c947639043..5f8c4b994c 100644
--- a/macros/latex/contrib/tagging/tagging.sty
+++ b/macros/latex/contrib/tagging/tagging.sty
@@ -15,38 +15,45 @@
% This work consists of these files:
% tagging.sty, tagging.tex, and tagging.pdf
% --------------------------------------------------------------
-\ProvidesPackage{tagging}[2011/08/04]
+\ProvidesPackage{tagging}[2019/09/07 v1.1]
\RequirePackage{etoolbox,verbatim}
+
+
\newcommand{\taggedy}{\relax}
\newcommand{\taggedn}{\relax}
+\newcomment{tagged@ignore}
\newcommand\usetag[1]{%
\def\do##1{\csdef{tagged@##1}{}}%
\docsvlist{#1}}%
\newcommand\droptag[1]{%
\def\do##1{\csundef{tagged@##1}{}}%
\docsvlist{#1}}%
+
+
\newenvironment{taggedblock}[1]%
{\def\do##1{%
\ifcsname tagged@##1\endcsname%
- \let\comment\relax%
- \let\endcomment\relax%
+ \let\tagged@ignore\relax%
+ \let\endtagged@ignore\relax%
\fi}%
\docsvlist{#1}%
- \comment}%
- {\endcomment\leavevmode}%
+ \tagged@ignore\ignorespaces}% FMi
+ {\endtagged@ignore\ignorespacesafterend}% FMi
\newenvironment{untaggedblock}[1]{%
- \csdef{@tagged@flag}{}
+ \csdef{@tagged@flag}{}% FMi
\def\do##1{%
\ifcsname tagged@##1\endcsname%
\csundef{@tagged@flag}{}
\fi}%
\docsvlist{#1}%
\ifcsname @tagged@flag\endcsname%
- \let\comment\relax%
- \let\endcomment\relax%
+ \let\tagged@ignore\relax%
+ \let\endtagged@ignore\relax%
\fi%
- \comment}%
- {\endcomment\leavevmode}%
+ \tagged@ignore\ignorespaces}% FMi
+ {\endtagged@ignore\ignorespacesafterend}% FMi
+
+
\newcommand{\iftagged}[3]%
{\renewcommand{\taggedy}{#2}%
\renewcommand{\taggedn}{#3}%
@@ -57,3 +64,7 @@
}%
\newcommand{\tagged}[2]{\iftagged{#1}{#2}{}}
\newcommand{\untagged}[2]{\iftagged{#1}{}{#2}}
+
+%FMi Allow tags to be activated as package options
+\DeclareOption*{\usetag{\CurrentOption}}
+\ProcessOptions
diff --git a/macros/latex/contrib/tagging/tagging.tex b/macros/latex/contrib/tagging/tagging.tex
index 15ae60e47e..11dfea4587 100644
--- a/macros/latex/contrib/tagging/tagging.tex
+++ b/macros/latex/contrib/tagging/tagging.tex
@@ -1,5 +1,5 @@
-% taggingmanual.tex
-% Copyright 2011 Brent Longborough
+% tagging.tex
+% Copyright 2019 Brent Longborough
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -36,10 +36,11 @@
\pagestyle{ruled}
\settocdepth{section}
\setsecnumdepth{none}
-\newcommand{\tpfname}{\textsf{tagging.sty}}
-\newcommand{\tpname}{\textsf{\itshape tagging}}
-\newcommand{\gitVtag}{\space1.0}
-\newcommand{\gitVtagn}{\space1.0}
+\newcommand{\tpn}{tagging}
+\newcommand{\tpfname}{\textsf{\tpn.sty}}
+\newcommand{\tpname}{\textsf{\itshape \tpn}}
+\newcommand{\gitVtag}{\space1.1}
+\newcommand{\gitVtagn}{\space1.1}
% -----------------------------------------------------
\usepackage[%
bookmarksnumbered,
@@ -59,7 +60,7 @@
\Large A package for document configuration
}
\author{Brent Longborough}
-\date{28th August, 2011}
+\date{7th September, 2019}
\maketitle
{\centering
@@ -84,17 +85,18 @@ or to reuse varying parts of an input file
to produce more than one result at different places
in a single document.
-To use \tpname, just include a standard \verb!\usepackage{tagging}!
-in your document preamble; there are no package options.
+To use \tpname, just include a standard
+\verb!\usepackage{tagging}! in your document preamble; there
+are no package options which alter its intrinsic behaviour,
+although later you will see how any options you may give are
+subverted.
With \tpname, you mark up parts of your
\LaTeX source code with \textit{tags} --- labels which
make some kind of sense for you in relation to
the document you are writing.
-For example, imagine you are writing a car owners' manual.\footnote{%
-OK, I know Peugeot don't do this,
-but imagine a top-end luxury car manufacturer.}
+For example, imagine you are writing a car owners' manual.
The car can have optional features, such as automatic transmission
or a navigation system, and can be powered by diesel or petrol.
@@ -225,6 +227,15 @@ activating or deactivating a given tag has no hidden effect on other tags.
\subsection{{\ttfamily\textbackslash usetag\{{\itshape<taglist>}\}}}
This command activates \emph{all} the tags in \texttt{\itshape<taglist>}.
% - - - - - - - - - - - - - - - - - - - - - - - - - - -
+\subsection{{\ttfamily\textbackslash usepackage[{\itshape<taglist>}]\{\tpn\}}}
+If you wish, you may activate one or more tags, once, in your
+document preamble by passing a taglist as options when you call
+the package.
+\emph{All} the tags in \texttt{\itshape<taglist>} are activated.
+Any tags activated this way can still be deactivated and
+reactivated as many times as you may need in the body of the
+document.
+% - - - - - - - - - - - - - - - - - - - - - - - - - - -
\subsection{{\ttfamily\textbackslash droptag\{{\itshape<taglist>}\}}}
This command deactivates \emph{all} the tags in \texttt{\itshape<taglist>}.
\tpname\ is too simple to include a command
@@ -318,20 +329,25 @@ Philipp Lehman's
\href{http://www.ctan.org/tex-archive/macros/latex/contrib/etoolbox}{etoolbox}
and of
\href{http://www.ctan.org/pkg/verbatim}{verbatim}, currently maintained by
-Rainer Schöpf, both of which are required for \tpname to work.
+Rainer Schöpf, both of which are required for \tpname\ to work.
+
+I am most grateful to Frank Mittelbach, who intervened to fix my
+dodgy code and to provide the ability to activate tags as
+package options, thereby directly inspiring v1.1.
-The \href{http://tex.stackexchange.com}{\TeX.SE community}
-has been a constant source of help, inspiration, and amazement.
+The \href{http://tex.stackexchange.com}{\TeX.SE community} has
+been a constant source of help, inspiration, and amazement.
-Of course, we all stand on the shoulders of giants: Donald Knuth,
-and then too many others to name.
+Of course, we all stand on the shoulders of giants: Donald
+Knuth, and then too many others to name.
Thank you all. Any failings that remain are entirely
``an ill-favoured thing, sir, but mine own''.
% - - - - - - - - - - - - - - - - - - - - - - - - - - -
+\clearpage
\section{Copyright \& licence}
-Copyright \copyright\ 2011, Brent Longborough.
+Copyright \copyright\ 2019, Brent Longborough.
This work --- \tpname\ --- may be distributed and/or modified under the
conditions of the LaTeX Project Public License: either version 1.3
@@ -345,8 +361,8 @@ version 2005/12/01 or later.
This work has the LPPL maintenance status `maintained';
the Current Maintainer of this work is Brent Longborough.
-This work consists of the files tagging.sty, taggingtest.tex,
-taggingmanual.tex, and taggingmanual.pdf
+This work consists of the files
+tagging.sty, tagging.tex, and tagging.pdf
% - - - - - - - - - - - - - - - - - - - - - - - - - - -
\section{From the author}
@@ -358,7 +374,7 @@ if you find such an incompatibility, I may not have the skill to fix it.
However, I'll be very happy to receive your comments by email.\\[\baselineskip]
Enjoy!\\
Brent Longborough\\[\baselineskip]
-\textsf{brent+tagging (at) longborough (dot) org}\\
+\textsf{brent+ctan (at) llwyd-consulting (dot) cymru}\\
and at \href{http://tex.stackexchange.com/users/344/brent-longborough}{\TeX.SE}
% -----------------------------------------------------
\end{document}