% \iffalse meta-comment
% $Id$
% Copyright (C) 2005--2008 by Martin Thorsen Ranang <mtr@ranang.org>
% -------------------------------------------------------
% 
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2
% of this license or (at your option) any later version.
% The latest version of this license is in:
%
%    http://www.latex-project.org/lppl.txt
%
% and version 1.2 or later is part of all distributions of LaTeX 
% version 1999/12/01 or later.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{intex.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{intex}
%<*package>
   [2008/10/13 v1.1 A concept indexing and typesetting package]
%</package>
%<*batchfile>
\begingroup
%%
%% Copyright (C) 2005--2008 by Martin Thorsen Ranang <mtr@ranang.org>
%%
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.2 of this license
%% or (at your option) any later version.  The latest version of this
%% license is in:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% and version 1.2 or later is part of all distributions of LaTeX version
%% 1999/12/01 or later.
%%
\input docstrip.tex
\keepsilent

\usedir{tex/latex/intex}

\preamble

This is a generated file.

Copyright (C) 2005--2008 by Martin Thorsen Ranang <mtr@ranang.org>

This file may be distributed and/or modified under the conditions of
the LaTeX Project Public License, either version 1.2 of this license
or (at your option) any later version.  The latest version of this
license is in:

   http://www.latex-project.org/lppl.txt

and version 1.2 or later is part of all distributions of LaTeX version
1999/12/01 or later.

\endpreamble

\askforoverwritefalse
\generate{\file{intex.sty}{\from{intex.dtx}{intex}}}

\obeyspaces
\Msg{*************************************************************}
\Msg{*                                                           *}
\Msg{* To finish the installation you have to move the following *}
\Msg{* file into a directory searched by TeX:                    *}
\Msg{*                                                           *}
\Msg{*     intex.sty                                             *}
\Msg{*                                                           *}
\Msg{* To produce the documentation run the file intex.dtx       *}
\Msg{* through LaTeX.                                            *}
\Msg{*                                                           *}
\Msg{* Happy TeXing!                                             *}
\Msg{*                                                           *}
\Msg{*************************************************************}

\endgroup
%</batchfile>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{intex}[2008/10/13]
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[norsk,english]{babel}
\usepackage{fancyvrb}
\usepackage{url}
\usepackage[colorlinks=true]{hyperref}
\usepackage{svn}
\usepackage{booktabs}
\SVN $Rev$
\SVN $Date$
\EnableCrossrefs
%\CodelineIndex
\RecordChanges
\begin{document}
  \DocInput{intex.dtx}
  %\PrintChanges
  %\PrintIndex
\end{document}
%</driver>
% \fi
%
% \CheckSum{0} ^^A Should be 0 during development.
%
% \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
%   Lower-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
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
%
% \changes{v1.0}{2005/08/05}{Initial version}
%
% \GetFileInfo{intex.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
% ^^A From ltugboat.cls
%
% ^^A Typeset the name of an environment
% \providecommand\env[1]{\textsf{#1}}
% \providecommand\clsname[1]{\textsf{#1}}
% \providecommand\pkgname[1]{\textsf{#1}}
% \providecommand\optname[1]{\textsf{#1}}
% \providecommand\progname[1]{\textsf{#1}}
%
% ^^A A list of options for a package/class
% \newenvironment{optlist}{\begin{description}%
%   \renewcommand\makelabel[1]{%
%     \descriptionlabel{\mdseries\optname{##1}}}%
%   \itemsep0.25\itemsep}%
%  {\end{description}}
%
% ^^A Utility macros
%
% ^^A Special dashes
% \def\thinskip{\hskip 0.16667em\relax}
% \def\endash{--}
% \def\emdash{\endash-}
% \def\d@sh#1#2{\unskip#1\thinskip#2\thinskip\ignorespaces}
% \def\dash{\d@sh\nobreak\endash}
% \def\Dash{\d@sh\nobreak\emdash}
%
% ^^A Example macros - adapted from the `fvrb-ex' package
% ^^A ---------------------------------------------------
%
% ^^A Take care that we use here the "Z" character as comment character,
% ^^A to avoid to use an 8 bit one which can cause portability problems.
% ^^A But we can't use any more the "Z" into the example environments
% ^^A of this documentation.
%
% \makeatletter
% \newcommand{\BeginExample}[1][0]{%
% \parindent=0pt
% \multiply\topsep by 2
% \VerbatimEnvironment
% \begin{VerbatimOut}[gobble=#1]{\jobname.tmp}}
%
% \newcommand{\BelowExample}[1]{%
% \VerbatimInput[gobble=4,commentchar=Z,numbersep=3pt,frame=single,
%                numbers=left]{\jobname.tmp}
% \catcode`\Z=9\relax%
% #1\par}
%
% \newcommand{\SideBySide@Example}[1]{%
% \@tempdimb=\FV@XRightMargin
% \advance\@tempdimb -5mm
% \vspace{2mm}
% \begin{minipage}[c]{\@tempdimb}
%   \fvset{xrightmargin=0pt}%
%   \catcode`\Z=9\relax%
%   #1
% \end{minipage}%
% \@tempdimb=\textwidth
% \advance\@tempdimb -\FV@XRightMargin
% \advance\@tempdimb 5mm
% \begin{minipage}[c]{\@tempdimb}
%   \VerbatimInput[commentchar=Z,numbersep=3pt,frame=single,
%                  numbers=left,xleftmargin=5mm,xrightmargin=0pt]{\jobname.tmp}
% \end{minipage}
% \vspace{2mm}}
%
% \def\Example{%
% \catcode`\^^M=\active
% \@ifnextchar[{\catcode`\^^M=5\Example@}{\catcode`\^^M=5\Example@@}}
% \def\Example@[#1]{\fvset{#1}\Example@@}
% \def\Example@@{\BeginExample}
% \def\endExample{%
% \end{VerbatimOut}%
% \BelowExample{\input{\jobname.tmp}}}
%
% \def\CenterExample{%
% \catcode`\^^M=\active
% \@ifnextchar[{\catcode`\^^M=5\CenterExample@}
%              {\catcode`\^^M=5\CenterExample@@}}
% \def\CenterExample@[#1]{\fvset{#1}\CenterExample@@}
% \def\CenterExample@@{\BeginExample}
% \def\endCenterExample{%
% \end{VerbatimOut}%
% \center
% \BelowExample{\input{\jobname.tmp}}
% \endcenter}
% 
% \def\SideBySideExample{%
% \catcode`\^^M=\active
% \@ifnextchar[{\catcode`\^^M=5\SideBySideExample@}%
%              {\catcode`\^^M=5\SideBySideExample@@}}
% \def\SideBySideExample@[#1]{\fvset{#1}\SideBySideExample@@}
% \def\SideBySideExample@@{\BeginExample[4]}
% \def\endSideBySideExample{%
% \end{VerbatimOut}%
% \SideBySide@Example{\input{\jobname.tmp}}}
% \makeatother
%
% ^^A End of example macros from `fvrb-ex'
%
% \makeatletter
% \date{\the\year/\two@digits{\the\month}/\two@digits{\the\day}}
% \makeatother
%
% ^^A The beginning of the documentation itself.
%
% \title{The \textsf{\InTeX} Package\thanks{This document corresponds
%     to \textsf{intex}, revision~\SVNRev, dated \today.}}
% \author{Martin Thorsen Ranang \\ \texttt{mtr@ranang.org}}
%
% \maketitle
%
% \section{Introduction}
% This package adds functionality to \LaTeX\ that eases typesetting
% and indexing of phrases, acronyms and names in a consistent manner.
%
% \DescribeMacro{intex} \DescribeMacro{\co}
% The really short usage description is that in order to use the
% package, insert |\usepackage{intex}| at the beginning of your
% \LaTeX\ source file.  After that, you can wrap the macro
% |\co{|\meta{concept}|}| around any concept you want to typeset
% and/or typeset in some special way.
%
% \section{Background}
% I have been using \LaTeX\ since the spring of 1997.  Since then I
% have written several technical documents.  Like many others, I try
% to present my work in an accessible way to the reader, and I believe
% that \LaTeX\ can help with the technicalities of presenting
% technical writing in a clear and precise way.  For example, I have
% always tried to explain every non-trivial acronym used in my
% documents; include a meaningful index; and to also leave some clues
% to the reader through the typesetting, so that it will be easier to
% find the key phrases in the document.
%
% Already, packages exist that provide functionality that eases the
% \DescribeMacro{acronym}acronym\footnote{The |acronym| package,
%   written by Tobias Oetiker, available from
%   \url{CTAN:/macros/latex/contrib/acronym}.} and
% \DescribeMacro{index}indexing\footnote{The |index| package, written
%   by David M.\,Jones, available from
%   \url{CTAN:/macros/latex/contrib/index}.} operations mentioned
% above.  However, problems quickly arise when writing about an
% acronym in both singular and plural.  For example, let's say you
% want to use the concept \emph{informed search} (abbreviated IS).
% Then, if you want to write about that concept in plural, the logical
% acronym would be ISes (informed searches).  At the same time, you
% probably want those two occurences---perhaps typeset several
% chapters apart---to be indexed as being the same concept.
%
% The \InTeX\ package was written to reduce the work needed to handle
% such a task.  This has been done by combining the functionality of
% the |acronym| and the |index| packages with an external
% \co{Python}\footnote{\co{Python} is available from
% \url{http://www.python.org/}.} script.
%
% \section{Usage}
% How you can use \InTeX\ should be clearer after examining some
% examples.  The central idea in \InTeX\ is that a phrase or a word
% worth indexing constitutes some kind of a \co{concept}---in a broad
% sense of the word.  A \co{concept} can be of several kinds.  It can
% be either an \co{acronym} (or abbreviation), the name of an entity
% (a \co{person concept}, or an organization), or of the ``plain''
% kind (simply a phrase).  Hence, we will refer to the three kinds of
% \co{concepts} as \emph{\co{acronym concepts}}, \emph{\co{person
%     concepts}}, and \emph{\co{plain concepts}}.
%
% In the above paragraph, the word ``concepts'' was defined as a
% \co{concept} of the \co{plain} kind, and it was defined to be
% indexed as the word ``concept''.  Furthermore, the words
% ``acronym'', ``person'', and ``plain'' where also defined as
% \co{plain}.  However, these concepts are defined as
% \co{sub-concepts} of ``concept'' and should be indexed accordingly.
%
% \subsection{Package Options}
% \begin{optlist}
%   \item[noindex]: Whether \InTeX\ should generate an index or not.
% (\emph{Default: true}).
% \item[nowarnundef]: Whether \InTeX\ should generate in-document
%  warnings where unknown/undeclared concepts are encountered.
% (\emph{Default: true}).
% \item[nomargin\meta{type}]: Tell \InTeX\ not to add margin notes
%  whenever \emph{new} concepts of kind \meta{type} are typeset, where
%  \meta{type} is one of \optname{plain}, \optname{acronym}, or
%  \optname{person}.
% \end{optlist}
%
% \subsection{Examples}
% \begin{SideBySideExample}[xrightmargin=5cm]
%   \makeatletter
%   \@itx@margin@acronymfalse%
%   \makeatother
%   It is easy to refer to (and thus index)
%   acronyms, like \co{H2O}.  And 
%   sub-concepts, like \co{H2O reserve}
% \end{SideBySideExample}
%
% \begin{SideBySideExample}[xrightmargin=5cm]
%   \makeatletter
%   \@itx@margin@acronymfalse%
%   \makeatother
%   We could talk about multiple \co{IDs}, 
%   or a single \co{ID}.  The following 
%   table shows explicitly defined 
%   formatting:\\
%
%   \begin{tabular}{@{}ll@{}}
%     \toprule
%     Format & Expansion \\
%     \midrule 
%     forced long & ``\coL{ID}''\\
%     short & ``\coS{ID}''\\
%     full & ``\coF{ID}'' \\
%     \bottomrule
%   \end{tabular}
% \end{SideBySideExample}
%
% \begin{SideBySideExample}[xrightmargin=5cm]
%   \makeatletter
%   \@itx@margin@acronymfalse%
%   \makeatother
%   The \InTeX\ package also supports 
%   indexing sub-terms of acronyms,
%   like the \co{Swedish SIMPLE}, which
%   is part of the \co{SIMPLE} project.
% \end{SideBySideExample}
%
% The package supports typesetting words differently in the text and
% in the index.  For example, take a look at the definition of the
% term ``\co{compound-word analyzer}'' in the \InTeX-file.  Example
% that provokes hyphenation: a new, experimental \co{compound-word
%   analyzer}, used for \co{Norwegian compound-word analysis} of
% \co{non-deverbal verb compounds}, perhaps found in
% \co{Bokmålsordboka}.  Generally, analyzing \co{compounds}.
%
% \makeatletter
% \@itx@margin@plainfalse%
% \makeatother
% \begin{SideBySideExample}[xrightmargin=5cm]
%   The word \co{carnivore} means
%   \co{meat eater}.  There are both
%   \co{feline} and \co{canine}
%   \co{meat eaters} in the animal
%   kingdom.
% \end{SideBySideExample}
% \makeatletter
% \@itx@margin@plaintrue%
% \makeatother
%
% It is also possible to refer to acronyms from non-acronym entries,
% like \co{water}.
%
% It is also possible to refer to a concept using capitalized words,
% as in
%
% \makeatletter
% \@itx@margin@plainfalse%
% \makeatother
% \begin{SideBySideExample}[xrightmargin=5cm]
%   \co{Carnivore} eat meat.
% \end{SideBySideExample}
% \makeatletter
% \@itx@margin@plaintrue%
% \makeatother
%
% The package also supports ``special'' typesetting of acronyms, like
%
% \makeatletter
% \@itx@margin@plainfalse%
% \makeatother
% \begin{SideBySideExample}[xrightmargin=5cm]
%   \verb|mkintex| automatically inflects 
%   words following common patterns.  For
%   example, \co{index} and \co{indices} 
%   both refer to the same concept, even
%   though only \verb|index| is entered 
%   in the \InTeX-file.  The same goes for
%   \co{vertex} and \co{vertices}, and
%   \co{dog} and \co{dogs}.
% \end{SideBySideExample}
% \makeatletter
% \@itx@margin@plaintrue%
% \makeatother
%
% The \InTeX\ package handles the notion of multiple names for the
% same concept too.  For example, a lot of people believes that
% \co{EAPK} is referring to one person only, and that is the late
% \co{EAP}.
%
% \subsubsection{Index Definitions}
% The concept index definition file used for the above paragraph looks
% like:
% \VerbatimInput[showtabs=true,tabsize=4,numbers=left,fontsize=\small,lastline=1]{intex.itx}
% The file can be divided into different sections, according to the
% kind of concepts to be declared.  To set the
% current section, use a single line that must contain exactly 
% |"% *|\meta{type}|*"|, where \meta{type} is either |ACRONYMS|,
% |CONCEPTS|, or |PERSONS|.
%
% \VerbatimInput[showtabs=true,tabsize=4,numbers=left,fontsize=\small,firstline=2,lastline=10]{intex.itx}
% the above line should mean that |\co{synsets}| in the text should be
% indexed as if it read |\co{synset}|.  However, if the plural of the
% concept occurs first (in the [part of] document), its full-form
% should be \emph{typeset} ``synonym set'' + ``s'' (indicated by the |#y|) in
% the index file.  In other words, it only a short-hand notation.  On the
% other hand, in the next definition, another short-hand notation |#y|
% is used that will transform ``y'' into ``ies'' as the end of the last
% word:
%
% \VerbatimInput[showtabs=true,tabsize=4,numbers=left,fontsize=\small,firstline=11]{intex.itx}
%
% \subsection{Compilation}
% \label{sec:compilation}
% \DescribeMacro{mkintex} As mentioned earlier, the package includes
% an external program named |mkintex|.  The typical usage of
% |mkintex|, given that your document is named \meta{name}, would
% be \co{concept}:
% 
% \begin{enumerate}
% \item |latex |\meta{name}|.tex|
% \item |mkintex |\meta{name} \meta{name}|.itx -o |\meta{name}|.rix [-a acronyms.tex -p persons.tex]|
% \item |makeindex |\meta{name}
% \item |makeindex -o |\meta{name}|.rid |\meta{name}|.rix|
% \item |latex |\meta{name}|.tex|
% \end{enumerate}
%
% \section{Macros}
%
% \DescribeMacro{\InTeX}
% This is simply a macro for typesetting the \co{InTeX logo}. 
%
% \StopEventually{}
%
% \section{Implementation}
%
% After the customary identification,
%    \begin{macrocode}
\def\filename{intex}%
\ProvidesPackage{intex}[2008/10/13 v1.1
Support for concept, acronym, and proper-name typesetting and indexing]%
%    \end{macrocode}
% we continue by defining the package options.
%
% \subsection{Package Options}
%
% \begin{macro}{noindex}
% \begin{macro}{\if@itx@index}
% Let the conditional |\if@itx@index| control whether
% \InTeX\ should generate an index or not.  The default is to perform
% indexing.  The option |noindex| turns this feature off.
%    \begin{macrocode}
\newif\if@itx@index%
\@itx@indextrue%
\DeclareOption{noindex}{\@itx@indexfalse}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{nowarnundef}
% \begin{macro}{\if@itx@nowarnundef}
% The conditional |\if@itx@nowarnundef| controls whether
% \InTeX\ should include in-document warnings about undefined concepts
% or not.  The default is to warn about undefined concepts inside the
% document.  The |nowarnundef| option turns this feature off.
%    \begin{macrocode}
\newif\if@itx@warn@undef%
\@itx@warn@undeftrue%
\DeclareOption{nowarnundef}{\@itx@warn@undeffalse}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{nomarginplain}
% \begin{macro}{nomarginacronym}
% \begin{macro}{nomarginperson}
% \begin{macro}{\if@itx@margin@plain}
% \begin{macro}{\if@itx@margin@acronym}
% \begin{macro}{\if@itx@margin@person}
%
% The conditionals |\if@itx@margin@|\meta{kind}---where \meta{kind} is
% one of |plain|, |acronym|, and |person|---control whether the short
% version of each first-occurrence of a concept (of kind \meta{kind},
% per significant document part) should also be typeset as a
% margin-label.
%
%    \begin{macrocode}
\newif\if@itx@margin@plain%
\newif\if@itx@margin@acronym%
\newif\if@itx@margin@person%
\@itx@margin@plaintrue%
\@itx@margin@acronymtrue%
\@itx@margin@persontrue%
\DeclareOption{nomarginplain}{\@itx@margin@plainfalse}%
\DeclareOption{nomarginacronym}{\@itx@margin@acronymfalse}%
\DeclareOption{nomarginperson}{\@itx@margin@personfalse}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% Next, process the options.
%    \begin{macrocode}
\ProcessOptions%
%    \end{macrocode}
%
% \subsection{External Packages}
%
% \begin{macro}{index}
% Now, if |\if@itx@index| is \emph{true}, then require the package
% |index| to be loaded.  If not, we define a handy macro usually
% defined in that package.
%    \begin{macrocode}
\if@itx@index%
  \RequirePackage{index}%
  \makeindex%
  \newindex{raw}{rix}{rid}{Index}%
\else%
  \def\@nearverbatim{\expandafter\strip@prefix\meaning}%
\fi%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{marginnote}
%   Only require the marginnote package if it is really required.
%   This is done in an attempt to avoid wasting counters.
%    \begin{macrocode}
\if@itx@margin@plain%
  \RequirePackage{marginnote}[2006/10/26]%
\fi%
\if@itx@margin@acronym%
  \RequirePackage{marginnote}[2006/10/26]%
\fi%
\if@itx@margin@person%
  \RequirePackage{marginnote}[2006/10/26]%
\fi%
%    \end{macrocode}
% Please note that the |marginnote| package will only be loaded once,
% even if it gets required multiple times.
% \end{macro}
%
% \begin{macro}{acronym}
% \begin{macro}{ifthen}
%   Anyhow, require the |acronym| and the |ifthen| packages to be
%   loaded.
%    \begin{macrocode}
\RequirePackage{acronym}[2008/05/28]%
\RequirePackage{ifthen}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% 
% \subsection{The \InTeX\ Logo}
% \begin{macro}{\InTeX}
% Define a \TeX-ish logo for this package.
%    \begin{macrocode}
\newcommand*{\InTeX}{\textsl{In}\kern-.07em\TeX}%
%    \end{macrocode}
% \end{macro}
%
% \subsection{Font Definitions}
%
% The following commands define the font-selection commands used to
% typeset the different kinds of concepts in different situations.
%
% \begin{macro}{\itxplaindeffont}
% \begin{macro}{\itxplainfollowfont}
% \begin{macro}{\itxplainmarginfont}
% These commands are used to typeset plain concepts.
%    \begin{macrocode}
\newcommand\itxplaindeffont[1]{\emph{#1}}%
\newcommand\itxplainfollowfont[1]{#1}%
\newcounter{itxpl}%
\newcommand\@itxbasemarginfont[1]{%
  \stepcounter{itxpl}%
  \ifthenelse{\isodd{\pageref{itxpl-\theitxpl}}}{%
    \raggedright\hspace{0pt}\footnotesize\textsf{#1}% odd
  }{%
    \raggedleft\hspace{0pt}\footnotesize\textsf{#1}% even
  }%
  \label{itxpl-\theitxpl}%
}%
\newcommand\itxplainmarginfont[1]{%
  \@itxbasemarginfont{#1}%
}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\itxacronymdeffont}
% \begin{macro}{\itxacronymdefshortfont}
% \begin{macro}{\itxacronymshortfont}
% \begin{macro}{\itxacronymmarginfont}
%
% For acronyms:
%    \begin{macrocode}
\newcommand{\itxacronymdeffont}[1]{#1}%
\newcommand{\itxacronymdefshortfont}[1]{\emph{#1}}%
\newcommand{\itxacronymshortfont}[1]{#1}%
\newcommand{\itxacronymmarginfont}[1]{%
  \@itxbasemarginfont{#1}%
  %\raggedleft\hspace{0pt}\footnotesize\textsf{#1}%
}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\itxpersondeffont}
% \begin{macro}{\itxpersonfirstfont}
% \begin{macro}{\itxpersonlastfont}
% \begin{macro}{\itxpersonmarginfont}
%
% For persons:
%    \begin{macrocode}
\newcommand{\itxpersondeffont}[1]{\emph{#1}}%
\newcommand{\itxpersonfirstfont}[1]{#1}%
\newcommand{\itxpersonlastfont}[1]{#1}%
\newcommand{\itxpersonmarginfont}[1]{%
  \@itxbasemarginfont{#1}%
  %\raggedleft\hspace{0pt}\footnotesize\textsf{#1}%
}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{The (Low-Level) Clockwork of the Package}
%
% \begin{macro}{co@serial}
%   First, define a counter that is used to enumerate new concept
%   definitions.
%    \begin{macrocode}
\newcounter{co@serial}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{co@equiv@serial}
%   First, define a counter that is used to enumerate new concept
%   definitions.
%    \begin{macrocode}
%\newcounter{co@equiv@serial}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{co@type}
%   First, define a counter that is used to enumerate new concept
%   definitions.
%    \begin{macrocode}
\newcounter{co@type}%
%    \end{macrocode}
% The |co@type| counter is used only inside the |\@itx| command.
% \end{macro}
%
% \begin{macro}{\itxundefcomment}
% Then, define the comment to display where use of undefined concepts
% are detected.
%    \begin{macrocode}
\newcommand*\itxundefcomment[1]{\emph{(undefined concept ``#1'')}}%
%    \end{macrocode}
% \end{macro}
%
% Define a couple of convenience macros.
%    \begin{macrocode}
\long\def\@firstofthree#1#2#3{#1}%
\long\def\@secondofthree#1#2#3{#2}%
%\newcommand*\@secondofthree[3]{#2}%
%    \end{macrocode}
%
% Make it possible to reset the ``defined'' flag for each concept.
% After a reset, the next time that concept occurs, it is typeset as
% if it's the first occurrence of that concept.
%    \begin{macrocode}
\def\ITX@reset#1{%
  \global\expandafter\let\csname itx@#1\endcsname\relax}%
%    \end{macrocode}
%
% \subsubsection{Typesetting of Margin Labels}
% \begin{macro}{\@itxmarginlabel}
%
% Define a macro to typeset the concepts at first-occurrence points in
% the margin.
%
%    \begin{macrocode}
\newcommand*\@itxmarginlabel[2]{%
  \hspace{0pt}%
%    \end{macrocode}
% 
% The second argument is the \meta{identity} of the entity we're
% typesetting, while the first argument signals its \meta{type}; that
% is, whether we're typesetting a\ldots
% 
%    \begin{macrocode}
  \ifcase#1%
%    \end{macrocode}
  % \ldots plain concept, \ldots
%    \begin{macrocode}
    \if@itx@margin@plain%
      \marginpar{\itxplainmarginfont{\ITX@itxs{#1}{#2}}}%
      %\marginnote{\itxplainmarginfont{\ITX@itxs{#1}{#2}}}%
    \fi%
  \or%
%    \end{macrocode}
  % \ldots an acronym, \ldots
%    \begin{macrocode}
    \if@itx@margin@acronym%
      \marginpar{\itxacronymmarginfont{\ITX@itxs{#1}{#2}}}%
    \fi%
  \or%
%    \end{macrocode}
  % \ldots or a person's name.
%    \begin{macrocode}
    \if@itx@margin@person%
      \marginpar{\itxpersonmarginfont{\ITX@itxl{#1}{#2}}}%
    \fi%
  \fi%
}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ITX@used}
% Value to flag a concept as used.
%    \begin{macrocode}
\newcommand*\ITX@used{@<>@<>@}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ITX@get}
%    \begin{macrocode}
\newcommand*\ITX@get[2]{%
  \ifx#1\relax%
  \else%
    \expandafter#2#1%
  \fi%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\itxplainarea}
% \begin{macro}{\itxacronymarea}
% \begin{macro}{\itxpersonarea}
% \begin{macro}{\@itxarea}
% Significant-area definitions.  When these counters change, the
% concepts concerned will be typeset as first occurrences.
%    \begin{macrocode}
\newcommand*\itxplainarea{\thesubparagraph:\thepage}%
\newcommand*\itxacronymarea{\thechapter}%
\newcommand*\itxpersonarea{\thesubsubsection}%
\newcommand*\@itxarea[1]{%
  \ifcase#1%
    {\itxplainarea}%
  \or%
    {\itxacronymarea}%
  \or%
    {\itxpersonarea}%
  \fi%
}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\itx@last@pos0}
% \begin{macro}{\itx@last@pos1}
% \begin{macro}{\itx@last@pos2}
%   The default (empty) area definitions.
%    \begin{macrocode}
\def\itx@last@pos0{}%
\def\itx@last@pos1{}%
\def\itx@last@pos2{}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\ITX@itxs}
%    \begin{macrocode}
\newcommand*\ITX@itxs[2]{%
  \csname fnss@\number#2\endcsname%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ITX@itxl}
%    \begin{macrocode}
\newcommand*\ITX@itxl[2]{%
  \csname fnsl@\number#2\endcsname%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\itxs}
%   The syntax is |\itxs{|\meta{type}|}{|\meta{identity}|}|.  A
%   wrapper for |\@itxs|.
%    \begin{macrocode}
\newcommand*{\itxs}[2]{%
  \texorpdfstring{\protect\@itxs{#1}{#2}}{#1}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@itxs}
%   The syntax is |\@itxs{|\meta{type}|}{|\meta{identity}|}|.
%   Typesets the concept referred to by \meta{identity} in its
%   \emph{short form} according to its \meta{type}.
%    \begin{macrocode}
\newcommand*{\@itxs}[2]{%
  \ifcase\number#1%
%    \end{macrocode}
% \begin{description}
% \item[Plain Concept]
%    \begin{macrocode}
    \itxplainfollowfont{\ITX@itxs{#1}{#2}}%
  \or%
%    \end{macrocode}
% \item[Acronym]
%    \begin{macrocode}
    \itxacronymshortfont{\ITX@itxs{#1}{#2}}%
  \or%
%    \end{macrocode}
% \item[Person]
%    \begin{macrocode}
    \itxpersonlastfont{\ITX@itxl{#1}{#2}}%
  \fi%
}%
%    \end{macrocode}
% \end{description}
% \end{macro}
%
% \begin{macro}{\itxl}
%   The syntax is |\itxl{|\meta{type}|}{|\meta{identity}|}|.  A
%   wrapper for |\@itxl|.
%    \begin{macrocode}
\newcommand*{\itxl}{\protect\@itxl}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@itxl}
%   The syntax is |\@itxl{|\meta{type}|}{|\meta{identity}|}|.
%   Typesets the concept referred to by \meta{identity} in its
%   \emph{long form} according to its \meta{type}.
%    \begin{macrocode}
\newcommand*{\@itxl}[2]{%
  %\ITX@itxl{#1}{#2}%
  \ifcase\number#1%
%    \end{macrocode}
% \begin{description}
% \item[Plain Concept] Typeset the concept, \ldots
%    \begin{macrocode}
    \itxplainfollowfont{\ITX@itxs{#1}{#2}}\nolinebreak %
  \or%
%    \end{macrocode}
% \item[Acronym] Typeset the concept (note in-between margin
%   label), \ldots
%    \begin{macrocode}
    \itxacronymdeffont{\ITX@itxl{#1}{#2}}%
  \or%
%    \end{macrocode}
% \item[Person] Typeset the concept (note the in-between margin
%   label), \ldots
%    \begin{macrocode}
    \itxpersondeffont{%
      \itxpersonfirstfont{\ITX@itxs{#1}{#2}} %
      %\nolinebreak[3] %
      \itxpersonlastfont{\ITX@itxl{#1}{#2}}%
    }%
  \fi%
}%
%    \end{macrocode}
% \end{description}
% \end{macro}
%
% \begin{macro}{\itxf}
%   The syntax is |\itxf{|\meta{type}|}{|\meta{identity}|}|.  A wrapper
%   for |\@itxf|.
%    \begin{macrocode}
\newcommand*{\itxf}[2]{%
  \texorpdfstring{\protect\@itxf{#1}{#2}}{\ITX@itxl{#1}{#2} (#1)}%
}%
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\@itxf}
%   The syntax is |\@itxf{|\meta{type}|}{|\meta{identity}|}|.
%   Typesets the concept referred to by \meta{identity} in its
%   \emph{full form} according to its \meta{type}.
%    \begin{macrocode}
\newcommand*{\@itxf}[2]{%
  \ifcase\number#1%
%    \end{macrocode}
% \begin{description}
% \item[Plain Concept] Typeset margin-notes if applicable, \ldots
%    \begin{macrocode}
    \@itxmarginlabel{#1}{#2}%
%    \end{macrocode}
% \ldots typeset the concept, \ldots
%    \begin{macrocode}
    \itxplaindeffont{\ITX@itxs{#1}{#2}}\nolinebreak %
  \or%
%    \end{macrocode}
% \item[Acronym] Typeset the concept (note in-between margin
%   label), \ldots
%    \begin{macrocode}
    \itxacronymdeffont{%
      \ITX@itxl{#1}{#2} %
      %\nolinebreak[3] %
%    \end{macrocode}
% \ldots typeset margin-notes if applicable, \ldots
%    \begin{macrocode}
      \@itxmarginlabel{#1}{#2}%
%    \end{macrocode}
% \ldots continue typesetting the concept.
%    \begin{macrocode}
      \itxacronymdefshortfont{%
        \itxacronymshortfont{(\ITX@itxs{#1}{#2})}}%
    }%
  \or%
%    \end{macrocode}
% \item[Person] Typeset the concept (note the in-between margin
%   label), \ldots
%    \begin{macrocode}
    \itxpersondeffont{%
      \itxpersonfirstfont{%
        \ITX@itxs{#1}{#2}} %
      %\nolinebreak[3] %
%    \end{macrocode}
% \ldots typeset margin-notes if applicable, \ldots
%    \begin{macrocode}
      \@itxmarginlabel{#1}{#2}%
%    \end{macrocode}
% \ldots continue typesetting the concept.
%    \begin{macrocode}
      \itxpersonlastfont{%
        \ITX@itxl{#1}{#2}%
      }%
    }%
  \fi%
%    \end{macrocode}
% \end{description}
% Now, do the used/unused accounting.
%    \begin{macrocode}
  \expandafter\ifx\csname itx@#2\endcsname\ITX@used%
    %\relax%
  \else%
    \global\expandafter\let\csname itx@#2\endcsname\ITX@used%
    %\ITX@addtoclearlist{#2}% MTR
  \fi%
  %\ITX@logged{#2} MTR
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@itxrecordarea}
%   The syntax is |\@itxrecordarea{|\meta{type}|}{|\meta{identity}|}|.
%   A macro used to update the current used/non-used status of each
%   concept.  This macro only use the \emph{type} and \emph{numeric
%     id} of the concept.
%    \begin{macrocode}
\newcommand*{\@itxrecordarea}[2]{%
%    \end{macrocode}
  % Record this area:
%    \begin{macrocode}
  \edef\curr@pos{\@itxarea{#1}}%
  %\PackageWarning{InTeX}{Current position for type "#1" is "\curr@pos"}%
%    \end{macrocode}
  % Remember the last area where this concept (second argument) was used.
%    \begin{macrocode}
  \edef\last@pos{\csname itx@last@pos#1@#2\endcsname}%
  \ifx\curr@pos\last@pos%
%    \end{macrocode}
    % We're still in the same area.  Hence, we do nothing.
%    \begin{macrocode}
  \else%
%    \end{macrocode}
    % The area has changed.
%    \begin{macrocode}
    \ITX@reset{#2}%
  \fi%
  \expandafter\xdef\csname itx@last@pos#1@#2\endcsname{\curr@pos}%
}%
%    \end{macrocode}
%  \end{macro}
%
% \begin{macro}{\@itx@init@nonbookmode}
%   The syntax is |\@itx@init@nonbookmode|.  This command is responsible
%   for setting up miscellaneous aspects of the package when used in
%   nonbook environments.
%    \begin{macrocode}
\newcommand\@itx@init@nonbookmode{%
  \newcommand*{\@itxtypeset}[3]{% Article-mode.
    \ifx##3A%
      %\PackageWarning{InTeX}{Typesetting format is automatic}%
      \expandafter\ifx\csname itx@##2\endcsname\ITX@used%
%    \end{macrocode}
% The concept was last used in this area.  Hence, it is typeset in its
% short form.
%    \begin{macrocode}
        \itxs{##1}{##2}%
      \else%
%    \end{macrocode}
% The concept has not yet been used, or it was last used in another
% area.  Hence, it is typeset in its full form.
%    \begin{macrocode}
        \itxf{##1}{##2}%
      \fi%
    \else%
%    \end{macrocode}
% Explicit selected typesetting format.
%    \begin{macrocode}
      %\PackageWarning{InTeX}{Typesetting format = "##3"}%
      \ifx##3S\itxs{##1}{##2}\fi%
      \ifx##3L\itxl{##1}{##2}\fi%
      \ifx##3F\itxf{##1}{##2}\fi%
    \fi%
  }%
}%
%    \end{macrocode}
%  \end{macro}
%
% \begin{macro}{\@itx@init@bookmode}
%   The syntax is |\@itx@init@bookmode|.  This command is responsible
%   for setting up miscellaneous aspects of the package when used in
%   book environments.
%    \begin{macrocode}
\newcommand\@itx@init@bookmode{%
  \PackageInfo{InTeX}{Adjusting behavior to suite book/report document
    classes\@gobble}%
  \newcommand*{\@itxtypeset}[3]{% Book/report-mode.
    \ifx##3A%
      %\PackageWarning{InTeX}{Typesetting format is automatic}%
%    \end{macrocode}
% \emph{Automatic} typesetting.
%    \begin{macrocode}
      \if@mainmatter%
        \expandafter\ifx\csname itx@##2\endcsname\ITX@used%
%    \end{macrocode}
% The concept was last used in this area.  Hence, it is typeset in its
% short form.
%    \begin{macrocode}
          \itxs{##1}{##2}%
        \else%
%    \end{macrocode}
% The concept has not yet been used, or it was last used in another
% area.  Hence, it is typeset in its full form.
%    \begin{macrocode}
          \itxf{##1}{##2}%
        \fi%
      \else%
%    \end{macrocode}
% Either in frontmatter or in backmatter.
%    \begin{macrocode}
        \itxl{##1}{##2}%
      \fi%
    \else%
%    \end{macrocode}
% Explicit selected typesetting format.
%    \begin{macrocode}
      %\PackageWarning{InTeX}{Typesetting format = "##3"}%
      \ifx##3S\itxs{##1}{##2}\fi%
      \ifx##3L\itxl{##1}{##2}\fi%
      \ifx##3F\itxf{##1}{##2}\fi%
    \fi%
  }%
}
%    \end{macrocode}
%  \end{macro}
%
% \begin{macro}{\@itxtypeset}
%   The syntax is
%   |\@itxtypeset{|\meta{type}|}{|\meta{identity}|}{|\meta{format
%       code}|}|.  This command is responsible for typesetting the
%   $\left(\meta{type}, \meta{identity}\right)$ tuple.
%
%   If the \meta{identity} was referred to in the frontmatter (part of
%   books and reports), then a different set of rules should dictate
%   the typesetting of the according concept.  Therefore, first find
%   out if the package is used in an article, which does not have any
%   |\if@mainmatter| macro.
%    \begin{macrocode}
\newif\if@itx@bookmode%
\@itx@bookmodetrue%
%    \end{macrocode}
% Adjust the defaults so they make sense when used with the article
% document class.
%    \begin{macrocode}
\@ifclassloaded{article}{%
  \PackageInfo{InTeX}{Adjusting behavior to suite the article document
    class\@gobble}%
  \@itx@init@nonbookmode%
  \@itx@bookmodefalse%
}{}%
%    \end{macrocode}
% Adjust the defaults so they make sense when used with the beamer
% document class.
%    \begin{macrocode}
\@ifclassloaded{beamer}{%
  \PackageInfo{InTeX}{Adjusting behavior to suite the beamer document
    class\@gobble}%
  \@itx@init@nonbookmode%
  \@itx@bookmodefalse%
  \renewcommand*\itxacronymarea{0}%
  \@itx@margin@plainfalse%
  \@itx@margin@acronymfalse%
  \@itx@margin@personfalse%
}{}%
%    \end{macrocode}
% Assume that the current document class is one of the book or report
% classes, or another class with a definition of |\thechapter|.
%    \begin{macrocode}
\if@itx@bookmode%
  \@itx@init@bookmode%
\fi%
%    \end{macrocode}
%  \end{macro}
%
% \begin{macro}{\@itxplain}
%   The syntax is
%   |\@itxplain{|\meta{type}|}{|\meta{identity}|}{|\meta{format
%       code}|}|.  This command is responsible for keeping track of
%   where the $\left(\meta{type}, \meta{identity}\right)$ tuple was
%   last used and for typesetting it accordingly.
%
%   The \meta{format code} can be one of
%   \begin{description}
%   \item[|A|] for \emph{automatic} selection of any of the following,
%     explicit, format codes.
%   \item[|S|] for typesetting the entry in its \emph{short} form.
%   \item[|L|] for typesetting the entry in its \emph{long} form.
%   \item[|F|] for \emph{full-form} typesetting.
%   \end{description}
%    \begin{macrocode}
\newcommand*{\@itxplain}[3]{%
%    \end{macrocode}
%
% First, update the ``last used'' status of the current concept so
% that it refers to the current area.
%    \begin{macrocode}
  \@itxrecordarea{#1}{#2}%
%    \end{macrocode}
% Then, typeset the concept.
%    \begin{macrocode}
  \@itxtypeset{#1}{#2}{#3}%
}%
% \end{macro}
%
% \begin{macro}{\@itxalias}
%   Define the identity of the equivalent entry.  Get the identity of the main
%   index entry for which this is an alias.  Keep the original
%   definition as |\@orig|.  Redefine the main entry (as in
%   |\expandafter\gdef\csname fn@#1\endcsname{{#2}{#2}}|.)  Now,
%   typeset the alias by using the main index entry identity.  Finally,
%   reset the definition of the main entry.  \textbf{|FIXME:|} This
%   command is (probably) not used at the moment (2007-07-14) and is
%   not doing what this paragraph states.
%    \begin{macrocode}
\newcommand*{\@itxalias}[2]{%
  \edef\@mainserial{\expandafter\@firstoftwo#2}%
  \edef\@equivserial{\expandafter\@secondoftwo#2}%
%    \end{macrocode}
% Record usage of the main concept entry.
%    \begin{macrocode}
  %\@itxrecordarea{#1}{\@mainserial}%
  \@itxplain{#1}{\@equivserial}%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@itx@fakeindex}
%   If no index is to be generated, we still need some output for
%   |mkintex| to work with.  Hence, this command substitutes the
%   |\index| command in the |index| package, and makes sure that an
%   index entry with \emph{page} equal to |\thepage| is written to the
%   auxiliary file instead.  However, the \emph{page} value will then
%   be used only for providing more detailed warnings about references
%   to undefined concepts.
%    \begin{macrocode}
\newcommand{\@itx@fakeindex}[1]{%
  \begingroup%
    \edef\@tempa{%
      \write\@auxout{%
        \string\@writefile{raw}{%
          \string\indexentry{#1}{\thepage}%
        }%
      }%
    }%
  \expandafter\endgroup\@tempa%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\co}
%
%   The |\co| command is the only command the user should \emph{need}
%   to use.  The syntax is |\co{|\meta{identity}|}[|\meta{format
%     code}|]|, where \meta{identity} refers to a concept and
%   \meta{format code} is an optional argument that can be used to
%   force a particular kind of typesetting.  The idea is that the
%   |\co{}| command should be wrapped around every concept the user
%   want to either typeset or index in a special and consistent way
%   (or both).  Note that |\co| is a wrapper for the |\@itx| command.
%   Please see the definition of |\@itxplain| for a description of the
%   available format codes.  The default \meta{format code} is |A|.
%    \begin{macrocode}
%\newcommand*{\co}{\protect\@itx}%
\newcommand{\co}{\@itx}%
\newcommand{\coS}[1]{\@itx[S]{#1}}%
\newcommand{\coL}[1]{\@itx[L]{#1}}%
\newcommand{\coF}[1]{\@itx[F]{#1}}%
%\DeclareRobustCommand*{\co}{\protect\@itx}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@itx}
%   The |\@itx| command works just as described for |\co| above.
%   Hence, |#1| is the \meta{format code}, and |#2| is the
%   \meta{identity}.
%    \begin{macrocode}
%\newcommand*{\@itx}[2][A]{%
\DeclareRobustCommand*{\@itx}[2][A]{%
  \def\@tempa{#2}%
%    \end{macrocode}
% Handle, e.g., backslashes.
%    \begin{macrocode}
  \edef\@tempb{\@nearverbatim\@tempa}%
%    \end{macrocode}
%
% If \InTeX\ should generate an index, simply use the |index| package
% to write the identifying index entry.  The intricacies of how this
% concept should be indexed is handled externally by the |mkintex|
% program that is part of the \InTeX\ package.
%
%    \begin{macrocode}
  \if@itx@index%
    \index[raw]{#2}%
  \else%
    \@itx@fakeindex{\@tempb}%
  \fi%
%    \end{macrocode}
%
% Define a new conditional, |found|, to signal whether the
% \meta{identity} is found.
%    \begin{macrocode}
  \newif\iffound%
%    \end{macrocode}
%
% Now, let the |co@type| counter loop through the values $\left[0, 1,
%   2\right]$.
%    \begin{macrocode}
  \setcounter{co@type}{0}%
  \loop\ifnum\theco@type<3%
%    \end{macrocode}
% Check to see if the \meta{identity} is an (acronym or person)
% \emph{alias} or a \emph{main} entry.  If it is an \emph{alias},
% there exists a variable named |fn|$n$|e@|\meta{identity} (note the
% extra `|e|').  However, if \meta{identity} refers to a \emph{main}
% entry, a variable named |fn|$n$|@|\meta{identity} exists; that is,
% without the `|e|' before the `|@|'.  Also, it should be noted that
% \emph{no alias can exists without a main entry with the same
%   \meta{identity}}.
% 
% If an expansion of \meta{identity} is found, typeset it accordingly
% and flag the finding by setting |\iffound|.
%    \begin{macrocode}
    \expandafter\ifx\csname fn\number\theco@type e@\@tempb\endcsname\relax%
      \expandafter\ifx\csname fn\number\theco@type @\@tempb\endcsname\relax%
%    \end{macrocode}
% The \meta{identity} may refer to both a main entry \emph{and} an
% alias entry (because of the requirement mentioned above).  Do
% nothing.  The reason the code is written in this way is to implement
% a preference to main entries over alias entries (see the order
% below).
%    \begin{macrocode}
        % \PackageWarning{InTeX}{Main AND alias reference `#2' occurred}%
        % The reference refers to both main _and_ alias entries.  Do
        % nothing, this will be resolved through the |else|-cases
        % immediately below.
      \else%
%    \end{macrocode}
% The \meta{identity} refers to a main-entry.
%    \begin{macrocode}
        %\PackageInfo{InTeX}{Main reference `#2' occurred}%
        \edef\co@id{\csname fn\number\theco@type @\@tempb\endcsname}%
        \@itxplain{\number\theco@type}{\co@id}{#1}%
        \foundtrue%
      \fi%
%   \else%
%    \end{macrocode}
% The \meta{identity} refers to an alias-entry.
%    \begin{macrocode}
%      \PackageWarning{InTeX}{Alias reference `#2' occurred}%
%      %  XXX: It seems that this case never occurrs.
%      \edef\co@id{\csname fn\number\theco@type e@\@tempb\endcsname}%
%      \@itxalias{\number\theco@type}{\co@id}%
%      \foundtrue%
    \fi%
%    \end{macrocode}
% Increase |co@type| by $1$ and perform a new iteration of the loop.
% In other words, check if the reference (\meta{identity}) is referring to
% another kind of entry.
%    \begin{macrocode}
    \stepcounter{co@type}%
  \repeat%
%    \end{macrocode}
% If no expansion of \meta{identity} could be found, warn the user.
% Furthermore, an in-document warning will be typeset if
% |@itx@warn@undef| is \emph{true}.
%    \begin{macrocode}
  \iffound%
% Do nothing.
  \else%
    \PackageWarning{InTeX}{Reference `#2' to undefined concept}%
    \if@itx@warn@undef%
      \textbf{\itxundefcomment{#2}}%
    \else%
      #2%
    \fi%
  \fi%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\personused}
%    \begin{macrocode}
\newcommand*{\personused}[1]{%
  \expandafter\ifx\csname pnused@#1\endcsname\PN@used%
    \relax%
  \else%
    \global\expandafter\let\csname pnused@#1\endcsname\PN@used%
    \global\let\PN@populated\PN@used%
  \fi%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@itxdefineforms}
%    \begin{macrocode}
\newcommand\@itxdefineforms[3]{%
  \expandafter\gdef\csname fnss@\number#1\endcsname{#2}%
  \expandafter\gdef\csname fnsl@\number#1\endcsname{#3}%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@newentry}
% The macros |\new|\meta{type}, where
% \meta{type} $\in \{|acronym|, |concept|, |person|\}$ (as described
% below), all call |\@newentry| with an additional first argument,
% namely the numeric \meta{type} identifier of the new entry.  The
% syntax is
% \begin{displaymath}
%   |\@newentry{|\meta{type}|}{|\meta{reference}|}{|\meta{typeset 1}|}{|\meta{typeset 2}|}|,
% \end{displaymath}
% where \meta{reference} is the string later refered to as
% |\co{|\meta{string}|}|, and \meta{typeset 1} and \meta{typeset 2}
% define how the concept will be typeset where it was refered to in
% the text.  The exact meaning of \meta{typeset 1} and \meta{typeset
%   2} depends on what \meta{type} this entry has.
%    \begin{macrocode}
\newcommand\@newentry[4]{%
  \def\@tempa{#2}%
  \edef\@tempb{\@nearverbatim\@tempa}%
  %
  \stepcounter{co@serial}%
  %\PackageWarning{init}{serial counter = \expandafter\theco@serial}%
  \expandafter\xdef\csname fn\number#1@\@tempb\endcsname{%
    \number\theco@serial}%
  %\PackageWarning{init}{Def: \meaning\csname fn\number#1@\@tempb\endcsname}%
  \@itxdefineforms{\theco@serial}{#3}{#4}%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\newconcept}
%    \begin{macrocode}
\newcommand*\newconcept[3]{%
  \@newentry{0}{#1}{#2}{#3}%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\newacronym}
%    \begin{macrocode}
\newcommand*\newacronym[3]{%
  \@newentry{1}{#1}{#2}{#3}%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\newperson}
%   The syntax is
% \begin{displaymath}
%   |\newperson{|\meta{reference}|}{|\meta{short-form typeset}|}{|\meta{full-form typeset}|}|.
% \end{displaymath}
%    \begin{macrocode}
\newcommand*\newperson[3]{%
  \@newentry{2}{#1}{#2}{#3}%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@newentryequiv}
%   The syntax for this command is
%   \begin{displaymath}
%     |\@newentryequiv{|\meta{type}|}{|\meta{parent}|}{|\meta{typeset}|}{|\meta{reference}|}{|\meta{full-form typeset}|}|,
%   \end{displaymath}
%   where \meta{type} $\in \{|acronym|, |concept|, |person|\}$,
%   \meta{parent} is the (reference) identity of the concept for which
%   this is an equivalent, \meta{typeset} defines how this equivalent
%   should be typeset in text (short-form if it is an acronym),
%   \meta{reference} is the identity of this entry (referred to as
%   |\co{|\meta{reference}|}|), and \meta{full-form typeset} defines
%   how this concept should be typeset in the text in its full-form.
%
%   Note that the macros |\new|\meta{type}|equiv|, where \meta{type}
%   $\in \{|acronym|, |concept|, |person|\}$, all are wrappers for
%   this command.
%    \begin{macrocode}
\newcommand*\@newentryequiv[5]{%
  \newif\iffound%
  \def\@tempa{#2}%
  \edef\@tempb{\@nearverbatim\@tempa}%
  \expandafter\ifx\csname fn\number#1 @\@tempb\endcsname\relax%
%    \end{macrocode}
% Nothing is done if |\csname fn\number#1 @\@tempb\endcsname| is not
% defined here, but notice that the default value of |found| is
% \emph{false}.
%    \begin{macrocode}
  \else%
    \foundtrue%
    \edef\co@id{\csname fn\number#1@\@tempb\endcsname}%
    %\PackageWarning{init}{Found `\@tempb' (type=\number#1, serial=\co@id)}%
%    \end{macrocode}
% Store the \emph{short} and the \emph{long}
% versions of the alias, in that order.
%    \begin{macrocode}
    \stepcounter{co@serial}%
    \@itxdefineforms{\theco@serial}{#3}{#5}%
%    \end{macrocode}
% Store the numeric identity of the concept alias.
%    \begin{macrocode}
    \def\@tempa{#4}%
    \edef\@tempb{\@nearverbatim\@tempa}%
    \expandafter\xdef\csname fn\number#1 e@\@tempb\endcsname{%
      {\co@id}{\theco@serial}}%
  \fi%
  \iffound%
  \else%
    %\PackageWarning{InTeX}{Can't find `#2' for sub-concept `#3'}%
  \fi%
}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\newconceptequiv}
% \begin{macro}{\newacronymequiv}
% \begin{macro}{\newpersonequiv}
%   Wrappers for the |\@newentryequiv| command, where each wrapper
%   specifies the entry's \meta{type} through the first argument to
%   |\@newentryequiv|.
%    \begin{macrocode}
\newcommand*\newconceptequiv[4]{%
  \@newentryequiv{0}{#1}{#2}{#3}{#4}%
}%
\newcommand*\newacronymequiv[4]{%
  \@newentryequiv{1}{#1}{#2}{#3}{#4}%
}%
\newcommand*\newpersonequiv[4]{%
  \@newentryequiv{2}{#1}{#2}{#3}{#4}%
}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{The Internal \InTeX\ File}
% \begin{macro}{\InTeX}
%   After the first run of {Make\InTeX}, the file |\jobname.ito| will
%   contain the different concept definitions.  The |.ito| file is
%   loaded at the beginning of the document.
%    \begin{macrocode}
\AtBeginDocument{\@input{\jobname.ito}}%
%    \end{macrocode}
% \end{macro}
%
% \printindex[raw]
% \Finale
\endinput%
