summaryrefslogtreecommitdiff
path: root/tex/context/base/sort-new.tex
blob: c7bea35a8674e3b5117b1e8c612be2d41aff940f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
% temporary overloading

\unprotect

\def\strippedcsname
  {\expandafter\dostrippedcsname\string}

\def\dostrippedcsname#1%
  {\if\noexpand#1\letterbackslash\else#1\fi}

\def\doregisterreference[#1]#2%
  {\doifvalue{\??id#1\c!referencing}\v!on
     {\pagereference[#1:\strippedcsname#2]}}

\def\doprocesspageregister[#1]#2#3% key altnum entry
  {\begingroup
   \thisisnextinternal\s!ind
   \ifduplicate\getlastregisterentry{#3}\fi
   \convertexpanded{\registerparameter\c!keyexpansion}{#1}\asciiregisterentryA
   \convertexpanded{\registerparameter\c!expansion   }{#3}\asciiregisterentryB
   \doifsomething{\registerparameter\c!keyexpansion}
     {\ifx\asciiregisterentryA\empty
       \convertexpanded{\registerparameter\c!keyexpansion}{#3}\asciiregisterentryA
      \fi}%
   \makesectionformat
   \doifelse{\registerparameter\c!ownnumber}\v!yes
     \donetrue\donefalse
   % the spaces between } { are essential for texutil's split
   \expanded
     {\writeutility%
        {r \ifcase\registerpagestatus\space\or e \or f \or t \fi
         {\currentregister} %
         {\nextinternalreference} %
         {\asciiregisterentryA} %
         {\asciiregisterentryB} %
         {\sectionformat\sectionseparator\sectionseparator
          \ifdone#2\else\noexpand\pagenumber\fi} %
         {\noexpand\realfolio}}}%
   \getfirstcharacter\currentregister
   \registerinfo{> \firstcharacter}{#3}%
   \endgroup}

\def\reduceargument#1\to#2%
  {\begingroup
   \reducetocoding[raw]%
   \edef\ascii{#1}%
   \expandafter\endgroup\expandafter\edef\expandafter#2\expandafter{\ascii}}

\protect