Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

For my CV, I would like to reverse number publications (i.e., starting from the total number of publications all the way down to 1). Is this possible with plain LaTeX and BibTeX?

This question is similar to that one here, except that in the other thread people used biblatex, which I would like to avoid because I am looking for a simple solution that requires only minor changes. http://tex.stackexchange.com/a/22770/15319

share|improve this question
3  
Do you want just the label numbers to count downwards rather than upwards, or do you want the entire list order to be inverted? E.g., if entries are sorted alphabetically, do you want the first entry to be by Zwicky (and numbered, say, [125]) and the last one to be by Aaberg and numbered [1])? –  Mico Jun 5 '12 at 13:22
    
Hello. I just would like to have the numbering backwards. Thanks! –  Eric Jul 9 '12 at 15:06
add comment

1 Answer

up vote 11 down vote accepted

You can use the etaremune package; this requires redefining thebibliography to use it. I assume you are using the unsrt bibliography style.

\begin{filecontents*}{\jobname.bib}
@article{a,
 author={x y},
 title={a},
 journal={j},
 year=2000,
}
@article{b,
 author={x y},
 title={b},
 journal={j},
 year=2000,
}
@article{c,
 author={x y},
 title={c},
 journal={j},
 year=2000,
}
@article{d,
 author={x y},
 title={d},
 journal={j},
 year=2000,
}
\end{filecontents*}
\documentclass{article}
\usepackage{etaremune}
\makeatletter
\long\def\thebibliography#1{%
  \section*{\refname}%
  \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}
  \settowidth{\dimen0}{\@biblabel{#1}}%
  \setlength{\dimen2}{\dimen0}%
  \addtolength{\dimen2}{\labelsep}
  \sloppy
  \clubpenalty 4000 
  \@clubpenalty 
  \clubpenalty 
  \widowpenalty 4000
  \sfcode `\.\@m
  \renewcommand{\labelenumi}{\@biblabel{\theenumi}} % labels like [3], [2], [1]
  \begin{etaremune}[labelwidth=\dimen0,leftmargin=\dimen2]\@openbib@code
}
\def\endthebibliography{\end{etaremune}}
\def\@bibitem#1{%
  \item \if@filesw\immediate\write\@auxout{\string\bibcite{#1}{\the\value{enumi}}}\fi\ignorespaces
}
\makeatother

\begin{document}
\cite{a,b,c,d}

\bibliographystyle{unsrt}
\bibliography{\jobname}

\end{document}

The filecontents* environment is just to provide a mock bib file.

share|improve this answer
    
This works great, thanks! Is there a way to have the numbers appear as [3], [2], [1]... instead of 3., 2., 1.? I don't really understand the TeX you posted, so I don't quite see how to tweak it. –  Eric Dec 5 '12 at 18:10
    
@Eric I've fixed my answer to get that. –  egreg Dec 5 '12 at 18:23
    
That's superb, thanks a bunch! –  Eric Dec 5 '12 at 20:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.