LaTeX forum ⇒ BibTeX, biblatex and biberIn-text citation: Change [1][2][3][4] to [1]-[4]

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
iceui2
Posts: 2
Joined: Sun Aug 01, 2010 10:33 pm

In-text citation: Change [1][2][3][4] to [1]-[4]

Postby iceui2 » Sun Aug 01, 2010 10:35 pm

Hey so I'm new to LaTeX and I'm having trouble changing the in-text references from [1][2][3][4] to [1]-[4].

Currently, I just add the citations like this\cite{1}\cite{2}\cite{3}\cite{4}, which produces [1][2][3][4]. What should I change so that it produces [1]-[4]? Thanks!

On a side note, is there a way to make the citations superscript instead of in regular font?

php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Postby php1ic » Mon Aug 02, 2010 12:42 am

The "cite" package will do what you want, although you will need to slightly alter how you input multiple citations.
  1. \cite{1,2,3,4}

will output [1-4]

iceui2
Posts: 2
Joined: Sun Aug 01, 2010 10:33 pm

Postby iceui2 » Mon Aug 02, 2010 3:36 am

Cool thanks. I found that I actually had to download the package from here before I could use it: ftp://indian.cse.msu.edu/pub/mirrors/CTAN/macros/latex/contrib/cite/cite.sty

And using "\usepackage[superscript]{cite}" solved the superscript problem.

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Mon Aug 02, 2010 9:20 am

Now that the problem is solved, please mark the topic accordingly as described in Section 3 of the Board Rules.


Best regards and welcome to the board
Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1


Return to “BibTeX, biblatex and biber”

Who is online

Users browsing this forum: No registered users and 4 guests