[texhax] [hyperref] Programatically change the name of the \CheckBox?

Hubert Lam hubert at lamfamily.info
Thu Nov 27 12:45:48 CET 2014

Dear Heiko

All I could say is, a HUGE thanks for spotting the recursion in the code!

The next problem: how many of these \CheckBox 's can I have without blowing out TeX's memory? LuaLaTeX is not on the agenda -- it just doesn't like PSTricks either :(

Many thanks.


From: texhax <texhax-bounces at tug.org> on behalf of Heiko Oberdiek <heiko.oberdiek at googlemail.com>
Sent: Wednesday, 26 November 2014 3:47 AM
To: texhax at tug.org
Subject: Re: [texhax] [hyperref] Programatically change the name of the \CheckBox?


On 26.11.2014 12:50, Hubert Lam wrote:
> Hi all
> Does anyone know of ways to programmatically changing the name of the
> \CheckBox?

Yes, it is possible.

> i.e. I would like the name of the \CheckBox to advance with the
> \theenumi counter. However, if I use
> \CheckBox[name=Name\theenumi]{}
> Then it fail to compile, resulting in an error about “Use of \pdfmark@
> doesn’t match its definition”.

The definition of `\theenumi` is not appropriate, in contrary
you have a recursion: "label=\protect\CheckBoxes\arabic*."
defines \theenumi. If \theenumi is called within the \CheckBox,
then it calls \CheckBoxes at the start of the label `\theenumi
and expands further another \CheckBox, which again wants to
have \theenumi in its name.

But you can use the counter value `enumi' instead.
However, \value is redefined, thus \countervalue/\thevalue
are using the original \value:





\newcommand{\Placehold}{How are you? }


\begin{enumerate}[label={\protect\CheckBoxes \arabic*.},leftmargin=*]
\item   \psLoop{15}{\Placehold}
        \item   \psLoop{20}{\Placehold}
        \item   \psLoop{10}{\Placehold}
        \item   \psLoop{10}{\Placehold}
        \item   \psLoop{10}{\Placehold}
\item   \psLoop{35}{\Placehold}

Yours sincerely
TeX FAQ: http://www.tex.ac.uk/faq
Mailing list archives: http://tug.org/pipermail/texhax/
More links: http://tug.org/begin.html

Automated subscription management: http://tug.org/mailman/listinfo/texhax
Human mailing list managers: postmaster at tug.org

More information about the texhax mailing list