
私は 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}