Re: [NTG-context] Bug with custom TOC

2014-11-08 Thread Wolfgang Schuster

 Am 07.11.2014 um 15:04 schrieb Michał Goliński golin...@amu.edu.pl:
 
 The following example is taken from the wiki 
 (http://wiki.contextgarden.net/Command/setuplist):
 
 \define[3]\SectionToCEntry{
  \leftaligned\bgroup
 \hbox to 2em{#3}%
 \hskip 1em
 \vtop{\hsize\dimexpr\textwidth-3em\relax#2}%
  \egroup
 }
 
 \setuplist
  [part]
  [alternative=interactive,
   command=\SectionToCEntry]
 \setuplist
  [chapter]
  [alternative=interactive,
   command=\SectionToCEntry]
 \setuplist
  [section]
  [alternative=interactive,
   command=\SectionToCEntry]

You have to add “after=\endgraf” to all \setuplist settings. There was a change 
a while ago
for the interactive alternative which forces horizontal mode at the begin of 
each entry to ensure
the hyperlinks areas are positioned correct.

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
___

[NTG-context] Bug with custom TOC

2014-11-07 Thread Michał Goliński
The following example is taken from the wiki 
(http://wiki.contextgarden.net/Command/setuplist):


\define[3]\SectionToCEntry{
  \leftaligned\bgroup
 \hbox to 2em{#3}%
 \hskip 1em
 \vtop{\hsize\dimexpr\textwidth-3em\relax#2}%
  \egroup
}

\setuplist
  [part]
  [alternative=interactive,
   command=\SectionToCEntry]
\setuplist
  [chapter]
  [alternative=interactive,
   command=\SectionToCEntry]
\setuplist
  [section]
  [alternative=interactive,
   command=\SectionToCEntry]

\starttext

\startcolor[darkgreen]
\completecontent[criterium=all]
\stopcolor

\page[yes]

\part{I}
\chapter{1}
\section{1.1}
\section{1.2}
\section{1.3}
\stoptext

The fresh beta prints all the sections in TOC in a single line (so TOC 
has three lines only), while texlive prints it as expected: each section 
on its own line. I've tried adding \par after \egroup, but it doesn't 
help.


Curiously, it works if there are no sections in the TOC.

Best regards
Michał
___
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
___