1

I want to have four form questions in one row of table. I have the following four questions in the table row in Fig. 1:

  1. Key: Yes/No i.e. tick for Yes
  2. Choose one from V2 - V0
  3. Choose one from P2 - P0
  4. Critical: Yes/No i.e. tick for Yes

Code and its output in Fig. 1 where I cannot integrate Form options in the table cells

\documentclass{beamer}
\usepackage[english]{babel}
\usetheme{Berkeley}
\usepackage{microtype}% more flexibility for narrow columns
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{adjustbox}

\begin{document}
\begin{frame}
\begin{adjustbox}{max width=1.1\textwidth,center}
\begin{table}[!ht]
\centering
    % TODO have Form options in the table cells
    \begin{tabular}{|l|l|l|l|l|l|l|l|l|}
    \hline
    \textbf{Key} & 
        \textbf{V2} & \textbf{V1} & \textbf{V0} 
        & \textbf{SCORE} 
        & \textbf{P1} & \textbf{P2} & \textbf{P3} 
        & \textbf{Critical} \\ \hline
        &  &  &  & 1. Skills &  &  &  & \\ \hline
    \end{tabular}
\end{table}
\end{adjustbox}
\end{frame}

\begin{frame}
% Show reproduction of the answers in the next sheet. 

\end{frame}
\end{document}

I can do the form options in enumerate:

    % I can do form in enumerate but not in table
    \begin{Form}
    \begin{enumerate}
    \item \ChoiceMenu[name=football,radio,default=-0]{Do you play football?}{Much (2)=2,Little (1)=1,Not at all (0)=0}
    \item \ChoiceMenu[name=ice-hockey,radio,default=-0]{Do you play ice-hockey?}{Much (2)=2,Little (1)=1,Not at all (0)=0}
    \end{enumerate}
    \end{Form}

Fig. 1 Output where table structure

enter image description here

Expected output: four questions in one row of table, and reproduce those answers in the last slide

Example eforms structure based on Creating fillable PDFs

\begin{tabular}{lp{4in}}
   Key                & \infoInput{Key}\\[6pt]
   V2                 & \infoInput{V2}\\[6pt]
   V1                 & \infoInput{V1}\\[6pt]
   V0                 & \infoInput{V0}\\[6pt]
   P1                 & \infoInput{P1}\\[6pt]
   P2                 & \infoInput{P2}\\[6pt]
   P3                 & \infoInput{P3}\\[6pt]
   Critical           & \infoInput{Critical}\\[6pt]
\end{tabular}

Testing Ulirke's proposal

Ulrike' s proposal works for one row at the moment. I am thinking how it can work with many rows. Extended the case in the thread How to set centers of two rows aligned? for the adjusted center, where the expected output: row names aligned at the center.

OS: Debian 9
TeXLive: 2017 manual installation at /usr/local/
Acrotex and eforms: installed like this

  • 2
    I think you have to install eforms yourself as it relies on non-free stuff, so is excluded from TL. (But every time I think I understand this package's status, I find out I'm wrong.) – cfr Aug 15 '17 at 21:46
  • 2
    eforms is free, it is one ctan (in the acrotex bundle) and it is e.g. part of miktex, it is only not free enough for the debian rules. – Ulrike Fischer Aug 16 '17 at 10:22
  • @UlrikeFischer Parts of Acro require Acrobat or Adobe's distiller, I think. But, even then, Acro itself is free. – cfr Aug 16 '17 at 12:56
  • @cfr I know, I have used it for some forms in the past. – Ulrike Fischer Aug 16 '17 at 12:58
  • 1
    You can get the miktex package http://mirrors.ctan.org/systems/win32/miktex/tm/packages/acrotex.tar.lzma. You only need to unpack it. There are a few files which are documentation, but the rest should simply go in your local texmf in tex/latex/acrotex. – Ulrike Fischer Aug 19 '17 at 22:30
  • 1
    No you won't break anything. The purpose of texmf-local is to give you a place for your own files. And as everything is in one folder, it is easy to delete later anyway if you don't like it. – Ulrike Fischer Aug 20 '17 at 15:07
  • 2
    Sorry is really so difficult to copy files from one location to another? Use a GUI if you don't manage it on a command line. Or if you have texlive 2017: unpack the tar in the miktex package somewhere and add the whole tree with tlmgr conf auxtrees add /path/to/root-of-texmf. – Ulrike Fischer Aug 20 '17 at 17:39

1 Answers1

7

You can use \ChoiceMenu in tabulars, use one in every cell, but use the same name, so that they build a group. You will have to change the width of the field, as the default width is \baselineskip which is zero in tabulars:

\def\DefaultWidthofChoiceMenu{1em}

But while it works, it is difficult to fine tune the layout, a number of things are hardcoded and a lot of things are not really documentated.

I would recomment to use eforms, which has more tuning possibilities and also a quite good manual (eformman).

\documentclass{beamer}
\usepackage{eforms}
\begin{document}
\begin{frame}
\begin{tabular}{llll}
A & B & C & D \\
\radioButton{mybuttom}{1em}{1em}{1}
&
\radioButton{mybuttom}{1em}{1em}{2}
&
\radioButton{mybuttom}{1em}{1em}{3}
&
\radioButton{mybuttom}{1em}{1em}{4}
\end{tabular}
\end{frame}

\end{document}

enter image description here

Ulrike Fischer
  • 327,261