# Align form radio button in fixed size table column

I have to recreate an old form using latex. It includes a table where multiple questions are associated to some radio buttons.

I managed to create most of the form and table using hyperref and array, but now have a problem in the horizontal alignment of the radio buttons. As you can see in the screenshot the radio buttons are not center-aligned, but somewhat shifted to the right.

How to center-align the radio buttons in the 3 right columns?

\documentclass{report}

\usepackage{hyperref}
\usepackage{array}

\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\begin{document}
\begin{Form}

\noindent\begin{table}[!h]
\begin{tabular} {|m{8cm}|C{0.75cm}|C{0.75cm}|C{1.5cm}|}
\cline{2-4}
\multicolumn{1}{c|}{} &
Yes & No & Maybe \\
\hline
Some question? &
\hline
Some other question? &
\hline
\end{tabular}
\end{table}

\end{Form}
\end{document}

• with your code i can't reproduce your image. the radio buttons are not visible. it seems that something is missing in code. Apr 30 '19 at 8:55
• @Zarko strange - I just literally copied over the above to code to a new project and recompiled it. Still the radio buttons show up (Foxit reader). I'm using Miktex on Windows here. Apr 30 '19 at 9:43
• i use MikTeX too, but for viewer Sumatra. i didn't check other pdf viewers. Apr 30 '19 at 9:52
• I get nothing visible when viewing with mupdf, red squares when viewing using evince, grey squares with a red circle only in the chosen option in opera browser (linux), so I guess it's a viewer issue. Apr 30 '19 at 10:30

The macro \LayoutChoiceField{<label>}{<field>} controls how your radiobuttons are printed and is predefined to the effect of

\newcommand*\LayoutChoiceField[2]{#1 #2}


Note the space between label and field. This space shifts the field to the right in your table. Just redefine

\renewcommand*\LayoutChoiceField[2]{#1#2}


to get rid of it. (You could even leave out #1 if you never ever wanted to use a label, but I'd leave it in for clarity.)

The typesetting of the radio button itself also adds some spaces, too. This is done by \@@Radio, which adds several \spaces. We can prevent this by locally making \space do nothing (using etoolbox):

\pretocmd\@@Radio{\begingroup\let\space\@empty}{}{}


I do not know if this might have any unintended consequences, but I can't think of any right now.

All in all your MWE now looks like this:

\documentclass{report}

\usepackage{etoolbox}

\usepackage{array}
\usepackage{hyperref}

\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\makeatletter
\renewcommand*\LayoutChoiceField[2]{#1#2}
\makeatother

\begin{document}
\begin{Form}

\noindent\begin{table}[!h]
\begin{tabular} {|m{8cm}|C{0.75cm}|C{0.75cm}|C{1.5cm}|}
\cline{2-4}
\multicolumn{1}{c|}{} &
Yes & No & Maybe \\
\hline
Some question? &
\hline
Some other question? &