ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Register customization for backmatter page numbers
@ 2015-08-01  2:20 Rik
  2015-08-01 17:54 ` Pablo Rodriguez
  0 siblings, 1 reply; 4+ messages in thread
From: Rik @ 2015-08-01  2:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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.

-- 
Rik Kabel


___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Register customization for backmatter page numbers
  2015-08-01  2:20 Register customization for backmatter page numbers Rik
@ 2015-08-01 17:54 ` Pablo Rodriguez
  2015-08-01 18:42   ` Solved, was " Rik Kabel
  0 siblings, 1 reply; 4+ messages in thread
From: Pablo Rodriguez @ 2015-08-01 17:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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.
> 


-- 
http://www.ousia.tk
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Solved, was Re:  Register customization for backmatter page numbers
  2015-08-01 17:54 ` Pablo Rodriguez
@ 2015-08-01 18:42   ` Rik Kabel
  2015-08-02  1:28     ` Rik Kabel
  0 siblings, 1 reply; 4+ messages in thread
From: Rik Kabel @ 2015-08-01 18:42 UTC (permalink / raw)
  To: ntg-context


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

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.

-- 
Rik


[-- Attachment #1.2: Type: text/html, Size: 4298 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Solved, was Re: Register customization for backmatter page numbers
  2015-08-01 18:42   ` Solved, was " Rik Kabel
@ 2015-08-02  1:28     ` Rik Kabel
  0 siblings, 0 replies; 4+ messages in thread
From: Rik Kabel @ 2015-08-02  1:28 UTC (permalink / raw)
  To: ntg-context


[-- 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-02  1:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-01  2:20 Register customization for backmatter page numbers 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 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).