[Tex/LaTex] How to control the order of fields in bibtex

bibliographiesbibtex

I have a bibtex entries like this:

@inproceedings{x1,
  author    = {Dave Madengly and Johny Depp},
  title     = "{Using new Context}",
  booktitle = {Proceedings of 1st Conference of the XXX (XXX' 01)},
  year      = {2001},
  crossref  = {2},
  pages     ="12 -- 20",
}

@proceedings{x2,
  editor    = {John Doe},
  title     = {XXX 2001, Proceedings},
  booktitle = {Proceedings of 1st Conference of the XXX},
  publisher = {The XXXX},
  address =  {USA},
  year      = {2001}
}

and using plain bibliography style. The problem is that the publisher appears at the end. What I want is that the name of publisher appears before the page numbers. How can I do it?

Best Answer

Please always post complete documents that show the problem. You need to modify a copy of bst file.

enter image description here

\begin{filecontents}{xx.bib}
@inproceedings{x1,
  author    = {Dave Madengly and Johny Depp},
  title     = "{Using new Context}",
  booktitle = {Proceedings of 1st Conference of the XXX (XXX' 01)},
  year      = {2001},
  crossref  = {x2},
  pages     ="12 -- 20",
}

@proceedings{x2,
  editor    = {John Doe},
  title     = {XXX 2001, Proceedings},
  booktitle = {Proceedings of 1st Conference of the XXX},
  publisher = {The XXXX},
  address =  {USA},
  year      = {2001}
}
\end{filecontents}

\documentclass{article}
\begin{document}
\cite{x1}
\bibliographystyle{myplain}
\bibliography{xx}
\end{document}

where myplain.bst is a copy of plain.bst with `inproceedings changed to:

FUNCTION {inproceedings}
{ output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    { format.in.ed.booktitle "booktitle" output.check
      format.bvolume output
      format.number.series output
      address empty$
        { organization publisher new.sentence.checkb
          organization output
          publisher output
          format.date "year" output.check
        }
        { address output.nonnull
          format.date "year" output.check
          new.sentence
          organization output
          publisher output
        }
      if$
      format.pages output
    }
    { format.incoll.inproc.crossref output.nonnull
      format.pages output
    }
  if$
  new.block
  note output
  fin.entry
}

ie the position of format.pages output is moved.