summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/babeltools/esindex.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-10-14 23:34:51 +0000
committerKarl Berry <karl@freefriends.org>2010-10-14 23:34:51 +0000
commit7c0254fc2d33331f7d8762cb7738c4b9f94f0964 (patch)
tree2fa6e3fb8ff5f50a268df76050c3a4560eb8d6a1 /Master/texmf-dist/tex/latex/babeltools/esindex.sty
parentac155482e552dd85ebd61b7588e35ffa75a08222 (diff)
new latex package babeltools 0.2 (15oct10)
git-svn-id: svn://tug.org/texlive/trunk@20101 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/babeltools/esindex.sty')
-rw-r--r--Master/texmf-dist/tex/latex/babeltools/esindex.sty204
1 files changed, 204 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/babeltools/esindex.sty b/Master/texmf-dist/tex/latex/babeltools/esindex.sty
new file mode 100644
index 00000000000..3b2d61e02c0
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/babeltools/esindex.sty
@@ -0,0 +1,204 @@
+% +--------------------------------------------------+
+% | Typeset ensindex.tex to get the documentation. |
+% +--------------------------------------------------+
+%
+%% Copyright (C) 1998-2004, 2006, 2008 Javier Bezos
+%% All Rights Reserved
+%% http://www.tex-tipografia.com
+%%
+%% 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 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% This Current Maintainer of this work is Javier Bezos.
+%%
+%% This work consists of the files esindex.tex and esindex.sty.
+
+% Changes
+%
+% 2006-05-12. Bug fixed. Missing accents in multilevel entries.
+% 2008-09-17. Made compatible with latest LaTeX versions (\IeC).
+% Added \'\i.
+% Package option ignorespaces.
+% Macro \ignorewords.
+% 2008-09-28. Added \everyesindex.
+% Macro \esindexsort.
+
+\ProvidesPackage{esindex}[2008/09/28 v1.4 Spanish indexes]
+
+\def\esx@level{`\!}
+\def\esx@actual{`\@}
+\def\esx@encap{`\|}
+\def\esx@quote{`\"}
+
+\def\esx@error{\PackageError{esindex}{Unknown index parameter}%
+ {Except for ignorespaces and replaceindex, options^^J%
+ in this package ave the form parameter=value, where^^J%
+ parameter stands for of the following MakeIndex ones:^^J%
+ encap, level, actual, quote}}
+
+\def\esx@process#1=#2\esx@process{%
+ \@ifundefined{esx@#1}{\esx@error}{%
+ \expandafter\edef\csname esx@#1\endcsname
+ {\string`\expandafter\noexpand\csname\string#2\endcsname}}}
+
+\DeclareOption*{%
+ \@expandtwoargs\in@{=}{\CurrentOption}%
+ \ifin@
+ \expandafter\esx@process\CurrentOption\esx@process
+ \else
+ \def\esx@a{ignorespaces}
+ \ifx\esx@a\CurrentOption
+ \def\esx@zapspace#1\esx@zapspace{\zap@space#1 \@empty}%
+ \else\def\esx@a{replaceindex}
+ \ifx\esx@a\CurrentOption
+ \AtBeginDocument{%
+ \let\esx@trueindex\index
+ \let\index\esindex}
+ \else
+ \esx@error
+ \fi
+ \fi
+ \fi}
+
+\let\esx@zapspace\@empty
+\def\esx@trueindex{\index}
+
+\ProcessOptions
+
+\begingroup
+
+\catcode`\|=\catcode\esx@encap \lccode`\|=\esx@encap\relax
+\catcode`\!=\catcode\esx@level \lccode`\!=\esx@level\relax
+\catcode`\&=\catcode\esx@actual \lccode`\&=\esx@actual\relax
+\catcode`\*=13 \lccode`\*=\esx@quote\relax
+
+\catcode`\'=13
+\catcode`\"=13
+\catcode`\~=13
+
+\gdef\esindex#1#{\esx@index{#1}}
+
+\lowercase{
+\gdef\esx@index#1#2{%
+ \let\esx@g\@empty
+ \esx@bar@idx#2|\@@
+ \expandafter\esx@@index\esx@b!\@@
+ \toks@\expandafter{\esx@g}%
+ \protected@edef\esx@g{\noexpand\esx@trueindex#1{\the\toks@\esx@a}}%
+ \esx@g}
+}
+
+\lowercase{
+\gdef\esx@bar@idx#1|#2\@@{%
+ \def\esx@b{#1}\def\esx@a{#2}%
+ \ifx\esx@a\@empty\else\esx@bar@eat#2\fi}
+}
+
+\lowercase{
+\gdef\esx@bar@eat#1|{\def\esx@a{|#1}}
+}
+
+\lowercase{
+\gdef\esx@@index#1!#2\@@{%
+ \begingroup
+ \let\IeC\@firstofone
+ \def\@tabacckludge##1{\csname\string##1\endcsname}%
+ \def\'##1{\@ifundefined{esx@index@q@\string##1}%
+ {##1}%
+ {\csname esx@index@q@\string##1\endcsname}}%
+ \ifnum\catcode`\'=\active
+ \let'\'%
+ \fi
+ \def\~##1{\string##1\string^^ff}%
+ \ifnum\catcode`\~=\active
+ \let~\~%
+ \fi
+ \def\"##1{\@ifundefined{esx@index@qq@\string##1}%
+ {\string"##1}%
+ {\csname esx@index@qq@\string##1\endcsname}}%
+ \ifnum\catcode`\"=\active
+ \let"\"%
+ \fi
+ \def\esx@a{#1}%
+ \@ifundefined{esx@sort@\expandafter\strip@prefix\meaning\esx@a}%
+ {\@temptokena{#1}}%
+ {\@temptokena\expandafter\expandafter\expandafter{%
+ \csname esx@sort@\expandafter\strip@prefix\meaning\esx@a\endcsname}}%
+ \the\everyesindex
+ % Particles
+ \@for\esx@a:=\esx@ignorewords\do{%
+ \expandafter\esx@remwords\expandafter{\esx@a}}%
+ \toks@\expandafter{\esx@g}%
+ % Adds @ and removes spaces.
+ \protected@xdef\esx@g{%
+ \the\toks@
+ \expandafter\esx@zapspace\the\@temptokena\esx@zapspace
+ \string &}%
+ \endgroup
+ \begingroup
+ \def*##1{% <- its lower case is the quote char (")
+ \ifcat##1a%
+ \@ifundefined{spanish@sh@\string*\string##1@}%
+ {\string*##1}%
+ {\string*\string*##1}%
+ \else
+ \string*\string##1%
+ \fi}%
+ \def\esx@b{#2}%
+ \toks@\expandafter{\esx@g}%
+ \ifx\esx@b\@empty
+ \protected@xdef\esx@g{\the\toks@#1}%
+ \else
+ \protected@xdef\esx@g{\the\toks@#1!}%
+ \esx@@index#2\@@
+ \fi
+ \endgroup}
+}
+\endgroup
+
+\def\ignorewords#1{%
+ \protected@edef\esx@ignorewords{\zap@space#1 \@empty}}
+
+\let\esx@ignorewords\@empty
+
+\def\esx@remwords#1{%
+ \def\esx@c##1 #1 \esx@c{\esx@a##1 #1 \esx@a}%
+ \def\esx@a##1 #1 ##2\esx@a{%
+ \ifx\@empty##2\@empty
+ \@firstofone##1##2%
+ \else
+ \@firstofone##1 \esx@c##2\esx@c
+ \fi}%
+ \expandafter\esx@remwords@ii\expandafter{\the\@temptokena}{#1}}%
+
+\def\esx@remwords@ii#1#2{%
+ \protected@xdef\esx@b{\expandafter\esx@a\space#1 #2 \esx@a}%
+ \@temptokena\expandafter{\esx@b}}
+
+\def\esindexsort#1{%
+ \def\esx@a{#1}%
+ \@namedef{esx@sort@\expandafter\strip@prefix\meaning\esx@a}}
+
+\newtoks\everyesindex
+
+\def\esx@index@q@n{n\string^^ff}
+\def\esx@index@q@N{N\string^^ff}
+\@namedef{esx@index@q@\string\i}{i}
+
+\def\esx@index@qq@o{.o}
+\def\esx@index@qq@O{.O}
+\def\esx@index@qq@a{.a}
+\def\esx@index@qq@A{.A}
+\def\esx@index@qq@u{u}
+\def\esx@index@qq@U{U}
+\def\esx@index@qq@c{c}
+\def\esx@index@qq@C{C}
+
+\endinput \ No newline at end of file