ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Making checkboxes
@ 2010-09-06  9:14 Cecil Westerhof
  2010-09-06 10:55 ` Wolfgang Schuster
  0 siblings, 1 reply; 25+ messages in thread
From: Cecil Westerhof @ 2010-09-06  9:14 UTC (permalink / raw)
  To: NTG ConTeXt mailing list

I am trying to define a (paper) feedback form. One of the things I
need is checkboxes. A first stab for this (for example I need also a
start text, but I do one step at a time) is, based on TeX by Topic, a
Texnician's Reference page 106:
    \def\checkBox#1,{\space\space\space\space[\space\space] #1\par}

    \def\checkBoxes(#1,){\xcheckBoxes#1, xxx,}
    \def\endpiece{xxx}
    \def\xcheckBoxes#1,{\def\temp{#1}%
      \ifx\temp\endpiece
      \else \checkbox#1,%
        \expandafter\xcheckBox
      \fi}

    \starttext

    Some text

    \checkBoxes Yes, No, A little bit,xxx

    \stoptext

I would expect:
    Some text
        [  ] Yes
        [  ] No
        [  ] A little bit
but I get:
    Some text
    es, No, A little bit,xxx

What am I doing wrong?

Something else: how do I 'eat' spaces between parameters. I would like
to have:
    \checkBoxes Yes,No,A little bit,xxx
and:
    \checkBoxes Yes, No,   A little bit,    xxx
the same result.

And is there a way to know how many parameters a macro gets? Like ${#}
in Bash. That would make things easier.

-- 
Cecil Westerhof
M CLDWesterhof@gmail.com

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Please do not send me Microsoft Office/Apple iWork documents.
Send OpenDocument instead! http://fsf.org/campaigns/opendocument/
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2010-09-09 12:17 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-06  9:14 Making checkboxes Cecil Westerhof
2010-09-06 10:55 ` Wolfgang Schuster
2010-09-06 11:50   ` Cecil Westerhof
2010-09-06 12:58     ` Wolfgang Schuster
2010-09-06 13:34       ` Cecil Westerhof
2010-09-06 15:55         ` Cecil Westerhof
2010-09-06 16:37           ` Wolfgang Schuster
2010-09-06 17:57             ` Cecil Westerhof
2010-09-06 18:29               ` Wolfgang Schuster
2010-09-06 21:32                 ` Aditya Mahajan
2010-09-06 23:07                 ` Cecil Westerhof
2010-09-07  0:18                   ` Aditya Mahajan
2010-09-07  7:29                     ` Cecil Westerhof
2010-09-07  7:18                 ` Cecil Westerhof
2010-09-07  7:32                   ` Cecil Westerhof
2010-09-07 13:18                     ` Wolfgang Schuster
2010-09-07 13:21                       ` luigi scarso
2010-09-09 11:45                       ` Cecil Westerhof
2010-09-09 12:17                         ` Wolfgang Schuster
2010-09-07  7:42                   ` luigi scarso
2010-09-07  8:05                     ` Cecil Westerhof
2010-09-07  8:13                       ` luigi scarso
2010-09-07  9:08                         ` Cecil Westerhof
2010-09-07  9:24                           ` luigi scarso
2010-09-07 10:51                             ` Cecil Westerhof

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