I have a Bibliography.bib file with the following code:

  author   = "Franklin D. Lowy",
  title    = "Bacterial Classification, Structure and Function",
  url      = "https://api.semanticscholar.org/CorpusID:49963607",
  year     = 2008,
  note     = "Accessed: Columbia University",
  keywords = "Basics of Bacteria"

  author =       "Anja Freiwald
and Sascha Sauer",
  title =        "Phylogenetic classification and identification of bacteria by mass spectrometry",
  journal =      "Nat Protoc",
  volume =       "4",
  number =       "5",
  pages =        "732-742",
  year =         "2009, doi: https://doi.org/10.1038/nprot.2009.37",
  DOI =          "https://doi.org/10.1038/nprot.2009.37",
  keywords =     "Spectrometry"

I have my main.tex file with the following:

\documentclass[twoside, a4paper, 11pt]{article}
\usepackage[top=2.5cm, left=2.5cm, right=2.5cm, bottom=2.5cm, headheight=1.25cm, footskip=1.25cm, margin=1in]{geometry}



\setmainfont{Times New Roman}





{\normalfont\LARGE\bfseries}{Chapter~\thesection :}{1em}{}


    pdftitle={Comparative Study of Electronic Circuits for Bacterial Identification},
    pdfauthor={Dimitrios D. Koliouskas},


\input{Chapter 1}




I also have a Chapter 1.tex file with the following example code:

\subsection{Also an example}

\subsubsection{example no.2}

With THIS specific example in a new blank project it works as it should. BUT in my real document it does not work and my 2nd cited paper (Mass_Spectrometry) appears first in references, with the number [1], instead of second, although I mentioned first the Bacterial_Identification. I must clarify that in my real document I really do not have anything else from packages to anything. Literally the only thing that changes is the text in the document and the number of .tex files. I really do not know where the problem is.

I JUST figured that any bibliography that I cite in the following will go first in references (This is an edit and I did not include the packages for figures/tables in my main.tex):

\resizebox{1\textwidth}{!}{\includegraphics{A bacterial sample to a protein extraction and the final analysis by mass spectrometry.jpg}}
\caption{A bacterial sample subjected to a protein extraction and the final analysis by mass spectrometry. \cite{Mass_Spectrometry}}
  \label{Fig:Mass Spectrometry}

why is this happening? The funny thing is that the \cite{Bacterial_Classification} is mentioned 4 times before the above figure (1 inside the text and 3 in 3 different figures, all before the above-mentioned figure).

  • The first mentioning is in the list of figures. Use \caption[text without cite for the list of figures]{text with cite} Nov 29, 2023 at 10:24
  • 1
    There is no point in posting dozens of lines of code that no one can use as it includes files we don't have, make a small self contained example removing all packages not needed in the example. For example including minted means you need --shell-escape and I would not use --shell-escape on a document copied from the internet Nov 29, 2023 at 10:44
  • 1
    in your figure, never use \center that is part of the implementation of teh center environment, the command form is \centering and don't use \resizebox simply use width= key on the \includegraphics, wow, you really use file names like A bacterial sample to a protein extraction and the final analysis by mass spectrometry.jpg It should work in recent latex but using spaces is brave and I'm not sure I've ever seen a filename with that many spaces:-) Nov 29, 2023 at 10:46
  • 1
    @DGuys spaces are a problem because on the commandline to (say) move a file you need mv two word.jpeg new name.jpg which fails as the spaces separate the arguments, so you need mv 'two word.jpeg' 'new name.jpg' but that means when generating such commands in strings you have to be really careful with losing quotes (eg if ' is used to delimit the whole string) and things can easily go wrong. people used to GUI interfaces naturally use more spaces as those of us more used to command lines hardly ever do as even creating a file with a space in its name is more work than you want to do Nov 29, 2023 at 11:04
  • 1
    @DGuys - The former command is provided by the LaTeX kernel, whereas the latter is provided by the ragged2e package. Please read the user guide of the ragged2e package to learn about the differences between the two commands.
    – Mico
    Nov 29, 2023 at 11:24


You must log in to answer this question.

Browse other questions tagged .