strc-syn.mkiv /size: 20 Kb    last modification: 2023-12-21 09:44
1%D \module
2%D   [       file=strc-syn,
3%D        version=2008.10.20,
4%D          title=\CONTEXT\ Structure Macros,
5%D       subtitle=Synonyms and Sorting,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\writestatus{loading}{ConTeXt Structure Macros / Synonyms and Sorting}
15
16\registerctxluafile{strc-syn}{}
17
18%D Although we could nowadays build this on top of regular lists we keep this
19%D more efficient variant around. Eventually we can add some options to lists
20%D that also provide such functionality but at the cost of much more overhead.
21%D
22%D We show a usage of both synonyms and sorts, which are deep down variants of
23%D so called simple lists. A definition looks like this:
24%D
25%D \startbuffer
26%D \definesynonyms
27%D   [myabbreviation]
28%D
29%D \setupsynonyms
30%D   [myabbreviation]
31%D   [headstyle=bold,
32%D    headcolor=darkred,
33%D    synonymstyle=boldslanted,
34%D    synonymcolor=darkblue,
35%D    textstyle=slanted,
36%D    textcolor=darkgreen,
37%D    style=normal,
38%D    color=darkyellow]
39%D
40%D \definesorting
41%D   [mylogo]
42%D
43%D \setupsorting
44%D   [mylogo]
45%D   [style=bold,
46%D    color=darkmagenta]
47%D \stopbuffer
48%D
49%D \typebuffer \getbuffer
50%D
51%D More complex definitions involves commands to call up meanings and such. The
52%D use of the defined commands is as follows: \
53%D
54%D \startbuffer
55%D \myabbreviation [FIRST]  {TheFirst}  {The First Words}
56%D \myabbreviation [SECOND] {TheSecond} {The Second Words}
57%D \myabbreviation [THIRD]  {TheThird}  {The Third Words}
58%D
59%D \mylogo [FOURTH] {TheFourth}
60%D \stopbuffer
61%D
62%D \typebuffer \getbuffer
63%D
64%D By default a synonym is just typeset and flagges as being used, so that in
65%D a list it wil be shows with its meaning. You can however also expand the
66%D meaning automatically at first use:
67%D
68%D \startbuffer
69%D \setupsynonyms[myabbreviation][alternative=first]
70%D
71%D We have \FIRST, \SECOND\ and also \THIRD\ but no \FOURTH.
72%D
73%D We have \FIRST, \SECOND\ and also \THIRD\ but no \FOURTH.
74%D \stopbuffer
75%D
76%D \typebuffer \getbuffer
77%D
78%D We can change the order, as demonstrated in:
79%D
80%D \startbuffer
81%D \resetshownsynonyms[myabbreviation]
82%D
83%D \setupsynonyms[myabbreviation][alternative=last]
84%D
85%D We have \FIRST\ and \THIRD\ or \FOURTH.
86%D
87%D We have \FIRST\ and \THIRD\ or \FOURTH.
88%D \stopbuffer
89%D
90%D \typebuffer \getbuffer
91%D
92%D A list is called up with:
93%D
94%D \startbuffer
95%D \placelistofsynonyms[myabbreviation]
96%D
97%D \placelistofsorts[mylogo]
98%D \stopbuffer
99%D
100%D \typebuffer \getbuffer
101%D
102%D The lists are constructions (like descriptions are) and can be set up
103%D likewise.
104%D
105%D You can show the currently accessed entries as follows:
106%D
107%D \starttyping
108%D \startchapter[title=One]
109%D     test \FIRST\ test test \THIRD\ test \blank
110%D     \placelistofsynonyms[myabbreviation]
111%D     \resetsynonymsprogress[myabbreviation] % reset state
112%D \stopchapter
113%D
114%D \startchapter[title=Two]
115%D     test \FIRST\ test test \SECOND\ test \blank
116%D     \placelistofsynonyms[myabbreviation][criterium=current]
117%D     \resetsynonymsprogress[myabbreviation] % reset state
118%D \stopchapter
119%D
120%D \startchapter[title=Three]
121%D     test test test test test test \blank
122%D     \placelistofsynonyms[myabbreviation][criterium=current] % also reset state
123%D \stopchapter
124%D
125%D \startchapter[title=All]
126%D     \placelistofsynonyms[myabbreviation][criterium=all]
127%D \stopchapter
128%D \stoptyping
129
130% todo: add 'define only' option to descriptions, then add sorting (also based on key)
131% and call to definition -> replaces this module
132
133\unprotect
134
135% split but common in lua
136
137\def\preprocessexpansion#1#2#3#4% do this at the lua end if still needed
138  {\ifx#1\s!xml
139     \xmlstartraw
140       \xdef#2{#4}%
141     \xmlstopraw
142     \glet#3\s!xml
143   \else
144     \ifx#1\v!yes
145       \xdef#2{#4}%
146     \else
147       \xdef#2{\detokenize{#4}}%
148     \fi
149     \glet#3\s!tex
150   \fi}
151
152%D We now use a simple list variant:
153
154\installcorenamespace {simplelist}
155
156\installcommandhandler \??simplelist {simplelist} \??simplelist
157
158\let\setupsimplelists\setupsimplelist
159
160\setupsimplelists[%
161    %c!title=,
162    %c!text=,
163    %
164    %c!style=,
165    %c!color=,
166    %c!command=,
167    %c!align=,
168    %
169    %c!headstyle=,
170    %c!headcolor=,
171    %c!headalign=,
172    %
173    %c!titlestyle=,
174    %c!titlecolor=,
175    %c!titlecommand=,
176    %c!titleleft=,
177    %c!titleright=,
178    %
179    %c!closesymbol=,
180    %c!closecommand=,
181    %
182    \c!alternative=\v!left,
183    \c!display=\v!yes,
184    \c!width=7\emwidth,
185    \c!distance=\emwidth,
186    \c!titledistance=.5\emwidth,
187    %c!hang=,
188    %c!sample=,
189    \c!margin=\v!no,
190    \c!before=\startpacked,
191    \c!inbetween=\blank,
192    \c!after=\stoppacked,
193    %c!indentnext=,
194    %c!indenting=,
195    %
196    \c!expansion=\v!no,
197    %c!xmlsetup=,
198    %s!catcodes=,
199    \s!language=\currentmainlanguage,
200]
201
202\appendtoks
203    \setfalse\c_strc_constructions_define_commands
204    \ifx\currentsimplelistparent\empty
205        \defineconstruction[\currentsimplelist][\s!handler=\v!simplelist,\c!level=1]%
206    \else
207        \defineconstruction[\currentsimplelist][\currentsimplelistparent][\s!handler=\v!simplelist,\c!level=1]%
208    \fi
209    \settrue\c_strc_constructions_define_commands
210\to \everydefinesimplelist
211
212\setuvalue{\??constructioninitializer\v!simplelist}%
213  {\let\currentsimplelist               \currentconstruction
214   \let\constructionparameter           \simplelistparameter
215   \let\constructionnamespace           \??simplelist
216   \let\detokenizedconstructionparameter\detokenizedsimplelistparameter
217   \let\letconstructionparameter        \letsimplelistparameter
218   \let\useconstructionstyleandcolor    \usesimpleliststyleandcolor
219   \let\setupcurrentconstruction        \setupcurrentsimplelist}
220
221\setuvalue{\??constructionfinalizer\v!simplelist}%
222  {}
223
224\setuvalue{\??constructiontexthandler\v!simplelist}%
225  {\begingroup
226   \useconstructionstyleandcolor\c!headstyle\c!headcolor
227   \the\everyconstruction
228   \constructionparameter\c!headcommand
229     {\strut
230      \currentsimplelistentry}%
231   \endgroup}
232
233% And we build on top of this.
234
235\ifdefined\dotagsynonym \else \let\dotagsynonym\relax \fi
236\ifdefined\dotagsorting \else \let\dotagsorting\relax \fi
237
238\definesimplelist
239  [\v!synonym]
240  [\c!state=\v!start,
241  %\c!synonymstyle=,
242  %\c!textstyle=,
243  %\c!headstyle=,
244  %\c!headcolor=,
245  %\c!criterium=,
246   \c!location=\v!left,
247   \c!width=5\emwidth,
248   \c!distance=\zeropoint,
249  %\c!sample=,
250  %\c!hang=,
251  %\c!align=,
252  %\c!before=,
253  %\c!inbetween=,
254  %\c!after=,
255   \c!indentnext=\v!no,
256  %\c!expansion=,
257   \c!method=]
258
259\let\setupsynonyms\setupsimplelist
260
261\unexpanded\def\definesynonyms
262  {\doquadrupleempty\strc_synonyms_define}
263
264\def\strc_synonyms_define[#1][#2][#3][#4]% name plural \meaning \use
265  {\edef\currentsynonym{#1}%
266   \iffourthargument
267     \unexpanded\def#4##1{\strc_synonyms_insert{#1}{##1}}% name tag
268     \ifthirdargument
269       \unexpanded\def#3##1{\strc_synonyms_insert_meaning{#1}{##1}}% \meaning
270     \fi
271     \setuvalue{#1}{\definesynonym[\v!no][#1]}% \name
272   \else
273     \ifthirdargument
274       \unexpanded\def#3##1{\strc_synonyms_insert_meaning{#1}{##1}}% \meaning
275     \fi
276     \setuvalue{#1}{\definesynonym[\v!yes][#1]}% \name
277   \fi
278   %
279%  \checksynonymparent
280%  \setupcurrentsynonym[\s!single={#1},\s!multi={#2}]%
281   \setfalse\c_strc_constructions_define_commands
282   \definesimplelist
283     [\currentsynonym]%
284     [\v!sorting]
285     [\s!single={#1},%
286      \s!multi={#2}]%
287   \settrue\c_strc_constructions_define_commands
288   %
289   \presetheadtext[#2=\Word{#2}]% changes the \if...argument
290   %
291   \setvalue{\e!setup #2\e!endsetup}{\setupsynonyms[#1]}% obsolete definition
292   \setvalue{\e!place   \e!listof#2}{\placelistofsynonyms[#1]}% accepts extra argument
293   \setvalue{\e!complete\e!listof#2}{\completelistofsynonyms[#1]}}
294
295\unexpanded\def\definesynonym
296  {\dotripleempty\strc_synonyms_define_entry}
297
298\def\strc_synonyms_define_entry[#1][#2][#3]#4#5%
299  {\begingroup
300   \edef\currentsynonym{#2}%
301   \edef\currentsynonymtag{#3}%
302   \let\currentsimplelist\currentsynonym
303   \ifx\currentsynonymtag\empty
304     \edef\currentsynonymtag{#4}%
305   \fi
306   \ifx\currentsynonymtag\empty
307     % todo: error message
308   \else
309     % this is not that efficient, esp when we load a big list
310     \edef\currentsynonymexpansion{\simplelistparameter\c!expansion}%
311     \preprocessexpansion\currentsynonymexpansion\m_synonyms_text   \currentsynonymcoding{#4}%
312     \preprocessexpansion\currentsynonymexpansion\m_synonyms_meaning\currentsynonymcoding{#5}%
313     %
314     \clf_registersynonym
315        {\currentsynonym}%
316        {synonym}%
317        {%
318            metadata {%
319                catcodes \catcodetable
320                coding   {\currentsynonymcoding}%
321            \ifx\currentsynonymcoding\s!xml
322                xmlroot  {\xmldocument}%
323            \fi
324            }%
325            definition {%
326                tag     {\currentsynonymtag}%
327                synonym {\m_synonyms_text}%
328                meaning {\m_synonyms_meaning}%
329              % used    false
330            }%
331        }%
332     \relax
333     \doif{#1}\v!yes{\setuxvalue\currentsynonymtag{\strc_synonyms_insert{\currentsynonym}{\currentsynonymtag}}}%
334   \fi
335   \endgroup}
336
337\unexpanded\def\registersynonym
338  {\dodoubleargument\strc_synonyms_register}
339
340\def\strc_synonyms_register[#1][#2]%
341  {\clf_registerusedsynonym{#1}{#2}}
342
343\unexpanded\def\currentsynonymname         {\clf_synonymname         {\currentsimplelist}{\currentsynonymtag}}
344\unexpanded\def\currentsynonymmeaning      {\clf_synonymmeaning      {\currentsimplelist}{\currentsynonymtag}}
345\unexpanded\def\doifelsecurrentsynonymused {\clf_doifelsesynonymused {\currentsimplelist}{\currentsynonymtag}}
346\unexpanded\def\doifelsecurrentsynonymshown{\clf_doifelsesynonymshown{\currentsimplelist}{\currentsynonymtag}}
347\unexpanded\def\resetusedsynonyms      [#1]{\clf_resetsynonyms{#1}{used}}
348\unexpanded\def\resetshownsynonyms     [#1]{\clf_resetsynonyms{#1}{shown}}
349\unexpanded\def\resetlistsynonyms      [#1]{\clf_resetsynonyms{#1}{list}}
350\unexpanded\def\resetsynonyms          [#1]{\clf_resetsynonyms{#1}{all}}
351\unexpanded\def\resetsynonymsprogress  [#1]{\clf_resetsynonyms{#1}{progress}}
352
353\let\rawsynonymname   \clf_synonymname
354\let\rawsynonymmeaning\clf_synonymmeaning
355
356\installcorenamespace{simplelistalternative} % specific ways of rendering a list
357\installcorenamespace{simplelistrenderings}  % a namespace for setups (rather local)
358
359\installcommandhandler \??simplelistalternative {simplelistalternative} \??simplelistalternative
360
361\setupsimplelist
362  [\v!synonym]
363  [\c!alternative=\v!normal]
364
365\unexpanded\def\strc_synonyms_insert_meaning#1#2% name tag
366  {\dontleavehmode % otherwise we don't get it right at the beginning of a par
367   \begingroup
368   \def\currentsimplelist{#1}%
369   \def\currentsynonymtag{#2}%
370   \fastsetup{\??simplelistrenderings::\v!text}%
371   \endgroup}
372
373\unexpanded\def\strc_synonyms_insert#1#2% name tag
374  {\dontleavehmode % otherwise we don't get it right at the beginning of a par
375   \begingroup
376   \edef\currentsimplelist{#1}%
377   \let \currentsynonym\currentsimplelist % for a while
378   \def \currentsynonymtag{#2}%
379   \edef\currentsimplelistalternative{\simplelistparameter\c!alternative}%
380   \doifnotcommandhandler\??simplelistalternative\currentsimplelistalternative
381     {\let\currentsimplelistalternative\v!normal}%
382   \fastsetup{\??simplelistrenderings:\v!synonym:\currentsimplelistalternative}%
383   \normalexpanded{\endgroup\simplelistparameter\c!next}}
384
385% \setupsimplelistalternative
386%   [\c!command=\directsimplelistparameter\c!command]
387
388\definesimplelistalternative
389  [\v!normal]
390  [\c!inbetween=\space,
391   \c!left=(,
392   \c!right=)]
393
394\definesimplelistalternative
395  [\v!first]
396  [\v!normal]
397
398\definesimplelistalternative
399  [\v!last]
400  [\v!normal]
401
402\startsetups[\??simplelistrenderings::\v!synonym]
403    \begingroup
404    \dostarttaggedchained\t!synonym\currentsynonym\??simplelist
405    \dotagsynonym
406    \usesimpleliststyleandcolor\c!synonymstyle\c!synonymcolor
407    \simplelistparameter\c!synonymcommand{\currentsynonymname}%
408    \dostoptagged
409    \endgroup
410\stopsetups
411
412\startsetups[\??simplelistrenderings::\v!text]
413    \begingroup
414    \usehyphensparameter\simplelistparameter
415    \usesimpleliststyleandcolor\c!textstyle\c!textcolor
416    \simplelistparameter\c!textcommand{\currentsynonymmeaning}%
417    \endgroup
418\stopsetups
419
420\startsetups[\??simplelistrenderings:\v!synonym:\v!normal]
421    \fastsetup{\??simplelistrenderings::\v!synonym}
422\stopsetups
423
424\startsetups[\??simplelistrenderings:\v!synonym:\v!first]
425    \fastsetup{\??simplelistrenderings::\v!synonym}
426    \doifelsecurrentsynonymshown \donothing {
427        \simplelistalternativeparameter\c!inbetween
428        \simplelistalternativeparameter\c!left
429        \fastsetup{\??simplelistrenderings::\v!text}
430        \simplelistalternativeparameter\c!right
431    }
432\stopsetups
433
434\startsetups[\??simplelistrenderings:\v!synonym:\v!last]
435    \doifelsecurrentsynonymshown {
436        \fastsetup{\??simplelistrenderings::\v!synonym}
437    } {
438        \fastsetup{\??simplelistrenderings::\v!text}
439        \simplelistalternativeparameter\c!inbetween
440        \simplelistalternativeparameter\c!left
441        \fastsetup{\??simplelistrenderings::\v!synonym}
442        \simplelistalternativeparameter\c!right
443    }
444\stopsetups
445
446\unexpanded\def\placelistofsynonyms
447  {\dodoubleempty\strc_synonyms_place_list}
448
449\def\strc_synonyms_place_list[#1][#2]%
450  {\begingroup
451   \edef\currentsimplelist{#1}%
452   \doifelsecommandhandler\??simplelist\currentsimplelist
453     {\strc_constructions_initialize{#1}%
454      \setupcurrentsimplelist[#2]%
455      \let\synonymentry\strc_synonym_normal
456      % so we can hook tabulate into before and after
457      \normalexpanded{\simplelistparameter\c!before
458        \noexpand\clf_processsynonyms
459           {#1}%
460           {%
461               criterium {\simplelistparameter\c!criterium}%
462               language  {\simplelistparameter\s!language}%
463               method    {\simplelistparameter\c!method}%
464           }%
465        \relax
466      \simplelistparameter\c!after}%
467      \relax}%
468     {}% todo: message that invalid
469   \endgroup}
470
471\def\completelistofsynonyms
472  {\dodoubleempty\strc_synonyms_complete_list}
473
474\def\strc_synonyms_complete_list[#1][#2]%
475  {\begingroup
476   \edef\currentsimplelist{#1}%
477   \doifelsecommandhandler\??simplelist\currentsimplelist
478     {\normalexpanded{\startnamedsection[\v!chapter][\c!title={\headtext{\simplelistparameter\s!multi}},\c!reference=#1]}%
479        \strc_synonyms_place_list[#1][#2]%
480        \page
481      \stopnamedsection}%
482     {}% todo: message that invalid
483   \endgroup}
484
485\unexpanded\def\strc_synonym_normal#1#2#3#4%
486  {\begingroup
487   \def\currentsimplelistentry{#3}%
488   \csname\??constructionstarthandler\v!construction\endcsname
489   #4%
490   \csname\??constructionstophandler\v!construction\endcsname
491   \endgroup}
492
493%D Sorting (a simplified version of synonym).
494
495\definesimplelist
496  [\v!sorting]
497  [\c!state=\v!start,
498  %\c!command=, % we test for defined !
499  %\c!criterium=,
500  %\c!style=,
501   \c!before=\startpacked,
502   \c!after=\stoppacked,
503  %\c!expansion=,
504   \c!method=]
505
506\let\setupsorting\setupsimplelist
507
508\unexpanded\def\definesorting
509  {\dotripleempty\strc_sorting_define}
510
511% if #3=\relax or \v!none, then no command but still protected
512
513\def\strc_sorting_define[#1][#2][#3]%
514  {\edef\currentsorting{#1}%
515   \ifthirdargument
516     \doifnot{#3}\v!none
517       {\ifx#3\relax \else
518          \unexpanded\def#3##1{\strc_sorting_insert{#1}{##1}}%
519        \fi}%
520     \setuvalue{#1}{\definesort[\v!no][#1]}%
521   \else
522     \setuvalue{#1}{\definesort[\v!yes][#1]}%
523   \fi
524   \setfalse\c_strc_constructions_define_commands
525   \definesimplelist
526     [\currentsorting]%
527     [\v!sorting]
528     [\s!single={#1},%
529      \s!multi={#2}]%
530   \settrue\c_strc_constructions_define_commands
531   %
532   \presetheadtext[#2=\Word{#2}]% after \ifthirdargument -)
533   %
534   \setvalue{\e!setup #2\e!endsetup}{\setupsorting[#1]}% obsolete definition
535   \setvalue{\e!place   \e!listof#2}{\placelistofsorts[#1]}%
536   \setvalue{\e!complete\e!listof#2}{\completelistofsorts[#1]}}
537
538\unexpanded\def\definesort
539  {\dotripleempty\strc_sorting_define_entry}
540
541\def\strc_sorting_define_entry[#1][#2][#3]#4%
542  {\begingroup
543   \edef\currentsorting{#2}%
544   \edef\currentsortingtag{#3}%
545   \let\currentsimplelist\currentsimplelist
546   \ifx\currentsortingtag\empty
547     \edef\currentsortingtag{#4}%
548   \fi
549   \ifx\currentsortingtag\empty
550     % todo: error message
551   \else
552     \edef\currentsortingexpansion{\simplelistparameter\c!expansion}%
553     \preprocessexpansion\currentsortingexpansion\currentsortingtext\currentsortingcoding{#4}%
554     \clf_registersynonym
555        {\currentsorting}%
556        {sorting}%
557        {%
558            metadata {%
559                catcodes \catcodetable
560                coding   {\currentsortingcoding}%
561            \ifx\currentsortingcoding\s!xml
562                xmlroot  {\xmldocument}%
563            \fi
564            }%
565            definition {%
566                tag     {\currentsortingtag}%
567                synonym {\currentsortingtext}%
568              % used    false
569            }%
570        }%
571     \relax
572     \doif{#1}\v!yes{\setuxvalue\currentsortingtag{\strc_sorting_insert{\currentsorting}{\currentsortingtag}}}%
573   \fi
574   \endgroup}
575
576\unexpanded\def\currentsortingname         {\clf_synonymname         {\currentsimplelist}{\currentsortingtag}}
577\unexpanded\def\doifelsecurrentsortingused {\clf_doifelsesynonymused {\currentsimplelist}{\currentsortingtag}}
578\unexpanded\def\resetusedsortings      [#1]{\clf_resetusedsynonyms   {#1}}
579
580\setupsimplelist
581  [\v!sorting]
582  [\c!alternative=\v!normal]
583
584\unexpanded\def\strc_sorting_insert#1#2% name tag
585  {\dontleavehmode % otherwise we don't get it right at the beginning of a par
586   \begingroup
587   % no kap currently, of .. we need to map cap onto WORD
588   \edef\currentsorting{#1}%
589   \def \currentsortingtag{#2}%
590   \let \currentsimplelist\currentsorting
591   \edef\currentsimplelistalternative{\simplelistparameter\c!alternative}%
592   \doifnotcommandhandler\??simplelistalternative\currentsimplelistalternative
593     {\let\currentsimplelistalternative\v!normal}%
594   \fastsetup{\??simplelistrenderings:\v!sorting:\currentsimplelistalternative}%
595   \normalexpanded{\endgroup\simplelistparameter\c!next}}
596
597% or:
598%
599% \doifelsesetups{\??simplelistrenderings:\v!sorting:\currentsimplelistalternative}
600%    {\fastsetup{\??simplelistrenderings:\v!sorting:\currentsimplelistalternative}}
601%    {\fastsetup{\??simplelistrenderings:\v!sorting:\v!normal}}
602
603\startsetups [\??simplelistrenderings:\v!sorting:\v!normal]
604   \fastsetup{\??simplelistrenderings::\v!sorting}%
605\stopsetups
606
607\startsetups [\??simplelistrenderings::\v!sorting]
608    \begingroup
609    \dostarttaggedchained\t!sorting\currentsorting\??simplelist
610    \dotagsorting
611    \usesimpleliststyleandcolor\c!style\c!color
612    \currentsortingname
613    \dostoptagged
614    \endgroup
615\stopsetups
616
617\unexpanded\def\registersort
618  {\dodoubleargument\strc_sorting_register}
619
620\def\strc_sorting_register[#1][#2]%
621  {\clf_registerusedsynonym{#1}{#2}}
622
623% before after
624%
625% maybe just 'commandset' and then combine
626
627\unexpanded\def\placelistofsorts
628  {\dodoubleempty\strc_sorting_place_list}
629
630
631\def\strc_sorting_place_list[#1][#2]%
632  {\begingroup
633   \edef\currentsimplelist{#1}%
634   \strc_constructions_initialize{#1}%
635   \setupcurrentsimplelist[#2]%
636   \edef\p_simplelist_command{\simplelistparameter\c!command}%
637   \ifx\p_simplelist_command\empty
638     \let\synonymentry\strc_sorting_normal
639   \else
640     \let\synonymentry\strc_sorting_command
641   \fi
642   % so we can hook tabulate into before and after
643   \normalexpanded{\simplelistparameter\c!before
644     \noexpand\clf_processsynonyms
645        {#1}%
646        {%
647            criterium {\simplelistparameter\c!criterium}%
648            language  {\simplelistparameter\s!language}%
649            method    {\simplelistparameter\c!method}%
650        }%
651     \relax
652   \simplelistparameter\c!after}%
653   \endgroup}
654
655\unexpanded\def\completelistofsorts
656  {\dodoubleempty\strc_sorting_complete_list}
657
658\def\strc_sorting_complete_list[#1][#2]%
659  {\begingroup
660   \edef\currentsimplelist{#1}%
661   \normalexpanded{\startnamedsection[\v!chapter][\c!title={\headtext{\simplelistparameter\s!multi}},\c!reference=#1]}%
662   \strc_sorting_place_list[#1][#2]%
663   \page
664   \stopnamedsection
665   \endgroup}
666
667\def\strc_sorting_command#1#2#3#4% #4 is meaning but empty here
668  {\p_simplelist_command{#1}{#2}{#3}}
669
670\def\strc_sorting_normal#1#2#3#4% #4 is meaning but empty here
671  {\begingroup
672   \usesimpleliststyleandcolor\c!style\c!color
673   #3%
674   \endgroup
675   \par}
676
677%D Presets.
678
679% To be considered:
680%
681% \setupsimplelist
682%   [\v!sorting]
683%   [\c!headstyle=\simplelistparameter\c!synonymstyle,
684%    \c!headcolor=\simplelistparameter\c!synonymcolor,
685%    \c!style=\simplelistparameter\c!textstyle,
686%    \c!color=\simplelistparameter\c!textcolor]
687
688\definesynonyms
689  [\v!abbreviation]
690  [\v!abbreviations]
691  [\infull]
692
693\setupsynonyms
694  [\v!abbreviation]
695  [\c!hyphens=\v!no, % new, not yet in setup definitions
696   \c!textstyle=\v!capital]
697
698\definesorting
699  [\v!logo]
700  [\v!logos]
701% [\logogram] % no
702
703\protect \endinput
704