1

My code is given below. How can I make the box bigger so that the table fits inside it? Or how could I make the table smaller so that it fits inside the box?

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

How about you use open/closed interval notation? output

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.