On 7/26/2018 9:06 AM, Jeong Dal wrote:
Dear all,
In mathematics, there are many occasions to make exercise problems in columns, and I did that using “tabulate” as following. Thanks Hans for this method! %%%%%%% \define\iTwo{\starttabulate[||w(.42\makeupwidth)||lw(.42\makeupwidth)|]} \define\iThree{\starttabulate[||lw(.28\makeupwidth)||lw(.28\makeupwidth)||lw(.28\makeupwidth)|]} \define\iFour{\starttabulate[||lw(.21\makeupwidth)||lw(.21\makeupwidth)||lw(.21\makeupwidth)||lw(.21\makeupwidth)|]}
\starttext \startitemize[n] \iTwo \NC \itemtag \NC test1 \NC \itemtag \NC test2 \NC\NR \NC \itemtag \NC test3 \NC \itemtag \NC test4 \NC\NR \NC \itemtag \NC test5 \NC \itemtag \NC test6 \NC\NR \stoptabulate \stopitemize \stoptext
%%%%%%% It works well. Since the numbers in the definitions are calculated by .84/2, .84/3, .84/4, I want to combine those definitions in one form. Is it possible to define a one definition which can be set by argument as following.
\define[1]\iCol{\starttabulate[|*{#1}{|lw(.84/#1)\makeupwidth|}]}
When I call it \iCol{2}, the first *{#1} is working, but the second #1 is a problem. I tried \ctxlua for division, but it didn’t work either. Is there a nice way to define them in one definition? It may be my greedy hope. \define[1]\iCol {\starttabulate[|*{#1}{|lw(\dimexpr.84\makeupwidth/#1\relax)|}]}
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------