我的代码如下。我怎样才能让盒子变大,以便桌子可以放进去?或者我怎样才能让桌子变小,以便它能放进盒子里?
\documentclass[12pt]{article}
\usepackage{amsmath,amsthm,amssymb,amsfonts}
\usepackage{graphicx,float,wrapfig}
\usepackage{array}
\usepackage{microtype}
\usepackage[usenames,svgnames,dvipsnames]{xcolor}
\colorlet{lightcyan}{cyan!40!white}
\usepackage{thmtools}
\usepackage[framemethod=TikZ]{mdframed}
\theoremstyle{definition}
\mdfdefinestyle{mdbluebox}{%
roundcorner = 10pt,
linewidth=1pt,
skipabove=10pt,
innertopmargin=15pt,
innerbottommargin=9pt,
skipbelow=2pt,
nobreak=true,
linecolor=blue,
backgroundcolor=TealBlue!5,
}
\declaretheoremstyle[
headfont=\sffamily\bfseries\color{MidnightBlue},
mdframed={style=mdbluebox},
headpunct={\\[3pt]},
postheadspace={0pt}
]{thmbluebox}
\mdfdefinestyle{mdredbox}{%
roundcorner = 10pt,
linewidth=1pt,
skipabove=10pt,
innertopmargin=15pt,
innerbottommargin=9pt,
skipbelow=2pt,
nobreak=true,
linecolor=RubineRed,
backgroundcolor=red!2,
}
\declaretheoremstyle[
headfont=\bfseries\color{RubineRed},
mdframed={style=mdredbox},
headpunct={\\[3pt]},
postheadspace={0pt},
]{thmredbox}
\declaretheorem[%
style=thmbluebox,name=Theorem,numberwithin=section]{theorem}
\declaretheorem[style=thmredbox,name=Example,sibling=theorem]{example}
\begin{document}
\begin{example}
$\small
\begin{array}{|l|l|l|l|l|l|l|} \hline
\text{Mass, $m$ kg} & 2<m\leq 4 & 4<m\leq 5 & 5<m\leq 5.5 & 5.5<m\leq 6 &
6<m\leq 8 & 8<m\leq 10 \\ \hline
\text{Frequency} & 12 & 13 & 31 & 34 & 10 & 8 \\ \hline
\end{array}$
\end{example}
\end{document}
答案1
\documentclass[12pt]{article}
\usepackage{amsmath,amsthm,amssymb,amsfonts}
\usepackage{graphicx,float,wrapfig}
\usepackage{array}
\usepackage{microtype}
\usepackage[usenames,svgnames,dvipsnames]{xcolor}
\colorlet{lightcyan}{cyan!40!white}
\usepackage{thmtools}
\usepackage[framemethod=TikZ]{mdframed}
\theoremstyle{definition}
\mdfdefinestyle{mdbluebox}{%
roundcorner = 10pt,
linewidth=1pt,
skipabove=10pt,
innertopmargin=15pt,
innerbottommargin=9pt,
skipbelow=2pt,
nobreak=true,
linecolor=blue,
backgroundcolor=TealBlue!5,
}
\declaretheoremstyle[
headfont=\sffamily\bfseries\color{MidnightBlue},
mdframed={style=mdbluebox},
headpunct={\\[3pt]},
postheadspace={0pt}
]{thmbluebox}
\mdfdefinestyle{mdredbox}{%
roundcorner = 10pt,
linewidth=1pt,
skipabove=10pt,
innertopmargin=15pt,
innerbottommargin=9pt,
skipbelow=2pt,
nobreak=true,
linecolor=RubineRed,
backgroundcolor=red!2,
}
\declaretheoremstyle[
headfont=\bfseries\color{RubineRed},
mdframed={style=mdredbox},
headpunct={\\[3pt]},
postheadspace={0pt},
]{thmredbox}
\declaretheorem[%
style=thmbluebox,name=Theorem,numberwithin=section]{theorem}
\declaretheorem[style=thmredbox,name=Example,sibling=theorem]{example}
\begin{document}
\begin{example}
$\small
\begin{array}{|l|l|l|l|l|l|l|} \hline
\text{Mass, $m$ kg} & (2, 4] & (4, 5] & (5, 5.5] & (5.5, 6] & (6, 8] & (8, 10] \\ \hline
\text{Frequency} & 12 & 13 & 31 & 34 & 10 & 8 \\ \hline
\end{array}$
\end{example}
\end{document}