%%
%% This is file `testidx.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% testidx.dtx  (with options: `testidx.sty,package')
%% 
%%  testidx.dtx
%%  Copyright 2019 Nicola Talbot
%% 
%%  This work may be distributed and/or modified under the
%%  conditions of the LaTeX Project Public License, either version 1.3
%%  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.3 or later is part of all distributions of LaTeX
%%  version 2005/12/01 or later.
%% 
%%  This work has the LPPL maintenance status `maintained'.
%% 
%%  The Current Maintainer of this work is Nicola Talbot.
%% 
%%  This work consists of the files testidx.dtx and testidx.ins and the derived files testidx.sty, testidx-glossaries.sty, testidx-glossaries-diglyphs.tex, testidx-glossaries-nodiglyphs.tex, testidx-glossaries-samples.tex, testidx-glossaries-diglyphs-utf8.bib, testidx-glossaries-markers.bib, testidx-glossaries-mathsym.bib, testidx-glossaries-nodiglyphs-utf8.bib, testidx-glossaries-nodiglyphs.bib, testidx-glossaries-numbers.bib, testidx-glossaries-samples-ascii.bib, testidx-glossaries-samples-utf8.bib, testidx-glossaries-samples.bib.
%% 
%% \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         \~}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{testidx}[2019/09/29 v1.2 (NLCT)]
\RequirePackage{color}
\RequirePackage{ifxetex}
\RequirePackage{ifluatex}
\newcommand*{\@tstidx@ifxelua}[2]{%
  \ifxetex
   #1%
  \else
   \ifluatex
     #1%
   \else
     #2%
   \fi
  \fi
}
\newcommand*{\@@tstidx@ifutfviii}[2]{%
 \@tstidx@ifxelua{#1}
 {%
   \ifx\inputencodingname\@tstidx@utfviii#1\else#2\fi
 }%
}
\newcommand*{\@tstidx@utfviii}{utf8}
\let\@tstidx@ifutfviii\@@tstidx@ifutfviii
\DeclareOption{ascii}{\let\@tstidx@ifutfviii\@secondoftwo}
\DeclareOption{noascii}{\let\@tstidx@ifutfviii\@@tstidx@ifutfviii}
\newcommand*{\tstidxprocessasciisort}{\tstidxprocessasciisortstrip}
\newcommand*{\testidxStripAccents}{%
  \renewcommand*{\tstidxprocessasciisort}{\tstidxprocessasciisortstrip}%
}
\newcommand*{\testidxNoStripAccents}{%
  \renewcommand*{\tstidxprocessasciisort}{\tstidxprocessasciisortnostrip}%
}
\DeclareOption{stripaccents}{\testidxStripAccents}
\DeclareOption{nostripaccents}{\testidxNoStripAccents}
\newcommand{\tstidxquote}{\string"}
\newcommand*{\tstidxumlaut}{%
  \expandafter\@gobble\string\\\tstidxquote\string"}
\newcommand*{\tstidxsortumlaut}{%
  \expandafter\@gobble\string\\\tstidxquote\string"}
\newcommand*{\tstidxsortumlautstrip}{\@firstofone}
\newcommand*{\testidxGermanOn}{%
  \let\@tstidx@ifgerman\@firstoftwo
  \renewcommand{\tstidxquote}{+}%
  \renewcommand*{\tstidxumlaut}{\string"}%
  \renewcommand*{\tstidxsortumlautstrip}{\string"}%
  \renewcommand*{\tstidxsortumlaut}{\string"}%
}
\newcommand*{\testidxGermanOff}{%
  \let\@tstidx@ifgerman\@secondoftwo
  \renewcommand{\tstidxquote}{\string"}%
  \renewcommand*{\tstidxumlaut}{%
  \expandafter\@gobble\string\\\tstidxquote\string"}%
  \renewcommand*{\tstidxsortumlautstrip}{\@firstofone}%
  \renewcommand*{\tstidxsortumlaut}{%
    \expandafter\@gobble\string\\\tstidxquote\string"}%
}
\newcommand*{\@tstidx@ifgerman}[2]{#2}
\DeclareOption{german}{\testidxGermanOn}
\DeclareOption{ngerman}{\testidxGermanOn}
\DeclareOption{nogerman}{\testidxGermanOff}
\@tstidx@ifxelua
{
  \newcommand*{\tstidxprocessutf}{%
    \tstidxprocessutfnosanitize
  }
}
{
  \newcommand*{\tstidxprocessutf}{%
    \tstidxprocessutfsanitize
  }
}
\newcommand*{\@tstidx@ifsanitize}[2]{#1}
\newcommand*{\testidxSanitizeOn}{%
   \let\@tstidx@ifsanitize\@firstoftwo
   \renewcommand*{\tstidxprocessutf}{%
     \tstidxprocessutfsanitize
   }%
}
\newcommand*{\testidxSanitizeOff}{%
   \let\@tstidx@ifsanitize\@secondoftwo
   \renewcommand*{\tstidxprocessutf}{%
     \tstidxprocessutfnosanitize
   }%
}
\newif\iftestidxdiglyphs
\testidxdiglyphsfalse
\DeclareOption{diglyphs}{%
 \@tstidx@ifutfviii{\testidxdiglyphstrue}%
 {%
   \PackageWarning{testidx}{diglyphs option requires UTF-8 support}%
 }
}
\DeclareOption{nodiglyphs}{\testidxdiglyphsfalse}
\newif\iftestidxprefix
\testidxprefixtrue
\DeclareOption{prefix}{\testidxprefixtrue}
\DeclareOption{noprefix}{\testidxprefixfalse}
\DeclareOption{sanitize}{\testidxSanitizeOn}
\DeclareOption{nosanitize}{\testidxSanitizeOff}
\newif\iftestidxverbose
\testidxverbosefalse
\DeclareOption{verbose}{\testidxverbosetrue}
\DeclareOption{noverbose}{\testidxverbosefalse}
\newif\iftestidxshowmarks
\testidxshowmarkstrue
\DeclareOption{showmarks}{\testidxshowmarkstrue}
\DeclareOption{noshowmarks}{\testidxshowmarksfalse}
\DeclareOption{hidemarks}{\testidxshowmarksfalse}
\newif\if@tstidx@use@encaps
\@tstidx@use@encapstrue
\DeclareOption{testencaps}{\@tstidx@use@encapstrue}
\DeclareOption{notestencaps}{\@tstidx@use@encapsfalse}
\ProcessOptions
\AtBeginDocument{%
  \@ifpackageloaded{amsmath}%
  {\let\@tstidx@ifamsmath\@firstoftwo}%
  {\let\@tstidx@ifamsmath\@secondoftwo}%
  \@ifpackageloaded{amssymb}%
  {\let\@tstidx@ifamssymb\@firstoftwo}%
  {\let\@tstidx@ifamssymb\@secondoftwo}%
  \@ifpackageloaded{inputenc}
  {
    \let\@tstidx@if@inputenc\@firstoftwo
  }%
  {%
    \ifxetex
      \let\@tstidx@if@inputenc\@firstoftwo
    \else
      \ifluatex
        \let\@tstidx@if@inputenc\@firstoftwo
      \else
        \let\@tstidx@if@inputenc\@secondoftwo
      \fi
    \fi
  }%
  \ifxetex
    \let\@tstidx@if@notOT@ne\@firstoftwo
  \else
    \ifluatex
      \let\@tstidx@if@notOT@ne\@firstoftwo
    \else
      \newcommand*{\@tstidx@OT@ne}{OT1}%
      \edef\@tstidx@enc{\encodingdefault}%
      \ifx\@tstidx@OT@ne\@tstidx@enc
        \let\@tstidx@if@notOT@ne\@secondoftwo
      \else
        \let\@tstidx@if@notOT@ne\@firstoftwo
      \fi
    \fi
  \fi
}
\newcommand{\tstidxactual}{\string @}
\newcommand{\tstidxlevel}{\string!}
\newcommand{\tstidxencap}{\string|}
\newcommand{\tstidxopenrange}{\string(}
\newcommand{\tstidxcloserange}{\string)}
\newcommand*{\tstidxprocessascii}[2]{%
  {%
    \let\"\tstidxumlaut
    \def\'{\string\'}%
    \def\`{\string\`}%
    \def\.{\string\.}%
    \def\={\string\=}%
    \def\^{\string\^}%
    \def\~{\string\~}%
    \def\c{\string\c}%
    \def\r{\string\r}%
    \def\b{\string\b}%
    \def\d{\string\d}%
    \def\H{\string\H}%
    \def\k{\string\k}%
    \def\u{\string\u}%
    \def\v{\string\v}%
    \def\O{\string\O\space}%
    \def\o{\string\o\space}%
    \def\l{\string\l\space}%
    \def\L{\string\L\space}%
    \def\i{\string\i\space}%
    \def\AA{\string\AA\space}%
    \def\aa{\string\aa\space}%
    \def\ae{\string\ae\space}%
    \def\AE{\string\AE\space}%
    \def\oe{\string\oe\space}%
    \def\OE{\string\OE\space}%
    \def\ss{\string\ss\space}%
    \def\SS{\string\SS\space}%
    \def\th{\string\th\space}%
    \def\TH{\string\TH\space}%
    \def\dh{\string\dh\space}%
    \def\DH{\string\DH\space}%
    \def\dj{\string\dj\space}%
    \def\DJ{\string\DJ\space}%
    \def\ng{\string\ng\space}%
    \def\NG{\string\NG\space}%
    \protected@xdef#1{#2}%
  }%
}
\newcommand*{\tstidxprocessasciisortnostrip}[2]{%
  {%
    \let\"\tstidxsortumlaut
    \protected@xdef#1{#2}%
  }%
}
\newcommand*{\tstidxprocessasciisortstrip}[2]{%
  {%
    \let\"\tstidxsortumlautstrip
    \let\'\@firstofone
    \let\`\@firstofone
    \let\.\@firstofone
    \let\=\@firstofone
    \let\^\@firstofone
    \let\~\@firstofone
    \let\c\@firstofone
    \let\r\@firstofone
    \let\b\@firstofone
    \let\d\@firstofone
    \let\H\@firstofone
    \let\k\@firstofone
    \let\u\@firstofone
    \let\v\@firstofone
    \def\O{O}%
    \def\o{o}%
    \def\l{l}%
    \def\L{L}%
    \def\i{i}%
    \def\AA{A}%
    \def\aa{a}%
    \def\ae{ae}%
    \def\AE{AE}%
    \def\oe{oe}%
    \def\OE{OE}%
    \def\ss{ss}%
    \def\SS{SS}%
    \def\th{th}%
    \def\TH{TH}%
    \def\dh{dh}%
    \def\DH{DH}%
    \def\dj{dj}%
    \def\DJ{DJ}%
    \def\ng{ng}%
    \def\NG{NG}%
    \protected@xdef#1{#2}%
  }%
}
\newcommand*{\tstidxprocessutfsanitize}[2]{%
  \def#1{#2}%
  \@onelevel@sanitize#1%
}
\newcommand*{\tstidxprocessutfnosanitize}[2]{%
  \def#1{#2}%
}
\newcommand*{\tstidxencaptext}[2]{%
  \@ifundefined{#1}%
  {%
    \PackageError{testidx}{Encap value `#1' doesn't correspond
    to a known command}{}%
  }%
  {%
    \csname#1\endcsname{#2}%
  }%
}
\newcommand*{\tstidxtext}[1]{\textcolor[gray]{0.3}{#1}}
\newcommand*{\tstidxencapi}[1]{\textcolor{blue}{#1}}
\newcommand*{\tstidxencapii}[1]{\textcolor{cyan}{#1}}
\newcommand*{\tstidxencapiii}[1]{\textcolor{magenta}{#1}}
\newcommand*{\tstidxensuretext}[1]{%
 \ifmmode
  \@tstidx@ifamsmath{\text{#1}}{\mbox{#1}}%
 \else
  #1%
 \fi
}
\newcommand*{\tstidxmarker}{%
 \tstidxensuretext{\raisebox{.65ex}{.}}%
}
\newcommand*{\tstidxsubmarker}{%
 \tstidxensuretext{\strut\smash{\raisebox{-1.5ex}{\v{}}}}%
}
\newcommand*{\tstidxsubsubmarker}{%
 \tstidxensuretext{\strut\makebox[0pt][l]{\smash{\raisebox{-1ex}{\v{}}}}%
 \smash{\raisebox{-1.5ex}{\v{}}}}%
}
\newcommand*{\tstidxopenmarker}{%
  \tstidxensuretext
  {%
   \setlength{\unitlength}{1ex}%
   \begin{picture}(.5,2)
   \put(\@halfwidth\@gobble,0){\line(0,1){2}}
   \put(0,2){\line(1,0){.5}}
   \end{picture}%
   \hspace{\@halfwidth}%
 }%
}
\newcommand*{\tstidxclosemarker}{%
  \tstidxensuretext
  {%
   \setlength{\unitlength}{1ex}%
   \begin{picture}(.5,2)
   \put(\@halfwidth\@gobble,0){\line(1,0){.5}}
   \put(.5,0){\line(0,1){2}}
   \end{picture}%
   \hspace{\@halfwidth}%
 }%
}
\newcommand*{\tstidxopensubmarker}{%
 \tstidxensuretext
 {%
   \setlength{\unitlength}{1ex}%
   \begin{picture}(.4,1.6)
   \put(\@halfwidth\@gobble,0){\line(0,1){1.6}}
   \put(0,1.6){\line(1,0){.4}}
   \end{picture}%
   \hspace{\@halfwidth}%
 }%
}
\newcommand*{\tstidxclosesubmarker}{%
 \tstidxensuretext
 {%
   \setlength{\unitlength}{1ex}%
   \begin{picture}(.4,1.6)
   \put(\@halfwidth\@gobble,0){\line(1,0){.4}}
   \put(.4,0){\line(0,1){1.6}}
   \end{picture}%
   \hspace{\@halfwidth}%
 }%
}
\newcommand*{\tstidxopensubsubmarker}{%
 \tstidxensuretext
 {%
   \setlength{\unitlength}{1ex}%
   \begin{picture}(.3,1.2)
   \put(\@halfwidth\@gobble,0){\line(0,1){1.2}}
   \put(0,1.2){\line(1,0){.3}}
   \end{picture}%
   \hspace{\@halfwidth}%
 }%
}
\newcommand*{\tstidxclosesubsubmarker}{%
 \tstidxensuretext
 {%
   \setlength{\unitlength}{1ex}%
   \begin{picture}(.3,1.2)
   \put(\@halfwidth\@gobble,0){\line(1,0){.3}}
   \put(.3,0){\line(0,1){1.2}}
   \end{picture}%
   \hspace{\@halfwidth}%
 }%
}
\newcommand*{\tstidxseemarker}{\^{}}
\newcommand*{\tstidxseeref}[3]{\tstidxseemarker
 \marginpar{\strut\raggedright\footnotesize
   \normalcolor\tstidxseemarker#1, \csname#2\endcsname{#3}{}}%
}
\newcommand*{\tstidxsubseemarker}{%
 \tstidxensuretext{\makebox[0pt][l]{\tstidxsubmarker}%
 \tstidxseemarker}%
}
\newcommand*{\tstidxsubseeref}[4]{\tstidxsubseemarker
 \marginpar{\strut\raggedright\footnotesize
   \normalcolor\tstidxsubseemarker#1\tstidxsubseesep#2, \csname#3\endcsname{#4}{}}%
}
\newcommand*{\tstidxsubseesep}{\,$\triangleright$\,}
\newcommand*{\tstindex}{\index}
\newcommand*{\@tstindex}[1]{%
  \iftestidxverbose
   \def\@tstindex@arg{#1}%
   \@onelevel@sanitize\@tstindex@arg
   \testidxverbosefmt{\@tstindex@arg}%
  \fi
  \tstindex{#1}%
}
\newcommand*{\testidxverbosefmt}[1]{%
  \expandafter\def\expandafter\@tstidx@tmp\expandafter{\tstindex}%
  \@onelevel@sanitize\@tstidx@tmp
  \tstidxensuretext{%
    \discretionary{}{}{}%
    {\footnotesize\texttt{\@tstidx@tmp
     \expandafter\@gobble\string\{#1\expandafter\@gobble\string\}}}%
    \discretionary{}{}{}%
  }%
}
\newcommand*{\tstidxqt}[1]{``#1''}
\newcommand*{\tstidxdash}{\,---\,}
\newcommand*{\tstidxfootnote}{\footnote}
\newcommand*{\tstidxfmtpost}[3]{%
  \tstindexpost[#1]{\protect#2{#1}}[#1]{#3}{#2{#1}}%
}
\newcommand*{\tstidxfmtopenpost}[3]{%
  \tstindexopenpost[#1]{\protect#2{#1}}{#3}{#2{#1}}%
}
\newcommand*{\tstidxfmtclosepost}[3]{%
  \tstindexclosepost[#1]{\protect#2{#1}}{#3}{#2{#1}}%
}
\newcommand*{\tstidxfmtpre}[3]{%
  \tstindexpre[#1]{\protect#2{#1}}{#3}{#2{#1}}%
}
\newcommand*{\tstidxfmtopenpre}[3]{%
  \tstindexopenpre[#1]{\protect#2{#1}}{#3}{#2{#1}}%
}
\newcommand*{\tstidxfmtclosepre}[3]{%
  \tstindexclosepre[#1]{\protect#2{#1}}{#3}{#2{#1}}%
}
\newcommand*{\tstidxutf}{%
  \@ifnextchar[{\@tstidxutf}{\@tstidxutf[]}%
}
\def\@tstidxutf[#1]#2#3#4#5#6{%
  \def\@tstidx@text{#2}%
  \@tstidx@ifutfviii
  {%
    \ifx\@tstidx@text\@empty
      \def\@tstidx@text{#4}%
    \fi
    \tstidxprocessutf{\@tstidx@utf}{#4}%
    \protected@edef\@tstidx@doidx{%
      \noexpand#6{\unexpanded\expandafter{\@tstidx@utf}}[#1]{#5}%
        {\@tstidx@text}%
    }%
  }%
  {%
    \ifx\@tstidx@text\@empty
      \def\@tstidx@text{#3}%
    \fi
    \tstidxprocessascii{\@tstidx@ascii}{#3}%
    \tstidxprocessasciisort{\@tstidx@asciisort}{#3}%
    \protected@edef\@tstidx@doidx{%
      \noexpand#6[\unexpanded\expandafter{\@tstidx@asciisort}]%
        {\unexpanded\expandafter{\@tstidx@ascii}}[#1]{#5}%
        {\@tstidx@text}%
    }%
  }%
  \@tstidx@doidx
}
\newcommand*{\tstidxsubutf}[4]{%
  \@ifnextchar[{\@tstidxsubutf{#1}{#2}{#3}{#4}}%
  {\@tstidxsubutf{#1}{#2}{#3}{#4}[]}%
}
\def\@tstidxsubutf#1#2#3#4[#5]#6#7#8{%
  \def\@tstidx@text{#1}%
  \@tstidx@ifutfviii
  {%
    \ifx\@tstidx@text\@empty
      \def\@tstidx@text{#3}%
    \fi
    \tstidxprocessutf{\@tstidx@utf}{#3}%
    \tstidxprocessutf{\@tstidx@subutf}{#6}%
    \protected@edef\@tstidx@doidx{%
      \noexpand#8%
        {\unexpanded\expandafter{\@tstidx@utf}}%
        {\unexpanded\expandafter{\@tstidx@subutf}}%
        [#5]%
        {#7}%
        {\@tstidx@text}%
    }%
  }%
  {%
    \ifx\@tstidx@text\@empty
      \def\@tstidx@text{#2}%
    \fi
    \tstidxprocessascii{\@tstidx@ascii}{#2}%
    \tstidxprocessasciisort{\@tstidx@asciisort}{#2}%
    \tstidxprocessascii{\@tstidx@subascii}{#4}%
    \tstidxprocessasciisort{\@tstidx@subasciisort}{#4}%
    \protected@edef\@tstidx@doidx{%
      \noexpand#8%
        [\unexpanded\expandafter{\@tstidx@asciisort}]%
        {\unexpanded\expandafter{\@tstidx@ascii}}%
        [\unexpanded\expandafter{\@tstidx@subasciisort}]%
        {\unexpanded\expandafter{\@tstidx@subascii}}%
        [#5]%
        {#7}%
        {\@tstidx@text}%
    }%
  }%
  \@tstidx@doidx
}
\newcommand*{\tstidxutfpost}[2][]{%
  \@ifnextchar[{\@tstidxutfpost{#1}{#2}}{\@tstidxutfpost{#1}{#2}[]}%
}
\def\@tstidxutfpost#1#2[#3]#4#5{%
  \tstidxutf[#3]{#1}{#2}{#4}{#5}{\tstindexpost}%
}
\newcommand*{\tstidxutfopenpost}[4][]{%
  \tstidxutf{#1}{#2}{#3}{#4}{\tstindexopenpost}%
}
\newcommand*{\tstidxutfclosepost}[4][]{%
  \tstidxutf{#1}{#2}{#3}{#4}{\tstindexclosepost}%
}
\newcommand*{\tstidxutfpre}[2][]{%
  \@ifnextchar[{\@tstidxutfpre{#1}{#2}}{\@tstidxutfpre{#1}{#2}[#2]}%
}
\def\@tstidxutfpre#1#2[#3]#4#5{%
  \tstidxutf[#3]{#1}{#2}{#4}{#5}{\tstindexpre}%
}
\newcommand*{\tstidxutfopenpre}[4][]{%
  \tstidxutf{#1}{#2}{#3}{#4}{\tstindexopenpre}%
}
\newcommand*{\tstidxutfclosepre}[4][]{%
  \tstidxutf{#1}{#2}{#3}{#4}{\tstindexclosepre}%
}
\newcommand*{\tstidxutfsubpost}[4][]{%
 \@ifnextchar[{\@tstidxutfsubpost{#1}{#2}{#3}{#4}}%
 {\@tstidxutfsubpost{#1}{#2}{#3}{#4}[]}%
}
\def\@tstidxutfsubpost#1#2#3#4[#5]#6#7{%
  \tstidxsubutf{#1}{#2}{#3}{#4}[#5]{#6}{#7}{\tstsubindexpost}%
}
\newcommand*{\tstidxutfsubopenpost}[6][]{%
  \tstidxsubutf{#1}{#2}{#3}{#4}{#5}{#6}{\tstsubindexopenpost}%
}
\newcommand*{\tstidxutfsubclosepost}[6][]{%
  \tstidxsubutf{#1}{#2}{#3}{#4}{#5}{#6}{\tstsubindexclosepost}%
}
\newcommand*{\tstidxutfsubpre}[6][]{%
  \tstidxsubutf{#1}{#2}{#3}{#4}{#5}{#6}{\tstsubindexpre}%
}
\newcommand*{\tstidxutfsubopenpre}[6][]{%
  \tstidxsubutf{#1}{#2}{#3}{#4}{#5}{#6}{\tstsubindexopenpre}%
}
\newcommand*{\tstidxutfsubclosepre}[6][]{%
  \tstidxsubutf{#1}{#2}{#3}{#4}{#5}{#6}{\tstsubindexclosepre}%
}
\newcommand*{\tstidxcsfmt}[1]{\texttt{\char`\\#1}}
\if@tstidx@use@encaps
 \newcommand*{\tstidxcs}[2][tstidxencapi]{\@tstidxcs{#1}{#2}}
\else
 \newcommand*{\tstidxcs}[2][]{\@tstidxcs{#1}{#2}}
\fi
\newcommand*{\@tstidxcs}[2]{\tstidxfmtpost{#2}{\tstidxcsfmt}{#1}}
\if@tstidx@use@encaps
  \newcommand*{\tstidxopencs}[2][tstidxencapi]{%
    \tstidxfmtopenpost{#2}{\tstidxcsfmt}{#1}%
  }
\else
  \newcommand*{\tstidxopencs}[2][]{%
    \tstidxfmtopenpost{#2}{\tstidxcsfmt}{#1}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxclosecs}[2][tstidxencapi]{%
    \tstidxfmtclosepost{#2}{\tstidxcsfmt}{#1}%
  }
\else
  \newcommand*{\tstidxclosecs}[2][]{%
    \tstidxfmtclosepost{#2}{\tstidxcsfmt}{#1}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxencapcsn}[2][tstidxencapi]{%
    \tstindexpost[#2 (#2)]%
    {\texttt{#2} (\protect\tstidxcsfmt{#2})}[#2]{#1}{\texttt{#2}}%
    \tstsubindexpost{encap}[#2]{\texttt{#2}}[encap.#2]{#1}{}%
  }
\else
  \newcommand*{\tstidxencapcsn}[2][]{%
    \tstindexpost[#2 (#2)]%
    {\texttt{#2} (\protect\tstidxcsfmt{#2})}[#2]{#1}{\texttt{#2}}%
    \tstsubindexpost{encap}[#2]{\texttt{#2}}[encap.#2]{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxopencsn}[2][tstidxencapi]{%
    \tstindexopenpost[#2 (#2)]%
    {\texttt{#2} (\protect\tstidxcsfmt{#2})}{#1}{\texttt{#2}}%
  }
\else
  \newcommand*{\tstidxopencsn}[2][]{%
    \tstindexopenpost[#2 (#2)]%
    {\texttt{#2} (\protect\tstidxcsfmt{#2})}{#1}{\texttt{#2}}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxclosecsn}[2][tstidxencapi]{%
    \tstindexclosepost[#2 (#2)]%
    {\texttt{#2} (\protect\tstidxcsfmt{#2})}{#1}{\texttt{#2}}%
  }
\else
  \newcommand*{\tstidxclosecsn}[2][]{%
    \tstindexclosepost[#2 (#2)]%
    {\texttt{#2} (\protect\tstidxcsfmt{#2})}{#1}{\texttt{#2}}%
  }
\fi
\newcommand*{\tstidxenvfmt}[1]{\texttt{#1}}
\if@tstidx@use@encaps
  \newcommand*{\tstidxenv}[2][tstidxencapi]{%
    \tstindexpost[#2 environment]%
    {\protect\tstidxenvfmt{#2} environment}[#2environment]{#1}%
    {\tstidxenvfmt{#2}}%
  }
\else
  \newcommand*{\tstidxenv}[2][]{%
    \tstindexpost[#2 environment]%
    {\protect\tstidxenvfmt{#2} environment}[#2environment]{#1}%
    {\tstidxenvfmt{#2}}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxopenenv}[2][tstidxencapi]{%
    \tstindexopenpost[#2 environment]%
    {\protect\tstidxenvfmt{#2} environment}{#1}%
    {\tstidxenvfmt{#2}}%
  }
\else
  \newcommand*{\tstidxopenenv}[2][]{%
    \tstindexopenpost[#2 environment]%
    {\protect\tstidxenvfmt{#2} environment}{#1}%
    {\tstidxenvfmt{#2}}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxcloseenv}[2][tstidxencapi]{%
    \tstindexclosepost[#2 environment]%
    {\protect\tstidxenvfmt{#2} environment}{#1}%
    {\tstidxenvfmt{#2}}%
  }
\else
  \newcommand*{\tstidxcloseenv}[2][]{%
    \tstindexclosepost[#2 environment]%
    {\protect\tstidxenvfmt{#2} environment}{#1}%
    {\tstidxenvfmt{#2}}%
  }
\fi
\newcommand*{\tstidxappfmt}[1]{\texttt{#1}}
\if@tstidx@use@encaps
  \newcommand*{\tstidxapp}[2][tstidxencapi]{%
    \tstidxfmtpost{#2}{\tstidxappfmt}{#1}%
    \tstsubindexpost{applications}[#2]{\protect\tstidxappfmt{#2}}{#1}{}%
  }
\else
  \newcommand*{\tstidxapp}[2][]{%
    \tstidxfmtpost{#2}{\tstidxappfmt}{#1}%
    \tstsubindexpost{applications}[#2]{\protect\tstidxappfmt{#2}}{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxopenapp}[2][tstidxencapi]{%
    \tstidxfmtopenpost{#2}{\tstidxappfmt}{#1}%
    \tstsubindexopenpost{applications}[#2]{\protect\tstidxappfmt{#2}}{#1}{}%
  }
\else
  \newcommand*{\tstidxopenapp}[2][]{%
    \tstidxfmtopenpost{#2}{\tstidxappfmt}{#1}%
    \tstsubindexopenpost{applications}[#2]{\protect\tstidxappfmt{#2}}{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxcloseapp}[2][tstidxencapi]{%
    \tstidxfmtclosepost{#2}{\tstidxappfmt}{#1}%
    \tstsubindexclosepost{applications}[#2]{\protect\tstidxappfmt{#2}}{#1}{}%
  }
\else
  \newcommand*{\tstidxcloseapp}[2][]{%
    \tstidxfmtclosepost{#2}{\tstidxappfmt}{#1}%
    \tstsubindexclosepost{applications}[#2]{\protect\tstidxappfmt{#2}}{#1}{}%
  }
\fi
\newcommand*{\tstidxappoptfmt}[1]{\texttt{#1}}
\if@tstidx@use@encaps
  \newcommand*{\tstidxappopt}[3][tstidxencapiii]{%
    \tstindexpost[#3 (#2)]%
      {\protect\tstidxappoptfmt{#3} (\protect\tstidxappfmt{#2})}%
      [#3.#2option]{#1}{\tstidxappoptfmt{#3}}%
    \tstsubindexpost[#2]{\protect\tstidxappfmt{#2}}%
      [#3]{\protect\tstidxappoptfmt{#3}}{#1}{}%
    \tstsubsubindexpost{applications}[#2]{\protect\tstidxappfmt{#2}}%
      [#3]{\protect\tstidxappoptfmt{#3}}{#1}{}%
  }
\else
  \newcommand*{\tstidxappopt}[3][]{%
    \tstindexpost[#3 (#2)]%
      {\protect\tstidxappoptfmt{#3} (\protect\tstidxappfmt{#2})}%
      [#3.#2option]{#1}{\tstidxappoptfmt{#3}}%
    \tstsubindexpost[#2]{\protect\tstidxappfmt{#2}}%
      [#3]{\protect\tstidxappoptfmt{#3}}{#1}{}%
    \tstsubsubindexpost{applications}[#2]{\protect\tstidxappfmt{#2}}%
      [#3]{\protect\tstidxappoptfmt{#3}}{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxopenappopt}[3][tstidxencapiii]{%
    \tstsubindexopenpost[#2]{\protect\tstidxappfmt{#2}}%
      [#3]{\protect\tstidxappoptfmt{#3}}{#1}{\tstidxappoptfmt{#3}}%
    \tstsubsubindexopenpost{applications}[#2]%
      {\protect\tstidxappfmt{#2}}%
      [#3]{\protect\tstidxappoptfmt{#3}}{#1}{}%
  }
\else
  \newcommand*{\tstidxopenappopt}[3][]{%
    \tstsubindexopenpost[#2]{\protect\tstidxappfmt{#2}}%
      [#3]{\protect\tstidxappoptfmt{#3}}{#1}{\tstidxappoptfmt{#3}}%
    \tstsubsubindexopenpost{applications}[#2]%
      {\protect\tstidxappfmt{#2}}%
      [#3]{\protect\tstidxappoptfmt{#3}}{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxcloseappopt}[3][tstidxencapiii]{%
    \tstsubindexclosepost[#2]{\protect\tstidxappfmt{#2}}%
      [#3]{\protect\tstidxappoptfmt{#3}}{#1}{\tstidxappoptfmt{#3}}%
    \tstsubsubindexclosepost{applications}[#2]%
      {\protect\tstidxappfmt{#2}}%
      [#3]{\protect\tstidxappoptfmt{#3}}{#1}{}%
  }
\else
  \newcommand*{\tstidxcloseappopt}[3][]{%
    \tstsubindexclosepost[#2]{\protect\tstidxappfmt{#2}}%
      [#3]{\protect\tstidxappoptfmt{#3}}{#1}{\tstidxappoptfmt{#3}}%
    \tstsubsubindexclosepost{applications}[#2]%
      {\protect\tstidxappfmt{#2}}%
      [#3]{\protect\tstidxappoptfmt{#3}}{#1}{}%
  }
\fi
\newcommand*{\tstidxstyfmt}[1]{\texttt{#1}}
\newcommand*{\tstindexstysee}[3]{%
  \tstindexsee[#1package]{\protect\tstidxstyfmt{#1} package}{#2}%
  [#3package]{\protect\tstidxstyfmt{#3}}%
}
\if@tstidx@use@encaps
  \newcommand*{\tstidxsty}[2][tstidxencapiii]{%
    \tstindexpost[#2 package]%
     {\protect\tstidxstyfmt{#2} package}[#2package]{#1}{\tstidxstyfmt{#2}}%
    \tstsubindexpost{packages}[#2 package]%
     {\protect\tstidxstyfmt{#2} package}[packages.#2package]{#1}{}%
  }
\else
  \newcommand*{\tstidxsty}[2][]{%
    \tstindexpost[#2 package]%
     {\protect\tstidxstyfmt{#2} package}[#2package]{#1}{\tstidxstyfmt{#2}}%
    \tstsubindexpost{packages}[#2 package]%
     {\protect\tstidxstyfmt{#2} package}[packages.#2package]{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxopensty}[2][tstidxencapiii]{%
    \tstindexopenpost[#2 package]{\protect\tstidxstyfmt{#2} package}[#2package]{#1}%
      {\tstidxstyfmt{#2}}%
    \tstsubindexopenpost{packages}[#2 package]%
      {\protect\tstidxstyfmt{#2} package}[packages.#2package]{#1}{}%
  }
\else
  \newcommand*{\tstidxopensty}[2][]{%
    \tstindexopenpost[#2 package]{\protect\tstidxstyfmt{#2} package}[#2package]{#1}%
      {\tstidxstyfmt{#2}}%
    \tstsubindexopenpost{packages}[#2 package]%
      {\protect\tstidxstyfmt{#2} package}[packages.#2package]{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxclosesty}[2][tstidxencapiii]{%
    \tstindexclosepost[#2 package]{\protect\tstidxstyfmt{#2} package}%
     [#2package]{#1}%
     {\tstidxstyfmt{#2}}%
    \tstsubindexclosepost{packages}[#2 package]%
     {\protect\tstidxstyfmt{#2} package}[packages.#2package]{#1}{}%
  }
\else
  \newcommand*{\tstidxclosesty}[2][]{%
    \tstindexclosepost[#2 package]{\protect\tstidxstyfmt{#2} package}%
     [#2package]{#1}%
     {\tstidxstyfmt{#2}}%
    \tstsubindexclosepost{packages}[#2 package]%
     {\protect\tstidxstyfmt{#2} package}[packages.#2package]{#1}{}%
  }
\fi
\newcommand*{\tstidxstyoptfmt}[1]{\texttt{#1}}
\if@tstidx@use@encaps
  \newcommand*{\tstidxstyopt}[3][tstidxencapiii]{%
    \tstsubindexpost[#2 package]{\protect\tstidxstyfmt{#2} package}%
      [#3]{\protect\tstidxstyoptfmt{#3}}{#1}{\tstidxstyoptfmt{#3}}%
    \tstsubsubindexpost{packages}[#2 package]%
      {\protect\tstidxstyfmt{#2} package}%
      [#3]{\protect\tstidxstyoptfmt{#3}}{#1}{}%
  }
\else
  \newcommand*{\tstidxstyopt}[3][]{%
    \tstsubindexpost[#2 package]{\protect\tstidxstyfmt{#2} package}%
      [#3]{\protect\tstidxstyoptfmt{#3}}{#1}{\tstidxstyoptfmt{#3}}%
    \tstsubsubindexpost{packages}[#2 package]%
      {\protect\tstidxstyfmt{#2} package}%
      [#3]{\protect\tstidxstyoptfmt{#3}}{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxopenstyopt}[3][tstidxencapiii]{%
    \tstsubindexopenpost[#2 package]{\protect\tstidxstyfmt{#2} package}%
      [#3]{\protect\tstidxstyoptfmt{#3}}{#1}{\tstidxstyoptfmt{#3}}%
    \tstsubsubindexopenpost{packages}[#2 package]%
      {\protect\tstidxstyfmt{#2} package}%
      [#3]{\protect\tstidxstyoptfmt{#3}}{#1}{}%
  }
\else
  \newcommand*{\tstidxopenstyopt}[3][]{%
    \tstsubindexopenpost[#2 package]{\protect\tstidxstyfmt{#2} package}%
      [#3]{\protect\tstidxstyoptfmt{#3}}{#1}{\tstidxstyoptfmt{#3}}%
    \tstsubsubindexopenpost{packages}[#2 package]%
      {\protect\tstidxstyfmt{#2} package}%
      [#3]{\protect\tstidxstyoptfmt{#3}}{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxclosestyopt}[3][tstidxencapiii]{%
    \tstsubindexclosepost[#2 package]{\protect\tstidxstyfmt{#2} package}%
      [#3]{\protect\tstidxstyoptfmt{#3}}{#1}{\tstidxstyoptfmt{#3}}%
    \tstsubsubindexclosepost{packages}[#2 package]%
      {\protect\tstidxstyfmt{#2} package}%
      [#3]{\protect\tstidxstyoptfmt{#3}}{#1}{}%
  }
\else
  \newcommand*{\tstidxclosestyopt}[3][]{%
    \tstsubindexclosepost[#2 package]{\protect\tstidxstyfmt{#2} package}%
      [#3]{\protect\tstidxstyoptfmt{#3}}{#1}{\tstidxstyoptfmt{#3}}%
    \tstsubsubindexclosepost{packages}[#2 package]%
      {\protect\tstidxstyfmt{#2} package}%
      [#3]{\protect\tstidxstyoptfmt{#3}}{#1}{}%
  }
\fi
\newcommand*{\tstidxword}[2][]{%
  \tstindexpost{#2}{#1}{#2}%
}
\newcommand*{\tstidxwordpl}[1][]{\@tstidxwordpl{#1}}
\newcommand*{\@tstidxwordpl}[2]{\tstidxword[#1]{#2}s}
\newcommand*{\tstidxopenword}[2][]{%
  \tstindexopenpost{#2}{#1}{#2}%
}
\newcommand*{\tstidxcloseword}[2][]{%
  \tstindexclosepost{#2}{#1}{#2}%
}
\newcommand*{\tstidxsubword}[3][]{%
  \tstsubindexpost{#2}{#3}{#1}{#3}%
}
\if@tstidx@use@encaps
  \newcommand*{\tstidxnumber}[2][tstidxencapiii]{%
    \tstindexpost{#2}{#1}{#2}%
  }
\else
  \newcommand*{\tstidxnumber}[2][]{%
    \tstindexpost{#2}{#1}{#2}%
  }
\fi
\newcommand*{\tstidxphrase}[2][]{%
  \tstindexpre{#2}{#1}{#2}%
}
\newcommand*{\tstidxphrasepl}[1][]{\@tstidxphrasepl{#1}}
\newcommand*{\@tstidxphrasepl}[2]{\tstidxphrase[#1]{#2}s}
\newcommand*{\tstidxopenphrase}[2][]{%
  \tstindexopenpre{#2}{#1}{#2}%
}
\newcommand*{\tstidxclosephrase}[2][]{%
  \tstindexclosepre{#2}{#1}{#2}%
}
\newcommand*{\tstidxartphrase}[3][]{%
  \tstindexpost{#3, #2}[#3]{#1}{#2 #3}%
}
\newcommand*{\tstidxopenartphrase}[3][]{%
  \tstindexopenpost{#3, #2}[#3]{#1}{#2 #3}%
}
\newcommand*{\tstidxcloseartphrase}[3][]{%
  \tstindexclosepost{#3, #2}[#3]{#1}{#2 #3}%
}
\newcommand*{\tstidxperson}[3][]{%
  \tstidxutfperson[#1]{#2}{#3}{#2}{#3}%
}
\newcommand*{\tstidxopenperson}[3][]{%
  \tstidxutfopenperson[#1]{#2}{#3}{#2}{#3}%
}
\newcommand*{\tstidxcloseperson}[3][]{%
  \tstidxutfcloseperson[#1]{#2}{#3}{#2}{#3}%
}
\newcommand*{\tstidxutfperson}[3][]{%
  \@ifnextchar[{\@tstidxutfperson{#1}{#2}{#3}}%
  {\@tstidxutfperson{#1}{#2}{#3}[#2#3]}%
}
\def\@tstidxutfperson#1#2#3[#4]#5#6{%
  \@tstidx@ifutfviii
  {%
    \tstidxutfpost[#5 #6]{#3, #2}[#4]{#6, #5}{#1}%
  }%
  {%
    \tstidxutfpost[#2 #3]{#3, #2}[#4]{#6, #5}{#1}%
  }%
  \tstidxutfsubpost[\relax]{people}{people}{#3, #2}[people.#4]{#6, #5}{#1}%
}
\newcommand*{\tstidxutfopenperson}[3][]{%
  \@ifnextchar[{\@tstidxutfopenperson{#1}{#2}{#3}}%
  {\@tstidxutfopenperson{#1}{#2}{#3}[#2#3]}%
}
\def\@tstidxutfopenperson#1#2#3[#4]#5#6{%
  \@tstidx@ifutfviii
  {%
    \tstidxutfopenpost[#5 #6]{#3, #2}[#4]{#6, #5}{#1}%
  }%
  {%
    \tstidxutfopenpost[#2 #3]{#3, #2}[#4]{#6, #5}{#1}%
  }%
}
\newcommand*{\tstidxutfcloseperson}[3][]{%
  \@ifnextchar[{\@tstidxutfcloseperson{#1}{#2}{#3}}%
  {\@tstidxutfcloseperson{#1}{#2}{#3}[#2#3]}%
}
\def\@tstidxutfcloseperson#1#2#3[#4]#5#6{%
  \@tstidx@ifutfviii
  {%
    \tstidxutfclosepost[#5 #6]{#3, #2}[#4]{#6, #5}{#1}%
  }%
  {%
    \tstidxutfclosepost[#2 #3]{#3, #2}[#4]{#6, #5}{#1}%
  }%
}
\newcommand*{\tstidxsym}[2][]{%
  \@ifnextchar[{\@tstidxsym{#1}{#2}}{\@tstidxsym{#1}{#2}[#2]}%
}
\def\@tstidxsym#1#2[#3]#4{%
  \tstindexpost[#2]{\protect#4}[#3]{#1}{#4}%
}
\newcommand*{\tstidxopensym}[2][]{%
  \@ifnextchar[{\@tstidxopensym{#1}{#2}}{\@tstidxopensym{#1}{#2}[]}%
}
\def\@tstidxopensym#1#2[#3]#4{%
  \tstindexopenpost[#2]{\protect#4}[#3]{#1}{#4}%
}
\newcommand*{\tstidxclosesym}[2][]{%
  \@ifnextchar[{\@tstidxclosesym{#1}{#2}}{\@tstidxclosesym{#1}{#2}[]}%
}
\def\@tstidxclosesym#1#2[#3]#4{%
  \tstindexclosepost[#2]{\protect#4}[#3]{#1}{#4}%
}
\newcommand{\tstidxindexmarker}[1]{%
 \iftestidxprefix
   \expandafter\tstidxsym\expandafter
    {\tstidxindexmarkerprefix#1}[#1]{\csname#1\endcsname
     \protect\space (\protect\tstidxcsfmt{#1})}%
 \else
   \tstidxsym{#1}[#1]{\csname#1\endcsname
     \protect\space (\protect\tstidxcsfmt{#1})}%
 \fi
}
\newcommand*{\tstidxindexmarkerprefix}{<}
\if@tstidx@use@encaps
  \newcommand*{\tstidxmath}[2][tstidxencapii]{%
    \@ifnextchar[{\@tstidxmath{#1}{#2}}{\@tstidxmath{#1}{#2}[#2]}%
  }
\else
  \newcommand*{\tstidxmath}[2][]{%
    \@ifnextchar[{\@tstidxmath{#1}{#2}}{\@tstidxmath{#1}{#2}[#2]}%
  }
\fi
\def\@tstidxmath#1#2[#3]#4{%
  \tstindexpre[#2]{$#4$}[#3]{#1}{#4}%
}
\if@tstidx@use@encaps
  \newcommand*{\tstidxmathsym}[2][tstidxencapii]{%
    \@ifnextchar[{\@tstidxmathsym{#1}{#2}}{\@tstidxmathsym{#1}{#2}[#2]}%
  }
\else
  \newcommand*{\tstidxmathsym}[2][]{%
    \@ifnextchar[{\@tstidxmathsym{#1}{#2}}{\@tstidxmathsym{#1}{#2}[#2]}%
  }
\fi
\def\@tstidxmathsym#1#2[#3]#4{%
 \iftestidxprefix
  \expandafter\tstindexpre\expandafter
   [\tstidxmathsymprefix#2]{$#4$}[#3]{#1}{#4}%
 \else
  \tstindexpre[#2]{$#4$}[#3]{#1}{#4}%
 \fi
}
\newcommand*{\tstidxmathsymprefix}{>}
\newcommand*{\tstidxutfword}[2][]{%
  \@ifnextchar[{\@tstidxutfword{#1}{#2}}{\@tstidxutfword{#1}{#2}[#2]}%
}
\def\@tstidxutfword#1#2[#3]#4{%
  \tstidxutfpost{#2}[#3]{#4}{#1}%
}
\newcommand*{\tstidxgphword}[2][]{%
  \@ifnextchar[{\@tstidxgphword{#1}{#2}}{\@tstidxgphword{#1}{#2}[#2]}%
}
\def\@tstidxgphword#1#2[#3]#4#5{%
  \iftestidxdiglyphs
    \tstidxutfpost{#2}[#3]{#5}{#1}%
  \else
    \tstidxutfpost{#2}[#3]{#4}{#1}%
  \fi
}
\newcommand*{\tstidxopenutf}[4][]{%
  \tstidxutfopenpost{#2}{#3}{#1}%
}
\newcommand*{\tstidxcloseutf}[4][]{%
  \tstidxutfclosepost{#2}{#3}{#1}%
}
\newcommand*{\tstidxutfphrase}[2][]{%
  \@ifnextchar[{\@tstidxutfphrase{#1}{#2}}{\@tstidxutfphrase{#1}{#2}[#2]}%
}
\def\@tstidxutfphrase#1#2[#3]#4{%
  \tstidxutfpre{#2}[#3]{#4}{#1}%
}
\newcommand*{\tstidxopenutfphrase}[3][]{%
  \tstidxutfopenpre{#2}{#3}{#1}%
}
\newcommand*{\tstidxcloseutfphrase}[3][]{%
  \tstidxutfclosepre{#2}{#3}{#1}%
}
\newcommand*{\tstidxplace}[2][]{%
  \tstidxutfplace[#1]{#2}{#2}%
}
\newcommand*{\tstidxutfplace}[2][]{%
  \@ifnextchar[{\@tstidxutfplace{#1}{#2}}{\@tstidxutfplace{#1}{#2}[#2]}%
}
\def\@tstidxutfplace#1#2[#3]#4{%
  \tstidxutfpost{#2}[#3]{#4}{#1}%
  \tstidxutfsubpost[\relax]{places}{places}{#2}[places.#3]{#4}{#1}%
}
\newcommand*{\tstidxartplace}[3][]{%
  \tstindexpost{#3, #2}[#3]{#1}{#2 #3}%
  \tstidxutfsubpost[\relax]{places}{places}{#3, #2}[places.#3]{#3, #2}{#1}%
}
\newcommand*{\tstidxbookfmt}[1]{\emph{#1}}
\if@tstidx@use@encaps
  \newcommand*{\tstidxbook}[2][tstidxencapii]{%
    \tstindexpost[#2]{\protect\tstidxbookfmt{#2}}[#2]{#1}{\tstidxbookfmt{#2}}%
    \tstsubindexpost{books}[#2]{\protect\tstidxbookfmt{#2}}{#1}{}%
  }
\else
  \newcommand*{\tstidxbook}[2][]{%
    \tstindexpost[#2]{\protect\tstidxbookfmt{#2}}[#2]{#1}{\tstidxbookfmt{#2}}%
    \tstsubindexpost{books}[#2]{\protect\tstidxbookfmt{#2}}{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxopenbook}[2][tstidxencapii]{%
    \tstindexopenpost[#2]{\protect\tstidxbookfmt{#2}}{#1}{\tstidxbookfmt{#2}}%
    \tstsubindexopenpost{books}[#2]{\protect\tstidxbookfmt{#2}}{#1}{}%
  }
\else
  \newcommand*{\tstidxopenbook}[2][]{%
    \tstindexopenpost[#2]{\protect\tstidxbookfmt{#2}}{#1}{\tstidxbookfmt{#2}}%
    \tstsubindexopenpost{books}[#2]{\protect\tstidxbookfmt{#2}}{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxclosebook}[2][tstidxencapii]{%
    \tstindexclosepost[#2]{\protect\tstidxbookfmt{#2}}{#1}{\tstidxbookfmt{#2}}%
    \tstsubindexclosepost{books}[#2]{\protect\tstidxbookfmt{#2}}{#1}{}%
  }
\else
  \newcommand*{\tstidxclosebook}[2][]{%
    \tstindexclosepost[#2]{\protect\tstidxbookfmt{#2}}{#1}{\tstidxbookfmt{#2}}%
    \tstsubindexclosepost{books}[#2]{\protect\tstidxbookfmt{#2}}{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxartbook}[3][tstidxencapii]{%
    \tstindexpost[#3, #2]{\protect\tstidxbookfmt{#3, #2}}[#3]{#1}{\tstidxbookfmt{#2 #3}}%
    \tstsubindexpost{books}[#3, #2]{\protect\tstidxbookfmt{#3, #2}}[books.#3]{#1}{}%
  }
\else
  \newcommand*{\tstidxartbook}[3][]{%
    \tstindexpost[#3, #2]{\protect\tstidxbookfmt{#3, #2}}[#3]{#1}{\tstidxbookfmt{#2 #3}}%
    \tstsubindexpost{books}[#3, #2]{\protect\tstidxbookfmt{#3,
#2}}[books.#3]{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxopenartbook}[3][tstidxencapii]{%
    \tstindexopenpost[#3, #2]{\protect\tstidxbookfmt{#3, #2}}{#1}%
      {\tstidxbookfmt{#2 #3}}%
    \tstsubindexopenpost{books}[#3, #2]{\protect\tstidxbookfmt{#3, #2}}[books.#3]{#1}{}%
  }
\else
  \newcommand*{\tstidxopenartbook}[3][]{%
    \tstindexopenpost[#3, #2]{\protect\tstidxbookfmt{#3, #2}}{#1}%
      {\tstidxbookfmt{#2 #3}}%
    \tstsubindexopenpost{books}[#3, #2]{\protect\tstidxbookfmt{#3, #2}}[books.#3]{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxcloseartbook}[3][tstidxencapii]{%
    \tstindexclosepost[#3, #2]{\protect\tstidxbookfmt{#3, #2}}{#1}%
      {\tstidxbookfmt{#2 #3}}%
    \tstsubindexclosepost{books}[#3, #2]{\protect\tstidxbookfmt{#3, #2}}[books.#3]{#1}{}%
  }
\else
  \newcommand*{\tstidxcloseartbook}[3][]{%
    \tstindexclosepost[#3, #2]{\protect\tstidxbookfmt{#3, #2}}{#1}%
      {\tstidxbookfmt{#2 #3}}%
    \tstsubindexclosepost{books}[#3, #2]{\protect\tstidxbookfmt{#3, #2}}[books.#3]{#1}{}%
  }
\fi
\newcommand*{\tstidxfilmfmt}[1]{\emph{#1}}
\if@tstidx@use@encaps
  \newcommand*{\tstidxfilm}[2][tstidxencapii]{%
    \tstindexpost[#2]{\protect\tstidxfilmfmt{#2}}{#1}{\tstidxfilmfmt{#2}}%
    \tstsubindexpost{films}[#2]{\protect\tstidxfilmfmt{#2}}{#1}{}%
  }
\else
  \newcommand*{\tstidxfilm}[2][]{%
    \tstindexpost[#2]{\protect\tstidxfilmfmt{#2}}{#1}{\tstidxfilmfmt{#2}}%
    \tstsubindexpost{films}[#2]{\protect\tstidxfilmfmt{#2}}{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxopenfilm}[2][tstidxencapii]{%
    \tstindexopenpost[#2]{\protect\tstidxfilmfmt{#2}}{#1}{\tstidxfilmfmt{#2}}%
    \tstsubindexopenpost{films}[#2]{\protect\tstidxfilmfmt{#2}}{#1}{}%
  }
\else
  \newcommand*{\tstidxopenfilm}[2][]{%
    \tstindexopenpost[#2]{\protect\tstidxfilmfmt{#2}}{#1}{\tstidxfilmfmt{#2}}%
    \tstsubindexopenpost{films}[#2]{\protect\tstidxfilmfmt{#2}}{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxclosefilm}[2][tstidxencapii]{%
    \tstindexclosepost[#2]{\protect\tstidxfilmfmt{#2}}{#1}{\tstidxfilmfmt{#2}}%
    \tstsubindexclosepost{films}[#2]{\protect\tstidxfilmfmt{#2}}{#1}{}%
  }
\else
  \newcommand*{\tstidxclosefilm}[2][]{%
    \tstindexclosepost[#2]{\protect\tstidxfilmfmt{#2}}{#1}{\tstidxfilmfmt{#2}}%
    \tstsubindexclosepost{films}[#2]{\protect\tstidxfilmfmt{#2}}{#1}{}%
  }
\fi
\if@tstidx@use@encaps
  \newcommand*{\tstidxartfilm}[3][tstidxencapii]{%
    \tstindexpost[#3, #2]{\protect\tstidxfilmfmt{#3, #2}}[#3]{#1}%
      {\tstidxfilmfmt{#2 #3}}%
    \tstsubindexpost{films}[#3, #2]{\protect\tstidxfilmfmt{#3,
#2}}[films.#3]{#1}{}%
  }
\else
  \newcommand*{\tstidxartfilm}[3][]{%
    \tstindexpost[#3, #2]{\protect\tstidxfilmfmt{#3, #2}}[#3]{#1}%
      {\tstidxfilmfmt{#2 #3}}%
    \tstsubindexpost{films}[#3, #2]{\protect\tstidxfilmfmt{#3, #2}}[films.#3]{#1}{}%
  }
\fi
\newcommand*{\tstindexpost}[2][]{%
  \@ifnextchar[{\@tstindexpost{#1}{#2}}{\@tstindexpost{#1}{#2}[]}%
}%
\def\@tstindexpost#1#2[#3]#4#5{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
   \def\@tstidx@entry{#2}%
  \else
   \toks@{#1}%
   \edef\@tstidx@entry{\the\toks@\tstidxactual}%
   \expandafter\def\expandafter\@tstidx@entry\expandafter{\@tstidx@entry#2}%
  \fi
  \ifx\@tstidx@encap\@empty
   \iftestidxshowmarks
     \tstidxtext{#5\tstidxmarker}%
   \else
     #5%
   \fi
  \else
   \iftestidxshowmarks
     \tstidxtext{\tstidxencaptext{#4}{#5\tstidxmarker}}%
   \else
     #5%
   \fi
   \expandafter\toks@\expandafter{\@tstidx@entry}%
   \edef\@tstidx@entry{\the\toks@\tstidxencap#4}%
  \fi
  \expandafter\@tstindex\expandafter{\@tstidx@entry}%
}
\newcommand*{\tstindexopenpost}[2][]{%
  \@ifnextchar[{\@tstindexopenpost{#1}{#2}}{\@tstindexopenpost{#1}{#2}[]}}%
\def\@tstindexopenpost#1#2[#3]#4#5{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
   \def\@tstidx@entry{#2}%
  \else
   \toks@{#1}%
   \edef\@tstidx@entry{\the\toks@\tstidxactual}%
   \expandafter\def\expandafter\@tstidx@entry\expandafter{\@tstidx@entry#2}%
  \fi
  \ifx\@tstidx@encap\@empty
   \iftestidxshowmarks
     \tstidxtext{#5\tstidxopenmarker}%
   \else
     #5%
   \fi
   \expandafter\toks@\expandafter{\@tstidx@entry}%
   \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxopenrange}%
  \else
   \iftestidxshowmarks
     \tstidxtext{\tstidxencaptext{#4}{#5\tstidxopenmarker}}%
   \else
     #5%
   \fi
   \expandafter\toks@\expandafter{\@tstidx@entry}%
   \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxopenrange#4}%
  \fi
  \expandafter\@tstindex\expandafter{\@tstidx@entry}%
}
\newcommand*{\tstindexclosepost}[2][]{%
  \@ifnextchar[{\@tstindexclosepost{#1}{#2}}{\@tstindexclosepost{#1}{#2}[]}}%
\def\@tstindexclosepost#1#2[#3]#4#5{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
   \def\@tstidx@entry{#2}%
  \else
   \toks@{#1}%
   \edef\@tstidx@entry{\the\toks@\tstidxactual}%
   \expandafter\def\expandafter\@tstidx@entry\expandafter{\@tstidx@entry#2}%
  \fi
  \ifx\@tstidx@encap\@empty
   \iftestidxshowmarks
     \tstidxtext{#5\tstidxclosemarker}%
   \else
     #5%
   \fi
   \expandafter\toks@\expandafter{\@tstidx@entry}%
   \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxcloserange}%
  \else
   \iftestidxshowmarks
     \tstidxtext{\tstidxencaptext{#4}{#5\tstidxclosemarker}}%
   \else
     #5%
   \fi
   \expandafter\toks@\expandafter{\@tstidx@entry}%
   \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxcloserange#4}%
  \fi
  \expandafter\@tstindex\expandafter{\@tstidx@entry}%
}
\newcommand*{\tstindexpre}[2][]{%
  \@ifnextchar[{\@tstindexpre{#1}{#2}}{\@tstindexpre{#1}{#2}[]}}%
\def\@tstindexpre#1#2[#3]#4#5{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
   \def\@tstidx@entry{#2}%
  \else
   \toks@{#1}%
   \edef\@tstidx@entry{\the\toks@\tstidxactual}%
   \expandafter\def\expandafter\@tstidx@entry\expandafter{\@tstidx@entry#2}%
  \fi
  \ifx\@tstidx@encap\@empty
   \expandafter\@tstindex\expandafter{\@tstidx@entry}%
   \iftestidxshowmarks
     \tstidxtext{\tstidxmarker#5}%
   \else
     #5%
   \fi
  \else
   \expandafter\toks@\expandafter{\@tstidx@entry}%
   \edef\@tstidx@entry{\the\toks@\tstidxencap#4}%
   \expandafter\@tstindex\expandafter{\@tstidx@entry}%
   \iftestidxshowmarks
     \tstidxtext{\tstidxencaptext{#4}{\tstidxmarker#5}}%
   \else
     #5%
   \fi
  \fi
}
\newcommand*{\tstindexopenpre}[2][]{%
  \@ifnextchar[{\@tstindexopenpre{#1}{#2}}{\@tstindexopenpre{#1}{#2}[]}}%
\def\@tstindexopenpre#1#2[#3]#4#5{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
   \def\@tstidx@entry{#2}%
  \else
   \toks@{#1}%
   \edef\@tstidx@entry{\the\toks@\tstidxactual}%
   \expandafter\def\expandafter\@tstidx@entry\expandafter{\@tstidx@entry#2}%
  \fi
  \ifx\@tstidx@encap\@empty
   \expandafter\toks@\expandafter{\@tstidx@entry}%
   \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxopenrange}%
   \expandafter\@tstindex\expandafter{\@tstidx@entry}%
   \iftestidxshowmarks
     \tstidxtext{\tstidxopenmarker#5}%
   \else
     #5%
   \fi
  \else
   \expandafter\toks@\expandafter{\@tstidx@entry}%
   \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxopenrange#4}%
   \expandafter\@tstindex\expandafter{\@tstidx@entry}%
   \iftestidxshowmarks
     \tstidxtext{\tstidxencaptext{#4}{\tstidxopenmarker#5}}%
   \else
     #5%
   \fi
  \fi
}
\newcommand*{\tstindexclosepre}[2][]{%
  \@ifnextchar[{\@tstindexclosepre{#1}{#2}}{\@tstindexclosepre{#1}{#2}[]}}%
\def\@tstindexclosepre#1#2[#3]#4#5{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
   \def\@tstidx@entry{#2}%
  \else
   \toks@{#1}%
   \edef\@tstidx@entry{\the\toks@\tstidxactual}%
   \expandafter\def\expandafter\@tstidx@entry\expandafter{\@tstidx@entry#2}%
  \fi
  \ifx\@tstidx@encap\@empty
   \expandafter\toks@\expandafter{\@tstidx@entry}%
   \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxcloserange}%
   \expandafter\@tstindex\expandafter{\@tstidx@entry}%
   \iftestidxshowmarks
     \tstidxtext{\tstidxclosemarker#5}%
   \else
     #5%
   \fi
  \else
   \expandafter\toks@\expandafter{\@tstidx@entry}%
   \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxcloserange#4}%
   \expandafter\@tstindex\expandafter{\@tstidx@entry}%
   \iftestidxshowmarks
     \tstidxtext{\tstidxencaptext{#4}{\tstidxclosemarker#5}}%
   \else
     #5%
   \fi
  \fi
}
\newcommand*{\@tstidxseeencap}[1]{%
 \@ifundefined{tstidx@#1@encapname}{#1}{\csname tstidx@#1@encapname\endcsname}%
}
\newcommand*{\tstidxSetSeeEncap}[1]{%
 \@namedef{tstidx@see@encapname}{#1}%
}
\newcommand*{\tstidxSetSeeAlsoEncap}[1]{%
 \@namedef{tstidx@seealso@encapname}{#1}%
}
\newcommand*{\tstindexsee}[2][]{%
  \@ifnextchar[{\@tstindex@see{#1}{#2}}{\@tstindex@see{#1}{#2}[]}}%
\def\@tstindex@see#1#2[#3]#4{%
  \@ifnextchar[{\@tstindexsee{#1}{#2}{#3}{#4}}{\@tstindexsee{#1}{#2}{#3}{#4}[]}}%
\def\@tstindexsee#1#2#3#4[#5]#6{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@entry{#2}%
  \ifx\@tstidx@sort\@empty
    \@tstidx@ifutfviii
    {%
      \tstidxprocessutf{\@tstidx@entry}{#2}%
    }%
    {%
      \def\@tstidx@sort{#2}%
      \tstidxprocessasciisort{\@tstidx@sort}{#2}%
      \ifx\@tstidx@sort\@tstidx@entry
      \else
        \expandafter\toks@\expandafter{\@tstidx@sort}%
        \edef\@tstidx@entry{\the\toks@\tstidxactual}%
        \expandafter\def\expandafter\@tstidx@entry\expandafter
          {\@tstidx@entry#2}%
      \fi
    }%
  \else
    \@tstidx@ifutfviii
    {%
      \expandafter\tstidxprocessutf\expandafter\@tstidx@sort
        \expandafter{\@tstidx@sort}%
    }%
    {%
      \expandafter\tstidxprocessasciisort\expandafter\@tstidx@sort
        \expandafter{\@tstidx@sort}%
    }%
    \expandafter\toks@\expandafter{\@tstidx@sort}%
    \edef\@tstidx@entry{\the\toks@\tstidxactual}%
    \expandafter\def\expandafter\@tstidx@entry\expandafter{\@tstidx@entry#2}%
  \fi
  \expandafter\toks@\expandafter{\@tstidx@entry}%
  \protected@edef\@tstidx@entry{\the\toks@\tstidxencap
   \@tstidxseeencap{#4}{#6}}%
  \expandafter\@tstindex\expandafter{\@tstidx@entry}%
  \iftestidxshowmarks
    \tstidxseeref{#2}{#4}{#6}%
  \fi
}
\newcommand*{\tstindexutfsee}[2][]{%
  \@tstindexutfsee{#1}{#2}%
}
\newcommand*{\@tstindexutfsee}[2]{%
  \@ifnextchar[{\@tst@indexutfsee{#1}{#2}}{\@tst@indexutfsee{#1}{#2}[]}%
}
\def\@tst@indexutfsee#1#2[#3]#4{%
  \@ifnextchar[{\@@tst@indexutfsee{#1}{#2}{#3}{#4}}%
  {\@@tst@indexutfsee{#1}{#2}{#3}{#4}[]}%
}
\def\@@tst@indexutfsee#1#2#3#4[#5]#6{%
  \@ifnextchar[{\@@tst@@indexutfsee{#1}{#2}{#3}{#4}{#5}{#6}}%
  {\@@tst@@indexutfsee{#1}{#2}{#3}{#4}{#5}{#6}[]}%
}
\def\@@tst@@indexutfsee#1#2#3#4#5#6[#7]#8#9{%
 \@tstidx@ifutfviii
 {%
   \@tstindexsee{#3}{#4}{#5}{#6}[#7]{#9}%
 }%
 {%
   \@tstindexsee{#1}{#2}{#5}{#6}[#7]{#8}%
 }%
}
\newcommand*{\tstsubindexpost}[2][]{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@term{#2}%
  \@tst@subindexpost
}
\newcommand*{\@tst@subindexpost}[2][]{%
 \@ifnextchar[{\@tstidx@subindexpost{#1}{#2}}{\@tstidx@subindexpost{#1}{#2}[]}}%
\def\@tstidx@subindexpost#1#2[#3]#4#5{%
  \def\@tstidx@subsort{#1}%
  \def\@tstidx@subterm{#2}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
    \let\@tstidx@entry\@tstidx@term
  \else
     \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@sort}\tstidxactual
      \unexpanded\expandafter{\@tstidx@term}}%
  \fi
  \ifx\@tstidx@subsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subterm}}%
  \fi
  \ifx\@tstidx@encap\@empty
    \iftestidxshowmarks
      \tstidxtext{#5\tstidxsubmarker}%
    \else
      #5%
    \fi
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
  \else
    \iftestidxshowmarks
      \tstidxtext{\tstidxencaptext{#4}{#5\tstidxsubmarker}}%
    \else
      #5%
    \fi
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap#4}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
  \fi
}
\newcommand*{\tstsubindexopenpost}[2][]{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@term{#2}%
  \@tst@subindexopenpost
}
\newcommand*{\@tst@subindexopenpost}[2][]{%
 \@ifnextchar[{\@tstidx@subindexopenpost{#1}{#2}}{\@tstidx@subindexopenpost{#1}{#2}[]}}%
\def\@tstidx@subindexopenpost#1#2[#3]#4#5{%
  \def\@tstidx@subsort{#1}%
  \def\@tstidx@subterm{#2}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
    \let\@tstidx@entry\@tstidx@term
  \else
     \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@sort}\tstidxactual
      \unexpanded\expandafter{\@tstidx@term}}%
  \fi
  \ifx\@tstidx@subsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subterm}}%
  \fi
  \ifx\@tstidx@encap\@empty
    \iftestidxshowmarks
      \tstidxtext{#5\tstidxopensubmarker}%
    \else
      #5%
    \fi
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxopenrange}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
  \else
    \iftestidxshowmarks
      \tstidxtext{\tstidxencaptext{#4}{#5\tstidxopensubmarker}}%
    \else
      #5%
    \fi
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxopenrange#4}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
  \fi
}
\newcommand*{\tstsubindexclosepost}[2][]{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@term{#2}%
  \@tst@subindexclosepost
}
\newcommand*{\@tst@subindexclosepost}[2][]{%
 \@ifnextchar[{\@tstidx@subindexclosepost{#1}{#2}}{\@tstidx@subindexclosepost{#1}{#2}[]}}%
\def\@tstidx@subindexclosepost#1#2[#3]#4#5{%
  \def\@tstidx@subsort{#1}%
  \def\@tstidx@subterm{#2}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
    \let\@tstidx@entry\@tstidx@term
  \else
     \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@sort}\tstidxactual
      \unexpanded\expandafter{\@tstidx@term}}%
  \fi
  \ifx\@tstidx@subsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subterm}}%
  \fi
  \ifx\@tstidx@encap\@empty
    \iftestidxshowmarks
      \tstidxtext{#5\tstidxclosesubmarker}%
    \else
      #5%
    \fi
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxcloserange}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
  \else
    \iftestidxshowmarks
      \tstidxtext{\tstidxencaptext{#4}{#5\tstidxclosesubmarker}}%
    \else
      #5%
    \fi
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxcloserange#4}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
  \fi
}
\newcommand*{\tstsubindexpre}[2][]{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@term{#2}%
  \@tst@subindexpre
}
\newcommand*{\@tst@subindexpre}[2][]{%
 \@ifnextchar[{\@tstidx@subindexpre{#1}{#2}}{\@tstidx@subindexpre{#1}{#2}[]}}%
\def\@tstidx@subindexpre#1#2[#3]#4#5{%
  \def\@tstidx@subsort{#1}%
  \def\@tstidx@subterm{#2}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
    \let\@tstidx@entry\@tstidx@term
  \else
     \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@sort}\tstidxactual
      \unexpanded\expandafter{\@tstidx@term}}%
  \fi
  \ifx\@tstidx@subsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subterm}}%
  \fi
  \ifx\@tstidx@encap\@empty
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
    \iftestidxshowmarks
      \tstidxtext{#5\tstidxsubmarker}%
    \else
      #5%
    \fi
  \else
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap#4}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
    \iftestidxshowmarks
      \tstidxtext{\tstidxencaptext{#4}{#5\tstidxsubmarker}}%
    \else
      #5%
    \fi
  \fi
}
\newcommand*{\tstsubindexopenpre}[2][]{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@term{#2}%
  \@tst@subindexopenpre
}
\newcommand*{\@tst@subindexopenpre}[2][]{%
 \@ifnextchar[{\@tstidx@subindexopenpre{#1}{#2}}{\@tstidx@subindexopenpre{#1}{#2}[]}}%
\def\@tstidx@subindexopenpre#1#2[#3]#4#5{%
  \def\@tstidx@subsort{#1}%
  \def\@tstidx@subterm{#2}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
    \let\@tstidx@entry\@tstidx@term
  \else
     \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@sort}\tstidxactual
      \unexpanded\expandafter{\@tstidx@term}}%
  \fi
  \ifx\@tstidx@subsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subterm}}%
  \fi
  \ifx\@tstidx@encap\@empty
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxopenrange}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
    \iftestidxshowmarks
      \tstidxtext{#5\tstidxopensubmarker}%
    \else
      #5%
    \fi
  \else
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxopenrange#4}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
    \iftestidxshowmarks
      \tstidxtext{\tstidxencaptext{#4}{#5\tstidxopensubmarker}}%
    \else
      #5%
    \fi
  \fi
}
\newcommand*{\tstsubindexclosepre}[2][]{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@term{#2}%
  \@tst@subindexclosepre
}
\newcommand*{\@tst@subindexclosepre}[2][]{%
 \@ifnextchar[{\@tstidx@subindexclosepre{#1}{#2}}{\@tstidx@subindexclosepre{#1}{#2}[]}}%
\def\@tstidx@subindexclosepre#1#2[#3]#4#5{%
  \def\@tstidx@subsort{#1}%
  \def\@tstidx@subterm{#2}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
    \let\@tstidx@entry\@tstidx@term
  \else
     \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@sort}\tstidxactual
      \unexpanded\expandafter{\@tstidx@term}}%
  \fi
  \ifx\@tstidx@subsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subterm}}%
  \fi
  \ifx\@tstidx@encap\@empty
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxcloserange}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
    \iftestidxshowmarks
      \tstidxtext{#5\tstidxclosesubmarker}%
    \else
      #5%
    \fi
  \else
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxcloserange#4}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
    \iftestidxshowmarks
      \tstidxtext{\tstidxencaptext{#4}{#5\tstidxclosesubmarker}}%
    \else
      #5%
    \fi
  \fi
}
\newcommand*{\tstindexsubsee}[2][]{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@term{#2}%
  \ifx\@tstidx@sort\@empty
   \def\@tstidx@entry{#2}%
  \else
   \toks@{#1}%
   \edef\@tstidx@entry{\the\toks@\tstidxactual}%
   \expandafter\def\expandafter\@tstidx@entry\expandafter{\@tstidx@entry#2}%
  \fi
  \@tstindexsubsee
}
\newcommand*{\@tstindexsubsee}[2][]{%
 \@ifnextchar[{\@tstidx@index@subsee{#1}{#2}}%
  {\@tstidx@index@subsee{#1}{#2}[]}%
}%
\def\@tstidx@index@subsee#1#2[#3]#4{%
 \@ifnextchar[{\@tstidx@indexsubsee{#1}{#2}{#3}{#4}}%
  {\@tstidx@indexsubsee{#1}{#2}{#3}{#4}[]}%
}
\def\@tstidx@indexsubsee#1#2#3#4[#5]#6{%
  \def\@tstidx@subsort{#1}%
  \ifx\@tstidx@subsort\@empty
   \toks@{#2}%
   \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}%
     \tstidxlevel\the\toks@}%
  \else
   \toks@{#1}%
   \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}%
     \tstidxlevel\the\toks@\tstidxactual}%
   \expandafter\def\expandafter\@tstidx@entry\expandafter{\@tstidx@entry#2}%
  \fi
  \expandafter\toks@\expandafter{\@tstidx@entry}%
  \edef\@tstidx@entry{\the\toks@\tstidxencap
     \@tstidxseeencap{#4}{#6}}%
  \expandafter\@tstindex\expandafter{\@tstidx@entry}%
  \iftestidxshowmarks
    \tstidxsubseeref{\@tstidx@term}{#2}{#4}{#6}%
  \fi
}
\newcommand*{\tstsubsubindexpost}[2][]{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@term{#2}%
  \@tst@subsubindexpost
}
\newcommand*{\@tst@subsubindexpost}[2][]{%
  \def\@tstidx@subsort{#1}%
  \def\@tstidx@subterm{#2}%
  \@@tst@subsubindexpost
}
\newcommand*{\@@tst@subsubindexpost}[2][]{%
 \@ifnextchar[{\@@tstidx@subsubindexpost{#1}{#2}}%
 {\@@tstidx@subsubindexpost{#1}{#2}[]}}%
\def\@@tstidx@subsubindexpost#1#2[#3]#4#5{%
  \def\@tstidx@subsubsort{#1}%
  \def\@tstidx@subsubterm{#2}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
    \let\@tstidx@entry\@tstidx@term
  \else
     \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@sort}\tstidxactual
      \unexpanded\expandafter{\@tstidx@term}}%
  \fi
  \ifx\@tstidx@subsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subterm}}%
  \fi
  \ifx\@tstidx@subsubsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsubterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsubsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subsubterm}}%
  \fi
  \ifx\@tstidx@encap\@empty
    \iftestidxshowmarks
      \tstidxtext{#5\tstidxsubsubmarker}%
    \else
      #5%
    \fi
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
  \else
    \iftestidxshowmarks
      \tstidxtext{\tstidxencaptext{#4}{#5\tstidxsubsubmarker}}%
    \else
      #5%
    \fi
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap#4}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
  \fi
}
\newcommand*{\tstsubsubindexopenpost}[2][]{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@term{#2}%
  \@tst@subsubindexopenpost
}
\newcommand*{\@tst@subsubindexopenpost}[2][]{%
  \def\@tstidx@subsort{#1}%
  \def\@tstidx@subterm{#2}%
  \@@tst@subsubindexopenpost
}
\newcommand*{\@@tst@subsubindexopenpost}[2][]{%
 \@ifnextchar[{\@@tstidx@subsubindexopenpost{#1}{#2}}%
 {\@@tstidx@subsubindexopenpost{#1}{#2}[]}%
}%

\def\@@tstidx@subsubindexopenpost#1#2[#3]#4#5{%
  \def\@tstidx@subsubsort{#1}%
  \def\@tstidx@subsubterm{#2}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
    \let\@tstidx@entry\@tstidx@term
  \else
     \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@sort}\tstidxactual
      \unexpanded\expandafter{\@tstidx@term}}%
  \fi
  \ifx\@tstidx@subsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subterm}}%
  \fi
  \ifx\@tstidx@subsubsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsubterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsubsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subsubterm}}%
  \fi
  \ifx\@tstidx@encap\@empty
    \iftestidxshowmarks
      \tstidxtext{#5\tstidxopensubmarker}%
    \else
      #5%
    \fi
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxopenrange}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
  \else
    \iftestidxshowmarks
      \tstidxtext{\tstidxencaptext{#4}{#5\tstidxopensubmarker}}%
    \else
      #5%
    \fi
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxopenrange#4}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
  \fi
}
\newcommand*{\tstsubsubindexclosepost}[2][]{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@term{#2}%
  \@tst@subsubindexclosepost
}
\newcommand*{\@tst@subsubindexclosepost}[2][]{%
  \def\@tstidx@subsort{#1}%
  \def\@tstidx@subterm{#2}%
  \@@tst@subsubindexclosepost
}
\newcommand*{\@@tst@subsubindexclosepost}[2][]{%
 \@ifnextchar[{\@@tstidx@subsubindexclosepost{#1}{#2}}%
 {\@@tstidx@subsubindexclosepost{#1}{#2}[]}%
}%

\def\@@tstidx@subsubindexclosepost#1#2[#3]#4#5{%
  \def\@tstidx@subsubsort{#1}%
  \def\@tstidx@subsubterm{#2}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
    \let\@tstidx@entry\@tstidx@term
  \else
     \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@sort}\tstidxactual
      \unexpanded\expandafter{\@tstidx@term}}%
  \fi
  \ifx\@tstidx@subsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subterm}}%
  \fi
  \ifx\@tstidx@subsubsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsubterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsubsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subsubterm}}%
  \fi
  \ifx\@tstidx@encap\@empty
    \iftestidxshowmarks
      \tstidxtext{#5\tstidxclosesubmarker}%
    \else
      #5%
    \fi
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxcloserange}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
  \else
    \iftestidxshowmarks
      \tstidxtext{\tstidxencaptext{#4}{#5\tstidxclosesubmarker}}%
    \else
      #5%
    \fi
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxcloserange#4}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
  \fi
}
\newcommand*{\tstsubsubindexpre}[2][]{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@term{#2}%
  \@tst@subsubindexpre
}
\newcommand*{\@tst@subsubindexpre}[2][]{%
  \def\@tstidx@subsort{#1}%
  \def\@tstidx@subterm{#2}%
  \@@tst@subsubindexpre
}
\newcommand*{\@@tst@subsubindexpre}[2][]{%
 \@ifnextchar[{\@@tstidx@subsubindexpre{#1}{#2}}%
 {\@@tstidx@subsubindexpre{#1}{#2}[]}%
}%

\def\@@tstidx@subsubindexpre#1#2[#3]#4#5{%
  \def\@tstidx@subsubsort{#1}%
  \def\@tstidx@subsubterm{#2}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
    \let\@tstidx@entry\@tstidx@term
  \else
     \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@sort}\tstidxactual
      \unexpanded\expandafter{\@tstidx@term}}%
  \fi
  \ifx\@tstidx@subsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subterm}}%
  \fi
  \ifx\@tstidx@subsubsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsubterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsubsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subsubterm}}%
  \fi
  \ifx\@tstidx@encap\@empty
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
    \iftestidxshowmarks
      \tstidxtext{#5\tstidxsubsubmarker}%
    \else
      #5%
    \fi
  \else
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap#4}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
    \iftestidxshowmarks
      \tstidxtext{\tstidxencaptext{#4}{#5\tstidxsubsubmarker}}%
    \else
      #5%
    \fi
  \fi
}
\newcommand*{\tstsubsubindexopenpre}[2][]{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@term{#2}%
  \@tst@subsubindexopenpre
}
\newcommand*{\@tst@subsubindexopenpre}[2][]{%
  \def\@tstidx@subsort{#1}%
  \def\@tstidx@subterm{#2}%
  \@@tst@subsubindexopenpre
}
\newcommand*{\@@tst@subsubindexopenpre}[2][]{%
 \@ifnextchar[{\@@tstidx@subsubindexopenpre{#1}{#2}}%
 {\@@tstidx@subsubindexopenpre{#1}{#2}[]}%
}%
\def\@@tstidx@subsubindexopenpre#1#2[#3]#4#5{%
  \def\@tstidx@subsubsort{#1}%
  \def\@tstidx@subsubterm{#2}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
    \let\@tstidx@entry\@tstidx@term
  \else
     \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@sort}\tstidxactual
      \unexpanded\expandafter{\@tstidx@term}}%
  \fi
  \ifx\@tstidx@subsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subterm}}%
  \fi
  \ifx\@tstidx@subsubsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsubterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsubsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subsubterm}}%
  \fi
  \ifx\@tstidx@encap\@empty
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxopenrange}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
    \iftestidxshowmarks
      \tstidxtext{#5\tstidxopensubmarker}%
    \else
      #5%
    \fi
  \else
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxopenrange#4}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
    \iftestidxshowmarks
      \tstidxtext{\tstidxencaptext{#4}{#5\tstidxopensubmarker}}%
    \else
      #5%
    \fi
  \fi
}
\newcommand*{\tstsubsubindexclosepre}[2][]{%
  \def\@tstidx@sort{#1}%
  \def\@tstidx@term{#2}%
  \@tst@subsubindexclosepre
}
\newcommand*{\@tst@subsubindexclosepre}[2][]{%
  \def\@tstidx@subsort{#1}%
  \def\@tstidx@subterm{#2}%
  \@@tst@subsubindexclosepre
}
\newcommand*{\@@tst@subsubindexclosepre}[2][]{%
 \@ifnextchar[{\@@tstidx@subsubindexclosepre{#1}{#2}}%
 {\@@tstidx@subsubindexclosepre{#1}{#2}[]}%
}%

\def\@@tstidx@subsubindexclosepre#1#2[#3]#4#5{%
  \def\@tstidx@subsubsort{#1}%
  \def\@tstidx@subsubterm{#2}%
  \def\@tstidx@encap{#4}%
  \ifx\@tstidx@sort\@empty
    \let\@tstidx@entry\@tstidx@term
  \else
     \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@sort}\tstidxactual
      \unexpanded\expandafter{\@tstidx@term}}%
  \fi
  \ifx\@tstidx@subsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subterm}}%
  \fi
  \ifx\@tstidx@subsubsort\@empty
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsubterm}}%
  \else
    \edef\@tstidx@entry{\unexpanded\expandafter{\@tstidx@entry}\tstidxlevel
      \unexpanded\expandafter{\@tstidx@subsubsort}\tstidxactual
        \unexpanded\expandafter{\@tstidx@subsubterm}}%
  \fi
  \ifx\@tstidx@encap\@empty
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxcloserange}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
    \iftestidxshowmarks
      \tstidxtext{#5\tstidxclosesubmarker}%
    \else
      #5%
    \fi
  \else
    \expandafter\toks@\expandafter{\@tstidx@entry}%
    \edef\@tstidx@entry{\the\toks@\tstidxencap\tstidxcloserange#4}%
    \expandafter\@tstindex\expandafter{\@tstidx@entry}%
    \iftestidxshowmarks
      \tstidxtext{\tstidxencaptext{#4}{#5\tstidxclosesubmarker}}%
    \else
      #5%
    \fi
  \fi
}
\newcommand*{\testidx}{%
  \@ifstar
  {%
    \def\@testidx@block@sep{\space}%
    \@testidx
  }%
  {%
    \def\@testidx@block@sep{\tstidxdefblocksep}%
    \@testidx
  }%
}
\newcommand*{\@testidx}[1][1-\tstidxmaxblocks]{%
  \@for\@tidx@block@range:=#1\do{%
    \ifx\@tidx@block@range\@empty
    \else
     \expandafter\@test@idx\@tidx@block@range-\@nil-\@nil\@end@test@idx
    \fi
  }%
}
\newcommand{\tstidxdefblocksep}{\par}
\newcommand*{\tstidxprefixblock}[1]{{\scriptsize\number#1.}\ }
\newcount\@tidx@parctr
\def\@test@idx#1-#2-#3\@end@test@idx{%
  \def\@tst@idx@arg{#1}%
  \ifx\@tst@idx@arg\@nnil
   \PackageError{testidx}{Invalid range `\@tidx@block@range'}{}%
  \else
    \def\@tst@idx@arg{#2}%
    \ifx\@tst@idx@arg\@empty
      \PackageError{testidx}{Invalid range `\@tidx@block@range'}{}%
    \else
      \ifx\@tst@idx@arg\@nnil
        \@@test@idx{#1}%
      \else
        \ifnum#2<#1\relax
          \@tidx@parctr=\numexpr#1+1\relax
          \loop
            \advance\@tidx@parctr by -\@ne
            \@@test@idx\@tidx@parctr
          \ifnum\@tidx@parctr>#2
          \repeat
        \else
          \@tidx@parctr=\numexpr#1-1\relax
          \loop
            \advance\@tidx@parctr by \@ne
            \@@test@idx\@tidx@parctr
          \ifnum\@tidx@parctr<#2
          \repeat
        \fi
      \fi
    \fi
  \fi
}
\newcommand*{\@@test@idx}[1]{%
 \@ifundefined{@tidx@par@\romannumeral#1}%
 {%
   \PackageError{testidx}{No such test block `\number#1'}%
   {Blocks are numbered from 1 to \number\tstidxmaxblocks}%
 }%
 {%
    \tstidxprefixblock{#1}%
    \csname @tidx@par@\romannumeral#1\endcsname
    \@testidx@block@sep
 }%
}
\newcount\tstidxmaxblocks
\newcommand*{\tstidxnewblock}{
  \@ifstar\s@tstidxnewblock\@tstidxnewblock
}
\newcommand{\s@tstidxnewblock}[2]{%
  \@tstidxnewblock{#2}%
  \edef#1{\number\tstidxmaxblocks}%
}
\newcommand{\@tstidxnewblock}[1]{%
  \advance\tstidxmaxblocks by \@ne
  \expandafter
    \newcommand\csname @tidx@par@\romannumeral\tstidxmaxblocks\endcsname{#1}%
}
\tstidxnewblock
{%
 This is a~sample block of text designed to test
 \tstidxcs{index}, the
 \if@tstidx@use@encaps
  \tstidxword[tstidxencapii]{layout}
 \else
  \tstidxword{layout}
 \fi
  of the
 \if@tstidx@use@encaps
  \tstidxword[tstidxencapii]{index}
 \else
  \tstidxword{index}
 \fi
 (\tstidxenv{theindex} environment) and any
 \if@tstidx@use@encaps
   \tstidxphrase[tstidxencapii]{indexing application},
 \else
   \tstidxphrase{indexing application},
 \fi
 such as
 \tstidxapp{makeindex} or
 \tstidxapp{xindy}. This text is just
 \tstidxword{filler} (produced using \tstidxcs{testidx} provided
 by the \tstidxopensty{testidx} package) to
 pad\tstindexsee{padding}{seealso}{filler} out
 the document with instances of \tstidxcs{index} interspersed
 throughout. You can use it, for \tstidxword{example}, to test an indexing
 package, such as \tstidxsty{makeidx} or \tstidxsty{imakeidx}, or to
 test a \tstidxapp{makeindex} style file or \tstidxapp{xindy} module.
 You can find out more
 information from the \tstidxsty{testidx} user manual, which
 can be accessed using the \tstidxapp{texdoc} application.
 This block starts a range that is closed in block~\@tidx@close@testidxsty.%
}
\tstidxnewblock
{%
 The \tstidxsty{testidx} package doesn't make any
 modifications to \tstidxcs{index} or \tstidxenv{theindex}. All
 \tstidxphrase{visual effects} in this \tstidxphrase{dummy text} are produced
 using markup commands provided solely for this \tstidxword{purpose} that
 internally use \tstidxcs{index} or, more specifically, internally use
 \tstidxcs{tstindex}, which is defined to use \tstidxcs{index} (so you can
 redefine \tstidxcs{tstindex} if you have multiple indexes). This package
 doesn't attempt to \tstidxword{parse} or otherwise \tstidxword{interpret} the
 \tstidxword{argument} of \tstidxcs{index}, nor does it attempt to
 produce a well-designed index. Its purpose is to help you
 \tstidxword{test} your chosen \tstidxword{design}, which is easier to do with a
 relatively small test \tstidxword{document}, than with a large
 \tstidxword{book}. The \tstidxphrase{dummy text} is intended to produce an
 \tstidxword{index} that is at least three pages long to allow you
 to test the page headers and footers in a two-sided document.
 You can hide the visual effects with the
 \tstidxstyopt{testidx}{hidemarks} package option.%
 \iftestidxshowmarks
 \else
  \space (It seems you already have this option set.
  Remove it or use \tstidxstyopt{testidx}{showmarks} to show them
  again.)%
 \fi
}
\tstidxnewblock
{%
 The actual place where the \tstidxcs{index} command occurs in this
 \if@tstidx@use@encaps
   \tstidxphrase[tstidxencapiii]{dummy text}
 \else
   \tstidxphrase{dummy text}
 \fi
 is marked with the symbol
 \tstidxindexmarker{tstidxmarker} if there is no \tstidxword{range} or
 \tstidxphrase{cross-reference}. The
 \if@tstidx@use@encaps
   \tstidxword[tstidxencapi]{word}
 \else
   \tstidxword{word}
 \fi
 or
 \if@tstidx@use@encaps
   \tstidxword[tstidxencapii]{phrase}
 \else
   \tstidxword{phrase}
 \fi
 adjacent to this \tstidxword{marker} is
 the text being indexed.\tstidxfootnote{The \tstidxcs{index} command may
 occur before or after the \tstidxword{word} or \tstidxword{phrase} being
 indexed in this
 \if@tstidx@use@encaps
   \tstidxphrase[tstidxencapiii]{dummy text},
 \else
   \tstidxphrase{dummy text},
 \fi
 but there's no
 space between the \tstidxword{marker} and the term being indexed. Always
 remember not to surround your \tstidxcs{index} usage with spaces. Keep it
 flush against the term being indexed and only have a space on one
 side. Incidentally, this \tstidxword{footnote} text was produced
 using the command \tstidxcs{tstidxfootnote}, which you can
 redefined as required. (It defaults to just \tstidxcs{footnote}.)}
 A sub-entry is indicated with the symbol
 \tstidxindexmarker{tstidxsubmarker} and a sub-sub-entry is
 indicated with the symbol \tstidxindexmarker{tstidxsubsubmarker}.
 If an \tstidxword{encap} value is provided, both the
 \if@tstidx@use@encaps
  \tstidxword[tstidxencapiii]{text}
 \else
  \tstidxword{text}
 \fi
 and the
 \if@tstidx@use@encaps
   \tstidxword[tstidxencapii]{marker}
 \else
   \tstidxword{marker}
 \fi
 are typeset in the \tstidxword{argument} of the corresponding command.
 (The text occurring in the document is also typeset within the argument of
 \tstidxcs{tstidxtext}. The default value is to use a dark grey, but since the
 default values for the \tstidxword{predefined} encaps used in this text all
 change the colour, the dark grey will only apply where the encap hasn't
 been set.) There are three \tstidxword{encap} values used throughout this
 \tstidxphrase{dummy text} (unless you've used the
 \tstidxstyopt{testidx}{notestencaps} package option):
 \if@tstidx@use@encaps
  \tstidxencapcsn[tstidxencapi]{tstidxencapi},
 \else
  \tstidxencapcsn{tstidxencapi},
 \fi
 \if@tstidx@use@encaps
   \tstidxencapcsn[tstidxencapii]{tstidxencapii}
 \else
   \tstidxencapcsn{tstidxencapii}
 \fi
 and
 \if@tstidx@use@encaps
   \tstidxencapcsn[tstidxencapiii]{tstidxencapiii}.
 \else
   \tstidxencapcsn{tstidxencapiii}.
 \fi
 (The default values use \tstidxcs{textcolor}, so you might want to use the
 \tstidxstyopt{hyperref}{hidelinks} option
 if you want to use the \tstidxsty{hyperref} package.) A cross-referenced
 entry (using \tstidxencapcsn{see} or \tstidxencapcsn{seealso}) is identified
 using the \tstidxword{marker}  \tstidxindexmarker{tstidxseemarker}
 and the cross-referenced information is displayed as
 a \tstidxphrase{marginal note} by default, with the term being indexed
 followed by the \tstidxword{cross-reference}.
 For example,
 \tstidxword{lyuk}\tstindexsee{lyuk}{seealso}{digraph} has
 the marker \tstidxmarker\ to show that the word \tstidxqt{lyuk} was
 indexed followed by the marker \tstidxseemarker\ to show that
 a cross-reference to \tstidxword{digraph} has also been indexed
 (with the details shown in the margin).
 A sub-level
 \tstidxword{cross-reference} is identified with the \tstidxword{marker}
 \tstidxindexmarker{tstidxsubseemarker} and the marginal note
 displays the main term followed by the sub-term (separated by the
 symbol \tstidxsubseesep).  The \tstidxword{marker} used for the start of
 a range is \tstidxindexmarker{tstidxopenmarker} and the
 \tstidxword{marker} used for the end of
 a range is \tstidxindexmarker{tstidxclosemarker}
 unless the entry is a sub-level, in which case the
 \tstidxword{marker} for the start of the range is
 \tstidxindexmarker{tstidxopensubmarker}
 and the \tstidxword{marker} used for the end of a range is
 \tstidxindexmarker{tstidxclosesubmarker}, or for a sub-sub-level
 \tstidxindexmarker{tstidxopensubsubmarker} and
 \tstidxindexmarker{tstidxclosesubsubmarker}. There are no tests for
 any further sub-levels. Although \tstidxapp{xindy} allows more than
 three levels (\tstidxapp{makeindex} doesn't), it's somewhat
 \tstidxword{excessive} to go below a sub-sub-level.
 You'll have to add your own tests for anything deeper.
 Watch out for \tstidxsubword{sub-items}{lonely} sub-items.%
}
\tstidxnewblock*{\@tidx@openrangepar}
{%
 Here's an \tstidxword{example} of the start of a \tstidxopenword{range} but
 remember that a range must also have an end, so make sure that
 \tstidxword{block}~\@tidx@closerangepar\ has been included in this
 \if@tstidx@use@encaps
   \tstidxphrase[tstidxencapiii]{dummy text},
 \else
   \tstidxphrase{dummy text},
 \fi
  which closes this
 \tstidxword{example}.
 \iftestidxverbose
   I see you've used the \tstidxstyopt{testidx}{verbose} package option which
   shows the \tstidxword{argument} being passed to \tstidxcs{tstindex}.
   I expect it's caused some \tstidxphrase{overfull lines}.%
 \else
   If you want more detail, you can use the \tstidxstyopt{testidx}{verbose}
   package option which will show the \tstidxword{argument} being passed to
   \tstidxcs{tstindex} but be warned that it will
   cause \tstidxphrase{overfull lines}.%
 \fi
}
\tstidxnewblock
{%
 Now that the preliminaries have been dispensed with in the previous
 \tstidxwordpl{paragraph}, we can get on
 to some serious
 \if@tstidx@use@encaps
   \tstidxword[tstidxencapii]{waffle}
 \else
   \tstidxword{waffle}
 \fi
 to act as
 \if@tstidx@use@encaps
   \tstidxword[tstidxencapi]{filler}
 \else
   \tstidxword{filler}
 \fi
 text because this really needs
 some \tstidxword{padding} in order to get a decent sized
 \tstidxword{index} with lots of locations. I did consider using just
 plain old \tstidxphrase{lorem ipsum} (like the \tstidxsty{lipsum}
 package), but it gets a bit boring after a while, and it's easier to
 check the indexing has been performed successfully if you can understand
 the text. Of course, this doesn't help those who don't know any English, but at
 least they're no worse off than they would have been with random
 \tstidxword{gibberish}\tstindexsee{gobbledegook}{see}{gibberish},
 at least, I hope not.  In other words, if I could just \tstidxword{clarify}
 what I'm trying to say here, in a \tstidxword{confidential} and not too
 \tstidxword{roundabout} \tstidxword{fashion}\tstidxdash
 \tstidxphrase{between you, me and the gatepost}\tstidxdash is please don't
 consider this to be an
 \tstidxword{illustration}\tstindexsee{illustration}{seealso}{example} of
 my stunning \tstidxword{wit}, \tstidxword{eloquence} and
 \tstidxphrase{way with words} because I'm shamelessly contravening the
 \tstidxphrase{creative writing}
 \tstidxword{adage} (or possibly \tstidxword{motto}) of
 \tstidxphrase{cut to the chase}, remove excessive
 \tstidxword{verbiage} and \tstidxphrase{get to the point}. I shall
 take care to hide this \tstidxword{drivel} from my
 \if@tstidx@use@encaps
   \tstidxphrase[tstidxencapiii]{creative writing}
 \else
   \tstidxphrase{creative writing}
 \fi
 \tstidxword{tutor} and
 fellow writers, so
 \tstidxphrase{keep mum}\tstindexsee{keep mum}{seealso}{confidential}
 and don't \tstidxword{grass} on me because that just won't be fair,
 and it might \tstidxword{distress} them to a certain extent.
 I shall not be \tstidxword{assailed} by indecision and will
 \tstidxword{aspire} to find the \tstidxphrase{mot juste}.
 Where was I? Oh, yes, \tstidxword{padding}. I'm trying to make this
 \tstidxword{paragraph} quite long, not because I have any pretensions of being
 the next \tstidxperson{James}{Joyce} and competing with
 \tstidxbook{Ulysses}, but because one of the things
 we need to check for is what happens with paragraphs that span a
 \tstidxphrase{page break}. (If you're feeling particularly daring,
 try out the starred version of \tstidxcs{testidx}, although
 some of the blocks, such as \tstidxword{block}~\@tidx@xdypar, have some
 sneaky \tstidxword{paragraph} breaks that won't
 be suppressed.) \tstidxsym{TeX}{\TeX}'s asynchronous
 \if@tstidx@use@encaps
   \tstidxphrase[tstidxencapii]{output routine}
 \else
   \tstidxphrase{output routine}
 \fi
 can cause things to go a bit
 \if@tstidx@use@encaps
   \tstidxphrase[tstidxencapiii]{out of whack},
 \else
   \tstidxphrase{out of whack},
 \fi
 so lengthy paragraphs in this
 \if@tstidx@use@encaps
   \tstidxword[tstidxencapii]{example}
 \else
   \tstidxword{example}
 \fi
 document increase the chances of testing for these occurrences.
 Whether or not this particular \tstidxword{paragraph}
 actually spans a \tstidxphrase{page break} does, of course, depend on
 various things including your document \tstidxsubword{document}{properties},
 such as the \tstidxphrase{page dimensions}, \tstidxphrase{font family} and
 \tstidxphrase{font size}. If it turns out that this
 \if@tstidx@use@encaps
   \tstidxword[tstidxencapi]{paragraph}
 \else
   \tstidxword{paragraph}
 \fi
 has spanned a \tstidxphrase{page break}, you might want to check the terms
 indexed here to make sure they have the correct page numbers listed.
 Something else that you might want to check, while you're at it, is
 what's happened to the \tstindexsee{location list}{seealso}{cross-reference}%
 \tstidxword{location list} for the word
 \if@tstidx@use@encaps
   \tstidxqt{\tstidxword[tstidxencapii]{paragraph}},
 \else
   \tstidxqt{\tstidxword{paragraph}},
 \fi
 as I've used different
 \tstidxword{encap} values for it in various places in this
 \tstidxword{example}
 \if@tstidx@use@encaps
   \tstidxword[tstidxencapiii]{paragraph}.
 \else
   \tstidxword{paragraph}.
 \fi
 If you are using
 \tstidxapp{makeindex}, you might notice some warnings about
 \tstidxphrase{multiple encaps}, and the \tstidxphrase{page number}
 may be duplicated in the location list. If you are using
 \tstidxapp{xindy}, then it will discard duplicate page numbers and
 give preference to the first defined attribute in whatever
 \tstidxapp{xindy} module you're using. However, be careful if a
 \if@tstidx@use@encaps
   \tstidxword[tstidxencapi]{range}
 \else
   \tstidxword{range}
 \fi
 overlaps a different \tstidxword{encap}.
 Remember that there's a difference between an \tstidxword{index} and a
 \tstidxword{concordance}. If you just index pertinent places, there's less
 likelihood of conflicting encaps. This is the end of a
 \if@tstidx@use@encaps
   \tstidxword[tstidxencapiii]{paragraph}
 \else
   \tstidxword{paragraph}
 \fi
 that was written to deliberately upset \tstidxapp{makeindex}.
 Mean, aren't I?%
}
\tstidxnewblock*{\@tidx@xdypar}
{%
 On the subject of \tstidxapp{xindy}, if you want to use it with
 this \tstidxword{example} document, you'll need to add the
 \tstidxword{encap} values used in this \tstidxphrase{dummy text}
 as allowed attributes. For example, you may want to create a file
 called, say, \texttt{\jobname.xdy} that contains the following:
 \begin{flushleft}\ttfamily\obeylines
; list of allowed attributes
\par\medskip\par
(define-attributes ((
  \string"tstidxencapi\string"
  \string"tstidxencapii\string"
  \string"tstidxencapiii\string"
)))
\par\medskip\par
; define format to use for locations
\par\medskip\par
(markup-locref :open \string"\string\tstidxencapi\expandafter\@gobble\string\{\string"
 :close \string"\expandafter\@gobble\string\}\string"
 :attr \string"tstidxencapi\string")

(markup-locref :open \string"\string\tstidxencapii\expandafter\@gobble\string\{\string"
 :close \string"\expandafter\@gobble\string\}\string"
 :attr \string"tstidxencapii\string")

(markup-locref :open
\string"\string\tstidxencapiii\expandafter\@gobble\string\{\string"
 :close \string"\expandafter\@gobble\string\}\string"
 :attr \string"tstidxencapiii\string")
 \end{flushleft}
 This sets up allowed encap values and how they should be formatted.
 The ordering of the allowed \tstidxword{attributes} here gives the
 \tstidxencapcsn{tstidxencapi} encap precedence in the
 event of a \tstidxphrase{multiple encaps} clash, since it's the
 first one in the list. You can then
 run \tstidxapp{xindy} using:
 \begin{flushleft}\ttfamily
xindy -L english -C utf8 -M \jobname.xdy -M texindy -t \jobname.ilg
\jobname.idx
 \end{flushleft}
 You might also want to set the location list
 \tstidxsubword{location list}{page separator}
 and the \tstidxsubword{location list}{range separator}%
 \tstindexsee{range separator}{see}{location list}
 in your \texttt{.xdy} file.  For example:
 \begin{flushleft}\ttfamily
(markup-locref-list :sep \string", \string")\par
(markup-range :sep \string"\string-\string-\string")
 \end{flushleft}
 Check out the difference between using \tstidxapp{xindy} and
 \tstidxapp{makeindex} on this document.
 On the subject of location lists, the word
 \tstidxword{passim} (meaning \tstidxqt{here and there}) is
 sometimes used to tidy up ragged lists. For example,
 the locations \tstidxqt{1, 3, 4, 6, 7} may look neater as
 \tstidxqt{1-7 passim}, which indicates references are scattered (here
 and there) throughout that range.%
}
\tstidxnewblock
{%
 Computer algorithms can sometimes have difficulties with
 \tstidxword{localisation}. They can be tripped up by
 \tstidxphrase{input encoding} issues and \tstidxwordpl{digraph}
 (such as the Welsh \tstidxgphword{ll}{ll}{ỻ} digraph in
 \tstidxgphword{llan}{llan}{ỻan},
 the Dutch \tstidxgphword{ij}{ij}{ĳ} digraph in
 \tstidxgphword{lijnbus}{lijnbus}{lĳnbus} and
 \tstidxgphword{ijsvrij}{ijsvrij}{ĳsvrĳ}, and the
 \tstidxgphword{dz}{dz}{ǳ} digraph in the Hungarian
 \tstidxgphword{dz\'eta}[dzeta]{dzéta}{ǳéta} and Polish
 \tstidxgphword{dzwon}{dzwon}{ǳwon})
 or \tstidxwordpl{trigraph} (such as the Hungarian \tstidxword{dzs}
 trigraph in \tstidxutfword{dzs\'oker}[dzsoker]{dzsóker}
 and \tstidxword{dzsungel}\tstindexsee{dzsungel}{seealso}{trigraph}),
 so this \tstidxword{paragraph} is designed to provide some examples for
 testing various Latin alphabets. If you enable both UTF-8 (either
 with \tstidxsty{inputenc} or using XeLaTeX\slash LuaLaTeX) and
 the \tstidxstyopt{testidx}{digraphs} option, then the examples above
 will use the \tstidxqt{ll}, \tstidxqt{ij} and \tstidxqt{dz}
 \tstidxwordpl{glyph} (\emph{if supported}) for the \tstidxwordpl{digraph}
 (but not for \tstidxqt{dzs}, which is a
 \tstidxword{trigraph}). Remember that you'll also need a font that
 supports those glyphs.
 \iftestidxdiglyphs
  (If characters are missing from the above words, then they're not supported.)
 \fi
 Other digraphs include the Welsh \tstidxword{dd}, \tstidxword{ff},
 and \tstidxword{ng}, the Hungarian \tstidxword{ly} (in \tstidxword{lyuk}
 mentioned earlier) and the Polish \tstidxword{cz}, but these
 don't use glyphs in the sort value.
 Now for some more \tstidxword{nonsense} text to pad the index.
 We, the \tstidxutfword{\'elite}[elite]{élite} who discovered the
 \tstidxutfword{\ae sthetic}[aesthetic]{æsthetic}
 delights of \tstidxsym{TeX}{\TeX}, must not become
 \tstidxutfword{blas\'e}[blase]{blasé} about being the
 \tstidxutfword{prot\'eg\'e}[protege]{protégé}
 of the great \tstidxperson{Donald}{Knuth}.
 It may stagger the
 \tstidxutfword{client\`ele}[clientele]{clientèle} of
 \if@tstidx@use@encaps
   \tstidxartphrase[tstidxencapii]{the}{commercial world}
 \else
   \tstidxartphrase{the}{commercial world}
 \fi
 to discover our
 \tstidxutfword{r\'esum\'e}[resumee]{résumé}
 (after foraging for it in our natty
 \tstidxutfphrase{attach\'e case}[attachecase]{attaché case})
 while we sample a \tstidxword{vol-au-vent} or \tstidxword{two}
 at the \tstidxutfword{soir\'ee}[soiree]{soirée}
 in the \tstidxutfphrase{pied-\`a-terre}[piedaterre]{pied-à-terre}
 with the delightful \tstidxutfword{ph\oe nix}[phoenix]{phœnix}-%
 themed \tstidxutfword{d\'ecor}[decor]{décor}, \tstidxword{daft}
 \tstidxword{oak} \tstidxphrase{dado rail} and
 \tstidxutfword{f\ae rie}[faerie]{færie}
 \tstidxutfword{fa\c{c}ade}[facade]{façade}
 that has stunned
 many an \tstidxutfword{\ae thereal}[aethereal]{æthereal}
 \tstidxutfword{d\'ebutante}[debutante]{débutante}
 sporting a \tstidxutfphrase{berg\`ere hat}[bergerehat]{bergère hat},
 but it would be \tstidxutfword{na\"ive}[naive]{naïve}
 to fall for such a \tstidxutfword{f\oe tid}[foetid]{fœtid}
 \tstidxutfword{clich\'e}[cliche]{cliché}.
 This \tstidxword{paragraph} is in a state of
 \tstidxutfword{d\'eshabill\'e}[deshabille]{déshabillé}.
 Like a \tstidxword{sculpture} of \tstidxword{Venus} in a
 \tstidxutfword{n\'eglig\'ee}[negligee]{négligée}, it's transparently
 obvious that this \tstidxword{paragraph} is provided for the sole purpose of
 \tstidxword{ogling}\tstindexsee{gawping}{see}{ogling}
 \tstidxphrase{extended Latin characters} and testing
 how \tstidxapp{xindy} and \tstidxapp{makeindex} compare.
 Time for a quick trip to the \tstidxutfword{caf\'e}[cafe]{café}
 for an \tstidxutfword{an\ae mic}[anaemic]{anæmic}
 \tstidxphrase{cup of tea} (to \tstidxword{recover} from our travels) with
 \tstidxutfperson{Anders Jonas}{\AA ngstr\"om}[AndersJonasAngstrom]%
 {Anders Jonas}{Ångström} (but don't let it scald your
 \tstidxutfword{\oe sophagus}[oesophagus]{œsophagus})
 and then off to find a \tstidxword{zoo}
 in \tstidxutfplace{\"Osterg\"otland}[Ostergotland]{Östergötland},
 so we can get to the end of the \tstidxword{alphabet}. (We may even
 see an adventurous \tstidxword{aardvark} or
 a lucky \tstidxgphword{llama}{llama}{ỻama} or a
 \tstidxword{rhinoceros} eating \tstidxword{rhubarb}.) Perhaps
 then we should go over to
 \tstidxutfplace{\"Angelholm}[Angelholm]{Ängelholm}
 and head off across the
 \tstidxutfplace{\O resund}[Oresund]{Øresund} bridge and
 \tstidxword{resume} our search for some more examples.
 We'll go on a \tstidxphrase{whistle-stop tour} around
 \tstidxutfplace{T\r{a}rnby}[Tarnby]{Tårnby},
 \tstidxutfplace{R\o dovre}[Rodovre]{Rødovre},
 \tstidxutfplace{N\ae stved}[Naestved]{Næstved} and
 \tstidxutfplace{\O lstykke-Stenl\o se}[OlstykkeStenlose]{Ølstykke-Stenløse}.
 Afterwards, we'll \tstidxword{fly} to
 \tstidxplace{Poland} (possibly in an \tstidxword{aeroplane}\tstidxdash
 if passengers would like to look out of their \tstidxword{window}, they'll
 see we're passing over
 \tstidxutfplace{A\ss lar}[Asslar]{Aßlar} and
 \tstidxutfplace{Bad Gottleuba-Berggie\ss h\"ubel}[BadGottleubaBerggiesshubel]{Bad Gottleuba-Berggießhübel})
 and then we'll say
\tstidxqt{\tstidxutfword{cze\'s\'c}[czesc]{cześć}} to
\tstidxutfplace{\L\'od\'z}[Lodz]{Łódź}, and visit
 \@tstidx@if@notOT@ne
 {%
   \tstidxutfplace{\'Swi\k{e}tokrzyskie}[Swietokrzyskie]{Świętokrzyskie}%
   \ifxetex
   \else
     \ifluatex
     \else
       \space(that one will cause a problem for certain font encodings
       because of the \tstidxword{ogonek} and
       will be omitted if you use the default
       \tstidxsubword{font encoding}{OT1}
       encoding, but not if you use the \tstidxsty{fontenc}
       package\tstindexstysee{fontenc}{seealso}{inputenc} with,
       for example, the \tstidxstyopt{fontenc}{T1} option)%
     \fi
   \fi,
 }%
 {%
   [a place with an \tstidxword{ogonek} has been omitted because this document
    is using the default \tstidxsubword{font encoding}{OT1} font
   encoding\tstidxdash try loading the \tstidxsty{fontenc}
   package\tstindexstysee{fontenc}{seealso}{inputenc} with the
   \tstidxstyopt{fontenc}{T1} option],
 }%
 \tstidxutfplace{\.Zory}[Zory]{Żory},
 \tstidxutfplace{\.Zelech\'ow}[Zelechow]{Żelechów},
 \tstidxutfplace{\L obez}[Lobez]{Łobez},
 \tstidxutfplace{G\l og\'ow}[Glogow]{Głogów}
 (not to be confused with \tstidxplace{Glasgow}),
 \tstidxutfplace{\'Cmiel\'ow}[Cmielow]{Ćmielów},
 \tstidxutfplace{\'Scinawa}[Scinawa]{Ścinawa}
 and
 \tstidxutfplace{\'Swidnica}[Swidnica]{Świdnica}.
 Then let's \tstidxword{sail} to \tstidxplace{Iceland} (possibly in
 a \tstidxword{ship}) and visit the lakes of
 \tstidxplace{Iceland}, such as
 \tstidxutfplace{\"Olvesvatn}[Olvesvatn]{Ölvesvatn},
 \tstidxutfplace{\'Ulfsvatn}[Ulfsvatn]{Úlfsvatn},
 \tstidxutfplace{\'Anavatn}[Anavatn]{Ánavatn},
 \tstidxutfplace{M\'asvatn}[Masvatn]{Másvatn},
 \@tstidx@if@notOT@ne
 {%
   \tstidxutfplace{\TH r\'{\i}hyrningsvatn}[Thrihyrningsvatn]{Þríhyrningsvatn}
   (that one starts with a
    \tstidxutfword{thorn (\th)}[thorn]{thorn (þ)}%
    \tstindexutfsee{\th}{þ}[thornletter]{see}[thorn]{thorn (\th)}{thorn (þ)}),
   \tstidxutfplace{Sigr\'{\i}\dh arsta\dh avatn}[Sigridharstadhavatn]{Sigríðarstaðavatn}
   (that one has an \tstidxutfword{eth (\dh)}[eth]{eth (ð)}%
   \tstindexutfsee{\dh}{ð}[ethletter]{see}[eth]{eth (\dh)}{eth (ð)}%
   \ifxetex
    )%
   \else
     \ifluatex
      )%
     \else
       \tstidxdash those last two will also be omitted if you use the default
       \tstidxword{OT1} \tstidxword{font encoding})%
     \fi
   \fi,
 }%
 {%
   [a couple of lakes with a \tstidxword{thorn} and an
   \tstidxword{eth} have been omitted because this document is using the
   default \tstidxword{OT1} \tstidxword{font encoding}\tstidxdash try loading
   \tstidxsty{fontenc} with the \tstidxstyopt{fontenc}{T1} option],
 }%
 \tstidxutfplace{Gr\ae navatn}[Graenavatn]{Grænavatn},
 \tstidxutfplace{\'Arnesl\'on}[Arneslon]{Árneslón}
 and
 \tstidxutfplace{\'Ish\'olsvatn}[Isholsvatn]{Íshólsvatn}.
 If you are using this with \tstidxapp{xindy} and
 \tstidxword{UTF-8}, try this out with a different language option,
 for example \tstidxappopt{xindy}{-L swedish} or
 \tstidxappopt{xindy}{-L danish} or \tstidxappopt{xindy}{-L german-duden} or
 \tstidxappopt{xindy}{-L german-din5007} or \tstidxappopt{xindy}{-L polish} or
 \tstidxappopt{xindy}{-L icelandic}.
 \@tstidx@ifgerman
 {I notice you've use the \tstidxstyopt{testidx}{german} or
  \tstidxstyopt{testidx}{ngerman} package option. This means that if you want
  to use \tstidxapp{makeindex} instead of \tstidxapp{xindy}, you can
  use \tstidxapp{makeindex}'s \tstidxappopt{makeindex}{-g} option.%
 }%
 {%
  If you want to use \tstidxapp{makeindex} instead of
  \tstidxapp{xindy}, then the package option \tstidxstyopt{testidx}{german} or
  \tstidxstyopt{testidx}{ngerman} will allow you to use
  \tstidxapp{makeindex}'s \tstidxappopt{makeindex}{-g} option.%
 }%
 \@tstidx@ifutfviii
 {%
   \ifxetex
   \else
     \ifluatex
     \else
       \@tidx@sanitizenote
     \fi
   \fi
 }%
 { No UTF-8 support has been detected for this document.\@tidx@stripaccentsnote}%
}
\newcommand{\@tidx@sanitizenote}{%
 \space You currently have the
 \@tstidx@ifsanitize
 {\tstidxstyopt{testidx}{sanitize} option on.
  This means that the words containing \tstidxword{UTF-8} characters will
  first be sanitized before being passed to \tstidxcs{tstindex}, which
  will allow you to test how well the \tstidxphrase{indexing application}
  sorts \tstidxword{UTF-8} characters. If you'd rather test how
  \tstidxcs{index} writes these characters to the file read by the
  indexing application, use the \tstidxstyopt{testidx}{nosanitize}
  option instead. This may cause the \tstidxword{UTF-8} characters to be
  written in terms of \tstidxcs{IeC}.%
 }%
 {\tstidxstyopt{testidx}{nosanitize} option on.
  This means that the words containing \tstidxword{UTF-8} characters
  may be written to the file processed by the
  \tstidxphrase{indexing application} in terms of
  \tstidxcs{IeC}. This allows you to test how \tstidxcs{index} behaves.
  If you'd rather test how the indexing application sorts
  \tstidxword{UTF-8} characters, use the \tstidxstyopt{testidx}{sanitize}
  option instead, which will sanitize the \tstidxword{UTF-8} characters
  before passing them to \tstidxcs{tstindex}.%
 }%
}
\newcommand{\@tidx@stripaccentsnote}{%
 \space The \tstidxstyopt{testidx}{stripaccents} package option will
  effectively do, for example,
  \texttt{\string\index\char`\{elite@\string\'elite\char`\}}
   whereas the
  \tstidxstyopt{testidx}{nostripaccents} package option will
  effectively do, for example,
  \texttt{\string\index\char`\{\string\'elite\char`\}}.
  These options have no effect in UTF-8 mode.%
}
\tstidxnewblock
{%
  Don't forget there's also a \tstidxphrase{number group}, so let's
  have some numbers.
  \tstidxartbook{The}{Hitchhiker's Guide to the Galaxy} has
  of course propelled the number \tstidxnumber{42} to stardom, as the
  answer to \tstidxword{life}, the \tstidxword{universe} and
  everything. We usually deal in base~\tstidxnumber{10}, but sometimes
  base~\tstidxnumber{16} is useful to programmers, and computers
  prefer base~\tstidxnumber{2} (and \tstidxnumber{2} is the only
  \tstidxword{even} \tstidxword{prime number}). A \tstidxword{century} in
  \tstidxword{cricket} means \tstidxnumber{100} runs, and in the
  \tstidxword{calendar} \tstidxnumber{100} years.
  \@tidx@numberlettergroup
  Whilst we're on the subject of numbers, let's try out some
  equations.
\begin{equation}
\tstidxmath{E}{E} = mc^2
\end{equation}
  \@tstidx@ifamsmath
  {%
   Since this document is using \tstidxsty{amsmath}, let's try out
the \tstidxenv{align} environment:
\begin{align}
\tstidxmath{f(x)}[fx]{f(\protect\vec{x})} &=
 \tstidxmathsym{alpha}{\protect\alpha}
 \tstidxmathsym{sum}{\protect\sum}_i^{\tstidxmath{n}{n}} x_i
+\tstidxmathsym{beta}{\protect\beta} \sum_{i}^n x_i^2
+\tstidxmathsym{gamma}{\protect\gamma}\\
 \frac{\tstidxmathsym{partial}{\protect\partial}f}{\partial x_j} &=
  \alpha + 2\beta x_j
\end{align}
   \@tidx@scriptnote
   If this document hadn't loaded the \tstidxsty{amsmath} package,
we would have had to use the \tstidxenv{eqnarray} environment
instead.
  }%
  {%
   This document doesn't load the \tstidxsty{amsmath} package, so
let's try out the \tstidxenv{eqnarray} environment:
\begin{eqnarray}
\tstidxmath{f(x)}{f(\protect\vec{x})} &=&
 \tstidxmathsym{alpha}{\protect\alpha}
 \tstidxmathsym{sum}{\protect\sum}_i^{\tstidxmath{n}{n}} x_i
+\tstidxmathsym{beta}{\protect\beta} \sum_{i}^n x_i^2
+\tstidxmathsym{gamma}{\protect\gamma}\\
 \frac{\tstidxmathsym{partial}{\protect\partial}f}{\partial x_j} &=&
  \alpha + 2\beta x_j
\end{eqnarray}
   \@tidx@scriptnote
   If you load the \tstidxsty{amsmath} package, we'll test the
   \tstidxenv{align} environment instead.
  }%
  Incidentally, that's just a regular partial derivative symbol
  $\tstidxmathsym{partial}{\protect\partial}$. Not to be confused
  with the spin-weighted partial derivative
  \@tstidx@ifamssymb{$\tstidxmathsym{eth}[spinderiv]{\protect\eth}$,
   which can be displayed here as this document has loaded the
   \tstidxsty{amssymb} package}
  {[you need the \tstidxsty{amssymb} package for that symbol]}.
 \@tidx@mathslettergroup
 \iftestidxprefix
 I've done something similar with the \tstidxwordpl{marker} where I've used
 \texttt{\tstidxindexmarkerprefix} as the \tstidxword{prefix}.%
 \else
 With the prefixes on I can also do something similar with the
 \tstidxwordpl{marker} where I'll use
 \texttt{\tstidxindexmarkerprefix} as the \tstidxword{prefix}.%
 \fi
}
\newcommand{\@tidx@scriptnote}{%
  (Note how the subscripts and superscripts can be affected
  by material inserted between the symbol and the sub- and
  superscripts.)
}
\newcommand*{\@tidx@numberlettergroup}{%
  If you're using \tstidxapp{xindy}, you can provide a numbers group
  by adding the following to your \texttt{.xdy} module:
\begin{flushleft}\ttfamily
(define-letter-group \string"Numbers\string"\par
   \string:prefixes (\string"0\string" \string"1\string" \string"2\string"
\string"3\string" \string"4\string" \string"5\string"
\string"6\string" \string"7\string" \string"8\string"
\string"9\string")\par
   \string:before \string"A\string")
\end{flushleft}
}
\newcommand*{\@tidx@mathslettergroup}{%
 \iftestidxprefix
  Now I've been a bit fancy here and inserted
  \texttt{\tstidxmathsymprefix} in front of
  the sort key so I can get \tstidxapp{xindy} to create a special
  group for the maths symbols.  Here's
 \else
  This document has used the \tstidxstyopt{testidx}{noprefix}
  package option, which has switched of the sort prefixes.
  If you use the \tstidxstyopt{testidx}{prefix} option I can be a
  bit fancy here and insert
  \texttt{\tstidxmathsymprefix} in front of
  the sort key so I can get \tstidxapp{xindy} to create a special
  group for the maths symbols.  When you switch on the prefixes here's
 \fi
the code you can add to your \texttt{.xdy} file to implement it:
\begin{flushleft}\ttfamily
(define-letter-group \string"Maths\string"
   \string:prefixes (\string"\tstidxmathsymprefix\string")
   \string:before \string"Numbers\string")
\end{flushleft}
}
\tstidxnewblock*{\@tidx@closerangepar}%
{%
 Let's \tstidxutfword{re-cover}[reecover]{re-cover} old ground and
 talk about ranges again.
 This is the end of the \tstidxcloseword{range}
 \tstidxword{example} from \tstidxword{block}~\@tidx@openrangepar.
 There's not much else to say about this \tstidxword{block} really.
 It's quite boring, isn't it? However, you'll need it if you've
 included block~\@tidx@openrangepar. Unless you're testing for
 a mis-matched range, of course. That might be quite interesting,
 possibly, but I'm not going to \tstidxphrase{hold my breath}.%
}
\tstidxnewblock
{%
  Now this is going to be hard to believe\tstidxdash in fact I'm
  totally \tstidxword{gobsmacked} and utterly \tstidxword{astounded}
  \tstidxdash but I've discovered that we're still missing some
  \tstidxphrase{letter groups}, and I've run out of anything
  \tstidxword{quaint} to say, so I'm going to have to
  \tstidxword{yatter} for a while longer, which will probably make
  you \tstidxword{yawn} and fall \tstidxword{asleep}.
  What shall we talk about? My \tstidxword{quirky}
  \tstidxword{badinage} is about to \tstidxword{expire}. How about a
  \tstidxword{story}? Here's one I made up for my friend
  \tstidxperson{Paulo}{Cereda} in \tstidxsym{TeX}{\TeX}.SE chat because he likes
  ducks and is the creator of \tstidxapp{arara}.
  So, are you sitting comfortably? Then let's \tstidxword{begin}. By the way,
  before I \tstidxword{forget}, it's called
  \tstidxbook{Sir Quackalot and the Golden Arara} and is the
  first story in
  \tstidxartbook{The}{Adventures of Sir Quackalot}.
  It's a \tstidxword{tale} of \tstidxword{adventure} and
  \tstidxword{derring-do}. The \tstidxword{hero} of the
  \tstidxword{story} is \tstidxperson{Sir}{Quackalot}, in case you
  can't tell from the \tstidxword{title}.
  \tstidxphrase{Once upon a time}, a long time ago in
  \tstidxartphrase{a}{far away land}, there lived a
  \tstidxword{knight}. He was \tstidxword{handsome}, he was
  \tstidxword{bold}, he was \tstidxword{brave}.
  He was\tstidxdash a \tstidxword{duck}. His \tstidxword{name} was
  \tstidxperson{Sir}{Quackalot}.
  One day \tstidxperson{the}{Fairy Goose} appeared.
  \tstidxqt{Brave \tstidxword{knight},} she said. \tstidxqt{A terrible
  \tstidxword{plight} has fallen on
  the \tstidxword{land}. The evil \tstidxword{OgRe} has stolen
  \tstidxartphrase{the}{Golden Arara}. Only you can save it.}
  (That's a \tstidxword{reference} to
  \tstidxsym{TeX}{\TeX}'s \tstidxphrase{output routine}, if you missed it.)
  \tstidxqt{It will be a \tstidxword{perilous} \tstidxword{quest}, but find
  \tstidxartphrase{the}{Mighty Helm of Knuth} and
  \tstidxartphrase{the}{Legendary Sword} \tstidxword{xor} to aid you.} (Ask
  \tstidxperson{David}{Carlisle} about the \tstidxword{xor}
  \tstidxword{reference}.)%
}
\tstidxnewblock
{%
 So \tstidxperson{Sir}{Quackalot} set out on his \tstidxword{quest}.
 (This is the \tstidxword{continuation} from
 the previous \tstidxword{block}, for any \tstidxword{newcomers}
 who have just turned up.) He soon arrived at
 \tstidxartphrase{the}{Bog of Eternal Glossaries} (that's a
 reference to my \tstidxsty{glossaries} package, and it's also a
 \tstidxword{nod} to \tstidxartplace{the}{Bog of Eternal Stench} in
 \tstidxfilm{Labyrinth}), in the
 \tstidxword{centre} (or \tstidxword{center} for those of you
 \tstidxphrase{across the pond}) of which was
 suspended \tstidxartphrase{the}{Mighty Helm of Knuth}, but
 \tstidxperson{Sir}{Quackalot} was learned in the \tstidxword{lore} of
 installing \tstidxapp{Perl} and was able to leap upon the \tstidxword{magical}
 \tstidxword{raft} \tstidxapp{makeglossaries} and steer his way through the
 \tstidxword{external} \tstidxphrasepl{indexing application} and their many
 arguments.  (That's supposed to be a \tstidxword{pun}, but it's
 \tstidxphrase{bad form} to explain the \tstidxword{joke}, and it
 wasn't even particularly \tstidxword{witty}.
 Incidentally, \tstidxperson{Joseph}{Wright} makes a
 \tstidxword{cameo} at this point with the
 \tstidxword{exclamation} \tstidxqt{fetchez la vache!}\ but you'll have to
 ask \tstidxperson{Paulo}{Cereda} what
 that's all about. It wouldn't surprise me if it had something to
 do with \tstidxphrase{Monty Python}.)%
}
\tstidxnewblock
{%
 Anyway, where were we? Oh, yes.  He (that's
 \tstidxperson{Sir}{Quackalot} we're talking about, if you've only
 just joined us) snatched up \tstidxartphrase{the}{Mighty Helm of Knuth} and
 escaped from the \tstidxword{perilous} \tstidxword{bog}. Soon he came to
 \tstidxartphrase{the}{Dread Vale of the Editors}, guarded
 at either end by the ever-quarrelling
 \tstidxword{leviathans} \tstidxapp{Emacs} and \tstidxapp{Vi}.
 As he approached the \tstidxword{vale}, Emacs uttered the
 \tstidxphrase{magic incantation} that
 sent forth \tstidxartphrase{the}{butterflies of chaos}.
 (I know \tstidxqt{\tstidxword{doom}} is more appropriate but,
 as is \tstidxphrase{common knowledge}, \tstidxword{chaos} is a
 \tstidxword{butterfly} \tstidxword{motif}.)%
}
\tstidxnewblock
{%
But \tstidxperson{Sir}{Quackalot} was protected by
\tstidxartphrase{the}{Mighty Helm of Knuth} and
raced past into the \tstidxword{vale}, where he found
\tstidxartphrase{the}{Legendary Sword} \tstidxword{xor} in
the centre of the great \tstidxsty{longtable}. (\tstidxword{Ooh}, I've started a
\tstidxword{sentence} with a \tstidxword{conjunction}.
How \tstidxword{naughty} is that?)
With a great \tstidxword{leap} and a \tstidxword{bound},
\tstidxperson{Sir}{Quackalot} plucked out the \tstidxword{sword} and
headed for the far end of the \tstidxword{vale}.
Up pounced \tstidxapp{Vi} and belched forth a \tstidxword{myriad}
of \tstidxword{clones} that bore down on
\tstidxperson{Sir}{Quackalot}.  But, brandishing the \tstidxword{sword}
\tstidxword{xor}, \tstidxperson{Sir}{Quackalot} sliced them down.
(There's some \tstidxword{repetition} there, but hopefully no one's
noticed. There's even more coming up in the next
\tstidxword{block}.)%
}
\tstidxnewblock*{\@tidx@close@testidxsty}%
{%
\tstidxperson{Sir}{Quackalot} escaped from
\tstidxartphrase{the}{Dread Vale of the Editors} and set off
up the path that led to the evil \tstidxword{OgRe}'s \tstidxword{lair}.
As \tstidxperson{Sir}{Quackalot} approached, there was a fearful
\tstidxword{roar}, and the \tstidxword{OgRe} pounced on \tstidxperson{Sir}{Quackalot}.
The brave \tstidxword{knight} raised his powerful \tstidxword{sword}
\tstidxword{xor} and brought it down on the \tstidxword{OgRe}, destroying him.
\tstidxperson{Sir}{Quackalot} rescued \tstidxartphrase{the}{Golden Arara}
and the \tstidxword{land} was once more restored to \tstidxword{peace} and
\tstidxword{harmony} and
\tstidxwordpl{paragraph} were able to \tstidxword{span}
\tstidxphrasepl{page break} without \tstidxword{fear}.
\tstidxartphrase{The}{End}. Don't miss the next \tstidxword{thrilling}
\tstidxword{adventure} \tstidxbook{Sir Quackalot and the Hyper Lake of Doom}
where our \tstidxword{seaborne} \tstidxphrase{intrepid hero}%
\tstindexsubsee{hero}{intrepid}[hero.intrepid]{see}{intrepid hero} meets a \tstidxword{quixotic}
\tstidxword{seal} with a \tstidxword{zither} (a \tstidxword{zealous}
\tstidxword{fan} of \tstidxartfilm{The}{Third Man}), a \tstidxword{youthful}
\tstidxphrase{sea lion} with a \tstidxword{magic}
\tstidxword{yo-yo}, and a \tstidxword{wily} \tstidxword{wombat}
\tstidxword{warrior} with a \tstidxword{laser-guided}
\tstidxphrase{sealant gun}. Can they defeat the
\tstidxword{villainous}, \tstidxword{zany} \tstidxword{zoologist}
sailing a \tstidxword{xebec} across the \tstidxword{sea} bearing canisters of
\tstidxword{xenon}, \tstidxword{xylem} and \tstidxword{xylene}?
Oh, \tstidxword{zounds}! He's \tstidxword{ashore} wearing
a \tstidxphrase{zoot suit} and smoking a \tstidxword{zucchini}
whilst playing a \tstidxword{xylophone}.
As one \tstidxphrase{anonymous reviewer} said,
it's as \tstidxword{exhilarating} as watching a \tstidxword{yuppie}
eating a \tstidxphrase{yule log} soaked in \tstidxphrase{yoghurt}.
Hmm, \tstidxword{yummy}\tstidxdash or \tstidxword{yuck}, depending
on your tastes. Don't forget to \tstidxword{check} you
have some \tstidxword{chalk} so we can write
\tstidxword{ddisgynedig} and \tstidxword{ddyrchafedig}
in \tstidxplace{Nghaerdydd} (over in \tstidxplace{Nghymru})
because I want a few more words with \tstidxwordpl{digraph},
and then we can take a \tstidxword{ffotograff} of
\tstidxplace{Ffestiniog}.%
}
\tstidxnewblock
{%
 Oh, did I tell you about the \tstidxphrase{vice-president} who was
 a \tstidxword{Viking} in a \tstidxword{vignette}? No? Well, I can't
 quite remember the \tstidxword{story} myself, but it had something
 to do with a \tstidxphrase{vice admiral} with a
 \tstidxphrase{Victoria plum} and a \tstidxphrase{viceroy} with
 a \tstidxphrase{Victoria sponge}, or was it
 \tstidxphrase{vice versa}? The \tstidxphrase{vice chancellor}
 preferred \tstidxword{vichyssoise}.
 For \tstidxphrase{letter ordering} use the \tstidxappopt{makeindex}{-l} option
 with \tstidxapp{makeindex} or the \texttt{ord/letorder} module
 with \tstidxapp{xindy} (\tstidxappopt{xindy}{-M ord/letorder}).
 If you omit this, the default
 \tstidxphrase{word ordering} is used. The ordering in the
 \tstidxbook{Compact Oxford English Dictionary} (third edition,
 revised) for these words are: vice admiral, vice chancellor, vice-president,
 \tstidxword{viceregal}, viceroy, vice versa. Quick
 \tstidxword{quiz}. Can you get \tstidxapp{makeindex} or
 \tstidxapp{xindy} to reproduce that order?%
}
\tstidxnewblock*{\@tidx@close@testidxsty}%
{%
 This is the final \tstidxword{block} of dummy text
 provided by the \tstidxclosesty{testidx} package. This block
 contains the close of a \tstidxword{range} that was started in block~1.
 Fun, wasn't it?%
}
\endinput
%%
%% End of file `testidx.sty'.
