缺少 $ 插入。^^I^^I &\square

缺少 $ 插入。^^I^^I &\square

我是 LaTeX 的新手,我正在使用它编写如下问卷:

在此处输入图片描述

我当前的代码如下:

\begin{enumerate}
    \item
    Statement one.
    \begin{tabular}{c c c c c c c}
        \square    & \square  & \square & \square 
                   & \square  & \square & \square \\
    Strongly agree & Moderately agree & Slightly agree &
Neither agree or disagree & Slightly disagree & Moderately disagree & Strongly disagree 
    \end{tabular}
\end{enumerate}

我收到此错误:

在此处输入图片描述

请告诉我我的代码有什么问题?

答案1

\square是数学模式构造,需要数学分隔符,如$\square$。由于 的每个字段tabular在逻辑上与其他字段分开,因此必须为包含 的每个单元格添加数学模式\square。我还添加了一个空白行,以在一行上形成答案选项。

对于圆圈,只需替换\square\bigcirc

如果全部的单元格tabular处于数学模式,人们可能更愿意使用array而不是tabular,它本质上是 的数学模式版本tabular

\documentclass{article}
\usepackage[landscape,margin=1cm,]{geometry}
\usepackage{amssymb}
\begin{document}
\begin{enumerate}
    \item
    Statement one.

    \begin{tabular}{c c c c c c c}
        $\bigcirc$    & $\bigcirc$  & $\bigcirc$ & $\bigcirc$ 
                   & $\bigcirc$  & $\bigcirc$ & $\bigcirc$ \\
    Strongly agree & Moderately agree & Slightly agree &
Neither agree or disagree & Slightly disagree & Moderately disagree & Strongly disagree 
    \end{tabular}
\end{enumerate}
\end{document}

在此处输入图片描述

答案2

如果您想避免重复输入的繁琐工作$...$,您可以使用\Square\Circle 命令wasysym

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{wasysym}
\usepackage{array}

\begin{document}

\begin{enumerate}
\item Statement one.
    \begin{tabular}[t]{c c c}
    \Square & \Square & \Square \\
    Strongly agree & Moderately agree & Slightly agree \\[2ex]
   \bfseries\Circle \\
     Neither agree or disagree \\[2ex]
     \Square & \Square & \Square \\
    Slightly disagree & Moderately disagree & Strongly disagree
    \end{tabular}
\end{enumerate} 

\end{document} 

在此处输入图片描述

相关内容