[OS X TeX] Package/class for creating surveys

Jeffrey J Weimer weimerj at email.uah.edu
Fri Mar 30 19:41:34 CEST 2007


On Mar 30, 2007, at 7:52 AM, Charilaos Skiadas wrote:

> No I hadn't, thanks for the pointer. I looked at it now, at least  
> the pdf guide, and it doesn't quite seem like it would do what I  
> want it to do. Here is an example of what I'd like. A LaTeX code  
> that looks something like the following:
....

Try this ...

\documentclass[12pt]{article}

% theChoice
% defines how the selection appears (blank, line, or box}
% set within the SetStyle command
\newcommand{\theChoice}{}
%
% SetStyle
% sets the style
% called by the user as \SetStyle{N} with N = 0, 1, or 2
\newcommand{\SetStyle}[1]{%
	\ifcase#1\renewcommand{\theChoice}{\hspace{1em}\hspace{1cm}}% choice  
0 blank
	\or\renewcommand{\theChoice}{\hspace{1em}\rule{1cm}{1pt}}% choice 1  
rule
	\or\renewcommand{\theChoice}{\hspace{1em}\fbox{\rule{1ex}{0pt}\rule 
{0pt}{1ex}}}% choice 2 fbox
	\fi%
	}%
%
% option
% tag command for text
% called by the user as \option{OPTION TEXT}
% can be called as \option \OTHERCOMMAND as well
\newcommand{\option}[1]{#1\theChoice\ \hfill}
%
% options environment
% set up the start and end of the selection
\newenvironment{options}{%
	\rule{2cm}{1pt} Start
	
	\vspace{0.25\baselineskip}}%
	{\vspace{0.25\baselineskip}
	
	\rule{2cm}{1pt} End}
%
% common responses
\newcommand{\nr}{Not Really}
\newcommand{\sw}{Somewhat}
\newcommand{\vm}{Very Much}
\newcommand{\ys}{YES SIR!}
	
\begin{document}

\SetStyle{0}
\begin{options}
\option{Waste of Time!}
\option{OK}
\option{Heaven!}
\end{options}

\SetStyle{1}
\begin{options}
\option \nr
\option \sw
\option \vm
\end{options}

\SetStyle{2}
\begin{options}
\option{Never}
\option \sw
\option \vm
\option \ys
\end{options}

\end{document}

--
J. J. Weimer, Chemistry / Chemical & Materials Engineering
University of Alabama in Huntsville, MSB 125, 301 Sparkman Dr
Huntsville, AL 35899                phone: 256-824-6954



------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the macostex-archives mailing list