How can I enforce latex not to make line breaks of this form?
Assume, this code
First line~\cite{ref13,ref14,ref15,ref16,ref17}. Second line.
Produces the following output (line break because of the end of the line):
First line [13-
17]. Second line
While I would like to enforce smth like this:
First
line [13-17].
Second line
I'm using biblatex. But I would also be interested to know the answer for the case of using the standard latex bibliography.
UPDATE
A brute-force solution, thanks to @koleygr:
\newcommand{\mcite}[1]{\mbox{\cite{#1}}}
Best Answer
Update
With new info in the question, this seems like a good answer for
biblatex
. For standard bibliographies, you would need to alter the relevantbst
file to replace the--
with\textendash
, but this is always a pain.Your question is a little unclear, but I assume you are referring to page ranges?
Both
-
and--
contain (I think) an implied\penalty\hyphenpenalty
after them, so they will break as you are seeing.With default settings for both standard bibliographies and
biblatex
, you could use\cite[13\textendash 17]{entry}
, which won't break.If I where using
biblatex
I'd use\mkcomprange
(see Table 13 in the manual for set up) and ensure\bibrangedash
is not breakable (by default in English it is defined as\textendash\penalty\hyphenpenalty
).(Note: This doesn't seem to work with
xelatex
which allows a break after\textendash
. Perhaps someone else can help with this case.)Something like this: