summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-citesort.html
blob: 2dcdbe3e67d688813e116b154a066afb15c9e24c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<head>
<title>UK TeX FAQ -- question label citesort</title>
</head><body>
<h3>Sorting and compressing citations</h3>
<p/>If you give LaTeX
<code>\</code><code>cite{fred,joe,harry,min}</code>, its default commands could give
something like &#8220;[2,6,4,3]&#8221;;
this looks awful.  One can of course get the things in order by
rearranging the keys in the <code>\</code><code>cite</code> command, but who wants to do
that sort of thing for no more improvement than &#8220;[2,3,4,6]&#8221;?
<p/>The <i>cite</i> package sorts the numbers and detects consecutive
sequences, so creating &#8220;[2&#8211;4,6]&#8221;.  The <i>natbib</i> package,
with the <code>numbers</code> and <code>sort&#38;compress</code> options, will
do the same when working with its own numeric bibliography styles
(<i>plainnat.bst</i> and <i>unsrtnat.bst</i>).
<p/>Both <i>cite</i> and <i>natbib</i> will interwork with
<i>hyperref</i>, thus making links to the bibliography for 
<dl>
<dt><tt><i>cite.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/cite.zip">macros/latex/contrib/cite</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/cite/">browse the directory</a>)
<dt><tt><i>hypernat.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/hypernat.zip">macros/latex/contrib/hypernat</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/hypernat/">browse the directory</a>)
<dt><tt><i>hyperref.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/hyperref.zip">macros/latex/contrib/hyperref</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/hyperref/">browse the directory</a>)
<dt><tt><i>plainnat.bst</i></tt><dd>Distributed with <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/natbib.zip">macros/latex/contrib/natbib</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/natbib/">browse the directory</a>)
<dt><tt><i>unsrtnat.bst</i></tt><dd>Distributed with <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/natbib.zip">macros/latex/contrib/natbib</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/natbib/">browse the directory</a>)
</dl>
<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=citesort">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=citesort</a>
</body>