3

I have a very long list of citations in my TeX file. Rather than each bibliographic key appearing in the list, I would like a range of values, e.g. given

\cite{ref1,ref2,ref3,ref4}

I get

[1,2,3,4]

but would prefer

[1-4].

I am using TeX + Eplain + BibTeX. Any suggestions? I have tried using a few LaTeX packages (cite,mcite, and natbib), but (unsurprisingly) they all fail to load.

4
  • 1
    Have you already checked tex.stackexchange.com/questions/3871/…?
    – Nico
    Commented Feb 7, 2014 at 16:40
  • Have you tried loading the cite package using an \input statement, i.e., as \input cite.sty %?
    – Mico
    Commented Feb 7, 2014 at 23:01
  • @Nico That post doesn't really work here as I am using plain TeX as opposed to LaTeX.
    – Doug Moore
    Commented Feb 8, 2014 at 5:03
  • @Mico That doesn't work as cite.sty is a LaTeX package and so it has macros that are not defined in TeX.
    – Doug Moore
    Commented Feb 8, 2014 at 5:04

2 Answers 2

2

OPmac is plainTeX specific. You can use it. See this page.

\input opmac-bib

\sortcitations  % the cites are sorted in each \cite[a,b,c,d]
\shortcitations % the intervals [a--d] instead [a,b,c,d] are printed

Here is \cite[white,texbook,nierhaus,lech]
and \cite[demay,rowling].

\nonum\sec References

\rightskip=0em plus 5em
\usebib/s (iso690) op-example % op-example.bib plus iso690 bib style is used

\bye

The op-example.bib, opmac-bib.tex, opmac.tex and opmac-bib-iso690.tex files were used from this page (see the end of the page). You can try to process this example by pdftex document twice. No bibTeX is needed. All processing is done at TeX level. The result:

enter image description here

0

If you compile with (pdf) latex, you can use biblatex with its numeric-comp or numeric-icomp citation styles ("comp" is for "compact"; choice to be given as an option in the preamble) together with the \cites and its siblings commands.

See the details in §3.3.1 and 3.7.3 of the documentation.

3
  • 1
    Note that OP uses plain TeX with eplain, not LaTeX.
    – morbusg
    Commented Feb 7, 2014 at 20:58
  • That's precisely why I wrote: if you compile with (pdf)latex, thereby meaning "perhaps you should consider using (pdf)latex". As far as I understand it, neither natbib nor (m)cite are plaintex sets of macros.
    – Bernard
    Commented Feb 7, 2014 at 21:24
  • @Bernard You are right at natbib and mcite are LaTeX specific. They won't work for me here.
    – Doug Moore
    Commented Feb 8, 2014 at 5:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .