3

I'm using biblatex with biber to reference in my document. It works great but lately, I saw a problem. Most of my references are copied from google scholar cite option so I guess the references them self are a proper format.

r

As you can see some of the citations are going off the page.

This is one of the citations that are shown off the screen:

@inproceedings{wirth2000crisp,
  title={CRISP-DM: Towards a standard process model for data mining},
  author={Wirth, R{\"u}diger and Hipp, Jochen},
  booktitle={Proceedings of the 4th international conference on the practical applications of knowledge discovery and data mining},
  year={2000},
  organization={Citeseer}
}

@article{liu2012isolation,
  title={Isolation-based anomaly detection},
  author={Liu, Fei Tony and Ting, Kai Ming and Zhou, Zhi-Hua},
  journal={ACM Transactions on Knowledge Discovery from Data (TKDD)},
  volume={6},
  number={1},
  year={2012},
  publisher={ACM}
}

Someone knows how to fix this. I can't believe that fields like journal or booktitle can't be too long.

7
  • 3
    Latex is really bad at underlining. It is incredibly hard to get LaTeX to allow line breaks in underlined text. You probably loaded the ulem package, which by default changes \emph to produce underlined text. Load it as \usepackage[normalem]{ulem} instead to retain italics for \emph. Or don't load it at all.
    – moewe
    May 3, 2019 at 15:37
  • See also tex.stackexchange.com/q/104058/35864.
    – moewe
    May 3, 2019 at 15:53
  • tex.stackexchange.com/q/70851/35864, tex.stackexchange.com/q/385924/35864, tex.stackexchange.com/q/117347/35864 are all pretty much duplicates of this question. Unfortunately, they are either missing a proper MWE (like this question) or the WE is not really M.
    – moewe
    May 3, 2019 at 15:55
  • Great, make it into an answer so I can accept it :) Also I did not even see that the underlining should not be there in the first place. May 4, 2019 at 13:54
  • Would it also be OK to close the question as a duplicate of one of the linked questions? I feel that it would be superfluous if I added another answer stating the same thing that has been explained extensively elswhere.
    – moewe
    May 4, 2019 at 13:56

1 Answer 1

6

You'll find that those lines that don't break properly are those that are underlined. Indeed, underlining is quite hard in LaTeX: In standard LaTeX \underline does not allow line breaks (https://texfaq.org/FAQ-underline). There are alternative packages like soul and ulem that allow for a more sophisticated underlining mechanism, but their implementations also have limitations and usually only work smoothly for very simple input that does not feature too many macros. Fortunately, underlining is usually frowned upon in typography as a relic of the typewriter age and so LaTeX can get away with not supporting it as well as other word processors do.

If you know the output the biblatex standard styles, you'll find that the text that is underlined in your screenshot is usually printed in italics.

Putting that together suggests that you are loading the package ulem, whose default behaviour it is to redefine \em and \emph to produce underlined text instead of the normal italics.

The following MWE reproduces the effect you are seeing in your screenshot

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage{ulem}

\usepackage[style=authoryear, backend=biber]{biblatex}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson}
\printbibliography
\end{document}

Bibliography entry with underlined journal name protruding far into the right margin.

As explained in Getting \emph back to normal after loading ulem you can load the package ulem with the option normalem to avoid \emph being redefined. And indeed with

\usepackage[normalem]{ulem}

instead of \usepackage{ulem} the code produces

The same bibliography entry as before. This time the previously underlined text is in italics and breaks nicely.

Of course you can also stop loading ulem completely if you don't need underlining in your document.

1
  • For those who absolutely need underlining: The best solution in LaTeX that I'm currently aware of is lua-ul, which requires LuaLaTeX. See for example tex.stackexchange.com/q/446444/35864.
    – moewe
    Oct 18, 2022 at 15:54

You must log in to answer this question.

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