ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Rik Kabel <context@rik.users.panix.com>
To: ntg-context@ntg.nl
Subject: Re: Solved, was Re: Register customization for backmatter page numbers
Date: Sat, 1 Aug 2015 21:28:39 -0400	[thread overview]
Message-ID: <55BD7247.2030807@rik.users.panix.com> (raw)
In-Reply-To: <55BD1327.4030207@rik.users.panix.com>


[-- Attachment #1.1: Type: text/plain, Size: 4395 bytes --]

On 2015-08-01 14:42, Rik Kabel wrote:
> On 2015-08-01 13:54, Pablo Rodriguez wrote:
>> Hi Rik,
>>
>> sorry for top-posting, but I’m not sure whether I understand your request.
>>
>> I wonder whether the following sample points in the right direction:
>>
>>      \setuppapersize[A6]
>>      \setuppagenumber[way=bypart, prefix=yes, prefixset=chapter]
>>      \startsectionblockenvironment[bodypart]
>>          \setuppagenumber[number=1]
>>      \stopsectionblockenvironment
>>      \startsectionblockenvironment[appendix]
>>          \setuppagenumber[number=1]
>>      \stopsectionblockenvironment
>>      \starttext
>>      \completecontent
>>      \startbodymatter
>>      \dorecurse{5}{\chapter{Chapter}\recurselevel\index{bar}}
>>      \stopbodymatter
>>      \startappendices
>>      \dorecurse{5}{\chapter{Appendix}\recurselevel\index{foo}}
>>      \title{Index}
>>      \placeindex
>>      \stopappendices
>>      \stoptext
>>
>> Just in case it helps,
>>
>> Pablo
>>
>>
>> On 08/01/2015 04:20 AM, Rik wrote:
>>> List,
>>>
>>> I have a book with frontmatter, bodymatter, and backmatter. The
>>> frontmatter is pagenumbered with lc roman, and the bodymatter and
>>> backmatter are numbered, all by block.
>>>
>>> The backmatter contain a glossary, pagenotes, bibliography, and an
>>> index. In addition to the frontmatter and the bodymatter, both the
>>> glossary and the pagenotes contain items that are indexed.
>>>
>>> I need to distinguish pagenumbers that appear in the index so that the
>>> reader can identify where in the book the page is located. For the
>>> frontmatter, that is not a problem. For items that appear in the
>>> bodymatter or backmatter, however, page numbers are not unique.
>>>
>>> One method that has been suggested is to prefix the pagenumber displayed
>>> in the index with a mark to indicate that the page is in the backmatter,
>>> or to italicize it, or to use an alternate font. I have looked at the
>>> defineconversionset and defineprocessor documentation and find no way to
>>> mark index entries appropriately.
>>>
>>> Can anyone suggest a way to do this, or some other method? Perhaps a
>>> pagecommand that compares the register item real page number to the
>>> highest real page number of the body? I would prefer a solution that
>>> does not require changing the register commands (\index) in the text.
>>>
>>> Continuous numbering across the frontmatter, bodymatter, and backmatter
>>> is not wanted, although as a last resort I might be able to argue for
>>> continuous numbering in the bodymatter and backmatter.
> Thank you, Pablo. That does meet the requirements as stated, but 
> having the chapter number as a prefix for the body entries is overly 
> verbose and will not pass muster. (Failure of my specifications.)
>
> I have found a solution, however. By placing these in the environment:
>
>     \defineprocessor[Back][style=slanted,right=n]
>     \defineprocessor[Front][style=normal]
>     \def\Where{Front}
>     \def\Index{\index[\Where->]}
>
> And this at the start of the backmatter:
>
>     \def\Where{Back}
>
> I can index items with \Index{item} and the value of \Where when the 
> entry is processed will be used. This meets the requirement that no 
> change to the indexing is required in the text (except to change 
> \index to \Index), and I can further distinguish notes from glossary 
> entries if needed. I could even eliminate that last change by defining 
> my own register Index and using \def\index{\Index[\Where->] (and an 
> appropriate \placeregister).
>
> I still haven't played with this a lot, so I don't know yet if it will 
> handle all the optional bits of register entries, but it should 
> suffice for my current needs.
>
And a more robust solution that takes into account index sort keys:

    % macros=mkvi
    \starttexdefinition unexpanded index
       \dosingleempty\doStartindex
    \stoptexdefinition
    \starttexdefinition doStartindex [#sortkey]
       \doifmodeelse{*backpart}
          {\Index[Back->#sortkey]}
          {\Index[notBack->#sortkey]}
    \stoptexdefinition
    \defineprocessor[Back]    [style=slanted,right=n]
    \defineprocessor[notBack] [style=normal]
    \defineregister [Index]
    \setupregister  [Index]   [n=2,command=\Word,balance=no,compress=yes]


-- 
rik

[-- Attachment #1.2: Type: text/html, Size: 5522 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      reply	other threads:[~2015-08-02  1:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-01  2:20 Rik
2015-08-01 17:54 ` Pablo Rodriguez
2015-08-01 18:42   ` Solved, was " Rik Kabel
2015-08-02  1:28     ` Rik Kabel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55BD7247.2030807@rik.users.panix.com \
    --to=context@rik.users.panix.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).