summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/sort-ini.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-12 23:45:13 +0000
committerKarl Berry <karl@freefriends.org>2006-01-12 23:45:13 +0000
commit92a15e15b276458e10aa05016bf472e8c6dd3eb0 (patch)
treeaf0343097e5f497167cefa16ed45c03475b98c37 /Master/texmf-dist/tex/context/base/sort-ini.tex
parentdf014cf02a62504f6b3e7a4398fb1e093b84f114 (diff)
context
git-svn-id: svn://tug.org/texlive/trunk@608 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/sort-ini.tex')
-rw-r--r--Master/texmf-dist/tex/context/base/sort-ini.tex101
1 files changed, 101 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/sort-ini.tex b/Master/texmf-dist/tex/context/base/sort-ini.tex
new file mode 100644
index 00000000000..84d32e2ff12
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/sort-ini.tex
@@ -0,0 +1,101 @@
+%D \module
+%D [ file=sort-ini,
+%D version=2005.08.08,
+%D title=\CONTEXT\ Sort Macros,
+%D subtitle=Initialization,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D This module replaces existing sort key handling and is meant to be
+%D used with the new texutil functionality. This module defines a few
+%D auxiliary macros.
+
+%D The sorting method is largely bases on the one used in the old version
+%D of texutil but i've changed the interface a bit. It all boils down to
+%D a bunch of substitutions. The reimplementation makes it easier to extend
+%D the rules. Currently we have multipass substitution and onepass sorting,
+%D but we may change this some day. Since there is a plugin mechanism, using
+%D an external sorter is also possible.
+
+% test file:
+%
+% \mainlanguage[sl] \readfile{sort-ini}{}{}
+%
+% \starttext
+% test \index {aa1} test \index {ab1} test \index {aa2}
+% test \index {ab2} test \index {aa10} test \index {aa8}
+% test \index {aa9} test \index {aa11} test \index {aa10}
+% test \index {cccc} test \index {\ccaron ccc} test \index {\cacute ccc}
+% test \index {caaa} test \index {\ccaron aaa} test \index {\cacute aaa}
+% \placeindex
+% \stoptext
+
+% definitions:
+%
+% \exportsortshortcut{\\\'\\i}{iacute}
+% \exportsortshortcut{\\\'i} {iacute}
+% \exportsortshortcut{\\\"e} {ediaeresis}
+% \exportsortshortcut{\\\'o} {oacute}
+%
+% \exportsortexpansion{aeligature}{ae}
+% \exportsortexpansion{ijligature}{y}
+% \exportsortexpansion{oacute} {oz}
+% \exportsortexpansion{eacute} {ezzz} % or e3
+% \exportsortexpansion{egrave} {ezz} % or e2
+% \exportsortexpansion{ediaeresis}{ez} % or e1
+% \exportsortexpansion{adiaeresis}{az}
+% \exportsortreduction{ch} {c}
+% \exportsortreduction{ij} {y}
+%
+% \exportsortexpansion{ccaron} {cz}
+% \exportsortexpansion{cacute} {czz}
+% \exportsortexpansion{dstroke} {dz}
+% \exportsortexpansion{scaron} {sz}
+% \exportsortexpansion{zcaron} {zz}
+%
+% \exportsortreduction{ch}{c}
+% \exportsortreduction{ij}{y}
+%
+% \exportsortexpansion {ccaron} {c+1}
+% \exportsortdivision {c+1} {ccaron}
+% ==
+% \exportsortrule {ccaron} {c+1}
+
+\unprotect
+
+\let\currentexportclass\empty
+
+\def\exportsortaction#1#2#3%
+ {\convertargument#2\to\asciia
+ \convertargument#3\to\asciib
+ \immediatewriteutility{x #1 {\currentexportclass} {\asciia} {\asciib}}}
+
+\def\exportsortshortcut {\exportsortaction s}
+\def\exportsortexpansion{\exportsortaction e}
+\def\exportsortreduction{\exportsortaction r}
+\def\exportsortdivision {\exportsortaction d}
+
+\def\exportsortrule#1#2%
+ {\exportsortexpansion{#1}{#2}%
+ \exportsortdivision {#2}{#1}}
+
+% Next we overload some macros defined in enco-ini and core-uti. This
+% will change.
+
+\let\definesortkey\gobblefourarguments
+
+\def\savesortkeys
+ {\globallet\savesortkeys\relax
+ \enablemode[sortorder-\currentmainlanguage]%
+ \readfile{\f!sortprefix new}\donothing\donothing % temporary hacks
+ \readfile{\f!sortprefix def}\donothing\donothing % defaults
+ \readfile{\f!sortprefix lan}\donothing\donothing}% language specifics
+
+% already done \prependtoks \savesortkeys \to \everystarttext
+
+\protect \endinput