# Form CheckBox with answer written inside rather than on the left

My document is a list of questions and presently, each question ends with something of the following form :

\dotfill \makebox{2.5cm}{\fbox{\parbox[b][2mm]{2mm}{YES}}\hspace{2mm}
\fbox{\parbox[b][2mm]{2mm}{NO}}\hspace{2mm}
\fbox{\parbox[b][2mm]{2mm}{??}}\hspace{2mm}
\fbox{\parbox[b][2mm]{2mm}{\CoffeeCup}}}


i.e. 4 consecutive checkable boxes fitting in a horizontal space of 2.5cm precisely, and with the corresponding answer written inside of each box. I want to make the document interactive but one thing I cannot change is the size of the space in fit the 4 boxes. It must be exactly 2.5cm (and I also must beware of the height).

With the form environment, a Checkbox can apparently only have its answer written on the left hand side. Not inside of it. The best solution I have found (because I can control the width) which is not good enough is to use ChoiceMenu with combo instead. But I want checkable boxes.

Does anybody have another idea please?

You can control the appearance of a checkbox and its label with the macro \LayoutCheckField{label}{field} which defaults to #1 and #2 (try texdoc hyperref and see page 22). You can change this macro acc. to your needs. If you move the label inside the checkbox, you have to make sure that no background color is set. Code:

\documentclass{article}
\usepackage{hyperref}

\begin{document}

\begin{Form}

\def\LayoutCheckField#1#2{%
\parbox[c][5mm]{5mm}{\centering\footnotesize\strut #1\\#2}%
}

\def\DefaultHeightofCheckBox{3mm}
\def\DefaultWidthofCheckBox{3mm}

\noindent\dotfill
\CheckBox{yes}
\CheckBox{no}
\CheckBox{??}
\CheckBox{Cup}

\vspace{3ex}

\def\LayoutCheckField#1#2{%
\makebox[0pt][l]{%
\makebox[5mm][c]{\footnotesize\strut #1}%
}%
#2%
}

\def\DefaultHeightofCheckBox{5mm}
\def\DefaultWidthofCheckBox{5mm}

\noindent\dotfill
\CheckBox[backgroundcolor=]{yes}
\CheckBox[backgroundcolor=]{no}
\CheckBox[backgroundcolor=]{??}
\CheckBox[backgroundcolor=]{Cup}
\end{Form}
\end{document}