# Re: [NTG-context] context mkiv bug + related feature request + related question

Yue Wang wrote:

This bug is still not solved in the current context mkiv version.

On Mon, Jun 22, 2009 at 11:36 AM, Yue Wang<yuleo...@gmail.com> wrote:

Hi, Hans:

bug report :
here is the test file. (old version of mkiv produce right result.
current mkii result is also right)
It is a bug introduced in this/last month.
The code is a stripped down version of
http://wiki.contextgarden.net/Horizontal_Table_of_Contents (altough it
doesn't show toc horizontally)

\newcount\chapcounter \chapcounter=0
\placelist[section][criterium=chapter,number=\chapcounter]}
\starttext
\placelist[chapter][alternative=command,command=\tocchap]
\chapter{hello} \section{hello} \section{hello}
\chapter{good} \section{good} \section{good}
\stoptext



add \number in front of \listparameter\c!number in strc-lst.mkiv or just in front of your \chapcounter

\number\listparameter\c!number

(info passed to lua has to be expanded)

actually, there is in mkii:

\starttext

\placelist[chapter][after={\placelist[section][criterium=local]}]

\chapter{hello} \section{hello} \section{hello}
\chapter{good} \section{good} \section{good}

\stoptext

but that does not yet work in mkiv


feature request:

btw, Hans, context should give an option to iterate through all the
chapters/sections to do something tricky.
using \chaptercounter is a really bad idea (the materials should
follow strict rules, like cannot jump from chap 1 to chap 3).
I think with mkiv it is able to achieve that.



sure, but that's for later; the mkiv structure code has much more possibilities but first i want to have the standard features complete and debugged


question:

I want to show toc before each chapter, and the toc only shows the
following chapter name in red.
How can I do that?
e.g. show the following before chapter 3

% A Page
Chap1
sec 1 sec 2 sec 3
Chap2
sec 1 sec 2 sec 3
Chap 3  %in red
sec 1 sec 2 sec 3 %in Red
Chap4
sec 1 sec 2 sec 3
% Next Page
Chapter 3 % title
a lot of materials

Yue Wang


___________________________________________________________________________________
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________



--

-----------------------------------------------------------------
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
-----------------------------------------------------------------
___________________________________________________________________________________