Re: [NTG-context] [Fwd: hyphen breaking (URGENT)]

2010-02-24 Thread Bernhard Rosensteiner
Am 24.02.2010 um 23:11 schrieb Wolfgang Schuster:

> Am 24.02.10 22:54, schrieb Bernhard Rosensteiner:
>> for curiosity i tried the above code and it gives an error (undefined 
>> control sequence)
>> i searched in the source and found that \structureuservariable is valid not 
>> \structureuservalue
>>   
> What do you expect, it's a very old example and i wrote just after Hans
> added the functionality. Of yourse i should have checked it but testing
> each example consumes a lot of time.
> 
> Wolfgang

this was the reason for posting it (redundant error searching). Anyway, nice 
functionality - thanks for posting

best regards

___
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] [Fwd: hyphen breaking (URGENT)]

2010-02-24 Thread Wolfgang Schuster

Am 24.02.10 22:54, schrieb Bernhard Rosensteiner:

for curiosity i tried the above code and it gives an error (undefined control 
sequence)
i searched in the source and found that \structureuservariable is valid not 
\structureuservalue
   

What do you expect, it's a very old example and i wrote just after Hans
added the functionality. Of yourse i should have checked it but testing
each example consumes a lot of time.

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
___


Re: [NTG-context] [Fwd: hyphen breaking (URGENT)]

2010-02-24 Thread Bernhard Rosensteiner
Am 24.02.2010 um 22:38 schrieb Wolfgang Schuster:

> Am 24.02.10 22:26, schrieb Steffen Wolfrum:
> 
>> Perhaps I can also add comments to a writebetweenlist now?
>> Can you some further example on how to use "userdata"?
> 
> A example i wrote for Idris a while (April 2009) ago:
> 
> \setuphead[chapter][align=middle,command=\TitleCommand]
> 
> \define[2]\TitleCommand
>  {\startframedtext[frame=off,width=\hsize,align=middle]
>   #2\hairline
>   \structureuservalue{author}\hfill\structureuservalue{date}
>   \stopframedtext}
> 
> \starttext
> 
> \startchapter
>  [title={How to make Idris happy?},reference={sec:happy}]
>  [author={Wolfgang Schuster},date=\currentdate]
> 
> It's not as hard you think, just show him a few nice things
> and he is happy.
> 
> See \in{section}[sec:happy] at \at{page}[sec:happy].
> 
> \stopchapter
> 
> \stoptext
> 
> Wolfgang

Hi,

for curiosity i tried the above code and it gives an error (undefined control 
sequence)
i searched in the source and found that \structureuservariable is valid not 
\structureuservalue

best regards
Bernhard

___
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] [Fwd: hyphen breaking (URGENT)]

2010-02-24 Thread Wolfgang Schuster

Am 24.02.10 22:26, schrieb Steffen Wolfrum:


Perhaps I can also add comments to a writebetweenlist now?
Can you some further example on how to use "userdata"?


A example i wrote for Idris a while (April 2009) ago:

\setuphead[chapter][align=middle,command=\TitleCommand]

\define[2]\TitleCommand
  {\startframedtext[frame=off,width=\hsize,align=middle]
   #2\hairline
   \structureuservalue{author}\hfill\structureuservalue{date}
   \stopframedtext}

\starttext

\startchapter
  [title={How to make Idris happy?},reference={sec:happy}]
  [author={Wolfgang Schuster},date=\currentdate]

It's not as hard you think, just show him a few nice things
and he is happy.

See \in{section}[sec:happy] at \at{page}[sec:happy].

\stopchapter

\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
___


Re: [NTG-context] [Fwd: hyphen breaking (URGENT)]

2010-02-24 Thread Steffen Wolfrum

Am 23.02.2010 um 23:27 schrieb Hans Hagen:

> On 23-2-2010 21:18, Steffen Wolfrum wrote:
> 
>> The need is easily described:
>> 
>> \placelist[chapter, section,...][file=MyFile]
>> 
>> 
>> In old MkII times all information for a table of content was read from the 
>> ".tuo" file.
>> For making manual changes in needed a way to define from *which* tuo file 
>> the placelist command reads its information:
>> so I could copy the original tuo file, give it another name (MyFile) and 
>> define ...
>> 
>> \def\FrozenTUO{MyFile}
>> 
>>  thus each \placelist run would read from that paticular MyFile.tuo
>> 
>> The quoted code above was written by Hans to provide a way to implement a 
>> kind of \placelist[chapter, section,...][file=MyFile] in MkII.
> 
> the file= option will not come back, at least not soon, as we now have a 
> completely different way of dealing with tables of contents (and actually all 
> multipass data)
> 
> (ok, you can adapt copy the tuc file and replace the list table but as much 
> more goes into the list it's no fun; also way more information goes into the 
> lists and there are references to shared data that basically makes a no-go)
> 
> what we have already is a way to add userdata (which works if you use the 
> structured \startchapter ... commands) and when placing a list you can use 
> user entries; if you only need to replace a specific list entry you can do


I had a look in my tuc file and saw that a ...

\writebetweenlist[EbeneNull]{\strut\vskip-28pt}

... is now rendered as ...

{
  metadata=4,
  references={
   internal=5,
   realpage=5,
   section=0,
  },
  userdata={
   command="\\strut \\vskip -28pt",
  },
 }

... and that all my writebetweenlist instructions are now stored in such syntax 
one after the other.
In the MkII past the tuo file itself was not nice readable, but one could 
easily identify the context of a writebetweenlist instruction.

Perhaps I can also add comments to a writebetweenlist now?
Can you some further example on how to use "userdata"?

Thanks, Steffen
___
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] [Fwd: hyphen breaking (URGENT)]

2010-02-24 Thread Steffen Wolfrum

Am 24.02.2010 um 11:31 schrieb Hans Hagen:

> On 24-2-2010 8:50, Steffen Wolfrum wrote:
>> 
>> Am 23.02.2010 um 23:27 schrieb Hans Hagen:
>> 
>>> On 23-2-2010 21:18, Steffen Wolfrum wrote:
>>> 
 The need is easily described:
 
 \placelist[chapter, section,...][file=MyFile]
 
 
 In old MkII times all information for a table of content was read from the 
 ".tuo" file.
 For making manual changes in needed a way to define from *which* tuo file 
 the placelist command reads its information:
 so I could copy the original tuo file, give it another name (MyFile) and 
 define ...
 
 \def\FrozenTUO{MyFile}
 
  thus each \placelist run would read from that paticular MyFile.tuo
 
 The quoted code above was written by Hans to provide a way to implement a 
 kind of \placelist[chapter, section,...][file=MyFile] in MkII.
>>> 
>>> the file= option will not come back, at least not soon, as we now have a 
>>> completely different way of dealing with tables of contents (and actually 
>>> all multipass data)
>>> 
>>> (ok, you can adapt copy the tuc file and replace the list table but as much 
>>> more goes into the list it's no fun; also way more information goes into 
>>> the lists and there are references to shared data that basically makes a 
>>> no-go)
>>> 
>>> what we have already is a way to add userdata (which works if you use the 
>>> structured \startchapter ... commands) and when placing a list you can use 
>>> user entries; if you only need to replace a specific list entry you can do
>>> 
>>> \startchapter[title=whatever,list=whocares,bookmark=...]
>>> 
>>> so you have a different title and listentry and marking and reference and 
>>> bookmark and ..
>> 
>> 
>> There is an important side-effect in the way I use it in MkII:
>> The  idea is to run the table of contents independently from typesetting an 
>> entire book.
>> 
>> For example:
>> - you have a big book, each typesetting run takes quite long
>> - as you also have many headings the table of contents is 17 pages
>> - now you see an ugly page-brake at bottom of page 10
>> - but if the entire vertical spacing of this page would be reduced a bit 
>> then this page-break would look better.
>> 
>> What I'd do now in MkII is such (trial-and-error loop):
>> 0) the table of content is created by a \placelist command in a separate 
>> "contents.tex" component
>> 1) for testing purposes I now copy the tuo file and point (via 
>> \def\FrozenTUO) the placelist run to this file
>> 2) in this test-tuo file I hook in a command for reducing the vertical space 
>> (baseline/parskip) of my problematic contents page
>> 3) I run the contents.tex file again to see if the result is as desired
>> 4) if it is not, I do step 2) and 3) again
>> 5) finally, if the result is as desired, I write the command (that gave me 
>> that desired vertical space) via \writebetweenlist directly to the original 
>> chapter's files.
>> 6) now I point the \placelist run back again to the original tuo file: thus 
>> I can be save that whenever there will be additions/changes in the book, I 
>> can generate are table of contents with the updated pagenumbers (but also 
>> via writebetweenlist with my content's correction).
> 
> why not put a stoptext just after the toc then and run with --once?
> 
> that way the tuc file will not be overwritten and you have a short run



my experience is that run context --once literally work only once ...
thus, a trial-and-error loop (as described above) won't work.

or do you know a trick?!


Steffen
___
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] [Fwd: hyphen breaking (URGENT)]

2010-02-24 Thread Hans Hagen

On 24-2-2010 8:50, Steffen Wolfrum wrote:


Am 23.02.2010 um 23:27 schrieb Hans Hagen:


On 23-2-2010 21:18, Steffen Wolfrum wrote:


The need is easily described:

\placelist[chapter, section,...][file=MyFile]


In old MkII times all information for a table of content was read from the 
".tuo" file.
For making manual changes in needed a way to define from *which* tuo file the 
placelist command reads its information:
so I could copy the original tuo file, give it another name (MyFile) and define 
...

\def\FrozenTUO{MyFile}

 thus each \placelist run would read from that paticular MyFile.tuo

The quoted code above was written by Hans to provide a way to implement a kind 
of \placelist[chapter, section,...][file=MyFile] in MkII.


the file= option will not come back, at least not soon, as we now have a 
completely different way of dealing with tables of contents (and actually all 
multipass data)

(ok, you can adapt copy the tuc file and replace the list table but as much 
more goes into the list it's no fun; also way more information goes into the 
lists and there are references to shared data that basically makes a no-go)

what we have already is a way to add userdata (which works if you use the 
structured \startchapter ... commands) and when placing a list you can use user 
entries; if you only need to replace a specific list entry you can do

\startchapter[title=whatever,list=whocares,bookmark=...]

so you have a different title and listentry and marking and reference and 
bookmark and ..



There is an important side-effect in the way I use it in MkII:
The  idea is to run the table of contents independently from typesetting an 
entire book.

For example:
- you have a big book, each typesetting run takes quite long
- as you also have many headings the table of contents is 17 pages
- now you see an ugly page-brake at bottom of page 10
- but if the entire vertical spacing of this page would be reduced a bit then 
this page-break would look better.

What I'd do now in MkII is such (trial-and-error loop):
0) the table of content is created by a \placelist command in a separate 
"contents.tex" component
1) for testing purposes I now copy the tuo file and point (via \def\FrozenTUO) 
the placelist run to this file
2) in this test-tuo file I hook in a command for reducing the vertical space 
(baseline/parskip) of my problematic contents page
3) I run the contents.tex file again to see if the result is as desired
4) if it is not, I do step 2) and 3) again
5) finally, if the result is as desired, I write the command (that gave me that 
desired vertical space) via \writebetweenlist directly to the original 
chapter's files.
6) now I point the \placelist run back again to the original tuo file: thus I 
can be save that whenever there will be additions/changes in the book, I can 
generate are table of contents with the updated pagenumbers (but also via 
writebetweenlist with my content's correction).


why not put a stoptext just after the toc then and run with --once?

that way the tuc file will not be overwritten and you have a short run



-
  Hans Hagen | PRAGMA ADE
  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
-
___
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] [Fwd: hyphen breaking (URGENT)]

2010-02-23 Thread Steffen Wolfrum

Am 23.02.2010 um 23:27 schrieb Hans Hagen:

> On 23-2-2010 21:18, Steffen Wolfrum wrote:
> 
>> The need is easily described:
>> 
>> \placelist[chapter, section,...][file=MyFile]
>> 
>> 
>> In old MkII times all information for a table of content was read from the 
>> ".tuo" file.
>> For making manual changes in needed a way to define from *which* tuo file 
>> the placelist command reads its information:
>> so I could copy the original tuo file, give it another name (MyFile) and 
>> define ...
>> 
>> \def\FrozenTUO{MyFile}
>> 
>>  thus each \placelist run would read from that paticular MyFile.tuo
>> 
>> The quoted code above was written by Hans to provide a way to implement a 
>> kind of \placelist[chapter, section,...][file=MyFile] in MkII.
> 
> the file= option will not come back, at least not soon, as we now have a 
> completely different way of dealing with tables of contents (and actually all 
> multipass data)
> 
> (ok, you can adapt copy the tuc file and replace the list table but as much 
> more goes into the list it's no fun; also way more information goes into the 
> lists and there are references to shared data that basically makes a no-go)
> 
> what we have already is a way to add userdata (which works if you use the 
> structured \startchapter ... commands) and when placing a list you can use 
> user entries; if you only need to replace a specific list entry you can do
> 
> \startchapter[title=whatever,list=whocares,bookmark=...]
> 
> so you have a different title and listentry and marking and reference and 
> bookmark and ..


There is an important side-effect in the way I use it in MkII:
The  idea is to run the table of contents independently from typesetting an 
entire book.

For example: 
- you have a big book, each typesetting run takes quite long
- as you also have many headings the table of contents is 17 pages
- now you see an ugly page-brake at bottom of page 10
- but if the entire vertical spacing of this page would be reduced a bit then 
this page-break would look better.

What I'd do now in MkII is such (trial-and-error loop):
0) the table of content is created by a \placelist command in a separate 
"contents.tex" component
1) for testing purposes I now copy the tuo file and point (via \def\FrozenTUO) 
the placelist run to this file
2) in this test-tuo file I hook in a command for reducing the vertical space 
(baseline/parskip) of my problematic contents page
3) I run the contents.tex file again to see if the result is as desired
4) if it is not, I do step 2) and 3) again
5) finally, if the result is as desired, I write the command (that gave me that 
desired vertical space) via \writebetweenlist directly to the original 
chapter's files.
6) now I point the \placelist run back again to the original tuo file: thus I 
can be save that whenever there will be additions/changes in the book, I can 
generate are table of contents with the updated pagenumbers (but also via 
writebetweenlist with my content's correction).


That's why in MkIV I look for a way to point placelist to a specified file.

Steffen
___
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] [Fwd: hyphen breaking (URGENT)]

2010-02-23 Thread Hans Hagen

On 23-2-2010 21:18, Steffen Wolfrum wrote:


The need is easily described:

\placelist[chapter, section,...][file=MyFile]


In old MkII times all information for a table of content was read from the 
".tuo" file.
For making manual changes in needed a way to define from *which* tuo file the 
placelist command reads its information:
so I could copy the original tuo file, give it another name (MyFile) and define 
...

\def\FrozenTUO{MyFile}

 thus each \placelist run would read from that paticular MyFile.tuo

The quoted code above was written by Hans to provide a way to implement a kind 
of \placelist[chapter, section,...][file=MyFile] in MkII.


the file= option will not come back, at least not soon, as we now have a 
completely different way of dealing with tables of contents (and 
actually all multipass data)


(ok, you can adapt copy the tuc file and replace the list table but as 
much more goes into the list it's no fun; also way more information goes 
into the lists and there are references to shared data that basically 
makes a no-go)


what we have already is a way to add userdata (which works if you use 
the structured \startchapter ... commands) and when placing a list you 
can use user entries; if you only need to replace a specific list entry 
you can do


\startchapter[title=whatever,list=whocares,bookmark=...]

so you have a different title and listentry and marking and reference 
and bookmark and ..


Hans

-
  Hans Hagen | PRAGMA ADE
  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
-
___
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] [Fwd: hyphen breaking (URGENT)]

2010-02-23 Thread Steffen Wolfrum

Am 23.02.2010 um 16:23 schrieb Hans Hagen:

> On 23-2-2010 12:22, Steffen Wolfrum wrote:
>> 
>> Am 25.10.2009 um 21:33 schrieb Hans Hagen:
>> 
>>> Steffen Wolfrum wrote:
>>> 
> \unprotect
> \def\FrozenTUO{MyFile}
> \def\doplacerawlist[#1][#2]%
> {\begingroup
> \dogetcommalistelement1\from#1\to\firstlistelement
> \dosetuplist[#1][#2]%
> \doifvalue{\??li\firstlistelement\c!coupling}\v!on
>   {\startlistreferences{#1}}%
> \dosettoclevel\??li\firstlistelement
> \honorlocalfilterlevel
> \doutilities{listentries,#1}\FrozenTUO{#1}\relax\par
> \stoplistreferences{#1}%
>>> 
>>>   
>>> 
>>> remove {#1} here
>>> 
> \dosetlistmode
> \endgroup}
> \protect
>>> 
>>> i probably added some proper push/pop here
>> 
>> 
>> 
>> Today the code above gives an error:
>> 
>> ! Undefined control sequence.
>> \doplacerawlist ...references {#1}}\dosettoclevel
>>   \??li \firstlistelement 
>> \h...
>> \doplacelist ...ginoflist \doplacerawlist [#1][#2]
>>   \doendoflist
>> 
>> 
>> 
>> 
>> Can you see what needs to be changed?
> 
> sure, as the whole underlying mechanism of lists has changed (and now mostly 
> happens in lua) that code makes no sense and iven if i made a (fake) 
> \dosettoclevel it would not kick in
> 
> so, you need to identify your need and then implement a mkiv solution



The need is easily described: 

\placelist[chapter, section,...][file=MyFile]


In old MkII times all information for a table of content was read from the 
".tuo" file.
For making manual changes in needed a way to define from *which* tuo file the 
placelist command reads its information:
so I could copy the original tuo file, give it another name (MyFile) and define 
...

\def\FrozenTUO{MyFile}

... thus each \placelist run would read from that paticular MyFile.tuo

The quoted code above was written by Hans to provide a way to implement a kind 
of \placelist[chapter, section,...][file=MyFile] in MkII. 


As all list reading stuff was re-written from scratch in MkIV, this can be 
hopefully done directly now?
It looks like already prepared:
\placelist[chapter, section,...][file=MyFile]
doesn't give an error ... but doesn't work either.

Steffen












___
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] [Fwd: hyphen breaking (URGENT)]

2010-02-23 Thread Hans Hagen

On 23-2-2010 12:22, Steffen Wolfrum wrote:


Am 25.10.2009 um 21:33 schrieb Hans Hagen:


Steffen Wolfrum wrote:


\unprotect
\def\FrozenTUO{MyFile}
\def\doplacerawlist[#1][#2]%
{\begingroup
\dogetcommalistelement1\from#1\to\firstlistelement
\dosetuplist[#1][#2]%
\doifvalue{\??li\firstlistelement\c!coupling}\v!on
   {\startlistreferences{#1}}%
\dosettoclevel\??li\firstlistelement
\honorlocalfilterlevel
\doutilities{listentries,#1}\FrozenTUO{#1}\relax\par
\stoplistreferences{#1}%


   

remove {#1} here


\dosetlistmode
\endgroup}
\protect


i probably added some proper push/pop here




Today the code above gives an error:

! Undefined control sequence.
\doplacerawlist ...references {#1}}\dosettoclevel
   \??li \firstlistelement \h...
\doplacelist ...ginoflist \doplacerawlist [#1][#2]
   \doendoflist




Can you see what needs to be changed?


sure, as the whole underlying mechanism of lists has changed (and now 
mostly happens in lua) that code makes no sense and iven if i made a 
(fake) \dosettoclevel it would not kick in


so, you need to identify your need and then implement a mkiv solution

Hans


-
  Hans Hagen | PRAGMA ADE
  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
-
___
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
___