<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Thanks Robert,</p>
    <p>Initially I thought it would probably be Lua which could come up
      with a simple solution, though Hans had made it clear that
      'messing with' the key was the way to go, and, as always, he was
      proven correct. I simply had to find out the best way to do the
      messing! But when time allows I will take a closer look at the Lua
      possibilities.</p>
    <p>Julian<br>
    </p>
    <div class="moz-cite-prefix">On 1/2/22 18:49, Robert via ntg-context
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:7898B757-2A47-45B8-9B52-BC36BEB231D5@hccnet.nl">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div class="">Hi Julian,</div>
      <div class=""><br class="">
      </div>
      <div class="">Another solution could be to use Lua.</div>
      <div class=""><br class="">
      </div>
      <div class="">I have a multilingual document in which some
        elements to be printed bold (Language 1), and collected in an
        index (trk) arranged according their (verbal) stems. Elements
        from Language 2 are to be printed in italics in the text and
        collected in a separate index.</div>
      <div class=""><br class="">
      </div>
      <div class="">In the present example the morphemes from Language 2
        are separated by ::, the verbal stem ends in -.</div>
      <div class=""><br class="">
      </div>
      <div class="">In \\textbf the input is reproduced as is. Then
        interesting things happen in the index (trk).</div>
      <div class=""><br class="">
      </div>
      <div class="">The first element (until the first ::) is taken as
        an main entry in the index (hence !). Then the complete input is
        retained as the secondary entry. Note that in the index -
        separates the morphemes.</div>
      <div class=""><br class="">
      </div>
      <div class="">I use LuaLatex, but I am quite sure this is also
        possible in Context.</div>
      <div class=""><br class="">
      </div>
      <div class="">
        <div class="">It is quite complex, but it works.</div>
        <div class=""><br class="">
        </div>
        <div class="">Robert</div>
      </div>
      <div class=""><br class="">
      </div>
      <div class=""><br class="">
      </div>
      <div class="">
        <div class="">\newcommand{\TWI}[1]{\directlua{twi_help(\luastring{#1})}}</div>
      </div>
      <div class=""><br class="">
      </div>
      <div class="">
        <div class="">\begin{luacode}</div>
        <div class="">function twi_help ( s )</div>
      </div>
      <div class="">   s = unicode.utf8.gsub (s,
        '^([^:]+)::([^:]+)::([^:]+)::([^:]+)::([^:]+)$' ,
        '\\textbf{%1::%2::%3%::%4::%5}\\sindex%[trk%]{%#%1!%1%-%2%-%3%-%4-%5}’
        )</div>
      <div class=""><br class="">
      </div>
      <div class="">  s = unicode.utf8.gsub … other action</div>
      <div class=""><br class="">
      </div>
      <div class="">\end{luacode}</div>
      <div class=""><br class="">
      </div>
      <div class="">\begin{document}</div>
      <div class=""><br class="">
      </div>
      <div class="">text text text text \TWI{dī-::dū::kin::dah} text
        text text text text </div>
      <div class=""><br class="">
      </div>
      <div class="">\end{document}</div>
      <div class=""><br class="">
      </div>
      <div class=""><br class="">
      </div>
      <div><br class="">
        <blockquote type="cite" class="">
          <div class="">Op 1 feb. 2022, om 01:41 heeft jbf via
            ntg-context <<a href="mailto:ntg-context@ntg.nl"
              class="moz-txt-link-freetext" moz-do-not-send="true">ntg-context@ntg.nl</a>>
            het volgende geschreven:</div>
          <br class="Apple-interchange-newline">
          <div class="">
            <meta http-equiv="Content-Type" content="text/html;
              charset=UTF-8" class="">
            <div class="">
              <p class="">Yes, Adam, that works. Though it can be a
                laborious solution, since it means creating keys for
                everything in a sub entry list (and I have many
                instances, 40 or more in some cases). However, I did not
                ask for a 'simple' solution, just a solution! Thank you.</p>
              <p class="">Julian<br class="">
              </p>
              <div class="moz-cite-prefix">On 1/2/22 11:09, Adam
                Reviczky wrote:<br class="">
              </div>
              <blockquote type="cite"
cite="mid:CABaoHutx-0FK9X2-xoy8Zw27BsKGCgQYRS3_XP84PVUEoJYS3g@mail.gmail.com"
                class="">
                <meta http-equiv="content-type" content="text/html;
                  charset=UTF-8" class="">
                <div dir="ltr" class="">
                  <div class="">Hi Julian,</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">How about using the keys in every
                    instance?</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">\setupregister[index][n=1,method={zc,pc,zm,pm,uc},style=WORD]<br
                      class="">
                    \defineprocessor[special][style=italic]<br class="">
                    <br class="">
                    \starttext<br class="">
                    P\index[Plenary+periti]{Plenary Council+{\it periti}
                    (experts)}<br class="">
                    B\index[Plenary+beriti]{Plenary Council+{\it beriti}
                    (experts)}<br class="">
                    A\index[Plenary+aeriti]{Plenary Council+aeriti
                    (experts)}<br class="">
                    <br class="">
                    S\index[animals+special]{animals+‘special kinds’}<br
                      class="">
                    B\index[animals+bpecial]{animals+bpecial}<br
                      class="">
                    A\index[animals+apecial]{animals+‘apecial’}<br
                      class="">
                    U\index[animals+upecial]{animals+‘upecial’}<br
                      class="">
                    T\index[animals+tpecial]{animals+tpecial}<br
                      class="">
                    <br class="">
                    \placeindex<br class="">
                    \stoptext</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">See result in: <a
                      href="https://live.contextgarden.net/cgi-bin/result.cgi?id=j46XhZ"
                      moz-do-not-send="true"
                      class="moz-txt-link-freetext">https://live.contextgarden.net/cgi-bin/result.cgi?id=j46XhZ</a></div>
                  <div class=""><br class="">
                  </div>
                  <div class="">Adam<br class="">
                  </div>
                </div>
                <br class="">
                <div class="gmail_quote">
                  <div dir="ltr" class="gmail_attr">On Mon, Jan 31, 2022
                    at 10:38 PM jbf via ntg-context <<a
                      href="mailto:ntg-context@ntg.nl"
                      moz-do-not-send="true"
                      class="moz-txt-link-freetext">ntg-context@ntg.nl</a>>
                    wrote:<br class="">
                  </div>
                  <blockquote class="gmail_quote" style="margin:0px 0px
                    0px 0.8ex;border-left:1px solid
                    rgb(204,204,204);padding-left:1ex">
                    <div class="">
                      <p class="">Let me come back to the unresolved
                        (for me) question of two situations in sub
                        entries to a book index (register). Sub entries
                        that have formatting or sub entries that are
                        surrounded by quote marks (straight or curly, it
                        makes no difference) do not appear in the
                        correct alphabetical order.</p>
                      <p class="">Two attempts on my part:</p>
                      <p class="">text before
                        \index[Plenary+periti]{Plenary Council+{\it
                        periti} (experts)} text after.</p>
                      <p class="">text before \index{animals+‘special
                        kinds’} text after. Or alternatively,
                        \index[animals+special]{animals+‘special kinds’}</p>
                      <p class="">The setup for my register is a pretty
                        standard one. The processor is not for the
                        'periti' case above but I use it for book
                        titles.<span style="" class=""></span></p>
                      <pre style="margin:0px;text-indent:0px" class=""><span style="color:rgb(128,0,0)" class="">\setupregister</span><span style="" class="">[index][n=1,method={</span><span style="text-decoration: underline;" class="">zc</span><span style="" class="">,pc,</span><span style="text-decoration: underline;" class="">zm</span><span style="" class="">,pm,</span><span style="text-decoration: underline;" class="">uc</span><span style="" class="">},style=WORD]</span></pre>
                      <pre style="margin:0px;text-indent:0px" class=""><span style="color:rgb(128,0,0)" class="">\defineprocessor</span><span style="" class="">[special][style=italic]</span></pre>
                      <p class="">In the periti case it is the \it
                        command that clearly interferes with correct
                        alphabetic positioning in the sub entry list.
                        Placing +periti in the key does not overcome
                        that problem.</p>
                      <p class="">In the ‘special kinds’ case it is the
                        initial single quote mark (‘) that causes the
                        problem. The item comes last in the sub entry
                        list. And if i include a key [special], then it
                        comes first in the sub entry list. Either way,
                        it is out of the desired sorting order.</p>
                      <p class="">I believe I have followed the helpful
                        suggestions of various ones, but it is always
                        possible that I have not fully understood those
                        suggestions. The reality is that at the moment
                        the issue remains unresolved for me. Any further
                        wisdom out there to offer me?</p>
                      <p class="">Julian </p>
                    </div>
___________________________________________________________________________________<br
                      class="">
                    If your question is of interest to others as well,
                    please add an entry to the Wiki!<br class="">
                    <br class="">
                    maillist : <a href="mailto:ntg-context@ntg.nl"
                      target="_blank" moz-do-not-send="true"
                      class="moz-txt-link-freetext">ntg-context@ntg.nl</a>
                    / <a
                      href="http://www.ntg.nl/mailman/listinfo/ntg-context"
                      rel="noreferrer" target="_blank"
                      moz-do-not-send="true"
                      class="moz-txt-link-freetext">http://www.ntg.nl/mailman/listinfo/ntg-context</a><br
                      class="">
                    webpage  : <a href="http://www.pragma-ade.nl/"
                      rel="noreferrer" target="_blank"
                      moz-do-not-send="true"
                      class="moz-txt-link-freetext">http://www.pragma-ade.nl</a>
                    / <a href="http://context.aanhet.net/"
                      rel="noreferrer" target="_blank"
                      moz-do-not-send="true"
                      class="moz-txt-link-freetext">http://context.aanhet.net</a><br
                      class="">
                    archive  : <a
                      href="https://bitbucket.org/phg/context-mirror/commits/"
                      rel="noreferrer" target="_blank"
                      moz-do-not-send="true"
                      class="moz-txt-link-freetext">https://bitbucket.org/phg/context-mirror/commits/</a><br
                      class="">
                    wiki     : <a href="http://contextgarden.net/"
                      rel="noreferrer" target="_blank"
                      moz-do-not-send="true"
                      class="moz-txt-link-freetext">http://contextgarden.net</a><br
                      class="">
___________________________________________________________________________________<br
                      class="">
                  </blockquote>
                </div>
              </blockquote>
            </div>
___________________________________________________________________________________<br
              class="">
            If your question is of interest to others as well, please
            add an entry to the Wiki!<br class="">
            <br class="">
            maillist : <a href="mailto:ntg-context@ntg.nl"
              class="moz-txt-link-freetext" moz-do-not-send="true">ntg-context@ntg.nl</a>
            / <a href="http://www.ntg.nl/mailman/listinfo/ntg-context"
              class="moz-txt-link-freetext" moz-do-not-send="true">http://www.ntg.nl/mailman/listinfo/ntg-context</a><br
              class="">
            webpage  : <a href="http://www.pragma-ade.nl"
              class="moz-txt-link-freetext" moz-do-not-send="true">http://www.pragma-ade.nl</a>
            / <a href="http://context.aanhet.net"
              class="moz-txt-link-freetext" moz-do-not-send="true">http://context.aanhet.net</a><br
              class="">
            archive  : <a
              href="https://bitbucket.org/phg/context-mirror/commits/"
              class="moz-txt-link-freetext" moz-do-not-send="true">https://bitbucket.org/phg/context-mirror/commits/</a><br
              class="">
            wiki     : <a href="http://contextgarden.net"
              class="moz-txt-link-freetext" moz-do-not-send="true">http://contextgarden.net</a><br
              class="">
___________________________________________________________________________________<br
              class="">
          </div>
        </blockquote>
      </div>
      <br class="">
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : <a class="moz-txt-link-abbreviated" href="mailto:ntg-context@ntg.nl">ntg-context@ntg.nl</a> / <a class="moz-txt-link-freetext" href="http://www.ntg.nl/mailman/listinfo/ntg-context">http://www.ntg.nl/mailman/listinfo/ntg-context</a>
webpage  : <a class="moz-txt-link-freetext" href="http://www.pragma-ade.nl">http://www.pragma-ade.nl</a> / <a class="moz-txt-link-freetext" href="http://context.aanhet.net">http://context.aanhet.net</a>
archive  : <a class="moz-txt-link-freetext" href="https://bitbucket.org/phg/context-mirror/commits/">https://bitbucket.org/phg/context-mirror/commits/</a>
wiki     : <a class="moz-txt-link-freetext" href="http://contextgarden.net">http://contextgarden.net</a>
___________________________________________________________________________________
</pre>
    </blockquote>
  </body>
</html>