Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question already has an answer here:

Is there a template available that allows me to create questionnaires like this one?

http://www.ergo-online.de/site.aspx?url=html/software/verfahren_zur_beurteilung_der/fragebogen_isonorm_online.htm

EDIT:

Based on the answer and comments I did this example:

\begin{table}[htb]
\begin{tikzpicture}
\node (table) [inner sep=0pt] {
\begin{tabularx}{\textwidth}{|X|c|c|c|c|c|X|}
  \hline
  The software ... & - - & - & -/+ & + & + + &\\
  \hline
  is complicated to use & $\square$ & $\square$ & $\square$ & $\square$ & $\square$ & is not complicated to use\\
  \hline
bietet nicht alle Funktionen um die anfallenden Aufgaben effizient zu bewältigen  & $\square$ & $\square$ & $\square$ & $\square$ & $\square$ & bietet alle Funktionen, um die anfallenden Aufgaben effizient zu bewältigen
\end{tabularx}
};
\draw (table.north west) rectangle (table.south east);
\end{tikzpicture}
\end{table}

But now I have to problems. First how can I center the checkboxes (\square) vertically?

How can i make the table wider? I tried to use \pagewidth instead of \textwidth but this doesnt work.

share|improve this question

marked as duplicate by Kurt, Nils L, barbara beeton, Martin Schröder, mafp Jun 12 '13 at 18:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
You can do this using a simple tabular and the right symbol ($\circ$, ...) See also this question tex.stackexchange.com/q/9975/2975 –  Martin Scharrer Feb 17 '11 at 14:48
1  
@Martin Scharrer. Thanks so I was able to create a small example. Just some issues remaining ;) –  RoflcoptrException Feb 17 '11 at 15:33
    
@Christian: Longer tabulars can be split using longtable or supertabular. –  Martin Scharrer Feb 17 '11 at 16:14
    
@Martin I have moved my comment into an answer. –  Christian Lindig Feb 17 '11 at 16:28
    
See the similar, less specific qn tex.stackexchange.com/questions/5468/… –  Charles Stewart Jun 11 '13 at 12:37

5 Answers 5

up vote 3 down vote accepted

You can use the m column type to center the checkboxes vertically. If you want to make the tabular wider then \textwidth, like 1.2\textwidth, surround it with \makebox[\textwidth]{ ... } to center it.

Here the example code. Note also the $ $ to typeset the - and + symbols.

\documentclass{article}

\usepackage{amssymb}
\usepackage{array}
\usepackage{tabularx}

\newcolumntype{S}{>{\centering\arraybackslash}m{1.5em}}

\renewcommand{\tabularxcolumn}[1]{m{#1}} % redefine 'X' to use 'm'

\begin{document}

\makebox[\textwidth]{%
\begin{tabularx}{1.2\textwidth}{|X|S|S|S|S|S|X|}
  \hline
  The software ... & $--$ & $-$ & $-/+$ & $+$ & $++$ &\\
  \hline
  is complicated to use & $\square$ & $\square$ & $\square$ & $\square$ & $\square$ & is not complicated to use\\
  \hline
bietet nicht alle Funktionen um die anfallenden Aufgaben effizient zu bewältigen  & $\square$ & $\square$ & $\square$ & $\square$ & $\square$ & bietet alle Funktionen, um die anfallenden Aufgaben effizient zu bewältigen
\end{tabularx}%
}

\end{document}
share|improve this answer
    
You can also define the S column to add the $ s automatically using >{$} and <{$}. –  Martin Scharrer Feb 17 '11 at 16:13
    
@Martin Scharrer Thanks a lot this seems nice! I have one problem remaing. If I add a additional \hline at the end of the table i get the following error: ! Misplaced \noalign. \hline ->\noalign {\ifnum 0=`}\fi \hrule \@height \arrayrulewidth \futurelet... l.14 } ? –  RoflcoptrException Feb 17 '11 at 18:12
1  
@Roflcoptr: Make sure there is an \\ direct before the \hline. –  Martin Scharrer Feb 17 '11 at 18:13
    
@Martin Scharrer Thanks that worked like a charm although i dont know why :D –  RoflcoptrException Feb 17 '11 at 18:16
1  
@Roflcoptr: The newlines in a table are different from the one outside. You always have a final line (i.e. row) break in the table, with or without the \\ . –  Martin Scharrer Feb 17 '11 at 19:22

Do you mean in Latex?

I have already printed questionaires in this simple way:

  1. use the article class, no title, nothing.

  2. use \Box to make check boxes.

Here is a sample from one that I have used:

\subsection*{About you}
\label{sec:about-you-rest2}

\begin{itemize}    
\item \textbf{Your Email} 
\\
  \small{(The email field is required to keep track
  of the answers. All results will be anonymised when used.)}

\item \textbf{Your Age}
\item \textbf{Your Gender} $\Box$ F $\Box$ M
\end{itemize}

\subsection*{About the Conversation}
\label{sec:about-conversation-rest2}

The following questions are given in the form of statements regarding
the computer during its interaction. We would like you to give your
level of agreement with each statement on a scale going from "Strongly
Disagree" to "Strongly Agree".    

\begin{itemize}

\item \textbf{I found the fact that the computer acted as if it knew me was irritating.}\\$\Box$ Strongly disagree $\Box$ Disagree $\Box$
  Neither agree nor disagree $\Box$ Agree $\Box$ Strongly Agree

\item \textbf{In this conversation, the computer interacted with you
    in a natural way. }\\$\Box$ Strongly disagree $\Box$ Disagree
  $\Box$ Neither agree nor disagree $\Box$ Agree $\Box$ Strongly Agree

\item ....
\end{itemize}
share|improve this answer
    
do i need any specific package for \Box? –  RoflcoptrException Feb 17 '11 at 15:08
1  
@Roflcoptr. @Mortimer: AFAIK \Box is a LaTeX2.09 macro which is not provided by LaTeX2e. You can use e.g. \square from the amssymb package instead. –  Martin Scharrer Feb 17 '11 at 15:11
2  
@Roflcoptr: \usepackage{latexsym} will make \Box available –  Herbert Feb 17 '11 at 15:38

Here is my \question macro that provides room for a question and separately room for its scale without relying on a table. This is an advantage when you have questions over multiple pages; plus, you still can use \subsection and the like to structure your document. Below is the macro and how I use it:

\def\question#1\par#2\par{\hbox to \hsize
{\vbox{\hsize=0.72\hsize #1\dotfill}\quad#2\hfil}\medskip\goodbreak}

Example use:

 \question Would you come to another workshop?
 \par\fiveboxes{no}{}{}{}{yes}

The \fiveboxes macro (cf. below) provides five check boxes where the leftmost one is labeled with no and rightmost one is labeled with yes.

For free-text questions and answers I defined the following macro

\def\freequestion#1\par{#1\par\nobreak
    \begingroup\nobreak
    \advance\leftskip by 2pc
    \hrule width 0pt height 1.7\baselineskip\hrulefill
    \hrule width 0pt height 1.7\baselineskip\hrulefill
    \par
    \medskip
    \endgroup
    }

which is used like this:

\freequestion Please share any other remarks or ideas for improving the
workshop or this survey: \par

Note the use of \par to separate arguments such that I don't have to use braces. But of course, classic arguments could be used as well.

Below, similar macros are seen in action.

Example Survey

For completeness, here are my various macros for boxes, including \fiveboxes:

\def\boxit#1{\hbox{\lower0.7ex\vbox{\hrule\hbox{\vrule\kern1pt
    \vbox{\kern1pt\hbox to 1.4em
    {\small\strut\hfil #1\hfil}\kern1pt}\kern1pt\vrule}\hrule}}}

\def\fiveboxes#1#2#3#4#5{\hbox to\scalewidth
    {\boxit{#1}\hfil\boxit{#2}\hfil\boxit{#3}\hfil%
     \boxit{#4}\hfil\boxit{#5}}}

In the example above the scale is typeset above the boxes without taking up vertical space. This is a little more involved:

\question The group is a good mix in terms of expertise and interests.
\par\xagree

\newdimen\scalewidth
\scalewidth=0.3\hsize

\def\xagree{\xscale{strongly disagree}{agree completely}}
\def\boxes{\fiveboxes{}{}{}{}{}\ignorespaces}
\def\xscale#1#2{%
    \setbox0=\hbox{\boxes}%
    \setbox1=\hbox to \wd0{\small\strut\hfill #2 $\to$}%
    \setbox2=\hbox to \wd0{\small\strut $\gets$ #1 \hfill}%
    \vbox{\vbox to 0pt{\vss\box1\box2\kern2pt}\vbox{\box0}}}

Obviously this is all very PlainTeX-y and I'm not really an expert, so comments are welcome.

share|improve this answer
    
this is a very good solution. Suggest you include the \fiveboxes macro for completeness. –  Yiannis Lazarides Feb 17 '11 at 16:41
    
Thanks a lot I tried it but I get the error: Runaway argument? \fiveboxes {no}{}{}{}{yes} ! File ended while scanning use of \question. <inserted text> \par –  RoflcoptrException Feb 17 '11 at 17:09
    
to notify ;) –  RoflcoptrException Feb 17 '11 at 17:19
    
@Roflcoptr Make sure there is a \par at the end of the question and another one after the scale. You can either type it out as a \par or use an empty line. As an alternative, remove the two \par in the definition of \question and use braces for the two arguments when you use \question. –  Christian Lindig Feb 17 '11 at 19:38
\documentclass{article}
\usepackage{latexsym}
\usepackage{tabularx}
\renewcommand\tabularxcolumn[1]{m{#1}}
\def\MBox{\Large\ensuremath{\Box}}
\def\xstrut{\rule[-3ex]{0pt}{7ex}}
\begin{document}

\begin{tabularx}{1.2\textwidth}{|>{\scriptsize}X|*5{m{6mm}|}>{\scriptsize}X|}\hline
  The software ... & $--$ & $-$ & $-/+$ & $+$ & $++$ &\\\hline
\xstrut  is complicated to use & \MBox & \MBox & \MBox & \MBox & \MBox & is not complicated to use\\\hline
     bietet nicht alle Funktionen um die anfallenden Aufgaben effizient zu bewältigen  
 & \MBox & \MBox & \MBox & \MBox & \MBox & bietet alle Funktionen, um die anfallenden 
                                                      Aufgaben effizient zu bewältigen\\\hline
\end{tabularx}

\end{document}

enter image description here

share|improve this answer

There are some fine answers in the other posts. It is always to strive for a simpler user interface, especially if other people are going to use your macros. Here is an example based on some work that I have developed at work for checklists. The basic row is:

\question{Is everything working properly? }

The rest is pretty much hidden from the user. A sample is shown below: enter image description here

Here is an abbreviated version of the code:

\documentclass{article}
\usepackage{textcomp,amsmath,longtable}
\usepackage{latexsym}
\begin{document}

%% Set up counters for questions
%% 
\newcounter{qnumber}
\setcounter{qnumber}{0}
\stepcounter{qnumber}
\newcommand{\yesno}{\textsf{Yes}~~\textsf{No} {\Large ~$\Box$}~~~~   {\Large $\Box$}}

%% we now define the questions
\newcommand{\question}[1]{
    \hfill \relax1.\theqnumber\hfill\hfill &\textsf{#1} &{\small\yesno} & {\small\yesno} &{\small\yesno}\stepcounter{qnumber}\\ \hline
}

%% we now define the questions
\newcommand{\heading}[1]{
1.0 &\multicolumn{4}{|l|}{\bf\textsf{#1}}\\ \hline %
}
 \newcommand{\divider}{\hline}
 \begin{longtable}{|c| p{5.61cm}|p{1.5cm}|p{1.5cm}|  p{1.55cm} |}
\divider
Sl.     &Quality Checks & A     & B     &C\\
\divider\divider
\heading{Installation}
\question{Are the fans installed as per the drawings and specifications?}
\question{Are all safety rules understood by personnel repsonsible for operating the equipment?}
\heading{Electrical}
  \question{Proper motor and fan rotation verified?}
  \question{Verify that proper disconnect is located within sight of the unit it controls.}
\end{longtable}

\end{document}

The actual version is a bit more complicated, uses an environment etc. I use a longtable as inevitably you will somewhere end with a two page questionnaire.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.