* about the defining itemized columns. [not found] <mailman.1581.1532566184.2042.ntg-context@ntg.nl> @ 2018-07-26 7:06 ` Jeong Dal 2018-07-26 9:13 ` Hans Hagen 0 siblings, 1 reply; 3+ messages in thread From: Jeong Dal @ 2018-07-26 7:06 UTC (permalink / raw) To: list ntg-context@ntg.nl ntg-context@ntg.nl ntg-context@ntg.nl ntg-context@ntg.nl 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. Thanks for reading. Best regards, Dalyoung ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: about the defining itemized columns. 2018-07-26 7:06 ` about the defining itemized columns Jeong Dal @ 2018-07-26 9:13 ` Hans Hagen 2018-07-26 14:27 ` Jeong Dal 0 siblings, 1 reply; 3+ messages in thread From: Hans Hagen @ 2018-07-26 9:13 UTC (permalink / raw) To: mailing list for ConTeXt users, Jeong Dal 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 ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: about the defining itemized columns. 2018-07-26 9:13 ` Hans Hagen @ 2018-07-26 14:27 ` Jeong Dal 0 siblings, 0 replies; 3+ messages in thread From: Jeong Dal @ 2018-07-26 14:27 UTC (permalink / raw) To: Hans Hagen Cc: list ntg-context@ntg.nl ntg-context@ntg.nl ntg-context@ntg.nl ntg-context@ntg.nl [-- Attachment #1.1: Type: text/plain, Size: 172 bytes --] Dear Hans, Thanks for the solution. It works perfectly. Best regards, Dalyoung >> define[1]\iCol > {\starttabulate[|*{#1}{|lw(\dimexpr.84\makeupwidth/#1\relax)|}]} > [-- Attachment #1.2: Type: text/html, Size: 1804 bytes --] [-- Attachment #2: Type: text/plain, Size: 492 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-26 14:27 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <mailman.1581.1532566184.2042.ntg-context@ntg.nl> 2018-07-26 7:06 ` about the defining itemized columns Jeong Dal 2018-07-26 9:13 ` Hans Hagen 2018-07-26 14:27 ` Jeong Dal
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).