ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* register: spurious space & one more entry level ask
@ 2007-09-19 18:44 Vit Zyka
  2007-09-19 19:44 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Vit Zyka @ 2007-09-19 18:44 UTC (permalink / raw)
  To: ConTeXt

Dear ConTeXters,

there are 3 topics dealing with register (index):

1. [Spurious space] There are entries like
      \registerpage{index}{,}{5}{2--1-1-0-1-0-0-0--1}{2}
    in a *.tuo file. Since the definition (core-reg.tex)
      \def\dosetpageregisterpage#1#2#3#4#5#6%
        {\doifreglevelelse[#5]%
          {\dodosetpageregisterpage{#1}{#2}{#3}{#4}{#5}{#6}}%
          {}}
    there will be a spurious space between page number like
      Entry 23 , 67
    instead of
      Entry 23, 67

    Solution:
      \def\dosetpageregisterpage#1#2#3#4#5#6%
        {\doifreglevelelse[#5]%
          {\dodosetpageregisterpage{#1}{#2}{#3}{#4}{#5}{#6}}%
          {}\ignorespaces}

    Test file:
    --------------
    \starttext
      Text\index{test}.
      \page[yes]
      Paragraph\index{test}.
      \placeindex
    \stoptext
    --------------

2. [feature request] Current register implementation enable upto three 
entry level (\index{level 1+level 2+level 3}). My custommer require 4 
levels. Please could the entry number be extended?

3. [not important, just for info] Formating of the register entries is 
not much user friendly. See \hangindent1em in a following definition:

   \def\dosetpageregisterentrya#1#2%
     {\flushseenregisterpage
      \edef\currententrylevel{1}%
      \global\let\c!entryb\relax
      \global\let\c!entryc\relax
      \gdef\c!entrya
        {\iffirstregisterentry\else\endgraf\fi % new
         \global\firstregisterpagetrue
         \hangindent1em\noindent\c!entryreference
         \dohandlepageregisterentry{#1}{#2}%
         \global\firstregisterentryfalse
         \global\firstsubentrytrue
         \global\firstsubsubentrytrue}}

So, when one want the change formating he has to redefine this 
definition. It is against a ConTeXt spirit.

Best
Vit

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: register: spurious space & one more entry level ask
  2007-09-19 18:44 register: spurious space & one more entry level ask Vit Zyka
@ 2007-09-19 19:44 ` Hans Hagen
  2007-09-19 21:17   ` Vit Zyka
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2007-09-19 19:44 UTC (permalink / raw)
  To: vit.zyka, mailing list for ConTeXt users

Vit Zyka wrote:
> Dear ConTeXters,
> 
> there are 3 topics dealing with register (index):
> 
> 1. [Spurious space] There are entries like
>       \registerpage{index}{,}{5}{2--1-1-0-1-0-0-0--1}{2}
>     in a *.tuo file. Since the definition (core-reg.tex)
>       \def\dosetpageregisterpage#1#2#3#4#5#6%
>         {\doifreglevelelse[#5]%
>           {\dodosetpageregisterpage{#1}{#2}{#3}{#4}{#5}{#6}}%
>           {}}
>     there will be a spurious space between page number like
>       Entry 23 , 67
>     instead of
>       Entry 23, 67
> 
>     Solution:
>       \def\dosetpageregisterpage#1#2#3#4#5#6%
>         {\doifreglevelelse[#5]%
>           {\dodosetpageregisterpage{#1}{#2}{#3}{#4}{#5}{#6}}%
>           {}\ignorespaces}

interesting that no one noticed this before ... in core-uti.tex pushing 
the line ending was messed up when changing to catcode tables (well, 
pseudo ones in mkii)

\long\def\doutilities#1#2#3#4#5% % introduceren in utility file
   {\resetutilities
    % more than one utility thing can be handled in one pass,
    % for instance lists, so we process ##1 as list
    \def\douticommand##1{\csname\s!set##1\endcsname}%
    \processcommacommand[#1]\douticommand
    \begingroup
    \def\currentutilityfilename{#2}%
    \notesenabledfalse
    \doinpututilitiestrue
    \global\utilitydonefalse
    \pushcatcodetable
    \setcatcodetable\ctxcatcodes
    \pushendofline % <<<<<<<<<<<<<<<<<<<<<<<<<
    \ifunprotectutilities % nog nodig ?
      \unprotect
    \fi


> 2. [feature request] Current register implementation enable upto three 
> entry level (\index{level 1+level 2+level 3}). My custommer require 4 
> levels. Please could the entry number be extended?

not trivial, since we then need to adapt texutil too + a bunch of 
macros; adapting mkiv may be easier

> 3. [not important, just for info] Formating of the register entries is 
> not much user friendly. See \hangindent1em in a following definition:
> 
>    \def\dosetpageregisterentrya#1#2%
>      {\flushseenregisterpage
>       \edef\currententrylevel{1}%
>       \global\let\c!entryb\relax
>       \global\let\c!entryc\relax
>       \gdef\c!entrya
>         {\iffirstregisterentry\else\endgraf\fi % new
>          \global\firstregisterpagetrue
>          \hangindent1em\noindent\c!entryreference
>          \dohandlepageregisterentry{#1}{#2}%
>          \global\firstregisterentryfalse
>          \global\firstsubentrytrue
>          \global\firstsubsubentrytrue}}
> 
> So, when one want the change formating he has to redefine this 
> definition. It is against a ConTeXt spirit.

some day there will be a better interface (probably only in mkiv)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: register: spurious space & one more entry level ask
  2007-09-19 19:44 ` Hans Hagen
@ 2007-09-19 21:17   ` Vit Zyka
  2007-09-20  7:27     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Vit Zyka @ 2007-09-19 21:17 UTC (permalink / raw)
  To: Hans Hagen, ConTeXt

Jupiiiii!

Both patches (space & 4-level entry) work well as I can test them till 
now. I will do some testing on a real and big document in a near future.

Do you intend to incorporate both patches to the distribution?

Thank you Hans for extremely quick solutions
Vit

Hans Hagen wrote:
> Vit Zyka wrote:
>> Dear ConTeXters,
>>
>> there are 3 topics dealing with register (index):
>>
>> 1. [Spurious space] There are entries like
>>       \registerpage{index}{,}{5}{2--1-1-0-1-0-0-0--1}{2}
>>     in a *.tuo file. Since the definition (core-reg.tex)
>>       \def\dosetpageregisterpage#1#2#3#4#5#6%
>>         {\doifreglevelelse[#5]%
>>           {\dodosetpageregisterpage{#1}{#2}{#3}{#4}{#5}{#6}}%
>>           {}}
>>     there will be a spurious space between page number like
>>       Entry 23 , 67
>>     instead of
>>       Entry 23, 67
>>
>>     Solution:
>>       \def\dosetpageregisterpage#1#2#3#4#5#6%
>>         {\doifreglevelelse[#5]%
>>           {\dodosetpageregisterpage{#1}{#2}{#3}{#4}{#5}{#6}}%
>>           {}\ignorespaces}
> 
> interesting that no one noticed this before ... in core-uti.tex pushing 
> the line ending was messed up when changing to catcode tables (well, 
> pseudo ones in mkii)
> 
> \long\def\doutilities#1#2#3#4#5% % introduceren in utility file
>   {\resetutilities
>    % more than one utility thing can be handled in one pass,
>    % for instance lists, so we process ##1 as list
>    \def\douticommand##1{\csname\s!set##1\endcsname}%
>    \processcommacommand[#1]\douticommand
>    \begingroup
>    \def\currentutilityfilename{#2}%
>    \notesenabledfalse
>    \doinpututilitiestrue
>    \global\utilitydonefalse
>    \pushcatcodetable
>    \setcatcodetable\ctxcatcodes
>    \pushendofline % <<<<<<<<<<<<<<<<<<<<<<<<<
>    \ifunprotectutilities % nog nodig ?
>      \unprotect
>    \fi
> 
> 
>> 2. [feature request] Current register implementation enable upto three 
>> entry level (\index{level 1+level 2+level 3}). My custommer require 4 
>> levels. Please could the entry number be extended?
> 
> not trivial, since we then need to adapt texutil too + a bunch of 
> macros; adapting mkiv may be easier
> 
>> 3. [not important, just for info] Formating of the register entries is 
>> not much user friendly. See \hangindent1em in a following definition:
>>
>>    \def\dosetpageregisterentrya#1#2%
>>      {\flushseenregisterpage
>>       \edef\currententrylevel{1}%
>>       \global\let\c!entryb\relax
>>       \global\let\c!entryc\relax
>>       \gdef\c!entrya
>>         {\iffirstregisterentry\else\endgraf\fi % new
>>          \global\firstregisterpagetrue
>>          \hangindent1em\noindent\c!entryreference
>>          \dohandlepageregisterentry{#1}{#2}%
>>          \global\firstregisterentryfalse
>>          \global\firstsubentrytrue
>>          \global\firstsubsubentrytrue}}
>>
>> So, when one want the change formating he has to redefine this 
>> definition. It is against a ConTeXt spirit.
> 
> some day there will be a better interface (probably only in mkiv)
> 
> Hans
> 
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> -----------------------------------------------------------------

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: register: spurious space & one more entry level ask
  2007-09-19 21:17   ` Vit Zyka
@ 2007-09-20  7:27     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2007-09-20  7:27 UTC (permalink / raw)
  To: vit.zyka; +Cc: ConTeXt

Vit Zyka wrote:
> Jupiiiii!
> 
> Both patches (space & 4-level entry) work well as I can test them till 
> now. I will do some testing on a real and big document in a near future.
> 
> Do you intend to incorporate both patches to the distribution?

well, i always do such things directly in the source files so ...

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2007-09-20  7:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-19 18:44 register: spurious space & one more entry level ask Vit Zyka
2007-09-19 19:44 ` Hans Hagen
2007-09-19 21:17   ` Vit Zyka
2007-09-20  7:27     ` Hans Hagen

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