4

Hey I recently discovered a problem in my bibliography and I somehow can't solve it. Its appearing when the titles are too long, but its working with urls normally as you see in the 2nd example as long the as the title is short enough.

It seems that symbols like "[]" beeing generated from something and the log is giving me 2x Overfull \hbox (X pt too wide) in paragraph. As soon as I remove the dots from the URL in the title it will break automatically like it should but it should actually see that the url is too big and break it automatically.

generated latex document

setup: document.tex and bib/literature.bib

settings: pdfLatex (using biber and texindy)

Minexample:

\documentclass[
    11pt,
    a4paper
]{scrreprt}

% add bibliography
\usepackage[style=alphabetic, sorting=anyt]{biblatex}
\addbibresource{bib/literature.bib}

\usepackage[colorlinks, urlcolor=blue]{hyperref}

\begin{document}
    \cite{Gaedke}
    \cite{IOT}

    \printbibliography
\end{document}

literature.bib

@online{Gaedke,
    author = {Gaedke, Martin and Heil, Andreas},
    title = {{GET /dgs HTTP/1.1 Host: www.WebComposition.net.}},
    url = {http://www.mendeley.com/research/dgs-http11-host-wwwwebcompositionnet/},
    urldate={2018-08-19}
}
@online{IOT,
    author = {Litzel, Nico },
    title = {Was ist das Internet of Things?},
    url = {https://www.bigdata-insider.de/was-ist-das-internet-of-things-a-590806/},
    urldate={2018-08-19}
}
2
  • 1
    Welcome! You need to markup special things like URLs. url field values are wrapped automatically, but that doesn't apply to URLs in titles. You need \url{www.WebComposition.net} if you want this in the title. Otherwise, even if TeX figures out how to break it, it'll hyphenate it.
    – cfr
    Commented Aug 19, 2018 at 23:37
  • But you don't want to set these entries this way. At least the first one is not @online but @inproceedings and needs date and booktitle and the second needs its date.
    – cfr
    Commented Aug 19, 2018 at 23:48

1 Answer 1

2

Values for url are automatically wrapped, but in other contexts, you must mark them up appropriately. Moreover, the first entry should be @inproceedings and the second should have its date.

\begin{filecontents}{\jobname.bib}
@inproceedings{Gaedke,
    author = {Gaedke, Martin and Heil, Andreas},
    title = {{GET} {/dgs} {HTTP}/1.1 Host: \url{www.WebComposition.net}},
    url = {http://www.mendeley.com/research/dgs-http11-host-wwwwebcompositionnet/},
    urldate={2018-08-19},
    booktitle = {Proceedings of the 42nd Annual Hawaii International Conference on System Sciences},
    date = 2009,
    organization = {HICSS},
}
@online{IOT,
    author = {Litzel, Nico},
    title = {Was ist das Internet of Things?},
    url = {https://www.bigdata-insider.de/was-ist-das-internet-of-things-a-590806/},
    urldate={2018-08-19},
    date = {2016-01-09},
}
\end{filecontents}

\documentclass[11pt, a4paper]{scrreprt}
\usepackage[style=alphabetic, sorting=anyt]{biblatex}
\addbibresource{\jobname.bib}
\usepackage[colorlinks, urlcolor=blue]{hyperref}

\begin{document}
\cite{Gaedke}
\cite{IOT}

\printbibliography
\end{document}

output

This does break the URL in the title, though we still get a bad box because TeX can't figure out a good way to break up the URL further. Or, more likely the url package or hyperref's version cannot.

If you want the URLs to be broken regardless, you can set the penalties accordingly. For example, adding

\setcounter{biburlnumpenalty}{9000}
\setcounter{biburlucpenalty}{9000}
\setcounter{biburllcpenalty}{9000}

produces

alternative output

instead.

\documentclass[11pt, a4paper]{scrreprt}
\usepackage[style=alphabetic, sorting=anyt]{biblatex}
\addbibresource{\jobname.bib}
\usepackage[colorlinks, urlcolor=blue]{hyperref}
\setcounter{biburlnumpenalty}{9000}
\setcounter{biburlucpenalty}{9000}
\setcounter{biburllcpenalty}{9000}
\begin{document}
\cite{Gaedke}
\cite{IOT}

\printbibliography
\end{document}
1
  • Thanks! If its the only way to do it, I'll take it. Something I would like to add is that luatex is compiling this without problems, maybe I shall switch the compiler tho. Why should I pick @inproceedings over @online?
    – Supportic
    Commented Aug 20, 2018 at 8:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .