summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/corridx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/corridx
Initial commit
Diffstat (limited to 'macros/latex/contrib/corridx')
-rw-r--r--macros/latex/contrib/corridx/corridx.dtx550
-rw-r--r--macros/latex/contrib/corridx/corridx.ins54
-rw-r--r--macros/latex/contrib/corridx/corridx.pdfbin0 -> 128577 bytes
-rw-r--r--macros/latex/contrib/corridx/corridx.sample.pdfbin0 -> 69479 bytes
-rw-r--r--macros/latex/contrib/corridx/corridx.sample.tex129
-rw-r--r--macros/latex/contrib/corridx/corridx.sty171
6 files changed, 904 insertions, 0 deletions
diff --git a/macros/latex/contrib/corridx/corridx.dtx b/macros/latex/contrib/corridx/corridx.dtx
new file mode 100644
index 0000000000..45de25099f
--- /dev/null
+++ b/macros/latex/contrib/corridx/corridx.dtx
@@ -0,0 +1,550 @@
+% \iffalse meta-comment
+%
+% Copyright (C) Johannes Fink
+% -----------------------------------
+%
+% 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
+%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+%<package>\ProvidesPackage{corridx}
+%<package> [2005/05/05 v1.0 Chemical Index]
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{corridx}
+
+\EnableCrossrefs
+
+\CodelineIndex
+
+\RecordChanges
+
+%\OnlyDescription
+
+\begin{document}
+\DocInput{corridx.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{0}
+%
+% \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/05/05}{Initial version}
+%
+% \GetFileInfo{corridx.sty}
+%
+% \DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ }
+% \DoNotIndex{\@ne}
+% \DoNotIndex{\advance,\begingroup,\catcode,\closein}
+% \DoNotIndex{\closeout,\day,\def,\edef,\else,\empty,\endgroup}
+% \DoNotIndex{\bgroup,\egroup,\newcommand}
+% \DoNotIndex{\ifx,\fi}
+% \DoNotIndex{\let}
+%
+% \title{The \textsf{corridx} package
+% \thanks{This document corresponds to \textsf{corridx}~\fileversion,
+% dated \filedate.}}
+% \author{Johannes Fink\\ \texttt{fink@unileoben.ac.at}}
+%
+% \maketitle
+%
+% \begin{abstract}
+%
+% The package introduces a sort entry for chemical names that are
+% preceded by numbers and other prefixes to ensure a correct
+% ordering in the index.
+%
+% \end{abstract}
+%
+% \section{Introduction}
+%
+% Chemical Names often have preceding numbers or other prefiexes
+% that do not contribute to the alphabetic sorting of the respective
+% index entry. This drawback can be circumvented by introducing sort
+% keys into the index entry. Such as
+% \verb"\index{dimethylbenzene@1,3-Dimethylbenzene}". The
+% \textit{corridx} package does this automatically.
+%
+% Previously a Pascal program entitled \textit{CorrIdx} was used as a
+% preprocessor for the \textit{makeindex} program to insert these
+% key entries into the index entry.
+%
+% Now a \LaTeX\space macro package is available. This package includes all the
+% necessary modifications directly in the |*.idx| file.
+%
+%
+%
+% \subsection{Clashes}
+% The package |corridx| has a different approach
+% in comparison to the package |index| and will
+% not work with this package and maybe also with
+% other similar packages.
+% A package error
+% is forced when the package |index| is loaded.
+% The package works together with |makeidx|.
+%
+% \section{Usage}
+%
+% \subsection{Predefined Index Types}
+%
+% There are always the forms |\ia| and |\noia|, |\ib| and |\noib|,
+% |\ic| and |\noic|, |\ig| and |\noig|.
+% The |\no..| form places an index in the |*.idx| file, whereas the |\i.| form places both text and
+% index.
+%
+% \DescribeMacro{\ia}
+% The command |\ia| (index acronym) is used as
+% |\ia{1,2-butanediol}{1,2-BD}|
+% and places in the text "1,2-butanediol (1,2-BD)"
+% and in the index |*.idx|
+% \newline
+% |\indexentry{acr bd@1,2-BD!\nopagebreak 1,2-Butanediol}{1}|
+%
+% \DescribeMacro{\ic}
+% % The command |\ic| is used as |\ic{1,2-butanediol}| and places in the text
+% "1,2-butanediol" and in the index |*.idx| \newline
+% |\indexentry{chem butanediol@1,2-Butanediol}{1}|.
+%
+% \DescribeMacro{\ib}
+% The command |\ib| (\textbf{both} acronym and chemical index )
+% is used as \newline |\ib{1,2-butanediol}{1,2-BD}| and places in
+% the text
+% "1,2-butanediol (1,2-BD)" and in the index |*.idx|
+%
+% \begin{verbatim}
+% \indexentry{chem butanediol@\begin{crrdxchem}1,2-Butanediol\end{crrdxachem}}{1}
+% \indexentry{acr bd@1,2-BD\nopagebreak!\begin{crrdxacr}1,2-Butanediol\end{crrdxacr}}{1}
+% \end{verbatim}
+%
+% \DescribeMacro{\ig}
+% |\ig| (index general) places both in the index and the text, The macro has two arguments,
+% the first being optional.
+% The first optional argument is appended in the index to the second
+% and is suppressed in the text for |\ig|.
+% |\ig[!unsaturated]{polyester}| places in the text "polyester" and
+% in the index
+% |\indexentry{gen polyester@Polyester!unsaturated}{2}|.
+% To use |\ig| with one argument, |\ig{polyester}| places places in the text "polyester"
+% and in the index |*.idx| |\indexentry{gen polyester@Polyester}{2}|
+%
+% \StopEventually{\PrintIndex}
+%
+% \subsection{Define Yourself an Index Entry Type}
+% The index entry is structured by several variables to have freedom
+% in the output. A typical definition of an index looks like
+%
+% \begin{verbatim}
+% \newcommand{\myindex}[x]{%
+% \bgroup%
+% \def\crrdx@key@prefix{keyprefix}%
+% % here is the key inserted
+% \def\crrdx@key@ostfix{keypostfix}%
+% \def\crrdx@sep@@{@separator@}%
+% \def\crrdx@entry@prefix{entryprefix}%
+% % here is the entry inserted,
+% % with the first letter capitalized
+% \def\crrdx@entry@postfix{entrypostfix}%
+% \def\crrdx@fmt@page{formatpage}%
+% \def\crrdx@sfc@prerun{\crrdx@sfc@prerun@default}
+% \def\crrdx@key@prerun{\crrdx@key@prerun@default}
+% \crrdx@fmt@index@entry{thekey}{thecapitalizedentry}%
+% \egroup%
+% \end{verbatim}
+% In the foregoing definition we give the variables in the order as
+% they are placed by the macro \verb"\crrdx@fmt@index@entry".
+% There are more macros to be defined by the user, as are really
+% necessary in most cases, but this kind of structuring may be
+% helpful to achieve the desired result more easily.
+%
+% Look for the definitions of \verb"\noia", \verb"\noic",
+% \verb"\noig" to have a feeling how to use the variables.
+%
+% \subsection{Auxiliary Commands}
+%
+%
+% \DescribeMacro{\crrdxformatpage} This macro sets a postfix in the index
+% entry for page formatting. Use the command \newline
+% \verb"\crrdxformatpage{chem}{|textit}" \newline to get in the chemical
+% index the page number in italic. To make the page number for a
+% chemical index in boldface, place the command
+% \verb"\crrdxformatpage{chem}{|textbf}". This holds for all subsequent
+% entries, if placed in the main text. However, you can redefine the
+% environment |figure|, by including the |\crrdxformatpage| command to
+% get a special page formatting only there.
+%
+% For example, the definition
+% \begin{verbatim}
+% \renewenvironment{figure}%
+% {\@float{figure}\crrdxformatpage{chem}{|textit}}%
+% {\end@float}%
+% \end{verbatim}
+% causes chemical index entries to be \textit{italic} only in the figure environment,
+% of course, if switched off outside.
+% Do not use |\ic| within the caption, but use |\noic| outside the caption.
+%
+% Similarly use the commands \newline |\crrdxformatpage{acr}{}| and \newline |\crrdxformatpage{gen}{}|,
+% or \newline \verb"\crrdxformatpage{gen}{|textbf}".
+%
+% You can also use your own defined formats.
+%
+% \DescribeMacro{crrdxenvchem} \DescribeMacro{crrdxenvacr} We define empty environments that can be later used
+% for special settings in the index. For example, you can define some characters as active there.
+% In my personal copy I use to define this environment
+% \verb"\selectlanguage{chemical}".
+% The \verb"chemical" package is not available from the \LaTeX\space mirrors.
+% You can download it from \verb"http://www.unileoben.ac.at/~fink/papers/welcome.html"
+% somewhat downwards, in the \LaTeX section.
+%
+% \subsection{Index Sectioning}
+%
+% \begin{macro}{\sectioncrrdx}
+% This macro can be used to place an index heading that is included without
+% numbering into the table of contents. Example:
+%\begin{verbatim*}
+%\index{acr @\sectioncrrdx{Acronyms}\swallow|swallow}%
+%\index{chem @\sectioncrrdx{Chemicals}\swallow|swallow}%
+%\index{gen @\sectioncrrdx{General}\swallow|swallow}%
+%\end{verbatim*}
+% |\swallow| ensures that no comma and page number will come into the entry.
+% Take care to place the section entry at the top of the other entries,
+% by placing one space more behind \verb*+chem +, etc. than in the other
+% related entries.
+% \end{macro}
+%
+% \section{Implementation}
+% \subsection{Main Entries}
+%
+% \begin{macro}{\ic}
+% |\ic{1,2-chemname}| places |1,2-chemname| in the text and
+% places an index entry, formatted as |chem chemname@1,2-chename|.
+% \begin{macrocode}
+\newcommand{\ic}[1]{\begin{crrdxchem}#1\end{crrdxchem}\noic{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\noic}
+% |\noic{1,2-chemname}| places an index entry, formatted as \newline
+% |chem chemname@1,2-chename|.
+% We encapsule the whole macro by grouping.
+% \begin{macrocode}
+\newcommand{\noic}[1]{%
+\bgroup%
+\def\crrdx@key@prefix{chem }%
+\def\crrdx@key@ostfix{}%
+\def\crrdx@sep@@{@}%
+\def\crrdx@entry@prefix{\string\begin{crrdxchem}}%
+\def\crrdx@entry@postfix{\string\end{crrdxchem}}%
+\def\crrdx@fmt@page{\crrdx@fmtpage@chem}%
+\def\crrdx@sfc@prerun{\crrdx@sfc@prerun@default}%
+\def\crrdx@key@prerun{\crrdx@key@prerun@default}%
+\crrdx@fmt@index@entry{#1}{#1}%
+\egroup%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ia} This is the acronym entry.
+% It places the acronym in the text and in the index
+% \begin{macrocode}
+\newcommand{\ia}[2]{#1 \mbox{(#2)}\noia{#1}{#2}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\noia} This places the acronym in the index.
+% \begin{macrocode}%
+\newcommand{\noia}[2]{%
+\bgroup%
+\def\crrdx@key@prefix{acr }%
+\def\crrdx@key@ostfix{}%
+\def\crrdx@sep@@{@}%
+\def\crrdx@entry@prefix{#2\string\nopagebreak!\string\begin{crrdxacr}}%
+\def\crrdx@entry@postfix{\string\end{crrdxacr}}%
+\def\crrdx@fmt@page{\crrdx@fmtpage@acr}%
+\def\crrdx@sfc@prerun{\crrdx@sfc@prerun@default}%
+\def\crrdx@key@prerun{\crrdx@key@prerun@default}%
+\crrdx@fmt@index@entry{#2}{#1}%
+\egroup%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ib \noib}
+% |\ib| and |\noib| are macros to place both a chemical index and an
+% acronym. |\ib| places both the index and the text, whereas |\noib|
+% places only both index entries. The macros have two arguments,
+% e.g., |\ib{1,2-chemname}{CN}|.
+% \begin{macrocode}
+\newcommand{\noib}[2]{\noic{#1}\noia{#1}{#2}}%
+\newcommand{\ib}[2]{\ic{#1}\noia{#1}{#2}}%
+% \end{macrocode}
+% \end{macro}
+% |\ig| and |\noig| are macros to place a general index.
+% \begin{macro}{\ig}
+% \begin{macrocode}
+\newcommand{\ig}[2][]{%
+#2%
+\noig[#1]{#2}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\noig}
+% This macro formats a general index entry.
+% \begin{macrocode}
+\newcommand{\noig}[2][]{%
+\bgroup%
+\def\crrdx@key@prefix{gen }%
+\def\crrdx@key@ostfix{}%
+\def\crrdx@sep@@{@}%
+\def\crrdx@entry@prefix{}%
+\def\crrdx@entry@postfix{#1}%
+\def\crrdx@fmt@page{\crrdx@fmtpage@gen}%
+\def\crrdx@sfc@prerun{\crrdx@sfc@prerun@default}%
+\def\crrdx@key@prerun{\crrdx@key@prerun@default}%
+\crrdx@fmt@index@entry{#2}{#2}%
+\egroup%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Auxiliary Commands}
+% \begin{macro}{\crrdxformatpage} This macro set a postfix for page formatting.
+% \begin{macrocode}
+\newcommand{\crrdxformatpage}[2]{\@namedef{crrdx@fmtpage@#1}{#2}}%
+\crrdxformatpage{chem}{\@empty}%
+\crrdxformatpage{acr}{\@empty}%
+\crrdxformatpage{gen}{\@empty}%
+% \end{macrocode}
+% \end{macro}
+% The |makeindex| program describes the following
+% commands for page formatting:
+% \begin{verbatim}
+% \providecommand{\ii}[1]{{\it#1}}%
+% \providecommand{\bb}[1]{{\bf#1}}%
+% \end{verbatim}
+% e.g., for index boldface pagenumber as last entry in the
+% |\index| command \verb"|bb".
+% However we not use this type,
+% we use rather%
+% \verb"|textit}" or \verb"|textbf".
+% \begin{environment}{crrdxchem} We define an empty environment that can be later used
+% for special chemical language settings.
+% \begin{macrocode}
+\newenvironment{crrdxchem}{}{}%
+% \end{macrocode}
+% \end{environment}
+% \begin{environment}{crrdxacr} We define an empty environment that can be later used
+% for special settings for acronyms.
+% \begin{macrocode}
+\newenvironment{crrdxacr}{}{}%
+% \end{macrocode}
+% \end{environment}
+%
+% \subsection{Formatting the Key}
+%
+% \begin{macro}{\crrdx@key} This macro scans the entry and removes
+% every non-letter character. The key is placed in the index
+% before the |@| as sorting aid.
+% \begin{macrocode}
+\newcommand{\crrdx@key}[1]{%
+\crrdx@key@prerun%
+\edef\crrdx@key@temp{#1}%
+\edef\crrdx@key@var{\@empty}%
+\let\end\@empty%
+\expandafter\crrdx@key@loop\crrdx@key@temp\end%
+}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand{\crrdx@key@loop}[1]{%
+\let\next=\crrdx@key@loop%
+\ifx#1\end\let\next=\relax\fi%
+\ifcat\noexpand#1a\lowercase{\edef\crrdx@key@var{\crrdx@key@var#1}}\fi%
+\next}%
+% \end{macrocode}
+% The following text formats are skipped in the key:
+% \begin{macrocode}
+\newcommand{\crrdx@key@prerun@default}%
+{%
+\renewcommand{\textrm}[1]{{\noexpand\textrm{##1}}}%
+\renewcommand{\textbf}[1]{{\noexpand\textbf{##1}}}%
+\renewcommand{\textsf}[1]{{\noexpand\textsf{##1}}}%
+\renewcommand{\texttt}[1]{{\noexpand\texttt{##1}}}%
+\renewcommand{\textmd}[1]{{\noexpand\textmd{##1}}}%
+\renewcommand{\textit}[1]{{\noexpand\textit{##1}}}%
+\renewcommand{\textsc}[1]{{\noexpand\textsc{##1}}}%
+\renewcommand{\textsl}[1]{{\noexpand\textsl{##1}}}%
+\renewcommand{\textup}[1]{{\noexpand\textup{##1}}}%
+\def~{\string~}%
+}%
+% \end{macrocode}
+% If you want to skip a normal text in the key, then format it as |\textup|.
+% \subsection{Formatting the Entry}
+% \end{macro}
+% \begin{macro}{\crrdx@sfc@prerun}
+% After scanning the key, we want to use the formats again
+% with a different expansion than when doing the key.
+% \begin{macrocode}
+\newcommand{\crrdx@sfc@prerun@default}%
+{%
+\renewcommand{\textrm}{\string\textrm}%
+\renewcommand{\textbf}{\string\textbf}%
+\renewcommand{\textsf}{\string\textsf}%
+\renewcommand{\texttt}{\string\texttt}%
+\renewcommand{\textmd}{\string\textmd}%
+\renewcommand{\textit}{\string\textit}%
+\renewcommand{\textsc}{\string\textsc}%
+\renewcommand{\textsl}{\string\textsl}%
+\renewcommand{\textup}{\string\textup}%
+\def~{\string~}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\crrdx@fmt@index@entry}
+% This macro formats the input into the index.
+% \begin{macrocode}
+\newcommand{\crrdx@fmt@index@entry}[2]{%
+\crrdx@key{#1}%
+\crrdx@sfc{#2}%
+\edef\crrdx@fmt@index@entry@var{%
+\crrdx@key@prefix%
+\crrdx@key@var%
+\crrdx@key@ostfix%
+\crrdx@sep@@%
+\crrdx@entry@prefix%
+\crrdx@sfc@var%
+\crrdx@entry@postfix%
+\crrdx@fmt@page}%
+\index{\crrdx@fmt@index@entry@var}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\crrdx@sfc@loop}
+% We want to capitalize the first letter automatically. We start to declare the loop
+% used in |\crrdx@sfc|.
+% We scan the entry to find the first letter. This we are capitalizing
+% and then we switch to scan what is left over from |#1|.
+% \begin{macrocode}
+\newcommand{\crrdx@sfc@loop}[1]{%
+\crrdx@sfc@prerun%
+\let\next=\crrdx@sfc@loop%
+\ifx#1\end\let\next=\relax\fi%
+\ifcat\noexpand#1a%
+% \end{macrocode}
+% A letter is found
+% \begin{macrocode}
+\uppercase{\edef\crrdx@sfc@var{\crrdx@sfc@var#1}}%
+% \end{macrocode}
+% make it uppercase.
+% We scan now the rest what is left over in |#1| and add it to the |\crrdx@sfc@var|.
+% \begin{macrocode}
+\let\next=\crrdx@sfc@loop@leftover%
+\else%
+\edef\crrdx@sfc@var{\crrdx@sfc@var#1}%
+\fi%
+\next}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\crrdx@sfc@loop@leftover} Collects the stack |#1| after finding a letter.
+% \begin{macrocode}
+\newcommand{\crrdx@sfc@loop@leftover}[1]{%
+\let\next=\crrdx@sfc@loop@leftover%
+\ifx#1\end\let\next=\relax\fi%
+\edef\crrdx@sfc@var{\crrdx@sfc@var#1}%
+\next%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\crrdx@sfc} This is the main macro to \textbf{S}et the \textbf{F}irst letter as \textbf{C}apital, i.e.,
+% what is behind the |@| in the |\index| command.
+% We presume that before a possible space in the entry there is a letter
+% that can be capitalized.
+% \begin{macrocode}
+\newcommand{\crrdx@sfc}[1]{%
+\edef\crrdx@sfc@var{\@empty}%
+\let\end\@empty%
+\crrdx@split{#1}%
+\expandafter\crrdx@sfc@loop\crrdx@beforespace\end%
+\ifx\crrdx@afterspace\@empty\else%
+\edef\crrdx@sfc@var{\crrdx@sfc@var\space\crrdx@afterspace}%
+\fi%
+}%
+% \end{macrocode}
+% \end{macro}
+% Scanning the loop, normally spaces are lost. Therefore we split the
+% entry when a space is there at the first space and glue it together in the final part of
+% |\crrdx@sfc|.
+% \begin{macrocode}
+\def\crrdx@ss#1 #2\stop{\edef\crrdx@beforespace{#1}\edef\crrdx@afterspace{#2}}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand{\crrdx@split}[1]{%
+\edef\test{\@empty}%
+% \end{macrocode}
+% We test for no space there with a space and |\test| as last entry.
+% \begin{macrocode}
+\crrdx@ss#1 \test\stop%
+\ifx\crrdx@afterspace\test%
+% \end{macrocode}
+% there is no space%
+% \begin{macrocode}
+\edef\crrdx@beforespace{#1}\edef\crrdx@afterspace{\@empty}%
+\else%
+% \end{macrocode}
+% there is a space
+% \begin{macrocode}
+\crrdx@ss#1\stop%
+\fi%
+}%
+% \end{macrocode}
+%
+% \subsection{Index Sectioning}
+% We use here |providecommand| because it may be defined in some classes too
+% (at least in classes that I developed for personal use).
+%
+% \begin{macro}{\swallow} Swallows the next item (no operation)
+% \begin{macrocode}
+\providecommand\swallow[1]{\relax}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\sectioncrrdx} Makes an index, added to
+% table of contents at level 1 (section) without number.
+% \begin{macrocode}
+\providecommand{\sectioncrrdx}[1]%
+{\section*{#1}\addcontentsline{toc}{section}{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Clashes Check}
+% \begin{macrocode}
+\AtBeginDocument{ \@ifpackageloaded{index}%
+{\PackageError{corridx}%
+{This package is not compatible with package index}{}}}%
+% \end{macrocode}
+%
+%
+% \PrintChanges
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/corridx/corridx.ins b/macros/latex/contrib/corridx/corridx.ins
new file mode 100644
index 0000000000..45b4ccecaa
--- /dev/null
+++ b/macros/latex/contrib/corridx/corridx.ins
@@ -0,0 +1,54 @@
+%%
+%% Copyright (C) Johannes Fink
+%%
+%% 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/corridx}
+\preamble
+
+This is a generated file.
+Copyright (C) Johannes Fink
+
+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
+
+\generate{\file{corridx.sty}{\from{corridx.dtx}{package}}}
+
+
+\Msg{*********************************************************}
+
+\Msg{*}
+
+\Msg{* To finish the installation you have to move the}
+
+\Msg{* following file into a directory searched by TeX:}
+
+\Msg{*}
+
+\Msg{* \space\space corridx.sty}
+
+\Msg{*}
+
+\Msg{* To produce the documentation run the file corridx.dtx}
+
+\Msg{* through LaTeX.}
+
+\Msg{*********************************************************}
+
+\endbatchfile
diff --git a/macros/latex/contrib/corridx/corridx.pdf b/macros/latex/contrib/corridx/corridx.pdf
new file mode 100644
index 0000000000..6dff93692a
--- /dev/null
+++ b/macros/latex/contrib/corridx/corridx.pdf
Binary files differ
diff --git a/macros/latex/contrib/corridx/corridx.sample.pdf b/macros/latex/contrib/corridx/corridx.sample.pdf
new file mode 100644
index 0000000000..765446f27e
--- /dev/null
+++ b/macros/latex/contrib/corridx/corridx.sample.pdf
Binary files differ
diff --git a/macros/latex/contrib/corridx/corridx.sample.tex b/macros/latex/contrib/corridx/corridx.sample.tex
new file mode 100644
index 0000000000..9f605ed817
--- /dev/null
+++ b/macros/latex/contrib/corridx/corridx.sample.tex
@@ -0,0 +1,129 @@
+\documentclass{book}
+\usepackage{corridx}
+\usepackage{makeidx}
+%\usepackage[chemical,english]{babel}
+\makeindex
+\begin{document}
+
+%\selectlanguage{english}
+
+\tableofcontents
+
+ \chapter{Testing of the Corridx Package}
+
+
+\section{User Defined Commands}
+
+
+
+
+We show now the use of these commands in the following sample
+text. You should look in the original \LaTeX\space file.
+
+Note that we have in the text also the commands
+\begin{verbatim}
+\index{acr @\sectioncrrdx{Index of Acronyms}\swallow|swallow}%
+\index{chem @\sectioncrrdx{Index of Chemicals}\swallow|swallow}%
+\index{gen @\sectioncrrdx{General Index}\swallow|swallow}%
+\end{verbatim}
+
+
+Optionally you can use something like
+\verb"\newcommand{\cis}{\textit{cis}}". It will also work.
+
+
+
+\newcommand{\cis}{\textit{cis}}
+
+
+
+\section{Sample Text}
+
+There are various types of novolak resins with different \ig[
+resins]{ortho} to para ratios of the methylene linkages, \ia{high
+ortho novolak resins}{HON}, \ia{general-purpose novolak
+resins}{GPN} and \ia{high para novolak resins}{HPN}.
+
+The liquid-phase oxidation of cumene to \ib{cumene
+hydroperoxide}{CHP} results in \ic{acetone} and \ic{phenol}. This
+is used for \ic{bisphenol~A}, \ic{bisphenol~B}, \ic{resorcinol},
+\ic{cresol}s, and \ic{xylenol}s. \ic{2-Cyclohexyl-5-methylphenol}
+is used for \ig[!positive]{photoresist}s.
+\ic{\textit{m}-Methoxyphenol}, \ic{2-naphthol}, \ic{cardanol}, and
+\ic{cardol}, are other suitable \ig[!other]{phenols}.
+
+Compounds, such as \ic{$\alpha$-methylstyrene} or
+\ib{\textit{N},\textit{N}-dimethyl formamide}{DMF} are not used.
+Also \ib{1,3-propanediol}{1,3-PD} is not used. Further
+\ib{\cis-3-hexen-1-ol}{3-HXL} or \ib{2-pyridylcarbinol}{PC} are
+not a reasonable solution.
+
+\ic{2,5-Norbornadiene} is also known as
+\ic{bicyclo[2.2.1]hepta-2,5-diene}. Another interesting compound
+is \ic{[\textup{2.2.1.0$^{2,6}$.0$^{3,5}$}]quadricycloheptane}.
+
+
+We switch now \newline \verb"\crrdxformatpage{chem}{|textit}" and
+\newline\verb"\crrdxformatpage{gen}{|textbf}"
+
+\crrdxformatpage{chem}{|textit}%
+\crrdxformatpage{gen}{|textbf}%
+
+and check:
+
+ \ic{1,2-butanediol}
+ \ia{1,2-butanediol}{1,2-BD}
+ \ig[!unsaturated]{polyester}
+
+
+\section{The Sample Text Verbatim}
+
+\begin{verbatim}
+There are various types of novolak resins with different \ig[
+resins]{ortho} to para ratios of the methylene linkages, \ia{high
+ortho novolak resins}{HON}, \ia{general-purpose novolak
+resins}{GPN} and \ia{high para novolak resins}{HPN}.
+
+The liquid-phase oxidation of cumene to \ib{cumene
+hydroperoxide}{CHP} results in \ic{acetone} and \ic{phenol}. This
+is used for \ic{bisphenol~A}, \ic{bisphenol~B}, \ic{resorcinol},
+\ic{cresol}s, and \ic{xylenol}s. \ic{2-Cyclohexyl-5-methylphenol}
+is used for \ig[!positive]{photoresist}s.
+\ic{\textit{m}-Methoxyphenol}, \ic{2-naphthol}, \ic{cardanol}, and
+\ic{cardol}, are other suitable \ig[!other]{phenols}.
+
+Compounds, such as \ic{$\alpha$-methylstyrene} or
+\ib{\textit{N},\textit{N}-dimethyl formamide}{DMF} are not used.
+Also \ib{1,3-propanediol}{1,3-PD} is not used. Further
+\ib{\cis-3-hexen-1-ol}{3-HXL} or \ib{2-pyridylcarbinol}{PC} are
+not a reasonable solution.
+
+\ic{2,5-Norbornadiene} is also known as
+\ic{bicyclo[2.2.1]hepta-2,5-diene}. Another interesting compound
+is \ic{[\textup{2.2.1.0$^{2,6}$.0$^{3,5}$}]quadricycloheptane}.
+
+
+We switch now \newline \verb"\crrdxformatpage{chem}{|textit}" and
+\newline\verb"\crrdxformatpage{gen}{|textbf}"
+
+\crrdxformatpage{chem}{|textit}%
+\crrdxformatpage{gen}{|textbf}%
+
+and check:
+
+ \ic{1,2-butanediol}
+ \ia{1,2-butanediol}{1,2-BD}
+ \ig[!unsaturated]{polyester}
+
+
+\end{verbatim}
+
+
+
+
+\index{acr @\sectioncrrdx{Index of Acronyms}\swallow|swallow}%
+\index{chem @\sectioncrrdx{Index of Chemicals}\swallow|swallow}%
+\index{gen @\sectioncrrdx{General Index}\swallow|swallow}%
+
+ \printindex
+\end{document}
diff --git a/macros/latex/contrib/corridx/corridx.sty b/macros/latex/contrib/corridx/corridx.sty
new file mode 100644
index 0000000000..e267017737
--- /dev/null
+++ b/macros/latex/contrib/corridx/corridx.sty
@@ -0,0 +1,171 @@
+%%
+%% This is file `corridx.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% corridx.dtx (with options: `package')
+%%
+%% This is a generated file.
+%% Copyright (C) Johannes Fink
+%%
+%% 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.
+%%
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{corridx}
+ [2005/05/05 v1.0 Chemical Index]
+\newcommand{\ic}[1]{\begin{crrdxchem}#1\end{crrdxchem}\noic{#1}}%
+\newcommand{\noic}[1]{%
+\bgroup%
+\def\crrdx@key@prefix{chem }%
+\def\crrdx@key@ostfix{}%
+\def\crrdx@sep@@{@}%
+\def\crrdx@entry@prefix{\string\begin{crrdxchem}}%
+\def\crrdx@entry@postfix{\string\end{crrdxchem}}%
+\def\crrdx@fmt@page{\crrdx@fmtpage@chem}%
+\def\crrdx@sfc@prerun{\crrdx@sfc@prerun@default}%
+\def\crrdx@key@prerun{\crrdx@key@prerun@default}%
+\crrdx@fmt@index@entry{#1}{#1}%
+\egroup%
+}%
+\newcommand{\ia}[2]{#1 \mbox{(#2)}\noia{#1}{#2}}%
+\newcommand{\noia}[2]{%
+\bgroup%
+\def\crrdx@key@prefix{acr }%
+\def\crrdx@key@ostfix{}%
+\def\crrdx@sep@@{@}%
+\def\crrdx@entry@prefix{#2\string\nopagebreak!\string\begin{crrdxacr}}%
+\def\crrdx@entry@postfix{\string\end{crrdxacr}}%
+\def\crrdx@fmt@page{\crrdx@fmtpage@acr}%
+\def\crrdx@sfc@prerun{\crrdx@sfc@prerun@default}%
+\def\crrdx@key@prerun{\crrdx@key@prerun@default}%
+\crrdx@fmt@index@entry{#2}{#1}%
+\egroup%
+}%
+\newcommand{\noib}[2]{\noic{#1}\noia{#1}{#2}}%
+\newcommand{\ib}[2]{\ic{#1}\noia{#1}{#2}}%
+\newcommand{\ig}[2][]{%
+#2%
+\noig[#1]{#2}%
+}%
+\newcommand{\noig}[2][]{%
+\bgroup%
+\def\crrdx@key@prefix{gen }%
+\def\crrdx@key@ostfix{}%
+\def\crrdx@sep@@{@}%
+\def\crrdx@entry@prefix{}%
+\def\crrdx@entry@postfix{#1}%
+\def\crrdx@fmt@page{\crrdx@fmtpage@gen}%
+\def\crrdx@sfc@prerun{\crrdx@sfc@prerun@default}%
+\def\crrdx@key@prerun{\crrdx@key@prerun@default}%
+\crrdx@fmt@index@entry{#2}{#2}%
+\egroup%
+}%
+\newcommand{\crrdxformatpage}[2]{\@namedef{crrdx@fmtpage@#1}{#2}}%
+\crrdxformatpage{chem}{\@empty}%
+\crrdxformatpage{acr}{\@empty}%
+\crrdxformatpage{gen}{\@empty}%
+\newenvironment{crrdxchem}{}{}%
+\newenvironment{crrdxacr}{}{}%
+\newcommand{\crrdx@key}[1]{%
+\crrdx@key@prerun%
+\edef\crrdx@key@temp{#1}%
+\edef\crrdx@key@var{\@empty}%
+\let\end\@empty%
+\expandafter\crrdx@key@loop\crrdx@key@temp\end%
+}%
+\newcommand{\crrdx@key@loop}[1]{%
+\let\next=\crrdx@key@loop%
+\ifx#1\end\let\next=\relax\fi%
+\ifcat\noexpand#1a\lowercase{\edef\crrdx@key@var{\crrdx@key@var#1}}\fi%
+\next}%
+\newcommand{\crrdx@key@prerun@default}%
+{%
+\renewcommand{\textrm}[1]{{\noexpand\textrm{##1}}}%
+\renewcommand{\textbf}[1]{{\noexpand\textbf{##1}}}%
+\renewcommand{\textsf}[1]{{\noexpand\textsf{##1}}}%
+\renewcommand{\texttt}[1]{{\noexpand\texttt{##1}}}%
+\renewcommand{\textmd}[1]{{\noexpand\textmd{##1}}}%
+\renewcommand{\textit}[1]{{\noexpand\textit{##1}}}%
+\renewcommand{\textsc}[1]{{\noexpand\textsc{##1}}}%
+\renewcommand{\textsl}[1]{{\noexpand\textsl{##1}}}%
+\renewcommand{\textup}[1]{{\noexpand\textup{##1}}}%
+\def~{\string~}%
+}%
+\newcommand{\crrdx@sfc@prerun@default}%
+{%
+\renewcommand{\textrm}{\string\textrm}%
+\renewcommand{\textbf}{\string\textbf}%
+\renewcommand{\textsf}{\string\textsf}%
+\renewcommand{\texttt}{\string\texttt}%
+\renewcommand{\textmd}{\string\textmd}%
+\renewcommand{\textit}{\string\textit}%
+\renewcommand{\textsc}{\string\textsc}%
+\renewcommand{\textsl}{\string\textsl}%
+\renewcommand{\textup}{\string\textup}%
+\def~{\string~}%
+}%
+\newcommand{\crrdx@fmt@index@entry}[2]{%
+\crrdx@key{#1}%
+\crrdx@sfc{#2}%
+\edef\crrdx@fmt@index@entry@var{%
+\crrdx@key@prefix%
+\crrdx@key@var%
+\crrdx@key@ostfix%
+\crrdx@sep@@%
+\crrdx@entry@prefix%
+\crrdx@sfc@var%
+\crrdx@entry@postfix%
+\crrdx@fmt@page}%
+\index{\crrdx@fmt@index@entry@var}%
+}%
+\newcommand{\crrdx@sfc@loop}[1]{%
+\crrdx@sfc@prerun%
+\let\next=\crrdx@sfc@loop%
+\ifx#1\end\let\next=\relax\fi%
+\ifcat\noexpand#1a%
+\uppercase{\edef\crrdx@sfc@var{\crrdx@sfc@var#1}}%
+\let\next=\crrdx@sfc@loop@leftover%
+\else%
+\edef\crrdx@sfc@var{\crrdx@sfc@var#1}%
+\fi%
+\next}%
+\newcommand{\crrdx@sfc@loop@leftover}[1]{%
+\let\next=\crrdx@sfc@loop@leftover%
+\ifx#1\end\let\next=\relax\fi%
+\edef\crrdx@sfc@var{\crrdx@sfc@var#1}%
+\next%
+}%
+\newcommand{\crrdx@sfc}[1]{%
+\edef\crrdx@sfc@var{\@empty}%
+\let\end\@empty%
+\crrdx@split{#1}%
+\expandafter\crrdx@sfc@loop\crrdx@beforespace\end%
+\ifx\crrdx@afterspace\@empty\else%
+\edef\crrdx@sfc@var{\crrdx@sfc@var\space\crrdx@afterspace}%
+\fi%
+}%
+\def\crrdx@ss#1 #2\stop{\edef\crrdx@beforespace{#1}\edef\crrdx@afterspace{#2}}%
+\newcommand{\crrdx@split}[1]{%
+\edef\test{\@empty}%
+\crrdx@ss#1 \test\stop%
+\ifx\crrdx@afterspace\test%
+\edef\crrdx@beforespace{#1}\edef\crrdx@afterspace{\@empty}%
+\else%
+\crrdx@ss#1\stop%
+\fi%
+}%
+\providecommand\swallow[1]{\relax}%
+\providecommand{\sectioncrrdx}[1]%
+{\section*{#1}\addcontentsline{toc}{section}{#1}}%
+\AtBeginDocument{ \@ifpackageloaded{index}%
+{\PackageError{corridx}%
+{This package is not compatible with package index}{}}}%
+\endinput
+%%
+%% End of file `corridx.sty'.