Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am having troubles with citations. As seen on the attached screenshot, they sometimes don't do linebreaking properly, but produce an error overfull hbox and break my layout.

Here are the relevant packages I include.

\documentclass[12pt,a4paper]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[hyphens]{url}
\usepackage{jurabib}
\usepackage{pdfpages}

And here is the screenshot: enter image description here

EDIT: I just found this answer. Neither \usepackage{breakcites} nor \usepackage{cite} helped, but \usepackage{microtype} certainly did. Let's see whether it will solve all linebreaking problems.

share|improve this question

1 Answer 1

up vote 7 down vote accepted

The problem you have is that you are generate very long citation texts that essentially do not have any breakpoints other than after the / and if you have many of those in a paragraph there may not be any legal linebreaking possible. If you run

\showhyphens{fairlylongword/fairlylongword/fairlylongword,2003}

you can see that only in the first name TeX finds any hyphenation points:

Underfull \hbox (badness 10000) in paragraph at lines 31--31
[] \T1/ptm/m/n/10 fair-ly-long-word/fairlylongword/fairlylongword,2003

The reason is that the moment TeX finds anything other than a letter in a word it stops hyphenation.

Now jurabib doesn't use / but it uses \slash between author names to generate a / and a breakpoint, which explains why you get "(Straub/Weidemann/ ... Weidemann,2007)" but you don't get "(Straub/Weide- ... mann/Weidemann,2007)" which had probably saved you the day.

So the question is where do you want to get linebreaks in? If you want to attempt hyphenating the names using normal hyphenation rules then you need to ensure that this / is not stopping hyphenation. The trick to use is to follow the \slash by some invisible white space (e.g., \hspace{0pt} as this results in starting a new "word".

The jurabib package is highly customizable and all you have to do is to modify the corresponding commands (see jurabib documentation, or if you have TLC2 look at example 12-5-39):

\renewcommand{\jbbtasep}{{\normalfont\slash\hspace{0pt}}}
\renewcommand{\jbbfsasep}{{\normalfont\slash\hspace{0pt}}}
\renewcommand{\jbbstasep}{{\normalfont\slash\hspace{0pt}}}

There are many more possibilities in that area.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.