🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #10338

Re: citation style

#10338
From: Werenfried Spit
Date: Tue, 18 Jun 1991 13:31
28 lines
1887 bytes
In <muzic.677244536@ds2.uh.cwru.edu> muzic@ds2.uh.cwru.edu (Ray Muzic) writes:

>I am using the unsrt bibliography style for a manuscript.  In several
>places, I cite a group of references and get, for example, `[1,2,3,4,5,8]'.
>Does anyone have a style file that would abbreviate this to something
>like `[1-5,8]'.

% Collapse citation numbers to ranges.  Non-numeric and undefined labels
% are handled.  No sorting is done.  E.g., 1,3,2,3,4,5,foo,1,2,3,?,4,5
% gives 1,3,2-5,foo,1-3,?,4,5
\newcount\@tempcntc
\def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
  \@tempcnta\z@\@tempcntb\m@ne\def\@citea{}\@cite{\@for\@citeb:=#2\do
    {\@ifundefined
       {b@\@citeb}{\@citeo\@tempcntb\m@ne\@citea\def\@citea{,}{\bf ?}\@warning
       {Citation `\@citeb' on page \thepage \space undefined}}%
    {\setbox\z@\hbox{\global\@tempcntc0\csname b@\@citeb\endcsname\relax}%
     \ifnum\@tempcntc=\z@ \@citeo\@tempcntb\m@ne
       \@citea\def\@citea{,}\hbox{\csname b@\@citeb\endcsname}%
     \else
      \advance\@tempcntb\@ne
      \ifnum\@tempcntb=\@tempcntc
      \else\advance\@tempcntb\m@ne\@citeo
      \@tempcnta\@tempcntc\@tempcntb\@tempcntc\fi\fi}}\@citeo}{#1}}
\def\@citeo{\ifnum\@tempcnta>\@tempcntb\else\@citea\def\@citea{,}%
  \ifnum\@tempcnta=\@tempcntb\the\@tempcnta\else
   {\advance\@tempcnta\@ne\ifnum\@tempcnta=\@tempcntb \else \def\@citea{--}\fi
    \advance\@tempcnta\m@ne\the\@tempcnta\@citea\the\@tempcntb}\fi\fi}
Technical Details
Message-ID: <1991Jun18.133119.1914@fys.ruu.nl>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!mcsun!hp4nl!alchemy!ruunfs!spit
References: <muzic.677244536@ds2.uh.cwru.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!mcsun!hp4nl!alchemy!ruunfs!spit
From: spit@fys.ruu.nl (Werenfried Spit)
Newsgroups: comp.text.tex
Subject: Re: citation style
Message-ID: <1991Jun18.133119.1914@fys.ruu.nl>
Date: 18 Jun 91 13:31:19 GMT
References: <muzic.677244536@ds2.uh.cwru.edu>
Organization: Physics Department, University of Utrecht
Lines: 28