7

I am trying to create a survey and I was hoping to do this with the eqexam package, but I can't really figure out how to make a good Likert scale. There are only examples of exams in the documentation and not of surveys.

I am trying to make something like:

    Bad NotBad Neutral OK Good
Q1  []    []     []    []  []
Q2  []    []     []    []  []
Q3  []    []     []    []  []
Q4  []    []     []    []  []

Should I do this with latex anyway? I am just trying to get a printable survey.

Marnix
  • 1,597
  • 3
  • 17
  • 23
  • 1
    What is the specific problem? This can be set as a table. For the checkboxes you could use \square from the \usepackage{amssymb}. – Christian Lindig May 23 '12 at 19:50
  • Ah yes, I found that one too. But I was hoping that the eqexam package would actually also include some questionnaire options that I haven't found yet. I have created the tables, but they are a bit messy with positioning, since they are floating objects. – Marnix May 23 '12 at 19:59
  • 2
    @Marnix your tabular material need not to be a floating onject; you can use tabular without table. – Gonzalo Medina May 23 '12 at 22:46

1 Answers1

5

Here's one possible solution using a longtable environment and the method described by Herbert in his answer to How to programmatically make tabular rows using `\whiledo` ? to iteratively build the rows. I defined a \CheckTable command with a mandatory argument which builds your table with the number of rows specified in the argument:

\documentclass{article}
\usepackage{amssymb}
\usepackage{array,longtable}

\newcounter{question}
\newcounter{row}

\makeatletter
\newtoks\@tabtoks
\newcommand\addtabtoks[1]{\@tabtoks\expandafter{\the\@tabtoks#1}}
\newcommand*\resettabtoks{\@tabtoks{}}
\newcommand*\printtabtoks{\the\@tabtoks}
\makeatother

\newcommand\CheckTable[1]{%
  \setcounter{question}{0}
  \setcounter{row}{0}
  \resettabtoks
  \loop\ifnum\therow<#1\relax
    \stepcounter{row}
    \addtabtoks{& $\square$ & $\square$ & $\square$ & $\square$ & $\square$ \\}%
  \repeat
  \begin{longtable}{>{\stepcounter{question}Q\thequestion}l*{5}{c}}
    \multicolumn{1}{c}{} & Bad & Not Bad & Neutral & OK & Good \\
    \printtabtoks
  \end{longtable}%
}

\begin{document}

\CheckTable{10}

\CheckTable{6}

\CheckTable{12}

\end{document}

enter image description here

Moriambar
  • 11,466
Gonzalo Medina
  • 505,128