summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/concepts/concepts.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/concepts/concepts.sty')
-rw-r--r--Master/texmf-dist/tex/latex/concepts/concepts.sty275
1 files changed, 140 insertions, 135 deletions
diff --git a/Master/texmf-dist/tex/latex/concepts/concepts.sty b/Master/texmf-dist/tex/latex/concepts/concepts.sty
index 95e1c606d75..7cb1e4a07e1 100644
--- a/Master/texmf-dist/tex/latex/concepts/concepts.sty
+++ b/Master/texmf-dist/tex/latex/concepts/concepts.sty
@@ -19,7 +19,7 @@
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \fi %%%%
-% \CheckSum{0}
+% \CheckSum{265}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -45,11 +45,11 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{concepts}[2012/12/18 0.0.5
+\ProvidesPackage{concepts}[2012/12/25 0.0.5-r1
managing names and symbols of document specific formal concepts]
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -65,14 +65,14 @@
%
% These are the packages we'll need.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\RequirePackage{etextools}
\RequirePackage{nth}
\RequirePackage{xspace}
\RequirePackage{xparse} % 1
\RequirePackage{ltxkeys}[2012/11/17] % 2
\RequirePackage{xstring}
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% We need a very recent version of |ltxkeys| in order to
% properly handle list-values. Note that |xparse| needs
@@ -90,7 +90,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \begin{macro}{\cnc@d} \marg{identifier}
-%%% \begin{macro}{\cnc@g} \marg{identifier}\\\nopagebreak
+%%% \begin{macro}{\cnc@g} \marg{identifier}\\\nopagebreak\noindentnext
%
% This package needs to store and retrieve a lot of data. To make
% the rest of the code more readable, we define the following commands.
@@ -100,10 +100,10 @@
% to a specific piece of data in |\csname| context.
% We can get access to the data itself by using |\cnc@g|.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\newcommand*{\cnc@d}[1]{cnc@data@#1}
\newcommand*{\cnc@g}[1]{\csuse{\cnc@d{#1}}}
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% Both take an identifier of one the following shapes:
% \begin{itemize}
@@ -126,15 +126,15 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% \begin{macro}{\cnc@upper} \marg{string}\\\nopagebreak
+%%% \begin{macro}{\cnc@upper} \marg{string}\\\nopagebreak\noindentnext
%
% We're going to need a command that capitalizes the first
% letter of a string which fully expands its argument. So
% here it is.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\newcommand*{\cnc@upper}[1]{\ExpandAftercmds\MakeUppercase{#1}}
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -142,7 +142,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \begin{macro}{\cnc@grabnumber} \marg{token sequence containing \#1}
-%%% \momarg{number}\\\nopagebreak
+%%% \momarg{number}\\\nopagebreak\noindentnext
%
% This is a command we're going to use for the automatically
% defined short symbol macros later. It has one 'real'
@@ -151,13 +151,13 @@
% substituted for all occurrences of \#1 in the mandatory
% argument which is then `returned'.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\newcommand{\cnc@grabnumber}[1]{%
\def\cnc@dowithnum##1{#1}%
\futuredef[0123456789]{\cnc@@n}%
{\expandafter\cnc@dowithnum\expandafter{\cnc@@n}}%
}
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -165,20 +165,20 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \begin{macro}{\cnc@csvlistsize} \marg{csvlist}
-%%% \marg{command sequence}\\\nopagebreak
+%%% \marg{command sequence}\\\nopagebreak\noindentnext
%
% This macro takes a comma-separated list of\ldots anything,
% and stores its size in the given macro as a simple decimal
% string.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\newcounter{cnc@listsize}
\newrobustcmd{\cnc@csvlistsize}[2]{%
\setcounter{cnc@listsize}{0}%
\def\do##1{\stepcounter{cnc@listsize}}\docsvlist{#1}%
\edef#2{\arabic{cnc@listsize}}%
}
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -192,7 +192,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \begin{macro}{\cnc@conceptname} \marg{plural} \marg{capitalized}
-%%% \marg{plural} \marg{concept key}\\\nopagebreak
+%%% \marg{plural} \marg{concept key}\\\nopagebreak\noindentnext
%
% This typesets the name of a specific concept in one of four forms. It
% can be capitalized or not; and it can be singular or plural. We define
@@ -204,25 +204,25 @@
% the |*| and |^| modifiers and we want to have a simple one-to-one
% mapping between their arguments and the arguments of this private macro.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\newcommand{\cnc@conceptname}[4]{%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% We test if \emph{both} the first and third arguments are true, meaning
% that the public command has two |*| modifiers. If it does, we give a
% package error.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\ifboolexpr{ test{\IfBooleanTF{#1}} and test{\IfBooleanTF{#3}} }{%
\PackageError{concepts}%
{You used the * modifier twice; once is enough}%
{I will pretend you just used one *.}%
}{}%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% And then we simply typeset the correct value from our datastore.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\ifboolexpr{ test{\IfBooleanTF{#1}} or test{\IfBooleanTF{#3}} }{%
\IfBooleanTF{#2}%
{\cnc@g{concept(#4).option(Plural)}}%
@@ -232,16 +232,21 @@
{\cnc@g{concept(#4).option(Name)}}%
{\cnc@g{concept(#4).option(name)}}%
}%
-% \end{macrocode}\end{codeframe}
-%
+% \end{macrocode}
+%
% We end with an |\xspace| because the public command may need one.
+% And first we cancel out any extra spacing (for example,
+% when one concept name ends with another).
+%
+% \changes{0.0.5-r1}{2012/12/25}
+% {fixed spacing for when one concept name ends with another}
%
-% \begin{codeframe}\begin{macrocode}
- \xspace%
-% \end{macrocode}\end{codeframe}
-% \begin{uninterestingcodeframe}\begin{macrocode}
+% \begin{macrocode}
+ \unskip\xspace%
+% \end{macrocode}
+% \uninteresting\begin{macrocode}
}
-% \end{macrocode}\end{uninterestingcodeframe}
+% \end{macrocode}
%
%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -249,7 +254,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \begin{macro}{\cnc@conceptsymbol} \marg{concept key}
-%%% \marg{index}\\\nopagebreak
+%%% \marg{index}\\\nopagebreak\noindentnext
%
% This is the private macro which takes a concept key and an index and returns
% the corresponding symbol from our data-store. We use it in the public macros
@@ -259,31 +264,31 @@
% consists of numerals. The rest of the argument is simply left in
% the input stream afterwards.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\newcommand*{\cnc@conceptsymbol}[2]{%
\cnc@grabnumber{%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% We check if an actual numerical value was passed.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\ifstrempty{##1}{%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% No, we didn't get a numerical index. If there is only one symbol
% allocated to this concept, we don't care and return that symbol.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\edef\cnc@symbolcount{\cnc@g{concept(#1).option(symbols).count}}%
\ifnumcomp{\cnc@symbolcount}{=}{1}{%
\ensuremath{\cnc@g{concept(#1).option(symbols).index(1)}}%
}%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% If there are multiple symbols, the lack of an index is ambiguous and
% we report a package error.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
{%
\PackageError{concepts}%
{You didn't specify a number, but the '#1'
@@ -292,29 +297,29 @@
to typeset a specific symbol}%
{I will pretend you didn't ask for a symbol here.}%
}%
-% \end{macrocode}\end{codeframe}
-% \begin{uninterestingcodeframe}\begin{macrocode}
+% \end{macrocode}
+% \uninteresting\begin{macrocode}
}%
-% \end{macrocode}\end{uninterestingcodeframe}
+% \end{macrocode}
%
% Now follows the `else' branch: we did get a numerical index!
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
{%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% We check whether it is larger than the number of symbols
% allocated to the concept.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\edef\cnc@symbolcount{\cnc@g{concept(#1).option(symbols).count}}%
\ifnumcomp{##1}{>}{\cnc@symbolcount}{%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% If it is, we report an `index out of bounds' error. We first prepare an
% appropriate sentence fragment so the error message becomes more readable.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\edef\cnc@nth{##1\nthSuff0##1\delimiter}%
\ExpandNext\IfStrEq{\cnc@symbolcount}{0}{%
\edef\cnc@somany{no symbols}%
@@ -328,33 +333,33 @@
but\MessageBreak the '#1' concept has
\cnc@somany\space allocated}%
{I will pretend you didn't ask for a symbol here.}%
-% \end{macrocode}\end{codeframe}
-% \begin{uninterestingcodeframe}\begin{macrocode}
+% \end{macrocode}
+% \uninteresting\begin{macrocode}
}%
-% \end{macrocode}\end{uninterestingcodeframe}
+% \end{macrocode}
%
% But if the number is within bounds, great! We just return the stored symbol.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
{%
\ensuremath{\cnc@g{concept(#1).option(symbols).index(##1)}}%
}%
-% \end{macrocode}\end{codeframe}
-% \begin{uninterestingcodeframe}\begin{macrocode}
+% \end{macrocode}
+% \uninteresting\begin{macrocode}
}%
-% \end{macrocode}\end{uninterestingcodeframe}
+% \end{macrocode}
%
% Now ends our |\cnc@grabnumber| command, and we supply the second argument
% that may contain the numbers. Just in case it's empty, we make sure we
% don't grab anything that comes after the second argument by adding a
% |\relax|.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
}#2\relax%
-% \end{macrocode}\end{codeframe}
-% \begin{uninterestingcodeframe}\begin{macrocode}
+% \end{macrocode}
+% \uninteresting\begin{macrocode}
}
-% \end{macrocode}\end{uninterestingcodeframe}
+% \end{macrocode}
%
%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -364,7 +369,7 @@
% \begin{macro}{\cnc@conceptsymbols} \marg{concept key}
% \marg{separator}
% \marg{last separator}
-%%% \oarg{indices}\\\nopagebreak
+%%% \oarg{indices}\\\nopagebreak\noindentnext
%
% This is the private macro which takes a concept key and a
% comma-separated list of symbol-indices and returns a
@@ -374,11 +379,11 @@
% functionality. The last argument is optional to make it
% easier to define our `short' symbol-list command later.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\newcounter{cnc@separatorcount}%
\NewDocumentCommand{\cnc@conceptsymbols}{m m m O{1}}{%
\def\cnc@result{}%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% We loop through the list of indices and produce the
% symbols one-by-one. We use a rather ugly trick to
@@ -389,7 +394,7 @@
% the document, but we don't care, since most of this
% will be rewritten when we switch to \LaTeX3.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\def\do##1{%
\stepcounter{cnc@separatorcount}%
\edef\cnc@sepcsname{cnc@separator\arabic{cnc@separatorcount}}%
@@ -403,10 +408,10 @@
\edef\cnc@sepcsname{cnc@separator\arabic{cnc@separatorcount}}%
\csdef{\cnc@sepcsname}{#3}%
\ensuremath{\expandafter\@gobble\cnc@result{}}%
-% \end{macrocode}\end{codeframe}
-% \begin{uninterestingcodeframe}\begin{macrocode}
+% \end{macrocode}
+% \uninteresting\begin{macrocode}
}
-% \end{macrocode}\end{uninterestingcodeframe}
+% \end{macrocode}
%
%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -419,7 +424,7 @@
% \marg{star}\\\nopagebreak
% \marg{separator}
% \marg{last separator}
-%%% \marg{indices}\\\nopagebreak
+%%% \marg{indices}\\\nopagebreak\noindentnext
%
% This is the private macro which takes a concept key, a few
% modifiers, a comma-separated list of symbol-indices and
@@ -427,42 +432,42 @@
% concept symbols from our data-store. We use it in the public
% macros that offer this functionality.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\newrobustcmd{\cnc@nameandsymbols}[7]{%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% We first check if any |*| modifiers were given and, if so,
% generate an error.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\ifboolexpr{ test{\IfBooleanTF{#2}} or test{\IfBooleanTF{#4}} }{%
\PackageError{concepts}%
{You used the * modifier, but pluralization\MessageBreak
will be decided by the size of the index list}%
{I will pretend you didn't use the * modifier.}%
}{}%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% We then typeset the name of the concept. We check pluralization
% and pass along the capitalization.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\cnc@csvlistsize{#7}{\cnc@symbollistsize}%
\ifnumcomp{\cnc@symbollistsize}{=}{1}{%
\cnc@conceptname{\BooleanFalse}{#3}{\BooleanFalse}{#1}%
}{%
\cnc@conceptname{\BooleanTrue}{#3}{\BooleanFalse}{#1}%
} % <-- intentional space
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% Finally, we print the symbol list.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\cnc@conceptsymbols{#1}{#5}{#6}[#7]%
-% \end{macrocode}\end{codeframe}
-% \begin{uninterestingcodeframe}\begin{macrocode}
+% \end{macrocode}
+% \uninteresting\begin{macrocode}
}
-% \end{macrocode}\end{uninterestingcodeframe}
+% \end{macrocode}
%
%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -478,43 +483,43 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% \begin{macro}{\NewConcept} \marg{concept key} \oarg{options}\\\nopagebreak
+%%% \begin{macro}{\NewConcept} \marg{concept key} \oarg{options}\\\nopagebreak\noindentnext
%
% The |\NewConcept| macro is defined using |xparse|, since we want the
% optional argument after the mandatory one (it's just nicer).
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\NewDocumentCommand{\NewConcept}{m O{}}{%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% Is this concept key already defined? If so, we report a package error.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\xifinlist{#1}{\cnc@g{concepts}}{%
\PackageError{concepts}%
{The concept key '#1' is already taken}%
{I will pretend that this '\protect\newconcept'%
didn't happen.}%
}%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% Otherwise, we start the actual processing of this new concept.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
{%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% We add the concept to the concepts list in our datastore.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\listcsxadd{\cnc@d{concepts}}{#1}%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% We then check which options were explicitly specified by the user.
% This results in a set of toggles in our datastore, which may
% be used by other code.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\DeclareRobustCommand*{\cnc@registertoggle}[1]{%
\newtoggle{\cnc@d{concept(#1).option(##1).given}}%
\togglefalse{\cnc@d{concept(#1).option(##1).given}}%
@@ -529,12 +534,12 @@
\cnc@registertoggle{symbols}%
\cnc@registertoggle{symbolcmd}%
\ltxkeys@setkeys*[cnc@toggle]{#1}{#2}%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% We now register the concept name options |name|, |Name|,
% |plural| and |Plural|. This is also where we set their default values.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\ltxkeys@newordkey[cnc]{#1}{name}%
[#1]%
{\csdef{\cnc@d{concept(#1).option(name)}}{##1}}%
@@ -542,12 +547,12 @@
[\cnc@upper{\cnc@g{concept(#1).option(name)}}]%
{\csdef{\cnc@d{concept(#1).option(Name)}}{##1}}%
\ltxkeys@newordkey[cnc]{#1}{plural}%
- [\cnc@g{concept(#1).option(name)}s]%
+ [\cnc@g{concept(#1).option(name)}\unskip s]%
{\csdef{\cnc@d{concept(#1).option(plural)}}{##1}}%
\ltxkeys@newordkey[cnc]{#1}{Plural}%
[\cnc@upper{\cnc@g{concept(#1).option(plural)}}]%
{\csdef{\cnc@d{concept(#1).option(Plural)}}{##1}}%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% We next register the |namecmd| option. Its default value is the
% concept key with a |\| in front of it. Unlike most other options,
@@ -555,27 +560,27 @@
% user to actually define the macro. The following code also
% contains the test.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\expandaftercmds{\ltxkeys@newordkey[cnc]{#1}{namecmd}%
[}{\csname#1\endcsname}]{%
\iftoggle{\cnc@d{concept(#1).option(namecmd).given}}{%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% We register the option value as given.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\csdef{\cnc@d{concept(#1).option(namecmd)}}{\noexpand##1}
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
%%% \vphantom{x}\marginnote{\meta{namecmd}} \movarg{*} \movarg{\textasciicircum}
% \movarg{*}
-% \oarg{indices}\\\nopagebreak
+% \oarg{indices}\\\nopagebreak\noindentnext
%
% \noindent If the option is processed, we define the concept-specific
% name command. We distinguish between two cases: whether an index-list
% was provided or not.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\NewDocumentCommand{##1}{t* t^ t* +o}{%
\IfValueTF{####4}{%
\cnc@nameandsymbols{#1}{####1}{####2}{####3}%
@@ -584,21 +589,21 @@
\cnc@conceptname{####1}{####2}{####3}{#1}%
}%
}%
-% \end{macrocode}\end{codeframe}
-% \begin{uninterestingcodeframe}\begin{macrocode}
+% \end{macrocode}
+% \uninteresting\begin{macrocode}
}{}%
}%
-% \end{macrocode}\end{uninterestingcodeframe}
+% \end{macrocode}
%
% We now register the |symbols| option. This option expects a list.
% The callback of the following code processes it one symbol at a time.
% And we first initialize the symbol counter to 0 in case the list is
% empty
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\csdef{\cnc@d{concept(#1).option(symbols).count}}{0}%
\ltxkeys@newlistkey[cnc]{#1}{symbols}[]{%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% We check if this particular symbol is already defined. We don't want
% a symbol allocated to different concepts. Or allocated twice to the
@@ -606,7 +611,7 @@
% counter for this concept, we add the symbol itself and we update
% the reverse map we use for checking duplicates.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\ifcsundef{\cnc@d{symbol(\detokenize{##1}).concept}}{%
\csedef{\cnc@d{concept(#1)%
.option(symbols)%
@@ -616,11 +621,11 @@
.index(\ltxkeys@listcount)}}{##1}%
\csedef{\cnc@d{symbol(\detokenize{##1}).concept}}{#1}%
}%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% If the symbol is already in use we report a package error.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
{%
\PackageError{concepts}%
{The symbol '\detokenize{##1}' is already allocated
@@ -629,26 +634,26 @@
{I will pretend that you did not
try to add this symbol.}%
}%
-% \end{macrocode}\end{codeframe}
-% \begin{uninterestingcodeframe}\begin{macrocode}
+% \end{macrocode}
+% \uninteresting\begin{macrocode}
}%
-% \end{macrocode}\end{uninterestingcodeframe}
+% \end{macrocode}
%
% We register the |symbolcmd| option. It does not really have a default,
% but we give an empty default so we can test for the empty string inside.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\ltxkeys@newordkey[cnc]{#1}{symbolcmd}[]{%
\ifblank{##1}{}{%
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% We register the option value as given.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\csdef{\cnc@d{concept(#1).option(symbolcmd)}}{\noexpand##1}
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
-%%% \vphantom{x}\marginnote{\meta{symbolcmd}} \momarg{index}\\\nopagebreak
+%%% \vphantom{x}\marginnote{\meta{symbolcmd}} \momarg{index}\\\nopagebreak\noindentnext
%
% \noindent If the option is processed, we now define the concept-specific
% `short' command used to typeset one or more of the allocated symbols. It
@@ -657,7 +662,7 @@
% we pass control to the |\cnc@conceptsymbols| command, which is still able
% to grab a square bracket delimited list of indices.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\newrobustcmd*{##1}{%
\cnc@grabnumber{%
\IfInteger{########1}{%
@@ -667,21 +672,21 @@
}%
}%
}%
-% \end{macrocode}\end{codeframe}
-% \begin{uninterestingcodeframe}\begin{macrocode}
+% \end{macrocode}
+% \uninteresting\begin{macrocode}
}%
}%
-% \end{macrocode}\end{uninterestingcodeframe}
+% \end{macrocode}
%
% Finally, we issue the command to parse and process all options.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\ltxkeys@launchkeys[cnc]{#1}{#2}%
-% \end{macrocode}\end{codeframe}
-% \begin{uninterestingcodeframe}\begin{macrocode}
+% \end{macrocode}
+% \uninteresting\begin{macrocode}
}%
}
-% \end{macrocode}\end{uninterestingcodeframe}
+% \end{macrocode}
%
%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -689,17 +694,17 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \begin{macro}{\ConceptOption} \marg{concept key}
-%%% \marg{option key}\\\nopagebreak
+%%% \marg{option key}\\\nopagebreak\noindentnext
%
% The point of this command is that it can retrieve any option value
% in an expandable way. That means we can't use |xparse|, but we don't
% need it.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\newcommand*{\ConceptOption}[2]{%
\cnc@g{concept(#1).option(#2)}%
}
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
% Unfortunately, as of writing this, not all options are stored in a
% fully expandable way yet. But they will be in a later version.
@@ -711,16 +716,16 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \begin{macro}{\ConceptName} \movarg{*} \movarg{\textasciicircum}
% \movarg{*}
-%%% \marg{concept key}\\\nopagebreak
+%%% \marg{concept key}\\\nopagebreak\noindentnext
%
% This implementation simply calls our private macro for retrieving
% the name in one of four forms.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\NewDocumentCommand{\ConceptName}{t* t^ t* m}{%
\cnc@conceptname{#1}{#2}{#3}{#4}%
}
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -728,17 +733,17 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \begin{macro}{\ConceptSymbol} \marg{concept key}
-%%% \oarg{index}\\\nopagebreak
+%%% \oarg{index}\\\nopagebreak\noindentnext
%
% This implementation simply calls our private macro for retrieving
% the symbol with the given index. The index is optional and
% defaults to 1.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\NewDocumentCommand{\ConceptSymbol}{m O{1}}{%
\cnc@conceptsymbol{#1}{#2}%
}
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -748,13 +753,13 @@
% \begin{macro}{\ConceptSymbols} \marg{concept key}
% \oarg{separator}
% \oarg{last separator}
-%%% \marg{indices}\\\nopagebreak
+%%% \marg{indices}\\\nopagebreak\noindentnext
%
% This implementation simply calls our private macro for retrieving
% the symbol list with the given indices. The index-list is mandatory
% but can be empty.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\NewDocumentCommand{\ConceptSymbols}{m +O{,} +o m}{%
\IfValueTF{#3}{%
\cnc@conceptsymbols{#1}{#2}{#3}[#4]%
@@ -762,7 +767,7 @@
\cnc@conceptsymbols{#1}{#2}{#2}[#4]%
}%
}
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -770,18 +775,18 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \begin{macro}{\ConceptNameAndSymbols} \marg{concept key}
-%%% \marg{indices}\\\nopagebreak
+%%% \marg{indices}\\\nopagebreak\noindentnext
%
% This implementation simply calls our private macro for typesetting
% the concept name and the symbol list with the given indices. The
% index-list is mandatory and cannot be empty.
%
-% \begin{codeframe}\begin{macrocode}
+% \begin{macrocode}
\NewDocumentCommand{\ConceptNameAndSymbols}{t^ m +O{,} +O{$ and $} m}{%
\cnc@nameandsymbols{#2}{\BooleanFalse}{#1}{\BooleanFalse}%
{#3}{#4}{#5}%
}
-% \end{macrocode}\end{codeframe}
+% \end{macrocode}
%
%\end{macro}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%