Changing the order of references using bibtex to sequential

In summary, the conversation discusses sorting references in a LaTeX document and the use of different bibliography styles. The user is having trouble with the references being displayed in the wrong order and has tried using different styles, but the issue persists. They have also tried removing all auxiliary files and recompiling, but the problem remains. They provide a minimal working example and the prsty.bst file they are using.
  • #1
fluidistic
Gold Member
3,923
261
Hi people,
I'm having a very hard time to sort the references sequentially in my latex document. Right now my text is displayed as "blabla... [13] blabla... blabla... [6]" , so that I get [13] and [6] instead of [1] and [2].
I use bibtex and here's a simplification of the format I use:
Code:
\begin{document}
\bibliographystyle{unsrt}
\bibliography{source}
\end{document}
Using \bibliographystyle{unsrt} uses the same order as my source.bib file. In other words I get 13, 6 because I refer to the 13th and 6th item in my source.bib file.
I've tried to use "plain" instead of "unsrt", that changed the order but still far from 1,2,3,4,5, etc.
Any help is appreciated.
 
Physics news on Phys.org
  • #2
Try prsty.bst that is part of revtex (the APS LaTeX document class):

\bibliographystyle{prsty}
 
  • #3
  • #4
fluidistic said:
I took care of removing all .aux files
The important one is the .bbl file. In any case, you need to run latex, run bibtex, and run latex twice again for the change to take effect.
 
  • #5
DrClaude said:
The important one is the .bbl file. In any case, you need to run latex, run bibtex, and run latex twice again for the change to take effect.
Yeah in fact I removed all files but the .tex and .bst files. So all .aux, the bbl, log, etc. were removed.
And yes, that's exactly what I do: run pdflatex + bib(la)tex + pdflatex (twice) and then view pdf.
I just tried to compile under a different linux distribution, and the problem remains. The order of the references is exactly the same as in the .bib file.
 
  • #6
I could reproduce the problem with a "minimal working example".
Here's main.tex:
Code:
\documentclass[11pt,a4paper]{article}
\usepackage[margin=1in]{geometry}
\renewcommand{\refname}{Referencias}
\usepackage{cite}
\usepackage{sansmathfonts}
\usepackage[scaled]{helvet}
\renewcommand\familydefault{\sfdefault}
\usepackage[T1]{fontenc}
\DeclareMathSizes{11}{12}{7}{7}
\usepackage{hyperref}
\hypersetup{
  colorlinks=true,
  linktoc=all, 
  linkcolor=blue,
}
\title{
   {The big problem} \\
   {\large Stuff}
   }
\author{the tester}
\date{2016}
\bibliographystyle{prsty}
\begin{document}
\maketitle
\newpage
\pagestyle{plain}

\nocite{*}

\include{introduction}
\bibliography{referencias}
\end{document}
Here's referencias.bib:
Code:
@article{ author1,
   author = "tester1",
   journal = "Big bug",
   volume = "3",
   title = "How to run into bugs.",
   publisher = "{EDP} {S}ciences",
   pages = "131--148",
   year = "1998"}

@article{ author2,
  author = "tester2",
  title = "Please do bug",
   journal = "The huge bug.",
   pages ={133--267}, 
   year = "2018" }

@article{ author3,
  author = "the non bug",
   journal = "troubling bugs",
  title = "how to find bugs",
  year = "2014" }

@book{ author4,
  author = "bugs and bunny",
  title = "Introduction to bug materials",
   edition = "2nd",
   year="2009",
   publisher="wild bug" }

@inbook{ author5,
   editor = "never trust a bug",
   title = "How I created a bug",
   publisher = "Living on bugs.",
   pages = "51",
   year = "2005"}
Here's introduction.tex:
Code:
blabla \cite{author2} $\leftarrow$ should be [1]. While blablabla \cite{author1} $\leftarrow$ should be [2].

Now \cite{author5} should be [3] (and not [5]. Let's see if the problem appears with this minimal example.
Here's prsty.bst:
Code:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  begin prsty.bst  %
%  version 3.0  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  %
%  This file is part of the APS files in the REVTeX 3.0 distribution.  %
%  Version 3.0 of REVTeX, November 10, 1992.  %
%  %
%  Copyright (c) 1992 The American Physical Society.  %
%  %
%  See the REVTeX 3.0 README file for restrictions and more information.  %
%  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  This is a bibtex style file to produce Physical-Review--style  %
%  references for inclusion in LaTeX/REVTeX documents.  %
%  Main problem: crossref handling is terrible  %
%  Some documentation is available (e-mail below)  %
%  Contact: C. Hamlin, mis@aps.org  (Internet)  %
%  mis@apsedoff (bitnet)  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

ENTRY
  { address
  author
  booktitle
  chapter
  edition
  editor
  howpublished
  institution
  journal
  key
  month
  note
  number
  organization
  pages
  publisher
  school
  series
  title
  type
  volume
  year
  }
  {}
  { label }INTEGERS { vol.used i.temp }

STRINGS { s t }
FUNCTION {output}
{ duplicate$ empty$
  'pop$
  'write$
  if$
}

% Note: nothing left on stack for future processing in bibitem.
FUNCTION {output.bibitem}
{ newline$
  "\bibitem{" write$
  cite$ write$
  "}" write$
  newline$
}

FUNCTION {fin.entry}
{ add.period$
  write$
  newline$
}

FUNCTION {not}
{  { #0 }
  { #1 }
  if$
}

FUNCTION {and}
{  'skip$
  { pop$ #0 }
  if$
}

FUNCTION {or}
{  { pop$ #1 }
  'skip$
  if$
}

FUNCTION {field.or.null}
{ duplicate$ empty$
  { pop$ "" }
  'skip$
  if$
}

FUNCTION {emphasize}
{ duplicate$ empty$
  { pop$ "" }
  { "{\em " swap$ * "}" * }
  if$
}

FUNCTION {embolden}
{ duplicate$ empty$
  { pop$ "" }
  { "{\bf " swap$ * "}" * }
  if$
}

FUNCTION {paren}
{ duplicate$ empty$
  { pop$ "" }
  { "(" swap$ * ")" * }
  if$
}

INTEGERS { nameptr namesleft numnames }
INTEGERS { etal }

FUNCTION {format.names}
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames #4 >
  s numnames "{ll}" format.name$ "others" = numnames #1 > and
  or 'etal :=
  etal
  { #1 #1 + 'namesleft := }
  { numnames 'namesleft := }
  if$
  { namesleft #0 > }
  { s nameptr "{f. }{vv~}{ll}{, jj}" format.name$ 't :=
  nameptr #1 >
  { namesleft #1 >
  { ", " * t * }
  { nameptr #2 >
  { "," * }
  'skip$
  if$
  t "others" =
  etal or
  { " {\it et~al.}" * }
  { " and " * t * }
  if$
  }
  if$
  }
  't
  if$
  nameptr #1 + 'nameptr :=
  namesleft #1 - 'namesleft :=
  }
  while$
}

FUNCTION {format.authors}
{ author empty$
  { "" }
  { author format.names }
  if$
}

FUNCTION {format.edited}
{ editor empty$
  { "" }
  { "edited by " editor format.names * }
  if$
}

FUNCTION {format.title}
{ title empty$
  { "" }
  'title
  if$
}

FUNCTION {lc.first.letter}
{ 't :=
  ""
  t #1 #1 substring$
  "l" change.case$ *
  t #2 global.max$ substring$
  *
}

FUNCTION {n.dashify}
{ 't :=
  ""
  { t empty$ not }
  { t #1 #1 substring$ "-" =
  { t #1 #2 substring$ "--" = not
  { "--" *
  t #2 global.max$ substring$ 't :=
  }
  {  { t #1 #1 substring$ "-" = }
  { "-" *
  t #2 global.max$ substring$ 't :=
  }
  while$
  }
  if$
  }
  { t #1 #1 substring$ *
  t #2 global.max$ substring$ 't :=
  }
  if$
  }
  while$
}FUNCTION {first.page}
{ 't :=
  ""
  {  t empty$ not t #1 #1 substring$ "-" = not and }
  { t #1 #1 substring$ *
  t #2 global.max$ substring$ 't :=
  }
  while$
}

FUNCTION {format.date}
{ year empty$
  { "" }
  'year
  if$
}

FUNCTION {format.btitle}
{ title emphasize }

FUNCTION {tie.or.space.connect}
{ duplicate$ text.length$ #3 <
  { "~" }
  { " " }
  if$
  swap$ * *
}

FUNCTION {either.or.check}
{ empty$
  'pop$
  { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  if$
}

INTEGERS { multiresult }

FUNCTION {multi.page.check}
{ 't :=
  #0 'multiresult :=
  { multiresult not
  t empty$ not
  and
  }
  { t #1 #1 substring$
  duplicate$ "-" =
  swap$ duplicate$ "," =
  swap$ "+" =
  or or
  { #1 'multiresult := }
  { t #2 global.max$ substring$ 't := }
  if$
  }
  while$
  multiresult
}FUNCTION {format.pages}
{ pages empty$
  { "" }
  { pages multi.page.check
  { "pp.\ " pages n.dashify * }
  { "p.\ " pages * }
  if$
  }
  if$
}

FUNCTION {format.pages.a}
{ pages empty$
  { "" }
  { "page" pages first.page tie.or.space.connect }
  if$
}

FUNCTION {format.vol.num.pages}
{ volume field.or.null embolden
  " " swap$ * *
  pages empty$
  'skip$
  { duplicate$ empty$
  { pop$ format.pages.a }
  { ", " * pages first.page * }
  if$
  }
  if$
}

FUNCTION {if.comma}
{  { ", " * }
  'skip$
  if$
}

% pushes "" if value passed is empty$
FUNCTION {push.string}
{ 'i.temp :=
  duplicate$ empty$
  { pop$ "" }
  { i.temp if.comma }
  if$
}

% pushes "" if value passed is empty$
FUNCTION {push.string.check}
{ 'i.temp :=
  duplicate$ empty$
  { pop$ "Warning: " swap$ * " missing in entry " cite$ "." * * * warning$
  ""
  }
  { swap$ pop$ i.temp if.comma }
  if$
}

% adds nothing if value passed is empty$
FUNCTION {add.string}
{ 'i.temp :=
  duplicate$ empty$
  { pop$ }
  { * i.temp if.comma }
  if$
}

% adds nothing if value passed is empty$
FUNCTION {add.string.check}
{ 'i.temp :=
  duplicate$ empty$
  { pop$ "Warning: " swap$ * " missing in entry " cite$ "." * * * warning$ }
  { swap$ pop$ *
  i.temp if.comma
  }
  if$
}

FUNCTION {format.vol.page}
{ "volume" volume embolden #1 push.string.check
  " " *
  "pages" pages field.or.null first.page #0 add.string.check
  " " *
}

FUNCTION {empty.misc.check}
{ author empty$ title empty$ howpublished empty$
  year empty$ note empty$ and and and and
  { "All relevant fields are empty in " cite$ * warning$ }
  'skip$
  if$
}

FUNCTION {format.thesis.type}
{ type empty$
  'skip$
  { pop$
  type "t" change.case$
  }
  if$
}

FUNCTION {format.tr.number}
{ type empty$
  { "Technical Report" }
  'type
  if$
  number empty$
  { "t" change.case$ }
  { type empty$
  { " No.~" * }
  { " " * }
  if$
  number *
  }
  if$
}FUNCTION {format.etc}
{ vol.used
  'skip$
  { number empty$
  { volume empty$
  'skip$
  { "Vol.~" volume * *
  chapter empty$ pages empty$ note empty$ and and
  'skip$
  { ", " * }
  if$
  }
  if$
  }
  { "No.~" number * *
  chapter empty$ pages empty$ note empty$ and and
  'skip$
  { ", " * }
  if$
  }
  if$
  }
  if$
  chapter empty$
  'skip$
  { type empty$
  { "Chap.~" chapter * * }
  { type "u" change.case$ "l" change.case$ " " chapter * * * }
  if$
  pages empty$ note empty$ and
  'skip$
  { ", " * }
  if$
  }
  if$
  pages empty$
  'skip$
  { format.pages *
  note empty$
  'skip$
  { ", " * }
  if$
  }
  if$
  note empty$
  'skip$
  { note lc.first.letter * }
  if$
}FUNCTION {format.pub.add.year.etc}
{ " ("
  publisher empty$
  { "PUBLISHER" "No publisher for entry " cite$ "." * * warning$ }
  { publisher }
  if$
  ", " * *
  address empty$
  { "ADDRESS" "Missing address in entry " cite$ * "." * warning$ }
  { address }
  if$
  ", " * *
  year empty$
  { "YEAR" }
  'year
  if$
  ")" * *
  volume empty$ not number empty$ not or title empty$ series empty$ or and
  chapter empty$ not or
  pages empty$ not or type empty$ not or note empty$ not or
  { ", " *
  format.etc
  }
  'skip$
  if$
}

FUNCTION {format.bedition}
{ edition empty$
  { "" }
  { edition "l" change.case$
  duplicate$ "first" =
  { pop$ "1st " }
  { duplicate$ "second" =
  { pop$ "2nd " }
  { duplicate$ "third" =
  { pop$ "3rd " }
  'skip$
  if$
  }
  if$
  }
  if$
  " ed." *
  }
  if$
}

FUNCTION {format.title.and.series.and.org}
{ #0 'vol.used :=
  ""
  duplicate$ 's :=
  title empty$
  'skip$
  { title 's := }
  if$
  booktitle empty$
  'skip$
  { booktitle 's := }
  if$
  s empty$
  'skip$
  { type$ "inproceedings" = type$ "proceedings" = or type$ "inbook" = or
  { " in " * }
  { author empty$ not editor empty$ not and
  { " in " * }
  'skip$
  if$
  }
  if$
  s emphasize
  series empty$ editor empty$ edition empty$ and and not
  type$ "inproceedings" =  organization empty$ not  and
  type$ "proceedings"  =  organization empty$ not  and or  or
  add.string
  }
  if$
  series empty$
  'skip$
  { s empty$
  'skip$
  { number empty$
  { volume empty$
  'skip$
  { "Vol.~" volume " of " * * * #1 'vol.used := }
  if$
  }
  { "No.~" number " in " * * * #1 'vol.used := }
  if$
  }
  if$
  series emphasize
  edition empty$ not
  editor empty$ not
  type$ "inproceedings" =  organization empty$ not  and
  type$ "proceedings" =  organization empty$ not  and
  or  or  or
  add.string
  }
  if$
  type$ "inproceedings" =  type$ "proceedings" =  or
  { organization empty$
  'skip$
  { organization editor empty$ edition empty$ and not add.string }
  if$
  }
  'skip$
  if$
}FUNCTION {article}
{ output.bibitem
  "author" format.authors #1 push.string.check
  "journal" journal #0 add.string.check " " *
  output
  format.vol.page #0 push.string
  " " *
  "date" format.date paren #0 add.string.check
  note empty$
  'skip$
  { ", " * note lc.first.letter * }
  if$
  fin.entry
  crossref empty$
  'skip$
  { "See Ref.\ \cite{" crossref "}." * * write$ newline$ }
  if$
}

FUNCTION {book}
{ output.bibitem
  format.authors #1 push.string
  "title" format.title.and.series.and.org #0 add.string.check
  format.bedition editor empty$ not add.string
  output
  format.edited #0 push.string
  format.pub.add.year.etc #0 add.string
  fin.entry
  crossref empty$
  'skip$
  { "See Ref.\ \cite{" crossref "}." * * write$ newline$ }
  if$
}

FUNCTION {booklet}
{ output.bibitem
  format.authors #1 push.string
  "title" format.title #0 add.string.check
  howpublished empty$
  'skip$
  { ", " howpublished * * }
  if$
  address empty$
  'skip$
  { ", " address * * }
  if$
  year empty$
  'skip$
  { " (" year ")" * * * }
  if$
  note empty$
  'skip$
  { ", " note  lc.first.letter * * }
  if$
  fin.entry
}

FUNCTION {inbook} { book }

FUNCTION {incollection} { book }

FUNCTION {inproceedings}{ book }

FUNCTION {proceedings} { book }

FUNCTION {conference} { book }
FUNCTION {manual}
{ output.bibitem
  ""
  author empty$
  'skip$
  { format.authors #1 add.string }
  if$
  format.btitle
  edition empty$ address empty$ organization empty$ year empty$ note empty$
  and and and and not
  add.string
  edition empty$
  'skip$
  { format.bedition
  organization empty$ address empty$ year empty$ note empty$
  and and and not
  add.string
  }
  if$
  organization empty$
  'skip$
  { organization
  address empty$ year empty$ note empty$ and and not
  add.string
  }
  if$
  address empty$
  'skip$
  { address  year empty$ note empty$ and not  add.string }
  if$
  year empty$
  'skip$
  { year  note empty$ not  add.string }
  if$
  note empty$
  'skip$
  { note lc.first.letter #0 add.string }
  if$
  fin.entry
}

FUNCTION {mastersthesis}
{ output.bibitem
  "author" format.authors #1 push.string.check
  title empty$
  'skip$
  { "We don't use thesis titles in Phys. Rev, see \cite{"
  cite$ "}" * * warning$
  }
  if$
  "Master's thesis" format.thesis.type  #1  add.string
  "school"  school  #1  add.string.check
  address #1 add.string
  "year" format.date  note empty$ not  add.string.check
  note empty$
  'skip$
  { note lc.first.letter * }
  if$
  fin.entry
}

FUNCTION {phdthesis}
{ output.bibitem
  "author" format.authors #1 push.string.check
  title empty$
  'skip$
  { "We don't use thesis titles in Phys. Rev, see \cite{"
  cite$ "}" * * warning$
  }
  if$
  "Ph.D. thesis" format.thesis.type  #1  add.string
  "school"  school  #1  add.string.check
  address #1 add.string
  "year" format.date  note empty$ not  add.string.check
  note empty$
  'skip$
  { note lc.first.letter * }
  if$
  fin.entry
}

FUNCTION {misc}
{ output.bibitem
  format.authors
  title empty$ howpublished empty$
  year empty$ note empty$ and and and not push.string
  format.title
  howpublished empty$ year empty$ note empty$
  and and not add.string
  howpublished
  year empty$ note empty$ and not add.string
  format.date note empty$ not add.string
  note empty$
  'skip$
  { note
  author empty$ title empty$ howpublished empty$
  year empty$ and and and
  'skip$
  'lc.first.letter
  if$
  #0 add.string
  }
  if$
  fin.entry
  empty.misc.check
}FUNCTION {techreport}
{ output.bibitem
  "author" format.authors #1 push.string.check
  title empty$
  'skip$
  { "We chuck the title of techreports in Phys. Rev.---\cite{"
  cite$ "}." * * warning$
  }
  if$
  format.tr.number
  institution empty$ address empty$ note empty$ and and not add.string
  "institution"  institution  address empty$ note empty$ and not
  add.string.check
  address #0 add.string
  " (unpublished)" note empty$ not add.string
  note empty$
  'skip$
  { note lc.first.letter * }
  if$
  fin.entry
}
FUNCTION {unpublished}
{ output.bibitem
  "author" format.authors  note empty$ not  push.string.check
  note empty$
  'skip$
  { note lc.first.letter #0 add.string }
  if$
  " (unpublished)" *
  fin.entry
}

FUNCTION {default.type} { misc }

MACRO {jan} {"January"}
MACRO {feb} {"February"}
MACRO {mar} {"March"}
MACRO {apr} {"April"}
MACRO {may} {"May"}
MACRO {jun} {"June"}
MACRO {jul} {"July"}
MACRO {aug} {"August"}
MACRO {sep} {"September"}
MACRO {oct} {"October"}
MACRO {nov} {"November"}
MACRO {dec} {"December"}
MACRO {acmcs} {"ACM Comput. Surv."}
MACRO {acta} {"Acta Inf."}
MACRO {applopt} {"Appl. Opt."}
MACRO {cacm} {"Commun. ACM"}
MACRO {ibmjrd} {"IBM J. Res. Dev."}
MACRO {ibmsj} {"IBM Syst.~J."}
MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
MACRO {ieeetc} {"IEEE Trans. Comput."}
MACRO {ieeetcad}
{"IEEE Trans. Comput.-Aided Design Integrated Circuits"}
MACRO {ipl} {"Inf. Process. Lett."}
MACRO {jacm} {"J.~ACM"}
MACRO {jcss} {"J.~Comput. Syst. Sci."}
MACRO {scp} {"Sci. Comput. Programming"}
MACRO {sicomp} {"SIAM J. Comput."}
MACRO {tocs} {"ACM Trans. Comput. Syst."}
MACRO {tods} {"ACM Trans. Database Syst."}
MACRO {tog} {"ACM Trans. Gr."}
MACRO {toms} {"ACM Trans. Math. Softw."}
MACRO {toois} {"ACM Trans. Office Inf. Syst."}
MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}
MACRO {tcs} {"Theor. Comput. Sci."}
MACRO {anp} {"Adv. Nucl. Phys."}
MACRO {ap} {"Ann. Phys."}
MACRO {arnpc} {"Annu. Rev. Nucl. Part. Sci."}
MACRO {baps} {"Bull. Am. Phys. Soc."}
MACRO {cp} {"Computers Phys."}
MACRO {jp} {"J. Phys."}
MACRO {josa} {"J. Opt. Soc. Am."}
MACRO {josaa} {"J. Opt. Soc. Am. A"}
MACRO {josab} {"J. Opt. Soc. Am. B"}
MACRO {nim} {"Nucl. Instrum. Meth."}
MACRO {np} {"Nucl. Phys."}
MACRO {rmp} {"Rev. Mod. Phys."}
MACRO {physica} {"Physica"}
MACRO {pl} {"Phys. Lett."}
MACRO {plb} {"Phys. Lett. B"}
MACRO {pr} {"Phys. Rev."}
MACRO {pra} {"Phys. Rev. A"}
MACRO {prb} {"Phys. Rev. B"}
MACRO {prc} {"Phys. Rev. C"}
MACRO {prd} {"Phys. Rev. D"}
MACRO {pre} {"Phys. Rev. E"}
MACRO {prl} {"Phys. Rev. Lett."}
MACRO {prep} {"Phys. Rep."}
MACRO {ps} {"Phys. Scr."}
MACRO {rpp} {"Rep. Prog. Phys."}
MACRO {sjnp} {"Sov. J. Nucl. Phys."}
MACRO {springmp} {"Springer Tracts in Modern Physics"}
MACRO {yadfiz} {"Yad. Fiz."}
MACRO {zp} {"Z. Phys."}
READ

STRINGS { longest.label }
INTEGERS { number.label longest.label.width }
FUNCTION {initialize.longest.label}
{ "" 'longest.label :=
  #1 'number.label :=
  #0 'longest.label.width :=
}
FUNCTION {longest.label.pass}
{ number.label int.to.str$ 'label :=
  number.label #1 + 'number.label :=
  label width$ longest.label.width >
  { label 'longest.label :=
  label width$ 'longest.label.width :=
  }
  'skip$
  if$
}
EXECUTE {initialize.longest.label}
ITERATE {longest.label.pass}

FUNCTION {begin.bib}
{ preamble$ empty$
  'skip$
  { preamble$ write$ newline$ }
  if$
  "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
}

EXECUTE {begin.bib}

ITERATE {call.type$}

FUNCTION {end.bib}
{ newline$
  "\end{thebibliography}" write$ newline$
}
EXECUTE {end.bib}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  end prsty.bst  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Here's the screenshot of the problem:
j5ejIU0.png
Edit: Someone is telling me it's because I use \nocite. Commenting that line indeed get rids of the problem, but now I have less references at the end of the document. In many papers I've seen, they only cite a few references and they have a large list of references at the end of the document. How do they reach this?
 
Last edited:
  • #7
The problem is the \nocite{*}. This puts all the entries that are in the bib file in the bibliography, in order of appearance in the file. If you want to still use nocite, you need to move it to the very end of main.tex, just before the bibliography. It will then load all the remaining entries in the bib file after those that have already been cited.
 
  • Like
Likes fluidistic
  • #8
DrClaude said:
The problem is the \nocite{*}. This puts all the entries that are in the bib file in the bibliography, in order of appearance in the file. If you want to still use nocite, you need to move it to the very end of main.tex, just before the bibliography. It will then load all the remaining entries in the bib file after those that have already been cited.
Thank you very much. Problem solved.
 

1. What is bibtex and why is it used for referencing?

Bibtex is a software tool used for managing and formatting references in documents, particularly in scientific fields. It allows for the easy creation of a bibliography with proper formatting and citation styles. Bibtex is commonly used because it automates the process of creating and organizing references, saving time and ensuring accuracy.

2. How do I change the order of references using bibtex?

To change the order of references in bibtex, you can use the \bibliographystyle command to specify the desired citation style. Different citation styles may have different rules for ordering references, so it is important to choose the appropriate style for your document. You can also manually rearrange the order of references in your .bib file.

3. Can I change the order of references to be sequential?

Yes, it is possible to change the order of references to be sequential using bibtex. This means that the references will be listed in the order in which they appear in your document, rather than being sorted alphabetically or in another specific order. To do this, you can use the \bibliographystyle{unsrt} command, which stands for "unsorted" references.

4. How do I format the sequential order of references in bibtex?

In order to format the sequential order of references in bibtex, you can use the \bibliographystyle{unsrt} command and then specify any additional formatting options you want using the \bibliography command. This can include things like adding a title, changing the font, or adding a table of contents. It is important to consult the specific citation style guide you are using for any required formatting guidelines.

5. What should I do if my references are not appearing in sequential order?

If your references are not appearing in sequential order, it is likely due to the use of a different citation style in your document. Make sure that you have specified the \bibliographystyle{unsrt} command in your document and that all references are properly formatted in your .bib file. If you are still having issues, consult the bibtex documentation or seek assistance from a colleague or librarian.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
9K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
Back
Top