Hi, is there a mechanism so that on is able to say \index[start from here]{great+topic} % we are on p3 blabla much material \index[stop there]{great+topic} % we are on p7 and the index will advertise the topic as great topic 3-7 Of course I don't want to put an \index at every page (I don't even know the page break when looking at the source file ;) This feature is especially nice when defining a concept in a manual. Many thanks in advance, Olivier
In theory, you can say \startregister[index]{great+topic} and \stopregister[index]{great+topic} and this will do what you want. However, this is one of several bugs in the index module of ConTeXt: this will print just this range and gobble all other entries in the index for great/topic. I wrote a note to the list about these bugs about a week ago, but there were no replies. I guess if there are two of us and we yell loud enough, Hans will hear us eventually :-) Best Thomas On Oct 15, 2005, at 10:44 PM, Olivier wrote:
Hi,
is there a mechanism so that on is able to say \index[start from here]{great+topic} % we are on p3 blabla much material \index[stop there]{great+topic} % we are on p7
and the index will advertise the topic as great topic 3-7
Of course I don't want to put an \index at every page (I don't even know the page break when looking at the source file ;)
This feature is especially nice when defining a concept in a manual.
Many thanks in advance, Olivier
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Quoting "Thomas A. Schmitz" :
-- was thomas.schmitz@uni-bonn.de on Oct 16, 2005 at 12:11:31 --
In theory, you can say
\startregister[index]{great+topic} and \stopregister[index]{great+topic}
Many thanks Thomas, that's what I was looking for :))
and this will do what you want. However, this is one of several bugs in the index module of ConTeXt: this will print just this range and gobble all other entries in the index for great/topic.
You're right, a quick test demonstrated the bug. However, the .tui contained r f {index} {108} {} {great+topic} {2--0-9-1-1-0-0-0--101} {111} r t {index} {109} {} {great+topic} {2--0-9-1-1-0-0-0--102} {112} c \listentry{subsubsection}{110}{}{A section}{2--0-9-1-2-0-0-0--102}{112} c \mainreference{}{eq:aneq}{2--0-9-1-2-0-0-0--102}{112}{37} r e {index} {111} {} {great+topic} {2--0-9-1-2-0-0-0--103} {113} and the .tuo % % TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004 / Registers % \registerentry{index}{a} \registerentrya{index}{astonishing} \registerentryb{index}{bug} \registerpage{index}{,}{113}{2--0-9-1-3-0-0-0--103}{113} \registerentry{index}{g} \registerentrya{index}{great} \registerentryb{index}{topic} \registerfrom{index}{,}{108}{2--0-9-1-1-0-0-0--101}{111} \registerpage{index}{,}{111}{2--0-9-1-2-0-0-0--103}{113} \registerto{index}{,}{109}{2--0-9-1-1-0-0-0--102}{112} When swapping the two last lines in the .tuo and running texexec --once make it print the index great topic 101-102, 103 which is not that nice (should have been merged into 101-103), but recovered the missing file. In the texutil script there seems to be only sorting on entries' labels and no further sorting with the page number because it sorts this string join($JOIN,$Class,$LCKey,$Key,$Entry,$TextHow,$RegStatus, $RealPageNumber,$Location,$Page,$PageHow,$SeeToo) What about using a hash instead of a string to handle the register entries' information so that it will be easier to handle the page ranges after having sorted the labels?
I wrote a note to the list about these bugs about a week ago, but there were no replies. I guess if there are two of us and we yell loud enough, Hans will hear us eventually :-)
I'm with you :)) By the way, this may benefit Taco's bibmodule when implementing the backtracking referencing mechanism... Greetings, Olivier
Olivier wrote:
Quoting "Thomas A. Schmitz" :
-- was thomas.schmitz@uni-bonn.de on Oct 16, 2005 at 12:11:31 -
You're right, a quick test demonstrated the bug.
In the texutil script there seems to be only sorting on entries' labels and no further sorting with the page number because it sorts this string join($JOIN,$Class,$LCKey,$Key,$Entry,$TextHow,$RegStatus, $RealPageNumber,$Location,$Page,$PageHow,$SeeToo)
What about using a hash instead of a string to handle the register entries' information so that it will be easier to handle the page ranges after having sorted the labels?
newtexutil work different
I wrote a note to the list about these bugs about a week ago, but there were no replies. I guess if there are two of us and we yell loud enough, Hans will hear us eventually :-)
not with headphones, which i normally wear when i'm in that kind of debugging mode -)
I'm with you :))
so, what was the test file? Hans
On Nov 9, 2005, at 2:11 PM, Hans Hagen wrote:
not with headphones, which i normally wear when i'm in that kind of debugging mode -)
try a megaphone? ;-)
I'm with you :))
so, what was the test file?
Hans
Compile this with newtexexec: \starttext \index{This} This \index{and} and \index{That} That. \page \placeindex \stoptext and This and That will be sorted under "h." If you modify the file like so: \starttext \index{This} This \index{and} and \seeindex{That}{This} That. \page \placeindex \stoptext it will give this error message: ! Argument of \@@filterlevelpart has an extra }. <inserted text> \par <to be read again> } \doifprevlevelelse ...tor \@@filterlevelpart [#1]} \edef \@@tocsectiontype {\... \dosetpageregisterpage ...->\doifreglevelelse [#5] {\dodosetpageregisterpage ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} Runaway argument? 0:0:0:0:0:0:0] ! Paragraph ended before \@@filterlevelpart was complete. <to be read again> \par <to be read again> } \doifprevlevelelse ...tor \@@filterlevelpart [#1]} \edef \@@tocsectiontype {\... \dosetpageregisterpage ...->\doifreglevelelse [#5] {\dodosetpageregisterpage ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} ! Argument of \@@filterblockpart has an extra }. <inserted text> \par <to be read again> } \doifprevlevelelse ...pe {\@@filterblockpart [#1]} \ifcase \alltoclevels \ifn... \dosetpageregisterpage ...->\doifreglevelelse [#5] {\dodosetpageregisterpage ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} Runaway argument? 0:0:0:0:0:0:0] ! Paragraph ended before \@@filterblockpart was complete. <to be read again> \par <to be read again> } \doifprevlevelelse ...pe {\@@filterblockpart [#1]} \ifcase \alltoclevels \ifn... \dosetpageregisterpage ...->\doifreglevelelse [#5] {\dodosetpageregisterpage ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} ! Argument of \@@filternumberpart has an extra }. <inserted text> \par <to be read again> } \pageprefix ...stprefix {\@@filternumberpart [#2]} \let \donexttrackcommando ... <argument> ... {\??id \v!index }[2::0:0:0:0:0:0:0] \translatednumber [2::0:0:... \doregisterpagehowto ...??id #1\c!pagecommand }{#2 }\dostopattributes <argument> ...erpage {\v!index }[2::0:0:0:0:0:0:0] \ifnum 1=2\/\fi ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} Runaway argument? 0:0:0:0:0:0:0] ! Paragraph ended before \@@filternumberpart was complete. <to be read again> \par <to be read again> } \pageprefix ...stprefix {\@@filternumberpart [#2]} \let \donexttrackcommando ... <argument> ... {\??id \v!index }[2::0:0:0:0:0:0:0] \translatednumber [2::0:0:... \doregisterpagehowto ...??id #1\c!pagecommand }{#2 }\dostopattributes <argument> ...erpage {\v!index }[2::0:0:0:0:0:0:0] \ifnum 1=2\/\fi ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} Runaway argument? ! Paragraph ended before \@@dofilterheadpart was complete. <to be read again> \par \@@filterheadpart ... \@@dofilterheadpart \@EA [#1 :0] <argument> ...ix {\@@filterheadpart [\postprefix ] }\edef \postprefix {\@@fil... \firstoftwoarguments #1#2->#1 \donexttrackcommando #1->\dodopageprefix {#1} \donexttracklevel {#1} \pageprefix ...\donexttrackcommando \firstsection \egroup ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} Runaway argument? ! Paragraph ended before \@@dofiltertailpart was complete. <to be read again> \par \@@filtertailpart ... \@@dofiltertailpart \@EA [#1 :0] <argument> ...ix {\@@filtertailpart [\postprefix ] }\let \uchar \normaluchar ... \firstoftwoarguments #1#2->#1 \donexttrackcommando #1->\dodopageprefix {#1} \donexttracklevel {#1} \pageprefix ...\donexttrackcommando \firstsection \egroup ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} Runaway argument? ! Paragraph ended before \@@dofiltertailpart was complete. <to be read again> \par \postprefix ->\par :0] \@@filtertailpart ... \@@dofiltertailpart \@EA [#1 :0] <argument> ...ix {\@@filtertailpart [\postprefix ] }\let \uchar \normaluchar \secondoftwoarguments #1#2->#2 \donexttrackcommando #1->\dodopageprefix {#1} \donexttracklevel {#1} ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} Runaway argument? ! Paragraph ended before \@@dofiltertailpart was complete. <to be read again> \par \postprefix ->\par :0]:0] \@@filtertailpart ... \@@dofiltertailpart \@EA [#1 :0] <argument> ...ix {\@@filtertailpart [\postprefix ] }\let \uchar \normaluchar \secondoftwoarguments #1#2->#2 \donexttrackcommando #1->\dodopageprefix {#1} \donexttracklevel {#1} ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} Runaway argument? ! Paragraph ended before \@@dofiltertailpart was complete. <to be read again> \par \postprefix ->\par :0]:0]:0] \@@filtertailpart ... \@@dofiltertailpart \@EA [#1 :0] <argument> ...ix {\@@filtertailpart [\postprefix ] }\let \uchar \normaluchar \secondoftwoarguments #1#2->#2 \donexttrackcommando #1->\dodopageprefix {#1} \donexttracklevel {#1} ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} Runaway argument? ! Paragraph ended before \@@dofiltertailpart was complete. <to be read again> \par \postprefix ->\par :0]:0]:0]:0] \@@filtertailpart ... \@@dofiltertailpart \@EA [#1 :0] <argument> ...ix {\@@filtertailpart [\postprefix ] }\let \uchar \normaluchar \secondoftwoarguments #1#2->#2 \donexttrackcommando #1->\dodopageprefix {#1} \donexttracklevel {#1} ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} Runaway argument? ! Paragraph ended before \@@dofiltertailpart was complete. <to be read again> \par \postprefix ->\par :0]:0]:0]:0]:0] \@@filtertailpart ... \@@dofiltertailpart \@EA [#1 :0] <argument> ...ix {\@@filtertailpart [\postprefix ] }\let \uchar \normaluchar \secondoftwoarguments #1#2->#2 \donexttrackcommando #1->\dodopageprefix {#1} \donexttracklevel {#1} ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} Runaway argument? ! Paragraph ended before \@@dofiltertailpart was complete. <to be read again> \par \postprefix ->\par :0]:0]:0]:0]:0]:0] \@@filtertailpart ... \@@dofiltertailpart \@EA [#1 :0] <argument> ...ix {\@@filtertailpart [\postprefix ] }\let \uchar \normaluchar \secondoftwoarguments #1#2->#2 \donexttrackcommando #1->\dodopageprefix {#1} \donexttracklevel {#1} ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} ! Argument of \@@filterpagepart has an extra }. <inserted text> \par <to be read again> } \doregisterpagehowto ...?id #1\c!pagecommand }{#2} \dostopattributes <argument> ...erpage {\v!index }[2::0:0:0:0:0:0:0] \ifnum 1=2\/\fi \showlocation ...iacolor ]{#1\presetgoto }\else #1 \fi <argument> ...}[2::0:0:0:0:0:0:0]\ifnum 1=2\/\fi } }\gotonextinternal {\s!ind... ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} Runaway argument? 0:0:0:0:0:0:0] ! Paragraph ended before \@@filterpagepart was complete. <to be read again> \par <to be read again> } \doregisterpagehowto ...?id #1\c!pagecommand }{#2} \dostopattributes <argument> ...erpage {\v!index }[2::0:0:0:0:0:0:0] \ifnum 1=2\/\fi \showlocation ...iacolor ]{#1\presetgoto }\else #1 \fi <argument> ...}[2::0:0:0:0:0:0:0]\ifnum 1=2\/\fi } }\gotonextinternal {\s!ind... ... l.46 ...isterpage{index}{,}{3}{2::0:0:0:0:0:0:0}{} and have this in the index: see This, :0]– After that, the .tuo file will be messed up, you have to delete it to make the document compile again. For the bug with ranges: \starttext \index{This} This \page \startregister[index]{This} and \page that \page again \stopregister[index]{This} \page \index{This} This \index{and} and \seeindex{That}{This} That. \page \placeindex \stoptext Will only have This 2-4 in the index, the other pages are ignored. All best, and thanks so much Hans Thomas
Thomas A. Schmitz wrote:
On Nov 9, 2005, at 2:11 PM, Hans Hagen wrote:
not with headphones, which i normally wear when i'm in that kind of debugging mode -)
try a megaphone? ;-)
I'm with you :))
so, what was the test file?
Hans
Compile this with newtexexec:
\starttext
\index{This} This \index{and} and \index{That} That.
\page
\placeindex
\stoptext
can you play a bit with the following: (patch context/ruby/base/texutil.rb) def preset(shortcuts=[],expansions=[],reductions=[],divisions=[]) # maybe we should move this to sort-def.tex 'a'.upto('z') do |c| expander(c) ; division(c) end 'A'.upto('Z') do |c| expander(c) ; division(c) end # ! ! ! ! ! ! ! added ! ! ! ! ! ! ! ! expander('1','b') ; expander('2','c') ; expander('3','e') ; expander('4','f') expander('5','g') ; expander('6','h') ; expander('7','i') ; expander('8','i') expander('9','j') ; expander('0','a') ; expander('-','-') ; # end potential move shortcuts.each do |s| shortcut(s[0],s[1]) end expansions.each do |e| expander(e[0],e[1]) end reductions.each do |r| reducer(r[0],r[1]) end divisions.each do |d| division(d[0],d[1]) end end
Thomas A. Schmitz wrote:
If you modify the file like so:
\starttext
\index{This} This \index{and} and \seeindex{That}{This} That.
\page
\placeindex
\stoptext
it will give this error message:
add the "copied = false " to: handle << "\\registersee{#{entry.type}}{#{entry.pagehowto},#{entry.texthowto}}{#{entry.seetoo}}{#{entry.page}}\n" ; lastpage, lastrealpage = entry.page, entry.realpage copied = false # no page ! Hans
Excellent! As far as I can see, this takes care of the seeindex bug and of the sorting bug. On the negative side: ranges make the new texutil.rb bomb out. Two down, one to go!!! Thanks a lot, Hans! Thomas On Nov 9, 2005, at 5:07 PM, Hans Hagen wrote:
Thomas A. Schmitz wrote:
If you modify the file like so:
\starttext
\index{This} This \index{and} and \seeindex{That}{This} That.
\page
\placeindex
\stoptext
it will give this error message:
add the "copied = false " to:
handle << "\\registersee{# {entry.type}}{#{entry.pagehowto},#{entry.texthowto}}{# {entry.seetoo}}{#{entry.page}}\n" ; lastpage, lastrealpage = entry.page, entry.realpage copied = false # no page !
Hans _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Correction: I goofed up; after correcting the file, I get exactly what I expected. AFAICS, index generation now works flawlessly with newtexexec! Great, wonderful, kudos to you! I'm happy again! Thanks Hans best Thomas On Nov 9, 2005, at 7:48 PM, Hans Hagen wrote:
send me a test file -)
Hans
Thomas A. Schmitz wrote:
Correction: I goofed up; after correcting the file, I get exactly what I expected. AFAICS, index generation now works flawlessly with newtexexec! Great, wonderful, kudos to you!
I'm happy again! Thanks Hans
well, thanks for testing newtexexec -) Hans
Alas, I spoke too soon... I tested again with a more complex document (the book project I'm working on), and I'm having problems again: page ranges still gobble up the other entries. If I insert a \seeindex command, the index is sorted according to page numbers instead of entries. The file is probably too big to send, but I can of course send logs, .tui or whatever might be useful... Best Thomas On Nov 10, 2005, at 12:35 AM, Hans Hagen wrote:
Thomas A. Schmitz wrote:
Correction: I goofed up; after correcting the file, I get exactly what I expected. AFAICS, index generation now works flawlessly with newtexexec! Great, wonderful, kudos to you!
I'm happy again! Thanks Hans
well, thanks for testing newtexexec -)
Hans _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Thomas A. Schmitz wrote:
Alas, I spoke too soon... I tested again with a more complex document (the book project I'm working on), and I'm having problems again: page ranges still gobble up the other entries. If I insert a \seeindex command, the index is sorted according to page numbers instead of entries. The file is probably too big to send, but I can of course send logs, .tui or whatever might be useful...
or make a dummy multipage doc with lots of entries Hans
Correction: I goofed up; after correcting the file, I get exactly what I expected. AFAICS, index generation now works flawlessly with newtexexec! Great, wonderful, kudos to you!
Um, I just noticed. "newtexexec"? Has the command name changed? Please say no. Because a command name change would mean that I have to redistribute the binaries (where the command lives) and not just the context trees in texmf. G
Hans can give a more authoritative answer, of course, but as a provisional one: no, the command name hasn't changed, you don't need to worry. The way ConTeXt is organized is that the binary texexec (which resides in texmf/ARCH/bin/) is just a small shell-script, a stub, that calls the real script in turn. This has been texexec.pl (in texmf/scripts/context/perl/), but you can of course modify it so it runs another script. Hans has been toying with ruby lately, so we now have texmf/scripts/ruby/newtexexec.rb which, I suppose, will replace the "old" texexec in due time. But as you have seen, it's not yet quite ready for prime time, it's still missing a few features (I don't think it can post-process pdf-files yet) and has a few buglets... So relax and vatch das blinkenlight! All best Thomas On Nov 10, 2005, at 9:33 AM, Gerben Wierda wrote:
Correction: I goofed up; after correcting the file, I get exactly what I expected. AFAICS, index generation now works flawlessly with newtexexec! Great, wonderful, kudos to you!
Um, I just noticed. "newtexexec"? Has the command name changed? Please say no. Because a command name change would mean that I have to redistribute the binaries (where the command lives) and not just the context trees in texmf.
G
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Hans Hagen wrote:
Thomas A. Schmitz wrote:
... it's still missing a few features (I don't think it can post-process pdf-files yet) and has a few buglets...
it should at least i remember writing some code -)
Here is an old example: ------------------------------------ \defineregister[Name][Names] \setupregister[Name][pagestyle=\it] \setupregister[Name][bf][pagestyle=\bf] \starttext Names: \Name[bf::]{Hans} \Name{Taco} \startregister[Name][bf::]{Patrick} \page[yes] \Name{Hans} \stopregister[Name][bf::]{Patrick} \page[yes] \Name{Patrick} \placeregister[Name] \stoptext -------------------------------------- Regrettably, I have now no time to install and check the new version of newtexexec.rb, so perhaps it is already done. Please, for quick check focus on 'Patrick' entry, it should have "1--2, 3" page numbers. Or more complex example: ------------------------------------ \defineregister[Name][Names] \setupregister[Name] \setupregister[Name][bf][pagestyle=\bf] \starttext Names: \Name{Patrick} \Name[bf::]{Hans} \Name{Taco} \startregister[Name][bf::]{Patrick} \page[yes] \Name{Patrick} \page[yes] \Name{Hans} \stopregister[Name][bf::]{Patrick} \placeregister[Name] \stoptext -------------------------------------- Possible variants: 1) Patrick 1, 2, {\bf 1--3} 2) Patrick {\bf 1--3}, 1, 2 3) Patrick 1--2, {\bf 1--3} 4) Patrick {\bf 1--3}, 1--2 in case of variants 1 v. 2 and 3 v. 4 I am not sure how the categories 'empty_string' and "bf" are sorted. But it does not matter since user can set any category name. variants 3, 4 should be set if some register option (coupling?) is set on vit
Gerben Wierda wrote:
Correction: I goofed up; after correcting the file, I get exactly what I expected. AFAICS, index generation now works flawlessly with newtexexec! Great, wonderful, kudos to you!
Um, I just noticed. "newtexexec"? Has the command name changed? Please say no. Because a command name change would mean that I have to redistribute the binaries (where the command lives) and not just the context trees in texmf.
no, for the moment stick to texexec here, when i set TEXMFSTART_MODE=experimental I get newtexexec automatically; the idea is that the stub (sh sript) is as follows: === texexec ===== #!/bin/sh texmfstart texexec $@ in that case texmfstart will locate the right script and do what is needed; no more hassle for distributers; basically only texmfstart needs to be copied to the bin path (texmfstart.rb -> texmfstart) plus some stubs be made (i made that mechanism because of the occasional changes in the tree locations) once newtexexec becomes texexec (the perl script will be replaced) i'll come back to it, so for the moment don't worry Hans
participants (6)
-
Gerben Wierda
-
Hans Hagen
-
Olivier
-
Thomas A. Schmitz
-
Thomas A.Schmitz
-
Vit Zyka