ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* strange index behaviour with entries inside separatedlist
@ 2013-04-12  6:10 WolfgangZ
  2013-04-12  8:29 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: WolfgangZ @ 2013-04-12  6:10 UTC (permalink / raw)
  To: ntg-context

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]

Hello,
I get wrong list entries when using my register entries inside separate 
lists. Example case included, even if it is a bit longer. For 
explanation, I have two lists, the correct index is in section 1.2 in 
the attached example and printed on page 3 (see test.pdf). The one that 
causes trouble is set in section 1.3 (green table) and printed on page 
5. There the index links to page 4 instead of page 1, on which the entry 
is placed.

The example gets more strange, as the wrong index entries only occurs if 
there is no regular text below the table in section 1.3. For testing you 
can uncomment line 70 in file test.tex.

I hope anyone can help to explain that functionality.
Best regards
Wolfgang


[-- Attachment #2: test.pdf --]
[-- Type: application/x-as400attachment, Size: 18412 bytes --]

[-- Attachment #3: test.tex --]
[-- Type: text/plain, Size: 3553 bytes --]

\setupinteraction[state=start]
\usemodule[database]%
\mainlanguage[de] % for hyphenation
\setupbodyfont[sans,10pt]
\setuppagenumbering[alternative=doublesided] %sets doublesided print
\setuplayout[topspace=14.5mm,header=12mm,backspace=22.5mm,footer=12.6mm,height=258.2mm, footerdistance=4.3mm, rightmargin=41.05mm,headerdistance=0mm,leftmargin=6.3mm,width=131.7mm,location=doublesided,grid=yes,doublesided=yes]
% colors
\setupcolors[state=start,rgb=yes]

\startsetups[MyTable]
    \switchtobodyfont[8pt]
    \setupTABLE[frame=off,background=color,backgroundcolor=red]
    \setupTABLE[column][1][width=44.25mm,align=right]%,style=bf
    \setupTABLE[column][2][width=broad,align=right]
\stopsetups

\defineseparatedlist
  [MyTable]
  [separator=tab,
   left=\bTD,right=\eTD,
   first=\bTR,last=\eTR,
   before=\bTABLE,after=\eTABLE,
   setups=MyTable]
   
\startsetups[MyTableWrong]
    \switchtobodyfont[8pt]
    \setupTABLE[frame=off,background=color,backgroundcolor=green]
    \setupTABLE[column][1][width=15.0mm,align=right]%,style=bf
    \setupTABLE[column][2][width=broad,align=right]
    \setupTABLE[column][3][width=17.0mm,align=right]
    \setupTABLE[column][4][width=17.0mm,align=right]
    \setupTABLE[column][5][width=25.0mm,align=right]
\stopsetups

\defineseparatedlist
  [MyTableWrong]
  [separator=tab,
   left=\bTD,right=\eTD,
   first=\bTR,last=\eTR,
   before=\bTABLE,after=\eTABLE,
   setups=MyTableWrong]

\defineregister[Correctliste][style=slanted,pagestyle=bold,indicator=no]
\setupregister[Correctliste][coupling=yes]
 \def\Listright#1{\Correctliste{#1}{#1}}

\defineregister[Wrongliste][style=slanted,pagestyle=bold,indicator=no]
\setupregister[Wrongliste][coupling=yes]
 \def\Listwrong#1{\Wrongliste{#1}{#1}}

 
 
\chapter{F30000\\ asdf asdf asdf asdf}

\section{Section}
\language[DE]
asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf

asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
\section{Liste Right}
\Listright{Fux}; \Listright{Zha} 
These entries get correct page references.

\section{Liste Wrong}
\startMyTableWrong
V001	\Listwrong{ListEntry1}	09.12.2005	01.01.3000	text
V002	\Listwrong{Listentry2}	01.01.2004	01.01.3000	text
\stopMyTableWrong

% These entries are wrong, only in case that there is no further text line below. For testing, uncomment this line. 

\section{Details}
 
\startMyTable
Anm:	ABC
Andatum:	5/10/1994
Anummer:	08/545,845
Pub:	
Pubnummer:	
Ert:	12/23/1997
Ertnummer:	5,700,527
\stopMyTable

\startMyTable
Anm:	LL
Andatum:	5/10/1994
Annummer:	2303
Pub:	3/6/1996
Pubnummer:	0699257
Ert:	1/8/1997
Ertnummer:	257B1
\stopMyTable


\chapter{Index: Correct}
\placeregister[Correctliste]
  
\chapter{Index: Wrong}
\placeregister[Wrongliste]

[-- Attachment #4: 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] 6+ messages in thread

* Re: strange index behaviour with entries inside separatedlist
  2013-04-12  6:10 strange index behaviour with entries inside separatedlist WolfgangZ
@ 2013-04-12  8:29 ` Wolfgang Schuster
  2013-04-12  9:59   ` Hans Hagen
  2013-04-12 10:59   ` WolfgangZ
  0 siblings, 2 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2013-04-12  8:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 12.04.2013 um 08:10 schrieb WolfgangZ <wollez@gmx.net>:

> Hello,
> I get wrong list entries when using my register entries inside separate lists. Example case included, even if it is a bit longer. For explanation, I have two lists, the correct index is in section 1.2 in the attached example and printed on page 3 (see test.pdf). The one that causes trouble is set in section 1.3 (green table) and printed on page 5. There the index links to page 4 instead of page 1, on which the entry is placed.
> 
> The example gets more strange, as the wrong index entries only occurs if there is no regular text below the table in section 1.3. For testing you can uncomment line 70 in file test.tex.

Put the text before the index entry in your definition in \Listwrong the output is correct:

  \define[1]\Listwrong{#1\Wrongliste{#1}}

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
___________________________________________________________________________________


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

* Re: strange index behaviour with entries inside separatedlist
  2013-04-12  8:29 ` Wolfgang Schuster
@ 2013-04-12  9:59   ` Hans Hagen
  2013-04-12 10:59   ` WolfgangZ
  1 sibling, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2013-04-12  9:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/12/2013 10:29 AM, Wolfgang Schuster wrote:
>
> Am 12.04.2013 um 08:10 schrieb WolfgangZ <wollez@gmx.net>:
>
>> Hello,
>> I get wrong list entries when using my register entries inside separate lists. Example case included, even if it is a bit longer. For explanation, I have two lists, the correct index is in section 1.2 in the attached example and printed on page 3 (see test.pdf). The one that causes trouble is set in section 1.3 (green table) and printed on page 5. There the index links to page 4 instead of page 1, on which the entry is placed.
>>
>> The example gets more strange, as the wrong index entries only occurs if there is no regular text below the table in section 1.3. For testing you can uncomment line 70 in file test.tex.
>
> Put the text before the index entry in your definition in \Listwrong the output is correct:
>
>    \define[1]\Listwrong{#1\Wrongliste{#1}}

indeed .. an entry needs to be bound to something and when in vmode it 
gets bound to the next paragraph (otherwise we get weird spacing 
interference) .. one of these tex-chicken-egg issues

wolfgangs solution is the most efficient and definitely the way to do in 
when wrapping in macros

in this case, the flush is delayed to the next valid paragraph ... 
anyway, i sort of fixed it for tables .. at some point i will revise the 
whole binding issue (but it's somewhat tricky as lots of mechanisms then 
need testing)

in the next beta this works :

\setupinteraction[state=start]

\starttext

     \bTABLE \bTR \bTD \index{test 1} entry 1 \eTD \eTR \eTABLE \page
     \bTABLE \bTR \bTD \index{test 2} entry 2 \eTD \eTR \eTABLE \page

     \placeregister[index][n=1]

\stoptext


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: strange index behaviour with entries inside separatedlist
  2013-04-12  8:29 ` Wolfgang Schuster
  2013-04-12  9:59   ` Hans Hagen
@ 2013-04-12 10:59   ` WolfgangZ
  2013-04-12 12:07     ` Hans Hagen
  1 sibling, 1 reply; 6+ messages in thread
From: WolfgangZ @ 2013-04-12 10:59 UTC (permalink / raw)
  To: ntg-context

Am 12.04.2013 10:29, schrieb Wolfgang Schuster:
>
> Am 12.04.2013 um 08:10 schrieb WolfgangZ <wollez@gmx.net>:
>
>> Hello,
>> I get wrong list entries when using my register entries inside separate lists. Example case included, even if it is a bit longer. For explanation, I have two lists, the correct index is in section 1.2 in the attached example and printed on page 3 (see test.pdf). The one that causes trouble is set in section 1.3 (green table) and printed on page 5. There the index links to page 4 instead of page 1, on which the entry is placed.
>>
>> The example gets more strange, as the wrong index entries only occurs if there is no regular text below the table in section 1.3. For testing you can uncomment line 70 in file test.tex.
>
> Put the text before the index entry in your definition in \Listwrong the output is correct:
>
>    \define[1]\Listwrong{#1\Wrongliste{#1}}
>
> Wolfgang

Great, this solves the problem! Is it possible to explain the reason for 
the behavior of context to the order of the text entry and the command?

Many thanks for the quick reply.
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
___________________________________________________________________________________


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

* Re: strange index behaviour with entries inside separatedlist
  2013-04-12 10:59   ` WolfgangZ
@ 2013-04-12 12:07     ` Hans Hagen
  2013-04-15  6:54       ` Wolfgang
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2013-04-12 12:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: WolfgangZ

On 4/12/2013 12:59 PM, WolfgangZ wrote:
> Am 12.04.2013 10:29, schrieb Wolfgang Schuster:
>>
>> Am 12.04.2013 um 08:10 schrieb WolfgangZ <wollez@gmx.net>:
>>
>>> Hello,
>>> I get wrong list entries when using my register entries inside
>>> separate lists. Example case included, even if it is a bit longer.
>>> For explanation, I have two lists, the correct index is in section
>>> 1.2 in the attached example and printed on page 3 (see test.pdf). The
>>> one that causes trouble is set in section 1.3 (green table) and
>>> printed on page 5. There the index links to page 4 instead of page 1,
>>> on which the entry is placed.
>>>
>>> The example gets more strange, as the wrong index entries only occurs
>>> if there is no regular text below the table in section 1.3. For
>>> testing you can uncomment line 70 in file test.tex.
>>
>> Put the text before the index entry in your definition in \Listwrong
>> the output is correct:
>>
>>    \define[1]\Listwrong{#1\Wrongliste{#1}}
>>
>> Wolfgang
>
> Great, this solves the problem! Is it possible to explain the reason for
> the behavior of context to the order of the text entry and the command?

in order to track locations we need to inject a so called whatsit which 
is an invivible but definitely present entity an din order to make this 
work:

test

\index{xxx}

test

\index will bind to the next paragraph when it's a loner

otherwise we would get

test
<whitespace or at least valid breakpoint>
\index{xxx}
<whitespace or at least valid breakpoint>
test

which could show up as an unwanted extra whitespace and/or page break 
with dislocated index entry

this kind of behaviour has always been part of context, as we want to be 
able to do

\chapter{...}

\index{...}
\index{...}
\index{...}
\index{...}
\index{...}

some text ...

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: strange index behaviour with entries inside separatedlist
  2013-04-12 12:07     ` Hans Hagen
@ 2013-04-15  6:54       ` Wolfgang
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang @ 2013-04-15  6:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 12.04.2013 14:07, schrieb Hans Hagen:
> On 4/12/2013 12:59 PM, WolfgangZ wrote:
>> Am 12.04.2013 10:29, schrieb Wolfgang Schuster:
>>>
>>> Am 12.04.2013 um 08:10 schrieb WolfgangZ <wollez@gmx.net>:
>>>
>>>> Hello,
>>>> I get wrong list entries when using my register entries inside
>>>> separate lists. Example case included, even if it is a bit longer.
>>>> For explanation, I have two lists, the correct index is in section
>>>> 1.2 in the attached example and printed on page 3 (see test.pdf). The
>>>> one that causes trouble is set in section 1.3 (green table) and
>>>> printed on page 5. There the index links to page 4 instead of page 1,
>>>> on which the entry is placed.
>>>>
>>>> The example gets more strange, as the wrong index entries only occurs
>>>> if there is no regular text below the table in section 1.3. For
>>>> testing you can uncomment line 70 in file test.tex.
>>>
>>> Put the text before the index entry in your definition in \Listwrong
>>> the output is correct:
>>>
>>>    \define[1]\Listwrong{#1\Wrongliste{#1}}
>>>
>>> Wolfgang
>>
>> Great, this solves the problem! Is it possible to explain the reason for
>> the behavior of context to the order of the text entry and the command?
>
> in order to track locations we need to inject a so called whatsit which
> is an invivible but definitely present entity an din order to make this
> work:
>
> test
>
> \index{xxx}
>
> test
>
> \index will bind to the next paragraph when it's a loner
>
> otherwise we would get
>
> test
> <whitespace or at least valid breakpoint>
> \index{xxx}
> <whitespace or at least valid breakpoint>
> test
>
> which could show up as an unwanted extra whitespace and/or page break
> with dislocated index entry
>
> this kind of behaviour has always been part of context, as we want to be
> able to do
>
> \chapter{...}
>
> \index{...}
> \index{...}
> \index{...}
> \index{...}
> \index{...}
>
> some text ...
>
> Hans
>
>
Many thanks for your answers!
Best regards
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
___________________________________________________________________________________


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

end of thread, other threads:[~2013-04-15  6:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-12  6:10 strange index behaviour with entries inside separatedlist WolfgangZ
2013-04-12  8:29 ` Wolfgang Schuster
2013-04-12  9:59   ` Hans Hagen
2013-04-12 10:59   ` WolfgangZ
2013-04-12 12:07     ` Hans Hagen
2013-04-15  6:54       ` Wolfgang

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