Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Why do I get the message:

Underfull \hbox (badness 10000) in paragraph at lines 107--108

I want a blank line between the problem name and the table, but if I use \\ or \newline along with a blank space, or if I use two \newline, I get the "underfull \hbox" message.

\begin{solution}{1.2}\newline % Line 107

    \newlength{\mylen}\settowidth{\mylen}{$p \to q$}% Widest element
        \begin{tabular}{*{5}{|>{\centering\arraybackslash\rule{0pt}{1.05em}}m{\mylen}}|}
            \hline
            $p$ & $q$ & $p \land q$ & $p \lor q$ & $p \to q$\\
            \hline
            T & T & T & T & T\\
            \hline
            T & F & F & T & F\\
            \hline
            F & T & F & T & T\\
            \hline
            F & F & F & F & T\\
            \hline
        \end{tabular}
    \end{solution}
share|improve this question
add comment

1 Answer 1

up vote 14 down vote accepted

Inserting \par\vspace{\baselineskip} would provide you with a single line gap between two paragraphs. In the following minimal example, a mock-up of a solution environment adds \par\nobreak\vspace{\baselineskip} after every \begin{solution}{<stuff>} (the \nobreak addition discourages page breaking after printing the environment header). If you don't want it this way, you can add the gap manually by removing \par\vspace{\baselineskip} from the definition of \begin{solution}:

enter image description here

\documentclass{article}
\usepackage{array}% http://ctan.org/pkg/array

\newenvironment{solution}[1] % solution environment
  {\par\textbf{Solution\ #1}:\par\nobreak\vspace{\baselineskip}}% \begin{solution}
  {}% \end{solution}

\begin{document}
\begin{solution}{1.2} % Line 107
  \newlength{\mylen}\settowidth{\mylen}{$p \to q$}% Widest element
  \begin{tabular}{*{5}{|>{\centering\arraybackslash\rule{0pt}{1.05em}}m{\mylen}}|}
    \hline
    $p$ & $q$ & $p \land q$ & $p \lor q$ & $p \to q$\\
    \hline
    T & T & T & T & T \\
    \hline
    T & F & F & T & F \\
    \hline
    F & T & F & T & T \\
    \hline
    F & F & F & F & T \\
    \hline
  \end{tabular}
\end{solution}
\end{document}

You might also consider using \smallskip, \medskip or \bigskip, each of which allows for some stretching/shrinking within the text.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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