$ が挿入されていません。^^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を使用する方がよいでしょう。これは基本的に の数式モード バージョンです。arraytabulartabular

\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\Circlewasysym

\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} 

ここに画像の説明を入力してください

関連情報