Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bibunits: possible to have continuous count of references?

215 views
Skip to first unread message

Ideen

unread,
Nov 19, 2008, 2:27:33 PM11/19/08
to
I am using bibunits. My references are per section. Everything works
just fine. I use plain or unsrt bibliography styles.

I would like to have continuous labels for the references. For
example, if the first section has 15 references, I would like the
label (or the reference count) for the next section to start at 16
(not reset back to 1).

Is it possible to somehow disable the reseting procedure? If options
are not available, what about the manual change in the code (I will
copy to the local directory before changes)?

Thanks in advance, Ideen

Michael Shell

unread,
Nov 21, 2008, 12:12:28 PM11/21/08
to
On Wed, 19 Nov 2008 11:27:33 -0800 (PST)
Ideen <ps....@gmail.com> wrote:

> I am using bibunits. My references are per section. Everything works
> just fine. I use plain or unsrt bibliography styles.
>
> I would like to have continuous labels for the references. For
> example, if the first section has 15 references, I would like the
> label (or the reference count) for the next section to start at 16
> (not reset back to 1).


(Note: apologies for any repost as my original seems to be MIA.)


Ideen,

It is the class file that resets the counter. For article.cls,
just redefine thebibliography environment changing the line
in the original definition from:

\usecounter{enumiv}%

to:

\@nmbrlisttrue\def\@listctr{enumiv}%


But, this will cause a problem if the document has lists
4 levels deep as the enumiv counter would be used there
as well.

Another approach would be to use your own private counter.
Using article.cls as an example:


\documentclass[10pt]{article}

\makeatletter
\newcounter{mybibcounter}
\renewenvironment{thebibliography}[1]
{\section*{\refname}%
\@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
\list{\@biblabel{\@arabic\c@mybibcounter}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\@openbib@code
\@nmbrlisttrue\def\@listctr{mybibcounter}%
\let\p@mybibcounter\@empty
\renewcommand\themybibcounter{\@arabic\c@mybibcounter}}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist}
\makeatother


which should work great as long as no packages rely on
enumiv being the bibliography counter.


Cheers,

Mike Shell

Michael Shell

unread,
Nov 21, 2008, 12:16:45 PM11/21/08
to
On Fri, 21 Nov 2008 12:12:28 -0500
Michael Shell <ne...@michaelshell.org> wrote:

> It is the class file that resets the counter. For article.cls,
> just redefine thebibliography environment changing the line
> in the original definition from:


And by that I mean via \renewenvironment in your .tex document,
not in the original class file, of course.


Mike Shell

0 new messages