0

I have a well-known problem in LaTeX, even though my case seems to be a little bit special. I've tried all the possible solutions suggested at "StackExchange" and elsewhere but I didn't succeed to solve it.

Actually, I am working on a paper and I've typed all the references using the 'biblatex' package. Once I printed them, I found that they are not in order in the text (e.g. what is supposed to be [2] is mentioned as [17], etc.). I've checked some solutions on the net such as replacing \printbibliography with \bibliographystyle{unsrt} followed by \bibliography{} (with the name of the .bib file inside without the extension) among many others, but all of them failed! To understand what I've done, I will attach a part of my .bib file's code.

@misc{NobelFermi,
author = {NobelPrize.org. Nobel Prize Outreach AB 2022},
title = {Enrico Fermi – Biographical},
 %year = {2022},
%note = {Last accessed January 2022},
url = {https://www.nobelprize.org/prizes/physics/1938/fermi/biographical/}
}
\\
 @article{LucaNanni,
title={Fermi’s theory of beta decay: a first attempt at electroweak unification},
author={Luca Nanni},
journal={Advanced Studies in Theoretical Physics},
volume={13},
number={6},
pages={281--293},
year={2019},
publisher={Hikari Ltd},
doi={https://doi.org/10.12988/astp.2019.8939}
}

And in the text, I've used the \cite commands. And below, I attach the preamble of my .tex file...

\documentclass[eqn,10pt]{SelfArx} % Document font size and equations flushed left
\usepackage[english]{babel} % Specify a different language here - english by default
\usepackage[utf8]{inputenc}
\usepackage[document]{ragged2e}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{titlesec}
\usepackage{epigraph}
\usepackage[autostyle]{csquotes}
\usepackage[latin1]{inputenc}
\usepackage{caption}
\usepackage{wrapfig}
\usepackage{color}
\usepackage{multicol}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{amsbsy}
\usepackage{lettrine} %For the enlarged capital letter in the beginning 
\NoAutoSpaceBeforeFDP
\usepackage{mathrsfs} %For the mathematical font style "mathscr"
\usepackage{xcolor}
\usepackage{biblatex} %For citation
\usepackage{url} %for the URL of websites  
\addbibresource{Ref.bib} %To add Ref.bib file

And at the end of the document, I put this command...

\printbibliography

And the generated document looks like this...(The colored numbers in red are the "logical" order of references which I wrote myself to verify their ordering in the text). Capture of a part of the text

The result seems chaotic as you can see.

19
  • 5
    you have not given any information that would allow anyone to answer your question. The bibliography style (which you have not mentioned) will specify the entries are ordered in order of reference or alphabetic order of author. Please ask the question about commas as a separate question, again add an example so that it is understantable. \big is a math mode command, perhaps you want \large ? But it is hard to guess what you did or what error you got. Jun 3, 2022 at 19:06
  • 5
    I'm probably being dense, but what is an "English comma"? From what you're describing, it doesn't seem to be the "Oxford comma" (the comma before "and" in a series), and I can't think of anything else. Jun 3, 2022 at 19:37
  • 2
    @Astro97 no sorry you need to provide an example as text, I am not going to try to debug fragments of code shown as an image. Jun 4, 2022 at 21:56
  • 3
    @Astro97 -- Now I understand. What you have called "English commas" are known in (US) English as opening and closing double quotes. On another matter, what you have called your ".tex" file actually has the format of a .bib file, and as pointed out elsewhere, % is not recognized as a comment. The lines that have no data should instead be removed. I don't remember whether such lines will result in errors in the .blg file (the error log from bibtex), but they will certainly cause problems. Also, remove the \\ lines, leaving a blank line instead. Jun 5, 2022 at 0:16
  • 1
    MWE = Minimal Working Example, i.e. a reduced example that actually compiles and shows the problem you are having. (Just follow the link I posted above.) Also, please do post actual code, not screenshots. And, again, consider to ask the second issue (the one about the quotation marks) in a separate posting.
    – Ingmar
    Jun 5, 2022 at 6:47

1 Answer 1

1

The comment thread has gotten entirely too long … I am posting an example of what I think you might be wanting, even though it's impossible to tell without a proper MWE:

\documentclass{article}

% Only for debugging. If you provide your own .bib file just
% remove the filecontents part and don't forget to change 
% \addbibresource{mwe.bib} below.

\begin{filecontents*}[overwrite]{mwe.bib} 

@misc{NobelFermi,
    title        = {Enrico Fermi – Biographical},
    author       = {NobelPrize.org. Nobel Prize Outreach AB 2022},
    year         = 2022,
    url          = {https://www.nobelprize.org/prizes/physics/1938/fermi/biographical/},
    note         = {Last accessed January 2022}
}
@article{LucaNanni,
    title        = {Fermi’s theory of beta decay: a first attempt at electroweak unification},
    author       = {Luca Nanni},
    year         = 2019,
    journal      = {Advanced Studies in Theoretical Physics},
    publisher    = {Hikari Ltd},
    volume       = 13,
    number       = 6,
    pages        = {281--293},
    doi          = {https://doi.org/10.12988/astp.2019.8939}
}

\end{filecontents*}

\usepackage[english]{babel}

\usepackage[backend=biber,sorting=none,style=numeric-comp]{biblatex}
\addbibresource{mwe.bib}

\begin{document}

Dolor sit amet.\cite{LucaNanni}
Lorem ipsum.\cite{NobelFermi}

\printbibliography

\end{document}

You can, of course, also use your own .bib file, like so:

\documentclass{article}

\usepackage[english]{babel}

\usepackage[sorting=none,style=numeric-comp]{biblatex}
\addbibresource{Ref.bib}

\begin{document}

Dolor sit amet.\cite{LucaNanni}
Lorem ipsum.\cite{NobelFermi}

\printbibliography

\end{document}
7
  • Thank you so much for the answer! Finally I got something concrete after all xD
    – Astro97
    Jun 5, 2022 at 14:09
  • I will try this one, but I want to know if there's a way to make the references in a .bib file instead of showing them on the .tex file? I have 34 references, and you can imagine how long will be my code. Furthermore, I'm risking being lost in it. More lines mean more struggle to make everything look great. In such projects, the organization is very crucial. Thanks in advance.
    – Astro97
    Jun 5, 2022 at 14:14
  • On the other hand, I want to know the meaning of the following commands and packages please: filecontents, [overwrite]{mwe.bib}, and \usepackage[backend=biber,sorting=none,style=numeric-comp]{biblatex} . What they do in particular?
    – Astro97
    Jun 5, 2022 at 14:19
  • I have changed my example. filecontents is an easy way to include an external file in your code, so it's all in a single file. You can, of course, use or own .bib file instead. As to biblatex, I refer you to the documentation: ctan.org/pkg/biblatex My basic example simply defines a style, and a sorting option (I think bibliography is sorted alphabetically by default?)
    – Ingmar
    Jun 5, 2022 at 14:46
  • ! Indeed, your suggestion worked well and the problem is now solved. Now, I just want to know the explanation of the commands I told you about above. Secondly, I want to know why you wrote down the references on the .tex file and you called the .bib file later? It seems that you do the same thing twice, isn't it?
    – Astro97
    Jun 5, 2022 at 17:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .