![问卷模板?](https://linux22.com/image/234789/%E9%97%AE%E5%8D%B7%E6%A8%A1%E6%9D%BF%EF%BC%9F.png)
是否有可用的模板可以让我创建类似的问卷?
编辑:
根据答案和评论我做了这个例子:
\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}
但现在我遇到了问题。首先,如何让复选框 (\square) 垂直居中?
如何让表格更宽?我尝试使用 \pagewidth 代替 \textwidth,但是没有效果。
答案1
您可以使用m
列类型将复选框垂直居中。如果您想让表格更宽,那么\textwidth
,例如1.2\textwidth
,用 将其包围以\makebox[\textwidth]{ ... }
使其居中。
这是示例代码。另请注意$ $
排版-
和+
符号。
\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}
答案2
其他帖子中有一些很好的答案。总是要努力实现更简单的用户界面,特别是如果其他人要使用你的宏。下面是一个基于我在工作中为清单开发的一些工作的示例。基本行是:
\question{Is everything working properly? }
其余部分对用户来说几乎是隐藏的。示例如下:
以下是该代码的简化版本:
\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}
实际版本有点复杂,使用环境等。我使用,longtable
因为你不可避免地会在某个地方以两页的问卷结束。
答案3
这是我的\question
宏,它为问题提供了空间,并为其规模提供了单独的空间。没有依靠表格。当您的问题涉及多页时,这是一个优势;此外,您仍然可以使用\subsection
等来构建您的文档。下面是宏以及我如何使用它:
\def\question#1\par#2\par{\hbox to \hsize
{\vbox{\hsize=0.72\hsize #1\dotfill}\quad#2\hfil}\medskip\goodbreak}
使用示例:
\question Would you come to another workshop?
\par\fiveboxes{no}{}{}{}{yes}
该\fiveboxes
宏(参见下文)提供了五个复选框,其中最左边的复选框标有不最右边的标签是是的。
对于自由文本问题和答案,我定义了以下宏
\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
}
使用方式如下:
\freequestion Please share any other remarks or ideas for improving the
workshop or this survey: \par
请注意使用\par
来分隔参数,这样我就不必使用括号了。当然,也可以使用经典参数。
下面可以看到类似的宏的实际作用。
为了完整起见,下面是我为盒子使用的各种宏,包括\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}}}
在上面的例子中,比例尺排版在框上方不占用垂直空间。这有点复杂:
\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}}}
显然,这一切都非常 PlainTeX-y,而且我并不是真正的专家,所以欢迎发表评论。
您可以在以下位置找到完整的示例GitHub 要点
答案4
你是指 Latex 吗?
我已经用这种简单的方法打印了调查问卷:
使用文章类,没有标题,什么都没有。
用于
\Box
制作复选框。
以下是我使用过的一个例子:
\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}