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.

  • 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. – David Carlisle Jun 03 '22 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. – barbara beeton Jun 03 '22 at 19:37
  • @Ingmar What did you mean by MWE? – Astro97 Jun 04 '22 at 21:25
  • @DavidCarlisle Can you have a look at the post, it should provide you with more details now. And sorry for not being clear enough about the commands and including 2 questions simultaneously. And I will take your suggestion of \large with a huge consideration. Tell me if everything seems understandable now. Thanks :) – Astro97 Jun 04 '22 at 21:28
  • @barbarabeeton What I meant by "English commas" is nothing but the `` (alt gr+7 twice) '' (4 twice) quoting commas. You can look at the given example in the post to understand the whole story. Sorry for not being quite clear about this subject. Thanks a lot :) – Astro97 Jun 04 '22 at 21:30
  • ``gg'' quotes are not commas, commas are,,, on the baseline – David Carlisle Jun 04 '22 at 21:54
  • 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. – David Carlisle Jun 04 '22 at 21:56
  • Your question is extremely confuse, I'm sorry for saying that. 1 - "I found that they are not in order": What standard (style) are you using? The sequence in the .bib-file is not the sequence in the compiled document. 2 - "\printbibliography" and "BibTeX": Are you using BibTeX or BibLaTeX, they might use the same base .bib-file, but they are not the same. 3 - I may be wrong here, but \\ in the .bib are unnecessary and you should avoid using % at the entry field, check this answer. 4 - Post your code and figure, not only figures. – FHZ Jun 04 '22 at 22:46
  • 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. – barbara beeton Jun 05 '22 at 00: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 05 '22 at 06:47
  • @DavidCarlisle I included the figure just to let you know about the .bib file's structure so you can deduce from it the probable sources of the errors. Anyway, I will include the whole code of my .bib file. – Astro97 Jun 05 '22 at 10:48
  • @FHZ There's no reason to be sorry, I understand how confusing might my question be. Your suggestions and remarks will help me to enhance the quality and the clarity of my question. For the 1st point, I know that! But in my case, they are equivalent. I put the references in the .bib file in order of appearance, and then I used \cite to include them. And for the 2nd, I used the "biblatex" package. And for the 3rd, there are some "BibTeX" references that I downloaded (from Springer or others) that are written in this way. Have I the right to change them? For the last point, I will do that. – Astro97 Jun 05 '22 at 11:00
  • 1
    @Ingmar Ok, that's understood! I will put the second question in a separate post. – Astro97 Jun 05 '22 at 11:02
  • @barbarabeeton Yeah, I was mistaken about both of them; commas and .bib indication. I was trying to say .bib file indeed. Secondly, I will remove the % and \ parts. But is it possible anyway to make the opening and closing double-quotes bigger? – Astro97 Jun 05 '22 at 11:06
  • There's a lot going on. Please reduce your example, remove unused or conflicting packages, comments, etc. and, above all, make it an example that we can simply copy & paste into our editors, from \documentclass{article} to \end{document}. If you post a .pdf, post the exact code used to create that file. – Ingmar Jun 05 '22 at 12:12
  • @Ingmar I have no idea how can I write down all the code. My paper is too long; It is a 10-pages article! I would like to give you all the data but it seems impossible with the question's editor (250 lines mean 250 clicks on "add a code"). Do you have an idea? – Astro97 Jun 05 '22 at 14:03
  • 1
    Simply shorten it to a paragraph or two with two or three citations … we don't need 10 pages to see the issue. Heck, you can use some dummy text for all we care. Also, no need to click add code multiple times, just put it all between three opening and three closing backticks, like so. – Ingmar Jun 05 '22 at 14:50
  • 1
    250 lines mean 250 clicks on "add a code" Just copy/paste your code, then before the first line of your code prepend another line \``lang-latexand after the last line of your code append another line````. The lang--thingie can can be changed to another language, e.g., \``lang-texor```lang-none`. – Ulrich Diez Jun 05 '22 at 18:23
  • @UlrichDiez Ok, that's understood! Thank you so much. – Astro97 Jun 09 '22 at 21:02

1 Answers1

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}

Ingmar
  • 6,690
  • 5
  • 26
  • 47
  • Thank you so much for the answer! Finally I got something concrete after all xD – Astro97 Jun 05 '22 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 05 '22 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 05 '22 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: https://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 05 '22 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 05 '22 at 17:13
  • Not sure what else to tell you? This is all pretty standard. I have modified my example to include a version without filecontents, as this seems to be the source of some confusion. – Ingmar Jun 05 '22 at 17:48
  • Thanks a lot! Your suggestions were very helpful. Very appreciated. – Astro97 Jun 09 '22 at 20:59