0

I'm using biblatex with the alphabetic style. I've noticed that line breaks after the dash between the page numbers (e.g. for journal entries) could occur.

Is it possible to prevent this and make the page numbers with the dash and the additional p. or pp. a non breakable unit?

1 Answer 1

1

You can use the extdash-package. It should be loaded as the very last package (even after hyperref and bookmark).

It defines unbreakable dashes and dashes so that LaTeX can break the connected words at other places then the hyphen.

Use \== for an unbreakable en-dash.

\documentclass{article}

\begin{filecontents}{test.bib}
  @BOOK{test,
  TITLE = {Philosophiae Naturalis Principia Mathematica},
  AUTHOR = {Newton, Isaac},
  YEAR = {1687},
}
\end{filecontents}

\usepackage[backend=biber]{biblatex}
\addbibresource{test.bib}
\usepackage[shortcuts]{extdash}

\begin{document}
   \cite[pp.~10\==15]{test}
\end{document}
5
  • Thank you. One problem I have, is that when I use your solution within the bib file for the entry pages, e.g. pages = {10\==20}, biblatex deletes the pp. entry. I think it is because biblatex can't interpret \== as a range of pages. For that case I search for another solution, because always printing the p. or pp. manually is cumbersome. Feb 8, 2015 at 16:46
  • YEs, you're right, biblatex does not parse the \==
    – MaxNoe
    Feb 8, 2015 at 16:49
  • @moewe I get several hundred errors stating missing control sequence inserted by using the command you provide for my full document. I think one for each autocite command with a given page. Feb 8, 2015 at 18:35
  • did you add the command after loading extdash?
    – MaxNoe
    Feb 8, 2015 at 18:54
  • @MaxNoe Yes, I've added the extdash package as last package and after that the DeclareRangeCommands moewe mentioned. Feb 9, 2015 at 8:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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