% This is xeindex, produced by the CodeDoc class % with the `produce' option on. % % To create the documentation, compile xeindex.tex % without the `produce' option. % % SOURCE: xeindex.tex % DATE: 2009/10/24 % VERSION: v.0.1 \ProvidesPackage{xeindex}[2009/10/24 v.0.1 Automatic index for XeLaTeX.] \RequirePackage{makeidx,xesearch} \makeatletter \newif\ifxi@mark \DeclareOption{mark}{\xi@marktrue} \ProcessOptions \ifxi@mark \def\xi@Mark#1{***[#1:\the\inputlineno] } \else \def\xi@Mark#1{} \fi \def\xi@empty{} \def\xi@end{\xi@end} \def\xi@Lists{} \def\IndexList{% \@ifstar{\def\xi@cs{*}\xi@IndexList}{\def\xi@cs{}\xi@IndexList}% } \def\xi@IndexList#1#2{% \def\xi@ListName{#1}% \edef\xi@Lists{\xi@Lists#1,}% \unless\ifcsname#1@xeindex\endcsname \csname#1@xeindex\endcsname \SearchList{#1@xeindex@ncs@normal@list}{% \def\xi@Word{##1}% \lowercase{\expandafter\index\expandafter{\xi@Mark\xi@Word##1}}}{}% \SearchList{#1@xeindex@cs@normal@list}{% \expandafter\index\expandafter{\xi@Mark{##1}##1}}{}% \SearchList{#1@xeindex@ncs@special@list}{% \lowercase{\csname##1@#1@xeindex@entry\endcsname}{##1}}{}% \SearchList{#1@xeindex@cs@special@list}{% \csname##1@#1@xeindex@entry\endcsname{##1}}{}% \SearchList{#1@xeindex@affix@special@list}{% \csname\AffixFound @#1@xeindex@entry\endcsname{##1}}{}% \fi \xi@ParseList#2,\xi@end,% } \def\xi@ParseList#1,{% \def\xi@temp{#1}% \ifx\xi@temp\xi@end \let\xi@next\relax \else \expandafter\xi@ParseEntry\xi@cs#1=\xi@end \let\xi@next\xi@ParseList \fi\xi@next } \def\xi@ParseEntry#1#2=#3\xi@end{% \def\xi@temp{#3}% \ifx\xi@temp\xi@empty \expandafter\if\noexpand#1*% \AddToList!{\xi@ListName @xeindex@cs@normal@list}{#1#2}% \else \AddToList!{\xi@ListName @xeindex@ncs@normal@list}{#1#2}% \fi \else \xi@MakeEntry#3% \expandafter\if\noexpand#1*% \xi@CheckAffix#2?\xi@end \ifxi@Affix \AddToList!{\xi@ListName @xeindex@affix@special@list}{#1#2}% \expandafter\edef\csname\xi@Affix @\xi@ListName @xeindex@entry\endcsname##1{% \unexpanded{\expandafter\index\expandafter}{% \noexpand\xi@Mark{##1}\ifxi@NoWord##1\fi\unexpanded\expandafter{\xi@temp}}% }% \else \AddToList!{\xi@ListName @xeindex@cs@special@list}{#1#2}% \expandafter\edef\csname#2@\xi@ListName @xeindex@entry\endcsname##1{% \unexpanded{\expandafter\index\expandafter}{% \noexpand\xi@Mark{##1}\ifxi@NoWord#2\fi\unexpanded\expandafter{\xi@temp}}% }% \fi \else \xi@CheckAffix#1#2?\xi@end \ifxi@Affix \AddToList!{\xi@ListName @xeindex@affix@special@list}{#1#2}% \expandafter\edef\csname\xi@lcAffix @\xi@ListName @xeindex@entry\endcsname##1{% \unexpanded{\def\xi@Word}{##1}% \noexpand\lowercase{ \unexpanded{\expandafter\index\expandafter}{% \unexpanded{\xi@Mark{\xi@Word}}% \ifxi@NoWord##1\fi\unexpanded\expandafter{\xi@temp}}% }% }% \else \AddToList!{\xi@ListName @xeindex@ncs@special@list}{#1#2}% \lowercase{% \expandafter\edef\csname#1#2@\xi@ListName @xeindex@entry\endcsname##1{% \unexpanded{\def\xi@Word}{##1}% \unexpanded{\expandafter\index\expandafter}{% \unexpanded{\xi@Mark{\xi@Word}}% \ifxi@NoWord#1#2\fi\unexpanded\expandafter{\xi@temp}}% }% }% \fi \fi \fi } \newif\ifxi@NoWord \def\xi@MakeEntry#1#2={% \def\xi@temp{#1#2}% \xi@NoWordtrue \expandafter\unless\expandafter\if\noexpand#1!% \expandafter\unless\expandafter\if\noexpand#1@% \expandafter\unless\expandafter\if\noexpand#1|% \xi@NoWordfalse \fi \fi \fi } \newif\ifxi@Affix \def\xi@CheckAffix#1#2?#3\xi@end{% \xi@Affixfalse \expandafter\if\noexpand#1?% \xi@Affixtrue \def\xi@Affix{#2}% \lowercase{\def\xi@lcAffix{#2}}% \else \def\xi@@temp{#3}% \unless\ifx\xi@@temp\xi@empty \xi@Affixtrue \def\xi@Affix{#1#2}% \lowercase{\def\xi@lcAffix{#1#2}}% \fi \fi } \def\StopIndexList#1{% \xi@StopIndexList#1,\xi@end,% }% \def\xi@StopIndexList#1,{% \def\xi@temp{#1}% \ifx\xi@temp\xi@end \let\xi@next\relax \else \StopList{% #1@xeindex@ncs@normal@list,% #1@xeindex@cs@normal@list,% #1@xeindex@cs@normal@list,% #1@xeindex@ncs@special@list,% #1@xeindex@cs@special@list,% #1@xeindex@affix@special@list% }% \let\xi@next\xi@StopIndexList \fi\xi@next } \def\StopIndex{% \expandafter\xi@StopIndexList\xi@Lists\xi@end,% } \def\NoIndex#1{% \bgroup \StopIndex #1% \egroup } \let\xi@PrintIndex\printindex \def\printindex{\StopIndex\xi@PrintIndex} \SortByLength{pPsS} \SearchOnlyOne{pPsS} \makeatother