
テーブルが不必要に次のページに浮いてしまいます。指定された場所に配置したいです。
\renewcommand{\familydefault}{\sfdefault}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage[scaled=1]{helvet}
\usepackage[helvet]{sfmath}
\usepackage{graphicx}
\setcounter{chapter}{0}
\frontmatter
\usepackage{multicol}
\setlength{\columnsep}{1cm}
\begin{document}
\chapter{Exponents}
\begin{multicols}{2}
\renewcommand{\theenumii}{\Alph{enumii}}
\begin{enumerate}
\item
\begin{table*}[!htbp]
\begin{tabular}{cc|c|c|c|c}
\cline{3-5}
& & \multicolumn{3}{c|}{Course} &
\\ \cline{3-6}
& & Algebra I & Geometry & Algebra II & \multicolumn{1}{c|}
{Total} \\ \hline
\multicolumn{1}{|c|}{\multirow{2}{*}{Gender}} & Female & 35 & 53 & 62 & \multicolumn{1}{c|}{150} \\ \cline{2-6}
\multicolumn{1}{|c|}{} & Male & 44 & 59 & 57 & \multicolumn{1}{c|}{160} \\ \hline
\multicolumn{2}{|c|}{Total} & 79 & 112 & 119 & \multicolumn{1}{c|}{310} \\ \hline
\end{tabular}
\end{table*}
A group of tenth-grade students responded to a survey that asked which math
course they were currently enrolled in. The survey data were broken down as
she able above. Which of the following categories accounts for approximately
19 percent of all the survey respondents?
\begin{enumerate}
\item Females taking Geometry
\item Females taking Algebra II
\item Males taking Geometry
\item Males taking Algebra I
\end{enumerate}
\item
Which of the following expressions is equivalent to
$ \sqrt[3]{a}\cdot a \cdot \sqrt[5]{a^2} $ for $a > 0$ ?
\\
\begin{enumerate}
\item $a^\frac{2}{15}$\\
\item $a^\frac{6}{15}$\\
\item $a^\frac{11}{15}$\\
\item $a^\frac{26}{15}$\\
\end{enumerate}
\item
$$ \sqrt{16y^2} $$
If $x>0$, which of the following is equivalent to the given expression?\\
\begin{enumerate}
\item $4y$\\
\item $4y^2$\\
\item $32y$\\
\item $32y^2$\\
\end{enumerate}
\end{enumerate}
\end{multicols}
\end{document}
答え1
私の回答は、あなたの投稿の 1 つの側面、つまり表形式の資料を列の幅内に収める方法に焦点を当てています。
使用するドキュメント クラス、フォント サイズ、ページとテキスト ブロックのサイズが指定されていません。そのため、次のソリューションでは書式設定のニーズを完全に満たすことができない可能性があります。満たさない場合は、不足している情報の詳細を自由に提供してください。
次のスクリーンショットはtabular
、縦線と横線が非常に多い元の環境と、提案されている新しいtabular*
環境の両方を示しています。前者は明らかに よりも幅が広く\columnwidth
なっています。後者の環境は、主に 6 列ではなく 5 列で済むため、水平方向のスペースをあまり占有しません。逆に、新しく提案されたソリューションでは、(a) 数字をそれぞれの (暗黙の) 小数点に揃え、(b) 主にすべての縦線を省略し、より少ないが間隔の広い横線を使用することで、より「オープン」な外観を実現しようとしています。2 番目のソリューションでは、情報を伝えるキャプションも提供することを目指しています。
\documentclass[twocolumn]{article} % ?
\renewcommand{\familydefault}{\sfdefault}
\usepackage{booktabs,siunitx,multirow}
\usepackage[skip=0.333\baselineskip]{caption} % optional
\begin{document}
\begin{table}
\caption{Original solution}
\begin{tabular}{cc|c|c|c|c}
\cline{3-5}
& & \multicolumn{3}{c|}{Course} &
\\ \cline{3-6}
& & Algebra I & Geometry & Algebra II & \multicolumn{1}{c|}
{Total} \\ \hline
\multicolumn{1}{|c|}{\multirow{2}{*}{Gender}} & Female & 35 & 53 & 62 & \multicolumn{1}{c|}{150} \\ \cline{2-6}
\multicolumn{1}{|c|}{} & Male & 44 & 59 & 57 & \multicolumn{1}{c|}{160} \\ \hline
\multicolumn{2}{|c|}{Total} & 79 & 112 & 119 & \multicolumn{1}{c|}{310} \\ \hline
\end{tabular}
\vspace{1cm}
\caption{Student enrolments, by gender and course}
\setlength\tabcolsep{0pt} % make LaTeX figure out amount of inter-column whitespace
\begin{tabular*}{\columnwidth}{@{\extracolsep{\fill}}l *{4}{S[table-format=3.0]}}
\toprule
Gender & \multicolumn{3}{c}{Course} & {Total} \\
\cmidrule{2-4}
& {Algebra I} & {Geometry} & {Algebra II} \\
\midrule
Female & 35 & 53 & 62 & 150 \\
Male & 44 & 59 & 57 & 160 \\
\addlinespace
Total & 79 &112 & 119 & 310 \\
\bottomrule
\end{tabular*}
\end{table}
\end{document}