GeneralWhat's wrong with my boxes?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Singularity
Posts: 156
Joined: Sat Jan 22, 2011 9:55 pm

What's wrong with my boxes?

Post by Singularity »

I'm coming into the home stretch of my thesis, and my school is finicky about margins and page size and all that. My document has 4 remain "Bad Box(es)" which I cannot figure out why they are bad? They don't run over any margin or anything like that. So what (if anything) is wrong with my boxes (log file output below)? Here's my MWE

Code: Select all

\documentclass[12pt,fleqn,oneside]{article}
\usepackage{subcaption}			% Necessary for \subfigure
\usepackage{array}					% Provides for a more flexible array and tabular environment
\usepackage{booktabs}				% For fancy stuff in arrays and tables, like the following column definitions.

\begin{document}

\begin{minipage}[t]{\linewidth}
%\centering
\captionof{table}{Summary of Results: ``Eight'' Models} \label{tab:summary8}
\begin{tabular}{|l|c|c|c|}
	\toprule
		\textbf{System} 			& \textbf{8} 	& \textbf{64} 					& \textbf{8 x 8} \\
	\midrule
		Energy Conserved 			& All $\beta$ & $\beta \le 23$ 				& All $\beta$ \\
		$\Delta H=0$ at $t=0$ & $\beta = 1$ & $\beta \le 30$ 				& None \\
	\midrule
		Recurrence 						& --- 				& $\beta = 4 \ldots 13$ & --- \\
		Thermalizes 					& --- 				& $\beta \ge 14$ 				& --- \\
	\bottomrule
\end{tabular}
\end{minipage}\newline\newline

\begin{minipage}{\linewidth}
%\centering
\captionof{table}{Summary of Results: ``Thirty-two'' Models} \label{tab:summary32}
\begin{tabular}{|l|c|c|c|}
	\toprule
		\textbf{System} 			& \textbf{32} 					& \textbf{1024} & \textbf{32 x 32} \\
	\midrule
		Energy Conserved 			& $\beta \le 13$ 				& All $\beta$		& $\beta \le 21$	\\
		$\Delta H=0$ at $t=0$ & $\beta \le  8$ 				& All $\beta$		& $\beta \le 21$	\\
	\midrule
		Recurrence 						& $\beta = 6 \ldots 8$ 	& Acts linear 	& None \\
		Thermalizes 					& $\beta \ge 7$ 				& None 					& None \\
	\bottomrule
\end{tabular}
\end{minipage}

\end{document}
From the logfile (note that the lines listed in the errors correspond to the line numbers of these minipages in my original source
Overfull \hbox (17.62482pt too wide) in paragraph at lines 1664--1679
[][]
[]


Underfull \hbox (badness 10000) in paragraph at lines 1664--1679

[]


Underfull \hbox (badness 10000) in paragraph at lines 1664--1679

[]

...

Overfull \hbox (17.62482pt too wide) in paragraph at lines 1680--1695
[]$[]$
[]

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

What's wrong with my boxes?

Post by Johannes_B »

You are inputting minipages, i guess to prevent floating. A float environment is a special box for LaTeX, some stuff is happening in the background. Using minipages, LaTeX sees a regular box, nothing more than a simple letter. That means, the paragraph indent is applied. You can use \noindent to avoid this behaviour. Of course it would be better to define a new environment, that takes care of all this, but i think it is too late for you now :-)

You can notice some odd gaps in the vertical lines. This is somehow by design, as package booktabs discourages the use of vertical lines.

To add some vertical space, never use \newline. I cannot stress this enough. LaTeX is told to begin a new line, but as there was nothing typeset, the program gets surprised and reports it. Underfull box.

Code: Select all

    \documentclass[12pt,fleqn,oneside]{article}
    \usepackage{subcaption}
    \usepackage{array}    
    \usepackage{booktabs}
    \usepackage{showframe}

    \begin{document}

\noindent%<---------------------
\begin{minipage}[t]{\linewidth}
    \centering
    \captionof{table}{Summary of Results: ``Eight'' Models} \label{tab:summary8}
    \begin{tabular}{lccc}
            \toprule
                    {System}                         &
		    {8}    & {64}
		    & {$8 \times 8$} \\
            \midrule
                    Energy Conserved                        & All $\beta$ & $\beta \le 23$                          & All $\beta$ \\
                    $\Delta H=0$ at $t=0$ & $\beta = 1$ & $\beta
		    \le 30$                            & None
		    \\\addlinespace
                    Recurrence                                              & ---                           & $\beta = 4 \ldots 13$ & --- \\
                    Thermalizes                                     & ---                           & $\beta \ge 14$                                & --- \\
            \bottomrule
    \end{tabular}
    \end{minipage}%\newline\newline%Never do stuff like that, it
%    is worse than bad
    \bigbreak

    \begin{minipage}{\linewidth}
    %\centering
    \captionof{table}{Summary of Results: ``Thirty-two'' Models} \label{tab:summary32}
    \begin{tabular}{|l|c|c|c|}
            \toprule
                    \textbf{System}                         & \textbf{32}                                   & \textbf{1024} & \textbf{32 x 32} \\
            \midrule
                    Energy Conserved                        & $\beta \le 13$                                & All $\beta$           & $\beta \le 21$        \\
                    $\Delta H=0$ at $t=0$ & $\beta \le  8$                          & All $\beta$           & $\beta \le 21$        \\
            \midrule
                    Recurrence                                              & $\beta = 6 \ldots 8$  & Acts linear   & None \\
                    Thermalizes                                     & $\beta \ge 7$                                 & None                                  & None \\
            \bottomrule
    \end{tabular}
    \end{minipage}

    \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply