In my output file authors names are split and hyphenated across lines. I use biblatex and biber.
How can I avoid that?
In my output file authors names are split and hyphenated across lines. I use biblatex and biber.
How can I avoid that?
You can avoid family names being hyphenated or broken across lines with
\renewcommand*{\mkbibnamefamily}{\mbox}
or following the example of babel-french with
\renewcommand*{\mkbibnamefamily}[1]{\leavevmode\begingroup\kern0pt #1\endgroup}
if they only consist of one word.
The command \textnohyphenation, which should do that, does not work at the moment, see https://github.com/plk/biblatex/issues/772
But of course disabling hyphenation of names (especially long names) increases the chances that your paragraphs don't look right any more. If there is no good hyphenation point, LaTeX has to give up at some point either leaving an overfull box with the unbroken line protruding into the margin or with a very underfull box pushing the name into the next line and making the spaces between words very large. The package microtype and fine tuning of certain line break/paragraph parameters may be able to improve on your situation, but the general problem remains: Long words that can't be hyphenated are an issue for TeX's line breaking algorithm.
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear, backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}
\renewcommand*{\mkbibnamefamily}{\mbox}
\begin{document}
Lorem ipsum dolor sit amet consectur. Gallia est omnis divisa in part \cite{sigfridsson}
Lorem ipsum dolor sit amet consectur. Gallia est omnis divisa in pa \cite{wassenberg}
\end{document}
In general I would allow hyphenation in author names, but then a sanity check is needed to avoid bad breaking as mentioned by Mico in the comments.
\sloppy to solve a similar problem in my bibliography. Could that be used in some way here?
– jbahn
Jul 19 '18 at 07:20
\sloppy (or full \RaggedRight from ragged2e) are feasible options. But for normal text I would be very careful to apply \sloppy. It gives LaTeX greater freedom to mess with inter-word spaces, but that means that the output is potentially less pleasing to the eye. See https://tex.stackexchange.com/q/241343/35864 and the linked questions (especially those linked in the question itself).
– moewe
Jul 19 '18 at 08:30
\renewcommand*{\mkbibnamefamily}{\textnohyphenation}to avoid hyphenation in family (last) names. – moewe Jul 19 '18 at 05:17\textnohyphenationfor the moment (https://github.com/plk/biblatex/issues/772), you could try\renewcommand*{\mkbibnamefamily}{\mbox}– moewe Jul 19 '18 at 05:56microtypeeven letters) a bit to ensure a uniform margin. But at some point there is no way any stretching and shrinking helps. If the word/name you don't allow to hyphenate is too long, it is hard to find a good way to produce a pleasant output. – moewe Jul 19 '18 at 06:39\hyphenation{...}directive in your preamble indicating just the hyphens that are acceptable. – barbara beeton Jul 26 '18 at 14:32