BibTeX, biblatex and biberSort&Compress Doesn't Compress

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
Eenzc
Posts: 48
Joined: Thu Jun 26, 2008 2:38 pm

Sort&Compress Doesn't Compress

Post by Eenzc »

Hello,

I use the following packages:

%%%% Citations and Reference packages
\usepackage[sort&compress]{natbib}
\usepackage{chapterbib}
\usepackage[colorlinks=true,linkcolor=blue,citecolor=green]{hyperref}


And I cite reference using the following:

\citep{ref1, ref2, ref3, ref4, ref5, ref6}


My reference appear in text as:

[1, 2, 3, 4, 5]

Not

[1-5]

As they should.

Anyone know why?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Sort&Compress Doesn't Compress

Post by gmedina »

Hi,

please provide a minimal working example that allows us to reproduce the problem.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Eenzc
Posts: 48
Joined: Thu Jun 26, 2008 2:38 pm

Sort&Compress Doesn't Compress

Post by Eenzc »

Here is as close to a MWE as you can get without me sending your my .bib file all the rest.

Code: Select all


%%%% Citations and Reference packages
\documentclass[a4paper,oneside,11pt,titlepage]{book}

\usepackage[sort&compress]{natbib}
\usepackage{chapterbib}
\usepackage[colorlinks=true,linkcolor=blue,citecolor=green]{hyperref}

\begin{document}
\mainmatter

\chaper{One}

Reference \citep{Key1, Key2, Key3, Key4}. % Key1 - 4 refer to bibtek reference keys

%%%% References at End of Chapter
\clearpage
\addcontentsline{toc}{section}{References}
\bibliographystyle{ThesisBibStyle} % My style file created using custombib
\bibliography{references} % database of my references exsists in my root dir

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}
Eenzc
Posts: 48
Joined: Thu Jun 26, 2008 2:38 pm

Re: Sort&Compress Doesn't Compress

Post by Eenzc »

I realise that the problem is to do with hyperref.

When that package isn't included, it sorts and compresses fine.

Someone suggested using \usepackage{hypernat} to make them compatable.

http://www.tex.ac.uk/tex-archive/help/C ... ernat.html

However no matter which order I include this package in it throws up errors. Probably something do to with incompatability with chapterbib.

Plz help me sort this out.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Sort&Compress Doesn't Compress

Post by localghost »

Most recent we had a similar discussion regarding cite and hyperref [1]. I worked out an example with natbib that is working for me. You may test it and report the result. I assume the chapterbib package might be the cause for the misbehaviour.

[1] View topic: hyperref and cite


Best regards
Thorsten
Post Reply