ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* textblocks in tables
@ 2007-03-16  8:41 Bernhard Michael
  2007-03-16 10:06 ` Wolfgang Schuster
  0 siblings, 1 reply; 8+ messages in thread
From: Bernhard Michael @ 2007-03-16  8:41 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 2072 bytes --]

Hi list

After writing some documents in LaTeX I discovered ConTeX. It's a great macro package for TeX. It gives me the flexibility I missed with LaTeX.

However it isn't that easy to start with :-) Especially when some advanced functionality is needed...

I write a document where I have to describe requirements. I want to give these requirements a running number over all chapters and I also need to prioritise them.

My idea is to describe the requirements in several chapter. At the end I want to list all the requirements together with their priority.

I tried the following code but unfortunately it didn't work:

\defineenumeration[Requirement][location=left,text=Req,width=broad,after={\blank[small]}]
\defineblock[Requirement,Priority]
\setupblock[Requirement][after=]
\hideblocks[Priority]

\starttext

\chapter{Description of requirements}

\beginRequirement
\Requirement A requirement \par
\endRequirement
\beginPriority
A
\endPriority
Description of the requirement.

\beginRequirement
\Requirement An other requirement \par
\endRequirement
\beginPriority
C
\endPriority
Description of the requirement.

\chapter{Additional requirements}

\beginRequirement
\Requirement An additional requirement \par
\endRequirement
\beginPriority
B
\endPriority
Description of the requirement.

\beginRequirement
\subRequirement A sub requirement \par
\endRequirement
\beginPriority
C
\endPriority
Description of the requirement.

\chapter{Summary of requirements}
% Here I would like to list all requirements with their priorities in a table
% I tried something like this but it didn't work
\reset[Requirement]
\setupblock[Requirement][before=\HL\VL,after=]
\setupblock[Priority][before=\VL,after=\VL\MR
\starttable[|l|c|]
\useblocks[Requirement,Priority]
\stoptable

\stoptext

Is it possible to use text blocks within tables or does an other way exists to do the same thing? It doesn’t have to be a table necessarily. I need some sort of compact listing.

Thanks in advance for your help!

Michael

[-- Attachment #1.2: Type: text/html, Size: 2722 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: textblocks in tables
  2007-03-16  8:41 textblocks in tables Bernhard Michael
@ 2007-03-16 10:06 ` Wolfgang Schuster
  2007-03-16 14:29   ` Bernhard Michael
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2007-03-16 10:06 UTC (permalink / raw)
  To: ntg-context

On Fri, 16 Mar 2007 09:41:50 +0100
"Bernhard Michael" <Michael.Bernhard@bfh.ch> wrote:

> Hi list
> 
> After writing some documents in LaTeX I discovered ConTeX. It's a great macro package for TeX. It gives me the flexibility I missed with LaTeX.
> 
> However it isn't that easy to start with :-) Especially when some advanced functionality is needed...
> 
> I write a document where I have to describe requirements. I want to give these requirements a running number over all chapters and I also need to prioritise them.
> 
> My idea is to describe the requirements in several chapter. At the end I want to list all the requirements together with their priority.
> 
> I tried the following code but unfortunately it didn't work:
> 
> \defineenumeration[Requirement][location=left,text=Req,width=broad,after={\blank[small]}]
> \defineblock[Requirement,Priority]
> \setupblock[Requirement][after=]
> \hideblocks[Priority]
> 
> \starttext
> 
> \chapter{Description of requirements}
> 
> \beginRequirement
> \Requirement A requirement \par
> \endRequirement
> \beginPriority
> A
> \endPriority
> Description of the requirement.
> 
> \beginRequirement
> \Requirement An other requirement \par
> \endRequirement
> \beginPriority
> C
> \endPriority
> Description of the requirement.
> 
> \chapter{Additional requirements}
> 
> \beginRequirement
> \Requirement An additional requirement \par
> \endRequirement
> \beginPriority
> B
> \endPriority
> Description of the requirement.
> 
> \beginRequirement
> \subRequirement A sub requirement \par
> \endRequirement
> \beginPriority
> C
> \endPriority
> Description of the requirement.
> 
> \chapter{Summary of requirements}
> % Here I would like to list all requirements with their priorities in a table
> % I tried something like this but it didn't work
> \reset[Requirement]
> \setupblock[Requirement][before=\HL\VL,after=]
> \setupblock[Priority][before=\VL,after=\VL\MR
> \starttable[|l|c|]
> \useblocks[Requirement,Priority]
> \stoptable
> 
> \stoptext
> 
> Is it possible to use text blocks within tables or does an other way exists to do the same thing? It doesn’t have to be a table necessarily. I need some sort of compact listing.
> 
> Thanks in advance for your help!
> 
> Michael
> 

Hi Michael,

using natural tables instead of the normal table environment works.

\bTABLE
  \bTR
    \bTD\useblocks[Requirement]\eTD
    \bTD\useblocks[Priority]\eTD
  \eTR
\eTABLE

Wolfgang

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: textblocks in tables
  2007-03-16 10:06 ` Wolfgang Schuster
@ 2007-03-16 14:29   ` Bernhard Michael
  2007-03-16 15:09     ` Wolfgang Schuster
  0 siblings, 1 reply; 8+ messages in thread
From: Bernhard Michael @ 2007-03-16 14:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 3670 bytes --]

Wolfgang, thank you for your answer!

However I suppose that it doesn't completely solve my problem. I think this solution makes a table with two huge cells. I couldn't make horizontal lines after every line and table splitting doesn't seem to work either (I have a lot of requirements).

Is there an other way to solve my problem with tables? I'd really like to automate the process because copy and paste the text is very error prone.

I looked at paragraphs as well but I didn't succeed. I thought inserting the necessary commands in the 'begin' and 'after' property of the textblock would 'generate' me correct ConTeXt code.

There is an other problem: The command \resetRequirement doesn't work. I need to reset the counter because the numbering must be the same like in the chapters before. I tried the code at live.contextgarden.net.

Tanks for your help!

Michael


Wolfgang Schuster wrote:
> On Fri, 16 Mar 2007 09:41:50 +0100
> "Bernhard Michael" <Michael.Bernhard@bfh.ch> wrote:
> 
>> Hi list
>>
>> After writing some documents in LaTeX I discovered ConTeX. It's a great macro package for TeX. It gives me the flexibility I missed with LaTeX.
>>
>> However it isn't that easy to start with :-) Especially when some advanced functionality is needed...
>>
>> I write a document where I have to describe requirements. I want to give these requirements a running number over all chapters and I also need to prioritise them.
>>
>> My idea is to describe the requirements in several chapter. At the end I want to list all the requirements together with their priority.
>>
>> I tried the following code but unfortunately it didn't work:
>>
>> \defineenumeration[Requirement][location=left,text=Req,width=broad,after={\blank[small]}]
>> \defineblock[Requirement,Priority]
>> \setupblock[Requirement][after=]
>> \hideblocks[Priority]
>>
>> \starttext
>>
>> \chapter{Description of requirements}
>>
>> \beginRequirement
>> \Requirement A requirement \par
>> \endRequirement
>> \beginPriority
>> A
>> \endPriority
>> Description of the requirement.
>>
>> \beginRequirement
>> \Requirement An other requirement \par
>> \endRequirement
>> \beginPriority
>> C
>> \endPriority
>> Description of the requirement.
>>
>> \chapter{Additional requirements}
>>
>> \beginRequirement
>> \Requirement An additional requirement \par
>> \endRequirement
>> \beginPriority
>> B
>> \endPriority
>> Description of the requirement.
>>
>> \beginRequirement
>> \subRequirement A sub requirement \par
>> \endRequirement
>> \beginPriority
>> C
>> \endPriority
>> Description of the requirement.
>>
>> \chapter{Summary of requirements}
>> % Here I would like to list all requirements with their priorities in a table
>> % I tried something like this but it didn't work
>> \reset[Requirement]
>> \setupblock[Requirement][before=\HL\VL,after=]
>> \setupblock[Priority][before=\VL,after=\VL\MR
>> \starttable[|l|c|]
>> \useblocks[Requirement,Priority]
>> \stoptable
>>
>> \stoptext
>>
>> Is it possible to use text blocks within tables or does an other way exists to do the same thing? It doesn’t have to be a table necessarily. I need some sort of compact listing.
>>
>> Thanks in advance for your help!
>>
>> Michael
>>
> 
> Hi Michael,
> 
> using natural tables instead of the normal table environment works.
> 
> \bTABLE
>   \bTR
>     \bTD\useblocks[Requirement]\eTD
>     \bTD\useblocks[Priority]\eTD
>   \eTR
> \eTABLE
> 
> Wolfgang
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context


[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 4127 bytes --]

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: textblocks in tables
  2007-03-16 14:29   ` Bernhard Michael
@ 2007-03-16 15:09     ` Wolfgang Schuster
  2007-03-16 16:05       ` Bernhard Michael
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2007-03-16 15:09 UTC (permalink / raw)
  To: ntg-context

On Fri, 16 Mar 2007 15:29:30 +0100
"Bernhard Michael" <Michael.Bernhard@bfh.ch> wrote:

> Wolfgang, thank you for your answer!
> 
> However I suppose that it doesn't completely solve my problem. I think this solution makes a table with two huge cells. I couldn't make horizontal lines after every line and table splitting doesn't seem to work either (I have a lot of requirements).
> 
> Is there an other way to solve my problem with tables? I'd really like to automate the process because copy and paste the text is very error prone.
> 
> I looked at paragraphs as well but I didn't succeed. I thought inserting the necessary commands in the 'begin' and 'after' property of the textblock would 'generate' me correct ConTeXt code.
> 
> There is an other problem: The command \resetRequirement doesn't work. I need to reset the counter because the numbering must be the same like in the chapters before. I tried the code at live.contextgarden.net.
> 
> Tanks for your help!
> 
> Michael
> 

Hi Michael,

another way to place the summary at the end of your document.

\starttabulate[|p(8cm)|p(1cm)|]
\NC\useblocks[Requirement]
\NC\useblocks[Priority]
\NC\NR
\stoptabulate

I saw also the problem with the reset of the enumeration in my file but
I don't know where the problem is.

Wolfgang

> 
> Wolfgang Schuster wrote:
> > On Fri, 16 Mar 2007 09:41:50 +0100
> > "Bernhard Michael" <Michael.Bernhard@bfh.ch> wrote:
> > 
> >> Hi list
> >>
> >> After writing some documents in LaTeX I discovered ConTeX. It's a great macro package for TeX. It gives me the flexibility I missed with LaTeX.
> >>
> >> However it isn't that easy to start with :-) Especially when some advanced functionality is needed...
> >>
> >> I write a document where I have to describe requirements. I want to give these requirements a running number over all chapters and I also need to prioritise them.
> >>
> >> My idea is to describe the requirements in several chapter. At the end I want to list all the requirements together with their priority.
> >>
> >> I tried the following code but unfortunately it didn't work:
> >>
> >> \defineenumeration[Requirement][location=left,text=Req,width=broad,after={\blank[small]}]
> >> \defineblock[Requirement,Priority]
> >> \setupblock[Requirement][after=]
> >> \hideblocks[Priority]
> >>
> >> \starttext
> >>
> >> \chapter{Description of requirements}
> >>
> >> \beginRequirement
> >> \Requirement A requirement \par
> >> \endRequirement
> >> \beginPriority
> >> A
> >> \endPriority
> >> Description of the requirement.
> >>
> >> \beginRequirement
> >> \Requirement An other requirement \par
> >> \endRequirement
> >> \beginPriority
> >> C
> >> \endPriority
> >> Description of the requirement.
> >>
> >> \chapter{Additional requirements}
> >>
> >> \beginRequirement
> >> \Requirement An additional requirement \par
> >> \endRequirement
> >> \beginPriority
> >> B
> >> \endPriority
> >> Description of the requirement.
> >>
> >> \beginRequirement
> >> \subRequirement A sub requirement \par
> >> \endRequirement
> >> \beginPriority
> >> C
> >> \endPriority
> >> Description of the requirement.
> >>
> >> \chapter{Summary of requirements}
> >> % Here I would like to list all requirements with their priorities in a table
> >> % I tried something like this but it didn't work
> >> \reset[Requirement]
> >> \setupblock[Requirement][before=\HL\VL,after=]
> >> \setupblock[Priority][before=\VL,after=\VL\MR
> >> \starttable[|l|c|]
> >> \useblocks[Requirement,Priority]
> >> \stoptable
> >>
> >> \stoptext
> >>
> >> Is it possible to use text blocks within tables or does an other way exists to do the same thing? It doesn’t have to be a table necessarily. I need some sort of compact listing.
> >>
> >> Thanks in advance for your help!
> >>
> >> Michael
> >>
> > 
> > Hi Michael,
> > 
> > using natural tables instead of the normal table environment works.
> > 
> > \bTABLE
> >   \bTR
> >     \bTD\useblocks[Requirement]\eTD
> >     \bTD\useblocks[Priority]\eTD
> >   \eTR
> > \eTABLE
> > 
> > Wolfgang
> > _______________________________________________
> > ntg-context mailing list
> > ntg-context@ntg.nl
> > http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: textblocks in tables
  2007-03-16 15:09     ` Wolfgang Schuster
@ 2007-03-16 16:05       ` Bernhard Michael
  2007-03-16 17:51         ` Wolfgang Schuster
  0 siblings, 1 reply; 8+ messages in thread
From: Bernhard Michael @ 2007-03-16 16:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 4960 bytes --]

Well, the result looks promising. The page breaking doesn't work however. 

An other idea: Is it possible to modify the line-spacing, that the 'Priority'
block is printed on the same line as the 'Requirement' block. This would preserve 
the page breaking because there is no \start \stop something.

The command \resetRequirement has to work, otherwise the whole effort is useless.

Wolfgang, thank you again for your quick answer.

Michael

Wolfgang Schuster wrote:
> On Fri, 16 Mar 2007 15:29:30 +0100
> "Bernhard Michael" <Michael.Bernhard@bfh.ch> wrote:
> 
>> Wolfgang, thank you for your answer!
>>
>> However I suppose that it doesn't completely solve my problem. I think this solution makes a table with two huge cells. I couldn't make horizontal lines after every line and table splitting doesn't seem to work either (I have a lot of requirements).
>>
>> Is there an other way to solve my problem with tables? I'd really like to automate the process because copy and paste the text is very error prone.
>>
>> I looked at paragraphs as well but I didn't succeed. I thought inserting the necessary commands in the 'begin' and 'after' property of the textblock would 'generate' me correct ConTeXt code.
>>
>> There is an other problem: The command \resetRequirement doesn't work. I need to reset the counter because the numbering must be the same like in the chapters before. I tried the code at live.contextgarden.net.
>>
>> Tanks for your help!
>>
>> Michael
>>
> 
> Hi Michael,
> 
> another way to place the summary at the end of your document.
> 
> \starttabulate[|p(8cm)|p(1cm)|]
> \NC\useblocks[Requirement]
> \NC\useblocks[Priority]
> \NC\NR
> \stoptabulate
> 
> I saw also the problem with the reset of the enumeration in my file but
> I don't know where the problem is.
> 
> Wolfgang
> 
>> Wolfgang Schuster wrote:
>>> On Fri, 16 Mar 2007 09:41:50 +0100
>>> "Bernhard Michael" <Michael.Bernhard@bfh.ch> wrote:
>>>
>>>> Hi list
>>>>
>>>> After writing some documents in LaTeX I discovered ConTeX. It's a great macro package for TeX. It gives me the flexibility I missed with LaTeX.
>>>>
>>>> However it isn't that easy to start with :-) Especially when some advanced functionality is needed...
>>>>
>>>> I write a document where I have to describe requirements. I want to give these requirements a running number over all chapters and I also need to prioritise them.
>>>>
>>>> My idea is to describe the requirements in several chapter. At the end I want to list all the requirements together with their priority.
>>>>
>>>> I tried the following code but unfortunately it didn't work:
>>>>
>>>> \defineenumeration[Requirement][location=left,text=Req,width=broad,after={\blank[small]}]
>>>> \defineblock[Requirement,Priority]
>>>> \setupblock[Requirement][after=]
>>>> \hideblocks[Priority]
>>>>
>>>> \starttext
>>>>
>>>> \chapter{Description of requirements}
>>>>
>>>> \beginRequirement
>>>> \Requirement A requirement \par
>>>> \endRequirement
>>>> \beginPriority
>>>> A
>>>> \endPriority
>>>> Description of the requirement.
>>>>
>>>> \beginRequirement
>>>> \Requirement An other requirement \par
>>>> \endRequirement
>>>> \beginPriority
>>>> C
>>>> \endPriority
>>>> Description of the requirement.
>>>>
>>>> \chapter{Additional requirements}
>>>>
>>>> \beginRequirement
>>>> \Requirement An additional requirement \par
>>>> \endRequirement
>>>> \beginPriority
>>>> B
>>>> \endPriority
>>>> Description of the requirement.
>>>>
>>>> \beginRequirement
>>>> \subRequirement A sub requirement \par
>>>> \endRequirement
>>>> \beginPriority
>>>> C
>>>> \endPriority
>>>> Description of the requirement.
>>>>
>>>> \chapter{Summary of requirements}
>>>> % Here I would like to list all requirements with their priorities in a table
>>>> % I tried something like this but it didn't work
>>>> \reset[Requirement]
>>>> \setupblock[Requirement][before=\HL\VL,after=]
>>>> \setupblock[Priority][before=\VL,after=\VL\MR
>>>> \starttable[|l|c|]
>>>> \useblocks[Requirement,Priority]
>>>> \stoptable
>>>>
>>>> \stoptext
>>>>
>>>> Is it possible to use text blocks within tables or does an other way exists to do the same thing? It doesn’t have to be a table necessarily. I need some sort of compact listing.
>>>>
>>>> Thanks in advance for your help!
>>>>
>>>> Michael
>>>>
>>> Hi Michael,
>>>
>>> using natural tables instead of the normal table environment works.
>>>
>>> \bTABLE
>>>   \bTR
>>>     \bTD\useblocks[Requirement]\eTD
>>>     \bTD\useblocks[Priority]\eTD
>>>   \eTR
>>> \eTABLE
>>>
>>> Wolfgang
>>> _______________________________________________
>>> ntg-context mailing list
>>> ntg-context@ntg.nl
>>> http://www.ntg.nl/mailman/listinfo/ntg-context
>>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 4695 bytes --]

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: textblocks in tables
  2007-03-16 16:05       ` Bernhard Michael
@ 2007-03-16 17:51         ` Wolfgang Schuster
  2007-03-17 16:22           ` Bernhard Michael
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2007-03-16 17:51 UTC (permalink / raw)
  To: ntg-context

On Fri, 16 Mar 2007 17:05:03 +0100
"Bernhard Michael" <Michael.Bernhard@bfh.ch> wrote:

> Well, the result looks promising. The page breaking doesn't work however. 
> 
> An other idea: Is it possible to modify the line-spacing, that the 'Priority'
> block is printed on the same line as the 'Requirement' block. This would preserve 
> the page breaking because there is no \start \stop something.
> 
> The command \resetRequirement has to work, otherwise the whole effort is useless.
> 
> Wolfgang, thank you again for your quick answer.
> 
> Michael

Hi Michael,

I found a very ugly solution to reset the \Requirement counter.

\defineenumeration[Requirement]
\defineblock[Requirement]

\starttext

\beginRequirement
\Requirement A requirement \par
\endRequirement

\bgroup
\setbox0\hbox
  {\Requirement text \par
   \resetRequirement}
\egroup

\useblocks[Requirement]

\stoptext

I think the problem has something to do with global and local values of
the \Requirement number.

Wolfgang

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: textblocks in tables
  2007-03-16 17:51         ` Wolfgang Schuster
@ 2007-03-17 16:22           ` Bernhard Michael
  2007-03-18  7:56             ` Wolfgang Schuster
  0 siblings, 1 reply; 8+ messages in thread
From: Bernhard Michael @ 2007-03-17 16:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

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

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 3079 bytes --]

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: textblocks in tables
  2007-03-17 16:22           ` Bernhard Michael
@ 2007-03-18  7:56             ` Wolfgang Schuster
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Schuster @ 2007-03-18  7:56 UTC (permalink / raw)
  To: ntg-context

On Sat, 17 Mar 2007 17:22:39 +0100
"Bernhard Michael" <Michael.Bernhard@bfh.ch> wrote:

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-03-18  7:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-16  8:41 textblocks in tables Bernhard Michael
2007-03-16 10:06 ` Wolfgang Schuster
2007-03-16 14:29   ` Bernhard Michael
2007-03-16 15:09     ` Wolfgang Schuster
2007-03-16 16:05       ` Bernhard Michael
2007-03-16 17:51         ` Wolfgang Schuster
2007-03-17 16:22           ` Bernhard Michael
2007-03-18  7:56             ` Wolfgang Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).