Re: [NTG-context] Testpage with extras

2014-02-01 Thread Hans Hagen

On 2/1/2014 10:15 AM, Keith J. Schultz wrote:

Hi Hans,

how about the \ifleftonpage, or something like that?


\if

is reserved for 'real' ifs

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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
___


Re: [NTG-context] Testpage with extras

2014-02-01 Thread Keith J. Schultz
Hi Hans,

how about the \ifleftonpage, or something like that?

Just trying to have the name of the command more literate.

Of course if the conditional part is to be expanded to something
more elaborate then pagechecker would be fine!

regards
Keith.

Am 31.01.2014 um 11:18 schrieb Hans Hagen :

> On 1/31/2014 10:46 AM, Keith J. Schultz wrote:
> 
>> Personally, I find the names used sub-optimal!
> 
> we had testpage and that one stays anyway and checkpage is close to that 
> (overloading testpage with a new syntax is messy)
> 
>> I would think something like conditionalbreak or conditionalpagebreak
>> would be better and verbose.
> 
> the new check command could evolve in more than break .. in fact it just 
> checks and then does some action (not per se a break)
> 
>> Other names could be ifpagelength, ifpagelengthstill, leftonpage, or
>> something similar.
> 
> one can say
> 
> \definepagechecker[leftonpage]
> 
> and then use it like
> 
> \chechpage[leftonpage]
> 
>> I assume you have implemented checkpage as an added layer on top
>> of testpage!
> 
> no, the reverse
> 
>> At least the test is if X lines left on page or still fit on page!
>> 
>> I also have a question. Are the commands setuppagechecker sothat
>> 
>> \definepagechecker[whatever]
>> 
>> \setuppagechecker[whatever]
>>  [lines=35,
>>   voffset=10pt,
>>   before={\vfill\wordright{(see next page)}\par},
>>   after=\noindentation]
>> 
>> and also
>> 
>> \checkpage [lines=35,
>>   voffset=10pt,
>>   before={\vfill\wordright{(see next page)}\par},
>>   after=\noindentation]
> 
> in that case you use those values, while
> 
> \checkpage
>  [whatever]
>  [lines=12]
> 
> would overload given whatever values
> 
> > Question: what is the voffset used for? Line height? If so then a better
>> name for this
>> would be nice, too!
> 
> it's 'offset' ... and it's like the second argument of testpage (i can't 
> think of another key so i've chosen one that already is part of context, 
> which has advantages)

[snip, snip]___
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
___

Re: [NTG-context] Rearrange Table of Contents section page numbers

2014-02-01 Thread Wolfgang Schuster

Am 31.01.2014 um 23:20 schrieb Thangalin :

> Hi,
> 
> I am trying to recreate the following ToC entries:
> 
> http://i.stack.imgur.com/ig6LX.png
> 
> The code on the wiki uses:
> 
>\doifelse\currentlistentrylocation{\structureheadlocation{chapter}}
>{{\bfb\currentlistentrytitle}}
>{ \currentlistentrytitle}\NC\NR
> 
> However, there are syntax errors and the conditional expression
> assumes that the ToC is being placed on every page. This assumption
> allows it to resolve the namedstructureheadlocation value. For a ToC
> at the start of a document, there is no "current chapter" and so the
> head location for the chapter entry returns 0.
> 
> Here is what I have so far:
> 
>\startsetups [list:TOC]
>\starttabulate
>\currentlistentrypagenumber{} \hskip 1em \NC \currentlistentrytitle{} \NR
>\stoptabulate
>\stopsetups
> 
>\definelistalternative
>  [TOC]
>  [renderingsetup=list:TOC]
> 
>% Format the ToC style.
>\setupcombinedlist[content][
>  alternative=TOC,
>]
> 
>\starttext
>  \completecontent
>  \startchapter [title=alpha] \stopchapter
>\startsection[title=alphasec] \stopsection
>  \startchapter [title=beta]  \stopchapter
>\startsection[title=alphasec] \stopsection
>  \startchapter [title=gamma] \stopchapter
>\startsection[title=alphasec] \stopsection
>\stoptext
> 
> How do you determine whether or not the chapter title should be displayed?

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

\setuplist[chapter][headnumber=no,pagenumber=no,style=\bfc]
\setuplist[section][alternative=command,command=\SectionListEntry]

\starttext

\completecontent

\dorecurse{100}
  {\chapter{Chapter #1}
   \dorecurse{2}{\section{Section #1.##1}}}

\stoptext

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
___