Re: [NTG-context] \defineprocessor and \at

2015-08-12 Thread Wolfgang Schuster

Rik Kabel 
12. August 2015 00:29
On 2015-08-11 14:49, Wolfgang Schuster wrote:

Rik Kabel 
4. August 2015 00:18
Should processors work with references? I would think that they 
should, but the following fails. (My backmatter page numbers need to 
be marked to distinguish them from bodymatter pages. I can automate 
applying a processor based on the location for index register 
entries, but not for references.)

\defineprocessor [bodypart] [style=bold]
\defineprocessor [backpart] [style=italic]

\defineconversionset[bodypart:pagenumber][][bodypart->n]
\defineconversionset[backpart:pagenumber][][backpart->n]

\setupheadertexts[{\convertedcounter[userpage][numberconversionset=number]}]

\starttext

\startbodymatter

\chapter[sec:knuth]{Knuth}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbodymatter

\startbackmatter

\chapter[sec:zapf]{Zapf}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbackmatter

\stoptext

Wolfgang


Wolfgang,

This is clearly a superior solution to my index-only attempt, handling 
all references to backmatter pages without regard to their being in 
the index or in text references.


However, the page number adjustment via \setupheadertexts is handled 
only at the top center (default location) of each page. Can you 
suggest how to modify this to support an un-processed page number in 
the right margin of the footer of backmatter pages? I currently use:


\setupheadertexts[][chapter][part][]
\setuppagenumbering [alternative=doublesided,location={footer,margin}]

and I do not see where 
{\convertedcounter[userpage][numberconversionset=number]} or something 
else to restore un-processed numbers might work, despite trying with 
\setupfootertexts, \setuppagenumbering, \setuppagenumbering, and 
related commands.
Disable the page number (\setuppagenumbering[location=none]) and use 
\setupfootertexts to place it.


\setupfootertexts[margin][][{\convertedcounter[userpage][numberconversionset=number]}][{\convertedcounter[userpage][numberconversionset=number]}][]
\setuppagenumbering [alternative=doublesided,location=none]

Wolfgang
___
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
___

Re: [NTG-context] \defineprocessor and \at

2015-08-11 Thread Rik Kabel

On 2015-08-11 14:49, Wolfgang Schuster wrote:

Rik Kabel 
4. August 2015 00:18
Should processors work with references? I would think that they 
should, but the following fails. (My backmatter page numbers need to 
be marked to distinguish them from bodymatter pages. I can automate 
applying a processor based on the location for index register 
entries, but not for references.)

\defineprocessor [bodypart] [style=bold]
\defineprocessor [backpart] [style=italic]

\defineconversionset[bodypart:pagenumber][][bodypart->n]
\defineconversionset[backpart:pagenumber][][backpart->n]

\setupheadertexts[{\convertedcounter[userpage][numberconversionset=number]}]

\starttext

\startbodymatter

\chapter[sec:knuth]{Knuth}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbodymatter

\startbackmatter

\chapter[sec:zapf]{Zapf}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbackmatter

\stoptext

Wolfgang


Wolfgang,

This is clearly a superior solution to my index-only attempt, handling 
all references to backmatter pages without regard to their being in the 
index or in text references.


However, the page number adjustment via \setupheadertexts is handled 
only at the top center (default location) of each page. Can you suggest 
how to modify this to support an un-processed page number in the right 
margin of the footer of backmatter pages? I currently use:


   \setupheadertexts[][chapter][part][]
   \setuppagenumbering [alternative=doublesided,location={footer,margin}]

and I do not see where 
{\convertedcounter[userpage][numberconversionset=number]} or something 
else to restore un-processed numbers might work, despite trying with 
\setupfootertexts, \setuppagenumbering, \setuppagenumbering, and related 
commands.


--
Rik

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

Re: [NTG-context] \defineprocessor and \at

2015-08-11 Thread Rik Kabel

On 2015-08-11 15:48, Wolfgang Schuster wrote:

Rik Kabel 
11. August 2015 21:41
On 2015-08-11 14:49, Wolfgang Schuster wrote:
Thank you, Wolfgang, for that. But it still does not handle the after 
key, as I had in my example, and which works in a processor for index 
entries. Is there no way to do this?
The processor mechanism has no after key and I have no idea what it is 
shoudl do.


My apologies, Wolfgang and list. The key I use is right, as in the 
following snippet from my environment. I should have checked my files 
instead of relying on memory when I replied.


When I add it to your solution it does work.

   \defineprocessor[Back][
   style=slanted,
   right=n,
  ]
   \defineprocessor[notBack][
  style=normal,
 ]

   \defineregister[Index]
   \setupregister [Index][n=2,
   command=\Word,
   balance=no,
   compress=yes,
  ]

   \starttexdefinition unexpanded index
  \dosingleempty\dostartindex
   \stoptexdefinition
   \starttexdefinition dostartindex [#sortkey]
  \doifmodeelse{*backpart}
 {\Index[Back->#sortkey]}
 {\Index[notBack->#sortkey]}
   \stoptexdefinition
   \starttexdefinition unexpanded seeindex
  \seeIndex
   \stoptexdefinition


   \starttexdefinition doIndex #INDEXTERM
  \expanded{\index{#INDEXTERM}}
   \stoptexdefinition

With this, I can use \index[Macintyre]{McIntyre, John} in the main text 
or an endnote and the indexing will identify the section. My simple use 
of the processor did not work, however, for references.


--
Rik
___
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
___

Re: [NTG-context] \defineprocessor and \at

2015-08-11 Thread Wolfgang Schuster

Rik Kabel 
11. August 2015 21:41
On 2015-08-11 14:49, Wolfgang Schuster wrote:
Thank you, Wolfgang, for that. But it still does not handle the after 
key, as I had in my example, and which works in a processor for index 
entries. Is there no way to do this?
The processor mechanism has no after key and I have no idea what it is 
shoudl do.


Wolfgang
___
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
___

Re: [NTG-context] \defineprocessor and \at

2015-08-11 Thread Rik Kabel

On 2015-08-11 14:49, Wolfgang Schuster wrote:

Rik Kabel 
4. August 2015 00:18
Should processors work with references? I would think that they 
should, but the following fails. (My backmatter page numbers need to 
be marked to distinguish them from bodymatter pages. I can automate 
applying a processor based on the location for index register 
entries, but not for references.)

\defineprocessor [bodypart] [style=bold]
\defineprocessor [backpart] [style=italic]

\defineconversionset[bodypart:pagenumber][][bodypart->n]
\defineconversionset[backpart:pagenumber][][backpart->n]

\setupheadertexts[{\convertedcounter[userpage][numberconversionset=number]}]

\starttext

\startbodymatter

\chapter[sec:knuth]{Knuth}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbodymatter

\startbackmatter

\chapter[sec:zapf]{Zapf}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbackmatter

\stoptext

Wolfgang

Thank you, Wolfgang, for that. But it still does not handle the after 
key, as I had in my example, and which works in a processor for index 
entries. Is there no way to do this?


--
Rik


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

Re: [NTG-context] \defineprocessor and \at

2015-08-11 Thread Wolfgang Schuster

Rik Kabel 
4. August 2015 00:18
Should processors work with references? I would think that they 
should, but the following fails. (My backmatter page numbers need to 
be marked to distinguish them from bodymatter pages. I can automate 
applying a processor based on the location for index register entries, 
but not for references.)

\defineprocessor [bodypart] [style=bold]
\defineprocessor [backpart] [style=italic]

\defineconversionset[bodypart:pagenumber][][bodypart->n]
\defineconversionset[backpart:pagenumber][][backpart->n]

\setupheadertexts[{\convertedcounter[userpage][numberconversionset=number]}]

\starttext

\startbodymatter

\chapter[sec:knuth]{Knuth}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbodymatter

\startbackmatter

\chapter[sec:zapf]{Zapf}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbackmatter

\stoptext

Wolfgang
___
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
___

Re: [NTG-context] \defineprocessor and \at

2015-08-11 Thread Rik Kabel

On 2015-08-03 18:18, Rik Kabel wrote:
Should processors work with references? I would think that they 
should, but the following fails. (My backmatter page numbers need to 
be marked to distinguish them from bodymatter pages. I can automate 
applying a processor based on the location for index register entries, 
but not for references.)


\defineprocessor[xx][style=slanted,after=n]
\starttext
\section[xxx]{Processor testing}
Why cannot a processor be applied to a reference? \at[xx->xxx]
\stoptext



Anyone?

--
Rik
___
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
___