[NTG-context] Making checkboxes

Wolfgang Schuster schuster.wolfgang at googlemail.com
Mon Sep 6 12:55:07 CEST 2010


Am 06.09.2010 um 11:14 schrieb Cecil Westerhof:

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


\def\CheckBoxes[#1]%
  {\par
   \getcommalistsize[#1]% count the number of arguments
   \processcommalist[#1]\doCheckBoxes}

\def\doCheckBoxes#1%
  {\hskip1em[ ] #1\par}

The number of arguments is available with the command \commalistsize.

Wolfgang



More information about the ntg-context mailing list