1

There are three files in the next section of code; all three should go in the same folder. The main document is bibProblem (combine document class), the import document is inputDoc1a (article class), and the bib file is the BibTeX bibliography. I am using the cite package with the sort option. (You must create the bibliography for the article using the article (inputDoc1a) and then format the main document to build the bibliography.) Notice that the two citations appear as [1,2] and [1,2] in the article and as [1,2] and [2,1] in the main document. Why are the citations not sorted when I format with the main document?

% bibProblem
\documentclass[book]{combine}
\usepackage{amsmath,amssymb,amsfonts,amsthm,times}
\usepackage{filecontents}
\usepackage{appendix}
\usepackage{blindtext}
\usepackage[sort]{cite}

% The main document
\begin{document}
\title{The collection}
\author{A. N. Editor}
\date{\today}
\maketitle

\chapter{First chapter}
\section{Introduction}
\ldots
\begin{papers}[]
    \coltoctitle{First article}\label{coltitle}
    \coltocauthor{Author of first article}
    \import{inputDoc1a}
\end{papers}
\bibliographystyle{abbrv}
\bibliography{bibliography}
\end{document} 

% inputDoc1a
\documentclass{article}
\usepackage{amsmath,amssymb,amsfonts,amsthm,times}
\usepackage{appendix}
\usepackage{blindtext}
\usepackage[sort]{cite}
\makeatletter
\@ifclassloaded{combine}
  {\let\@begindocumenthook\@empty
    }
  {}
\makeatother
\begin{document}
\title{First article}
\author{Author of first article}
\maketitle
\section{first section}
This is a problem.\index{problem}
\cite{article-minimal, article-full}
and notice that the order is reversed in the ``book.''
\cite{article-full, article-minimal}\\
\blindtext[1]
\section{Second section}
\blindtext[1-2]
\bibliographystyle{abbrv}
\bibliography{bibliography}
\appendix%\renewcommand{\thesection}{\Alph{section}}
\section{An appendix}
\blindtext[1]
\end{document}

% bibliography
@ARTICLE{article-minimal,
   author = {Thomas Price},
   title = {My article},
   journal = {Math fun facts},
   year = 1986,
}

@ARTICLE{article-full,
   author = {D.P. Story},
   title = {A better article},
   journal = {Math research facts},
   year = 1986,
   volume = 41,
   number = 7,
   pages = "73+",
   month = jul,
   note = "This is a full ARTICLE entry",
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.