例題のタイトルのすぐ下に表を置く

例題のタイトルのすぐ下に表を置く

現在、明るい青色のスペースにテーブルがあります。このテーブルを、その上の濃い青色のボックス、例のすぐ下に置きます。また、インデントも不要です。これが、これまでの私の状態です。ここに画像の説明を入力してください

\documentclass[a4paper,11pt,addpoints]{exam}
\usepackage[left=1.5cm,right=1.5cm,top=1.5cm,bottom=2cm]{geometry}

%noindent for whole doc
\setlength\parindent{0pt} 
%noindent for whole doc

%%%%%COLORS
\usepackage[dvipsnames]{xcolor}

%tables
\usepackage{tabularray}

%clour cells in table
\usepackage{nicematrix}

\usepackage{mathrsfs} 

%%%%%EXAMPLE BOX
\usepackage[most]{tcolorbox}
\usepackage{xcolor}
\usepackage{framed}
\usepackage{amssymb}
\tcbuselibrary{theorems}
\newtcbtheorem
  []% init options
  {Example}% name
  {\textcolor{black}{\textbf{Example}}}% title
  {%
    colback=cyan!5,
    colframe=cyan!40,
    fonttitle=\rmfamily,
    arc=0pt,
  }% options
  {exam}% prefix

%%%%%EXAMPLE BOX

\begin{document}

\begin{Example}{Complete the table and plot the points to sketch a line of the linear relationship, $y = x + 3$.
}{label}
 \begin{tblr}{colspec = {|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|},
cell{1}{1} = {yellow!40},
cell{2}{1} = {yellow!40},
}
    \hline
    $x$ & $-3$ & $-2$ & $-1$ & $0$ & 1 & 2 & 3 \\
    \hline
    $y$ & & & & &\\
    \hline
\end{tblr} 
  
\end{Example}

\end{document}

テキストを黒くするのに苦労したので、変だと思ったら無視してください。

答え1

あなたの質問が理解できたかどうかわかりません。
次のようなものを提案します:

\documentclass[a4paper,11pt,addpoints]{exam}
\usepackage[left=1.5cm,right=1.5cm,top=1.5cm,bottom=2cm]{geometry}

%noindent for whole doc
\setlength\parindent{0pt} 
%noindent for whole doc

%%%%%COLORS
\usepackage[dvipsnames]{xcolor}

%tables
\usepackage{tabularray}

%clour cells in table
\usepackage{nicematrix}

\usepackage{mathrsfs} 

%%%%%EXAMPLE BOX
\usepackage[most]{tcolorbox}
\usepackage{xcolor}
\usepackage{framed}
\usepackage{amssymb}
\tcbuselibrary{theorems}
\newtcbtheorem
  []% init options
  {Example}% name
  {Example}% title
  {%
  theorem hanging indent=0pt,
    colback=cyan!5,
    colframe=cyan!40,
    fonttitle=\rmfamily,
    arc=0pt,
    coltitle=black,
    fonttitle=\bfseries,
    description font=\normalfont,
  }% options
  {exam}% prefix

%%%%%EXAMPLE BOX

\begin{document}

\begin{Example}{Complete the table and plot the points to sketch a line of the linear relationship, $y = x + 3$.\vspace{4pt}\newline
  \begin{tblr}{
    colspec = {*8{X[c]}},
    hlines, vlines,
    column{1} = {yellow!40},
    columns={mode=math},
    }
    x & -3 & -2 & -1 & 0 & 1 & 2 & 3 \\
    y &&&&&&&\\
  \end{tblr}
  }{label}

\end{Example}

\end{document}

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

関連情報