You can’t do this with tabulate but it’s possible with natural tables. %\enablemode [BL] \starttext \startsetups [tablesetups] \setupTABLE [start] [frame=off] \setupTABLE [column] [1] [width=6cm,align=flushleft] \setupTABLE [column] [2] [width=2cm,align=flushleft] \stopsetups \bTABLE [setups=tablesetups] \bTR \bTD Well depth \eTD \bTD 10100 ft \eTD \startmode [BL] \bTD \unit{3100 meter} \eTD \stopmode \eTR \bTR \bTD Fluid density \eTD \bTD 9.0 ppg \eTD \startmode [BL] \bTD \unit{1.08 kilogram per liter} \eTD \stopmode \eTR \eTABLE \stoptext Wolfgang Jan Willem Flamma schrieb am 06.09.18 um 11:44:
Dear list members
I would like to disable to third column in the question when mode BL is not enabled.
When mode BL is enabled (using the toggle), the third column should of course appear again.
How can I achieve this?
Regards, Jan Willem
MWE:
\starttext
%Toggles %\enablemode[BL]
\defineblock[question] \defineblock[answer]
\hideblocks[question] \hideblocks[answer]
\defineenumeration [question] [text=Question, after={\blank[2*big]}, inbetween={\blank[nowhite]}, way=bychapter, prefixsegments=chapter, prefix=yes]
\defineenumeration [answer] [counter=answer, text=, width=, before={\blank[nowhite]}, after={\blank[nowhite]}, indenting=no, titledistance=1cm, location=inmargin, alternative=left, headstyle=, way=bychapter, prefixsegments=chapter, prefix=yes]
\beginquestion \startquestion Calculate the hydrostatic pressure of the following fluid. \starttabulate[|lw(6cm)|lw(3cm)|\doifmode{BL}{p|}] \NC Well depth \NC 10100 ft \doifmode{BL}{\NC 3100 m} \NC \NR \NC Fluid density \NC 9.0 ppg \doifmode{BL}{\NC 1.08 kg/l} \NC \NR \stoptabulate \stopquestion \endquestion \beginanswer \startanswer 4726 psi\doifmode{BL}{ / 328 bar} \stopanswer \endanswer
\startsection[title=Questions] \useblocks[question] \startsubsubsection[title=Answers] \useblocks[answer] \stopsubsubsection \stopsection
\stoptext ___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________