将表格嵌入考试类文档中的问题中

将表格嵌入考试类文档中的问题中

我在考试课上写测试,遇到了一点麻烦。我想将表格嵌入到问题中,但这样做会产生“多重定义”警告并打断问题部分的流程。这是我的代码...

\documentclass[12pt]{exam}

\providecommand\newthought[1]{%
\addvspace{1.0\baselineskip plus 0.5ex minus 0.2ex}%
\noindent\textsc{#1}}

\begin{document}
\center Cumulative Review
\begin{flushleft}
\newthought {As you guys know} we are required to give three summative exams which collectively count as \%60 of your grade. I thought it'd be nice to make one of those three tests a cumulative review of that which you have learned thus far. Enjoy!\\
\end{flushleft}

\vspace{5mm}
\makebox[\textwidth]{Name and section:\enspace\hrulefill}\\

\vspace{5mm}

\makebox[\textwidth]{Instructor’s name:\enspace\hrulefill}\\

\vspace{5mm}

\center Record your answers on the bubble sheet provided. 

\begin{flushleft}
\begin{questions}
\question Which of the following is an example of the associative property of addition? \vspace{5mm}
\begin{choices}

\choice $a(b+c)=ac+bc$
\choice $a+(b+c)=(a+b)+c$
\choice $(ab)c=a(bc)$
\choice $a+b+c=c+b+a$

\end{choices}
\vspace{5mm}
\question Which equation can be used to generate the given table?  

\center
\begin{tabular}{ |l|l| }
\hline
x & y \\ \hline
4 & 25 \\ \hline
7 & 25.75 \\ \hline
16 & 28 \\ \hline
18 & 28.50 \\
\hline
\end{tabular}

\vspace{5mm}

\begin{choices}

\choice $y=.5x+24$
\choice $y=.5x$
\choice $y=.25x+24$
\choice $y=.25x$

\end{choices}
\vspace{5mm}
\question The next question

\end{questions}
\end{flushleft}
\end{document}

如果我删除这个...

\center
\begin{tabular}{ |l|l| }
\hline
x & y \\ \hline
4 & 25 \\ \hline
7 & 25.75 \\ \hline
16 & 28 \\ \hline
18 & 28.50 \\
\hline
\end{tabular}

...问题环境继续运转良好,但我失去了我的桌子。

我对 Latex 的使用还很陌生,所以可能我遗漏了一些相当简单的东西。我只是还不知道。提前感谢您提供的任何帮助。

相关内容