TransWikia.com

LNCS: How to split DOI into multiple lines to avoid warning: Underfull hbox (badness 10000). on .bbl file?

TeX - LaTeX Asked by Aryo on March 19, 2021

I am writing a paper using the LNCS style and I have a lot of Underfull hbox warnings because URLs generated from the doi attribute of a Bib item do not split into multiple lines.

The LNCS style convert bibliography item doi value such as: 11.1111/111-1-1111-1111-1_11 into URL form: https://doi.org/11.1111/111-1-1111-1111-111.

Below is the minimum working example that generates the warning:

documentclass{llncs}
begin{document}

  Hello world, I cite somebody here cite{Somebody}.

bibliographystyle{splncs04}
bibliography{paper-bibliography}
end{document}

In the paper-bibliography.bib file I have the following entry:

@inbook{Somebody,
  author = {Somebody Someone},
  year = {2014},
  pages = {193--198},
  title = {Paper, Rock, and Scissors},
  isbn = {123-1-1234-1234-4},
  doi = {11.1111/111-1-1111-1111-1_11}
}

The code resulting in something like below:

enter image description here

and generated the following warning:

Underfull hbox (badness 10000)

I expect to avoid the Underfull warning and get the following result, where the URL is split into two lines, like the following

enter image description here

What I did to get the expected results is somewhat a hack to the Bib entry:

@inbook{Somebody,
    author = {Somebody Someone},
    year = {2014},
    pages = {193--198},
    title = {Paper, Rock, and Scissors},
    isbn = {123-1-1234-1234-4},
    url = {url{https://doi.org/11. 1111/111-1-1111-1111-1_11}}
}

I changed the doi entry to: url = {url{https://doi.org/11. 1111/111-1-1111-1111-1_11}} and able to get the desired result. However, I don’t think it is a good idea to change the doi values of all Bib entries that way.

Is there any proper way to get the expected result without modifying Bib item’s doi value?

One Answer

A good solution is to the xurl package that allows URLs to be split at arbitrary positions.

A problem with splncs04 and llncs.cls is that it defines doi as plain text string (unless the hyperref package is loaded). A way to obviate to this issue is to add

@preamble{ "renewcommand{doi}[1]{url{https://doi.org/#1}}" }

to the bib file, and use

doi = {11.1111/111-1-1111-1111-1_11}

i.e., for the doi (so the doi without the common prefix). In case, one wants the doi in the same font as the text, include

urlstyle{rm}

in the preamble.

Correct answer by Guido on March 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP