On Sat, 17 Mar 2007 17:22:39 +0100
"Bernhard Michael"
Hi Michael,
I found a very ugly solution to reset the \Requirement counter.
Hi Wolfgang
Thanks for the solution. It works for me too.
However the page breaking problem remains. The tabulate environment and the natural table produce both to large 'cells' containing all textblocks.
It would be really nice to have a solution where I can typeset the to textblocks (Requirements and Priority) in a list, each block in a cell.
I don't understand why I can't place arbitrary commands in the 'begin' and 'after' fields of '\setupblock'. Does the '\useblocks' command not produce plain TeX-Code in iterative fashion (like a for-loop over all textblocks)?
Is there somebody in the list, who already had a similar problem?
Michael
Hi Michael, I looked a little bit into the code for blocks (core-blk.tex) and it seems to be impossible with the current implementation. The before and after commands do not realy put their content at the begin and end of a block. I made a small solution that did what you want more or less. The \usemyblocks read the content from the output file jobname.tub and process the content between \thisisblock and \thiswasblock. The version below takes every block between these two commands and put them into boxes. To improve this macro you can make a test if the current environment it reads is a Requirement or a Priority and put it dependent of the bloxk into the left and right box or to make a empty block if one of them is misssing. \unprotect \chardef\myblockcount\zeropoint \def\usemyblocks {\bgroup \long\def\thisisblock##1##2[]##3\thiswasblock##4% {\ifcase\myblockcount \global\chardef\myblockcount\plusone \hbox\bgroup \vbox\bgroup \hsize6cm ##3 \egroup \column \or \global\chardef\myblockcount\zeropoint \vbox\bgroup \hsize1cm ##3\dontleavehmode\vfill \egroup \egroup \fi} \readfile{\jobname.tub}\donothing\donothing \egroup} \protect \defineenumeration[Requirement] \defineblock[Requirement,Priority] \starttext \beginRequirement \Requirement A requirement \par \endRequirement \beginPriority Text \endPriority \beginRequirement \Requirement A requirement \par \endRequirement \beginPriority Text \endPriority \bgroup \setbox0\hbox {\Requirement text \par \resetRequirement} \egroup \usemyblocks \stoptext Wolfgang