Seems to be a bug in the ruby code that works properly in the perl. Try: ---- \starttext \index{Knuth}\input knuth \par \seeindex{Knuth}{Tufte}\input tufte \par \blank\placeindex \stoptext ---- With the perl scripts it's right: Knuth 1 see Tufte but with the new ruby scripts it's wrong: Knuth see Tufte, 1 I don't know if it's relevant but the difference between the two .tuo files seems just to be reversal of two lines; the perl run shows: \registerentry{index}{k} \registerentrya{index}{Knuth} \registerpage{index}{,}{1}{2--0-0-0-0-0-0-0--1}{1} \registersee{index}{,}{Tufte}{2--0-0-0-0-0-0-0} while the ruby run shows: \registerentry{index}{k} \registerentrya{index}{Knuth} \registersee{index}{,}{Tufte}{2--0-0-0-0-0-0-0} \registerpage{index}{,}{1}{2--0-0-0-0-0-0-0--1}{1} [I discovered this by trying out the code on live.contextgarden, and I couldn't understand why I was getting different output from apparently the same beta - but then I noticed that the live server is still using the old texexec script. Perhaps this ought to be fixed (though it was very useful in this case!).] Duncan
[...]
[I discovered this by trying out the code on live.contextgarden, and I couldn't understand why I was getting different output from apparently the same beta - but then I noticed that the live server is still using the old texexec script. Perhaps this ought to be fixed (though it was very useful in this case!).]
It's on my to-do list. Can't promise a date, though. Patrick -- ConTeXt wiki and more: http://contextgarden.net
Duncan Hothersall (12/10/2006 16:08) said:
Seems to be a bug in the ruby code that works properly in the perl. Try:
---- \starttext \index{Knuth}\input knuth \par \seeindex{Knuth}{Tufte}\input tufte \par \blank\placeindex \stoptext ----
With the perl scripts it's right:
Knuth 1 see Tufte
but with the new ruby scripts it's wrong:
Knuth see Tufte, 1
As a non-Ruby person I've spent a while trying to work out where the problem might be but it's tough going. I need to do an index with this feature on Sun/Mon if poss, so if anyone is able to point me in the right direction that would be great. Duncan
Duncan Hothersall wrote:
Duncan Hothersall (12/10/2006 16:08) said:
Seems to be a bug in the ruby code that works properly in the perl. Try:
---- \starttext \index{Knuth}\input knuth \par \seeindex{Knuth}{Tufte}\input tufte \par \blank\placeindex \stoptext ----
With the perl scripts it's right:
Knuth 1 see Tufte
but with the new ruby scripts it's wrong:
Knuth see Tufte, 1
As a non-Ruby person I've spent a while trying to work out where the problem might be but it's tough going. I need to do an index with this feature on Sun/Mon if poss, so if anyone is able to point me in the right direction that would be great.
can you play with this (\global\firstregisterpagetrue ) \def\dosetpageregistersee#1#2#3#4% ugly separator hack {\flushseenregisterpage \expanded{\doifreglevelelse[#4\sectionseparator\sectionseparator0]}% {{\global\utilitydonetrue \setregisterhowto[#2]% \def\dohandleregisterentry##1% dubbelop | \strut nieuw {\doregistertexthowto{#1}{\strut \limitedregisterentry{#1}{##1}}}% \getvalue {#1\ifcase\currententrylevel \s!entrya\or\s!entryb\else\s!entryc\fi}% {\doregisterpagehowto{#1}{\labeltexts\v!see{#3}}}% \c!entryletter\c!entrya\c!entryb\c!entryc \global\let\c!entrya\relax \global\let\c!entryb\relax \global\let\c!entryc\relax \global\let\c!entryletter\relax \global\let\c!entryreference\relax \global\chardef\lastregisterpagestatus\zerocount % \global\firstregisterentrytrue \global\firstregisterpagetrue}} {}} ----------------------------------------------------------------- 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 -----------------------------------------------------------------
With the perl scripts it's right:
Knuth 1 see Tufte
but with the new ruby scripts it's wrong:
Knuth see Tufte, 1
As a non-Ruby person I've spent a while trying to work out where the problem might be but it's tough going. I need to do an index with this feature on Sun/Mon if poss, so if anyone is able to point me in the right direction that would be great.
can you play with this (\global\firstregisterpagetrue )
\def\dosetpageregistersee#1#2#3#4% ugly separator hack ... \global\firstregisterpagetrue}} {}}
That seems to remove the comma, but the page reference is still appearing on the wrong entry. I tried playing with other bits of that code but didn't get anywhere. I'm confused because it doesn't seem to be a TeX code issue - the same TeX code produced both versions above, the only difference (I could see) was that one was the old perl texexec + texutil and the other was the new ruby combined texexec. Sorry if I got the wrong end of the stick. Duncan
Duncan Hothersall wrote:
Sorry if I got the wrong end of the stick.
we need some extensive test for registers in the test repository (esp since some day we may move sorting code inside tex using lua) 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 -----------------------------------------------------------------
Duncan Hothersall wrote:
Seems to be a bug in the ruby code that works properly in the perl. Try:
---- \starttext \index{Knuth}\input knuth \par \seeindex{Knuth}{Tufte}\input tufte \par \blank\placeindex \stoptext ----
With the perl scripts it's right:
Knuth 1 see Tufte
but with the new ruby scripts it's wrong:
Knuth see Tufte, 1
I don't know if it's relevant but the difference between the two .tuo files seems just to be reversal of two lines; the perl run shows:
\registerentry{index}{k} \registerentrya{index}{Knuth} \registerpage{index}{,}{1}{2--0-0-0-0-0-0-0--1}{1} \registersee{index}{,}{Tufte}{2--0-0-0-0-0-0-0}
while the ruby run shows:
\registerentry{index}{k} \registerentrya{index}{Knuth} \registersee{index}{,}{Tufte}{2--0-0-0-0-0-0-0} \registerpage{index}{,}{1}{2--0-0-0-0-0-0-0--1}{1}
[I discovered this by trying out the code on live.contextgarden, and I couldn't understand why I was getting different output from apparently the same beta - but then I noticed that the live server is still using the old texexec script. Perhaps this ought to be fixed (though it was very useful in this case!).]
can you play a bit with: @@registers[data[1]].push(Register.new(4,data[1],data[2],data[3],data[4],data[5],data[6],0)) (nil -> 0) around line 798 in base/texutil.rb ----------------------------------------------------------------- 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 -----------------------------------------------------------------
can you play a bit with: @@registers[data[1]].push(Register.new(4,data[1],data[2],data[3],data[4],data[5],data[6],0))
(nil -> 0) around line 798 in base/texutil.rb
That seems to break quite a lot on my big index - just outputs everything in page order, and with no interpretation of "+" parts. If I change it to '0' instead it behaves exactly like nil; as does '' as far as I can tell. Subsequently I experimented with these eight values to try to understand what each of them represents, but your code is a bit (far) too clever for me. Wish I could be of more use. Duncan
participants (3)
-
Duncan Hothersall
-
Hans Hagen
-
Patrick Gundlach