1

New to Latex, I'm using IEEEtran template to writing some paper, but there is warning of underfull \hbox in the keyword environment, I googled it but have not found relevant information, can someone help me? Thanks very much!

\documentclass[journal]{IEEEtran}
\usepackage{graphicx} \usepackage{cite}
\usepackage{url} \usepackage{subfigure}
\usepackage[font=footnotesize]{caption}
\captionsetup{singlelinecheck=on}
\usepackage[para]{threeparttable}
\usepackage{tabularx} \usepackage{amsmath}
\usepackage{multirow}
\begin{document}
\begin{IEEEkeywords}
Probabilistic password model,
Probability-threshold graphs,
Probabilistic password model,
Probabilistic password model
\end{IEEEkeywords}
\end{document}
David Carlisle
  • 757,742
K.Wanter
  • 123
  • 1
    that just means that some white space got stretched beyond the amount that you have specified that white space can stretch. It may be Ok to ignore it or you may want to set the text ragged right rather than justified. Impossible to say as you have not shown any code. It is not an error it is a specific warning about how the words on that line fit on to the length of that line. So any fix has to be specific to the text in your case. – David Carlisle Sep 27 '17 at 09:53
  • Do you mean the IEEEkeywords environment? Since it uses \centering, I don't see how that is possible. – John Kormylo Sep 27 '17 at 23:24
  • @DavidCarlisle, the problem is I have a keyword composed of 3 words: ABCD-EFGH IJKL, the first line of compiled keywords ends with ABCD-, I can resolve the problem by remove - between ABCD and EFGH and add hyphenation of EF-GH, but without removing the - between ABCD and EFGH, the problem cannot be solved – K.Wanter Sep 29 '17 at 01:29
  • @JohnKormylo, do you mean it is impossible to solve the problem? – K.Wanter Sep 29 '17 at 01:29
  • @JohnKormylo, yes, I mean the IEEEkeywords environment – K.Wanter Sep 29 '17 at 01:51
  • it is impossible to tell you what to change if you do not show the code that is causing the problem. Please ensure that any question asking about a warning message includes a small example a complete document from \documentclass to \end{document} that shows the error. Then people can easily debug it and suggest changes. – David Carlisle Sep 29 '17 at 06:42
  • No, John meant it's impossible to get an underfull box warning in the scope of \centering, so there is something that you are not telling us that is causing the issue. – David Carlisle Sep 29 '17 at 06:44
  • @DavidCarlisle, I see, thank you, to reproduce the warning: \documentclass[journal]{IEEEtran} \usepackage{graphicx} \usepackage{cite} \usepackage{url} \usepackage{subfigure} \usepackage[font=footnotesize]{caption} \captionsetup{singlelinecheck=on} \usepackage[para]{threeparttable} \usepackage{tabularx} \usepackage{amsmath} \usepackage{multirow} \begin{document} \begin{IEEEkeywords} Probabilistic password model, Probability-threshold graphs, Probabilistic password model, Probabilistic password model \end{IEEEkeywords} \end{document} – K.Wanter Sep 29 '17 at 07:50
  • Thanks but better to add into the question (I did it this time) formatting of code in comments isn't that good:-) – David Carlisle Sep 29 '17 at 08:27
  • In relation to @JohnKormylo's comment re \centering that would have the same effect on spacing as the \raggedright I used below, . It is used in the class definition of the keywords environment however it only uses centred setting in single column, and you have double column (although we didn't know that until you posted the example:-) – David Carlisle Sep 29 '17 at 08:37

1 Answers1

1

The example posted produces

Underfull \hbox (badness 2318) in paragraph at lines 10--15
[]\OT1/ptm/b/it/9 Index Terms\OT1/ptm/b/n/9 ---Probabilistic pass-word model, P
robability-

which means that the white space on that line is over stretched. Actually 2318 isn't that bad. So one reasonable alternative is just to accept it as it is as it is anyway a formal list not a normal paragraph of text that needs to be read as text and where large spaces are distracting.

The alternatives are to tell tex to ignore this amount of badness (the default threshold is 1000 so you could make it 2500

\begin{IEEEkeywords}\hbadness=2500

and the warning would go (without changing the formatting)

Or you could tell tex to re-arrange the white space, eg set as \raggedright

\begin{IEEEkeywords}\raggedright

also has no warning, but has a different setting, with short and long lines, but regular inter-word space.

See further discussion about hbadness at

Do I have to care about bad boxes?

David Carlisle
  • 757,742
  • I just find that if I add hyphenation by \hyphenation{thres-hold}, and remove '-' in 'Probability-threshold graphs', then the problem also resolved, but I cannot use '-' in keyword 'Probability-threshold graphs', otherwise the trick does not work, even if I add \hyphenation{th-res-hold}. it seems it is forced to start newline at '-' in keyword 'Probability-threshold graphs'. – K.Wanter Sep 29 '17 at 10:25
  • tex doesn't automatically hyphenate words with explicit hyphens you could use Probability-thres\-hold in the document which would make tex happier but might break whatever automatic indexing the ieee do with keywords (I don't know) @K.Wanter – David Carlisle Sep 29 '17 at 11:37