缺少 $ 插入。 ^^I^^I &\平方

缺少 $ 插入。 ^^I^^I &\平方

我是 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

如果全部a 的單元格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} 

在此輸入影像描述

相關內容