1

I know that the recommended way to suppress messages such

Underfull \hbox (badness 10000) in paragraph at lines 23--26

is not to use \\ or \newline but instead other methods such as \medskip.

My problem is that in lines 23--26 there is an eqnarray and I separate equations using \\ (that seems to cause the above message) ... even though this message does not affect my work (the books is printed correctly) I am curious regarding its origin ... thanks a lot !!

Here is the code

\documentclass{article}
\usepackage{bm}
\begin{document}

\begin{eqnarray*}
\bm{A}=\bm{A}_{m\times n}=\left(\begin{tabular}{ccccccc}
$\bm{\alpha_{11}}$&$\alpha_{12}$&$\alpha_{13}$&$\dots$&$\alpha_{1j}$&$\dots$&$\alpha_{1n}$\\
$\alpha_{21}$&$\bm{\alpha_{22}}$&$\alpha_{23}$&$\dots$&$\alpha_{2j}$&$\dots$&$\alpha_{2n}$\\
$\alpha_{31}$&$\alpha_{32}$&$\bm{\alpha_{33}}$&$\dots$&$\alpha_{3j}$&$\dots$&$\alpha_{3n}$\\
$\vdots$&$\vdots$&$\vdots$&$\bm{\ddots}$&$\vdots$&$\ddots$&$\vdots$\\
$\alpha_{i1}$&$\alpha_{i2}$&$\alpha_{i3}$&$\ddots$&$\bm{\alpha_{ij}}$&$\ddots$&$\alpha_{in}$\\
$\vdots$&$\vdots$&$\vdots$&$\ddots$&$\vdots$&$\bm{\ddots}$&$\vdots$\\
$\alpha_{m1}$&$\alpha_{m2}$&$\alpha_{m3}$&$\dots$&$\alpha_{mj}$&$\dots$&$\bm{    \alpha_{mn}}$\\
\end{tabular}\right)
\end{eqnarray*}

\end{document}

it just prints an $n\times n$ array. The code extends from line 20 to line 30 and the message refers to the lines 23--26.

David Carlisle
  • 757,742
  • 2
    you mean \\ not // I assume. the \\ in an eqnarray are unlikely to generate this message, please show a small complete document that shows the problem. Note that eqnarray is deprecated and it is much better to use align from the amsmath package, but align rows similarly end with \\ – David Carlisle Oct 01 '17 at 17:41
  • do you have the \\ after the environment as in \end{eqnarray}\\ ? – David Carlisle Oct 01 '17 at 17:53
  • yes i mean \ of cource (i made a mistake) .. the code segment is – Athanasios Margaris Oct 01 '17 at 18:05
  • yes i mean \ of cource (i made a typing mistake) .. no, there is not an \ after eqnarray .... the codei mention just prints out a 3x3 matrix and in order to do this, i use the tabular environment inside the equation array (where in fact i use the \) .. i suppose that the \ put in an eqnarray does not cause the 'Underfull hbox...' message ... yes i know the align package and i will use it in the future .. thanks a lot – Athanasios Margaris Oct 01 '17 at 18:13
  • 6
    sorry unless you put a small example from \documentclass to \end{document} into your question it will be impossible to guess what you did or how to fix your document not to have the warning. – David Carlisle Oct 01 '17 at 18:28
  • as I said, the example should be a complete document that makes the warning, I took your fragment and added bm and \documentclass so it could be tested but it makes no warnings. The markup is rather odd, you should not be using tabular here but array for math mode, but that is a separate issue. Please edit the question so the example makes the underfull box warning. – David Carlisle Oct 01 '17 at 20:02
  • are you sure that the "line 23" was line 23 of your main file (not for example line 23 of your table of contents) – David Carlisle Oct 01 '17 at 20:05
  • i made the same thought and i am looking for this right now ... i will inform you about the result .. since your test did not produce any error maybe the problem is at another file .... thanks again for your time – Athanasios Margaris Oct 01 '17 at 20:30
  • yes, the problem found in the file cover.tex where i have the code for the book cover and in order to put some vertical space between the book title and the author name i wrote
    ${}$\\${}$\\${}$\\${}$\\${}$\\
    ${}$\\${}$\\${}$\\${}$\\${}$\\
    ${}$\\${}$\\${}$\\${}$\\${}$\\
    
    

    now i replaced these lines with the command \vspace{5cm} and the problem solved .. i confused by the log file since i have not much experience in its use and that's why i reached the above (erroneous) conclusion .... your help and interest is greatly appreciated :-)

    – Athanasios Margaris Oct 01 '17 at 20:40
  • i'm voting to close this question since the problem was in a different file than the one originally reported. the problem has been solved as noted in comments. – barbara beeton Oct 01 '17 at 21:27
  • 2
    I'm voting to close this question as off-topic because as barbara said – David Carlisle Oct 01 '17 at 21:28
  • 1
    I'm voting to close this question as off-topic because the problem was in a different file than the one reported, and it has been solved as noted in comments. – barbara beeton Oct 01 '17 at 21:28

1 Answers1

2

Your code does not produce any Underfull \hbox warning. However, you should modify it to make it easier to type.

\documentclass{article}
\usepackage{amsmath}
\usepackage{bm}

\begin{document}

\begin{equation*}
\bm{A}=\bm{A}_{m\times n}=
\begin{pmatrix}
\bm{\alpha_{11}}&\alpha_{12}&\alpha_{13}&\dots&\alpha_{1j}&\dots&\alpha_{1n}\\
\alpha_{21}&\bm{\alpha_{22}}&\alpha_{23}&\dots&\alpha_{2j}&\dots&\alpha_{2n}\\
\alpha_{31}&\alpha_{32}&\bm{\alpha_{33}}&\dots&\alpha_{3j}&\dots&\alpha_{3n}\\
\vdots&\vdots&\vdots&\bm{\ddots}&\vdots&\ddots&\vdots\\
\alpha_{i1}&\alpha_{i2}&\alpha_{i3}&\dots&\bm{\alpha_{ij}}&\dots&\alpha_{in}\\
\vdots&\vdots&\vdots&\ddots&\vdots&\bm{\ddots}&\vdots\\
\alpha_{m1}&\alpha_{m2}&\alpha_{m3}&\dots&\alpha_{mj}&\dots&\bm{\alpha_{mn}}\\
\end{pmatrix}
\end{equation*}

\end{document}

The changes I made are:

  1. loading of amsmath
  2. usage of equation* instead of eqnarray* (see eqnarray vs align)
  3. pmatrix instead of tabular
  4. \dots instead of \ddots in row i

About 2, note that eqnarray should not be used and amsmath environments should be preferred. Also, avoid using a multiline display for a single equation.

About 3, recall that array is the analog of tabular for math mode and doesn't require to input each cell as a math formula (pmatrix is based on it).

Your last comment should also be analyzed: using \\ for vertical space is definitely not the best way to cope with the problem.

enter image description here

egreg
  • 1,121,712