On Friday 20 June 2003 01:52 pm, Idris S Hamid wrote:
> > Here is what my customer  want:s:
> > 1. A TOC
> > 2. No chapter or section numbers anywhere.
>
> I think we've solved these two;
>
> > 3. Certain blocks of text which occur before the TOC to be listed in the
> > TOC with the correct page number.
>
> What's the difference between 1 & 3? Could you explain 3 a bit more:-)
>
As I explained before, whenever a TOC item appears in the source file before 
the actual TOC the whole TOC becomes blank. This is true  whether the item is 
a chapter and included automatically or I use the "write" commands to do  it 
manually. Here is a dummy file:

\pdfoutput=1
\starttext
\chapter{foo}
\completecontent
\chapter{bar}
\stoptext

When I run the above file the TOC will have a header but no contents. If 
however I comment out \chapter{foo}
then chapter bar appears in the contents.

I have also tried the write etc. commands and if they appear before the 
\completecontent 
command then the TOC blanks out. 

This may be a function of The general TeX procedure to write out the items on 
one pass and bring them in on the next. The write to \chapter{foo} may 
reinitialize the external file when it is encountered on the second pass.
According to the TeXbook the write occurs when the page is shipped out. So 
\chapter{foo} probalbly clobbers the external file.  Still the TOC mechanism 
should be developed in a way that it is possible to incorporate items 
occurring before the TOC in the TOC.  This is not an uncommon requirement. 

A cure might be to move the external file to a different file name at the end 
of each pass in texexec, and bring in that copy of the file instead of the 
original external file to create the actual TOC.. That way any premature 
references would not go to the copy but to a new original. Pehaps Hans could 
rewrite the texexec or the Content macros themselves to do this. In 
pseudocode of sorts it would work  like this:
\starttext
\chapter{foo} =write to filea    
\placecontent= read from fileb 
\chapter{bar}=write to filea
\chapter{alpha}=write to filea
(etc.)
\stoptext.
copy filea to fileb
end
-- 
John Culleton
Able Typesetters and Indexers
_______________________________________________
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to