1

i have a references.bib file with the references i need, i am using the following commands:

\documentclass[a4paper]{article}
% this in the preamble
\begin{filecontents}{references.bib}
@online{knuthwebsite,
    author = "Donald Knuth",
    title = "Knuth: Computers and Typesetting",
    url  = "http://www-cs-faculty.stanford.edu/~uno/abcde.html",
    date = "2016-09-01",
    keywords = "latex,knuth"
}

@inbook{knuth-fa, author = "Donald E. Knuth", title = "Fundamental Algorithms", publisher = "Addison-Wesley", year = "1973", chapter = "1.2", keywords = "knuth,programming" } \end{filecontents} \usepackage[style=authoryear,sorting=none]{biblatex} \addbibresource{references.bib}

\begin{document} ... \nocite{*} \bibstyle{numeric} \printbibliography \end{document}

The code is running without errors, but no references show up. The format in references are correct. What is going wrong?

Oni
  • 705
  • 1
    you should be using biber not bibtex as you are using biblatex. have you run biber (and then latex again to include the generated bibliography) ? – David Carlisle Jun 11 '21 at 20:10
  • how do I run biber? and which file do i run through biber? the main or .bib file? (this is my first time using a separate file for references.) – Lepakshi Ramkiran Jun 11 '21 at 20:23
  • You ask, "how do I run biber?" This depends largely on the front-end/editor software you employ. Which editor do you use? – Mico Jun 11 '21 at 20:31
  • 1
    I use TexMaker paired with MikTeX – Lepakshi Ramkiran Jun 11 '21 at 20:34
  • 2
    if your document is doc.tex you want to run pdflatex doc; biber doc; pdflatex doc ; pdflatex doc but texmaker probably has a menu option to do that for you, but I don't use miktex or texmaker so can not give details, but a texmaker user will no doubt answer soon. – David Carlisle Jun 11 '21 at 20:46
  • 1
    https://tex.stackexchange.com/q/63852/35864 explains brilliantly why you need to run Biber. https://tex.stackexchange.com/q/154751/35864 explains how you can set up your editor to run Biber for you. – moewe Jun 12 '21 at 06:46
  • 1
    But note that you should remove the \bibstyle{numeric}. With biblatex the bibliography and citation styles are specified at loading-time in \usepackage[<options>]{biblatex}. style=authoryear,sorting=none is a combination that is probably cause confusion to your readers. Either just use style=authoryear, and let biblatex use the default author-year-title sorting for that style or switch to a numeric style with style=numeric, sorting=none,. – moewe Jun 12 '21 at 06:47

2 Answers2

0

One need to remove \bibstyle{numeric} and run biber after compiling and then compile again. Instructions how to setup TeXmaker can be found at here.

\documentclass[a4paper]{article}
% this is the preamble
\usepackage[style=authoryear, sorting=ynt]{biblatex} % if you want numeric use [style=numeric, sorting=none].
\begin{filecontents}{references.bib}
@online{knuthwebsite,
    author = "Donald Knuth",
    title = "Knuth: Computers and Typesetting",
    url  = "http://www-cs-faculty.stanford.edu/~uno/abcde.html",
    date = "2016-09-01",
    keywords = "latex,knuth"
}

@inbook{knuth-fa, author = "Donald E. Knuth", title = "Fundamental Algorithms", publisher = "Addison-Wesley", year = "1973", chapter = "1.2", keywords = "knuth,programming" } \end{filecontents} \addbibresource{references.bib}

\begin{document} ... \nocite{*} \printbibliography \end{document}

Oni
  • 705
  • 1
    I think the OP's main issue is how to run biber from within the TeXmaker front-end. Can you provide some hints in this regard? – Mico Jun 12 '21 at 06:52
-1

To use bibtex your document should be structured as e.g., assuming your references are in `references.bib:

\documentclass{article}
\usepackage{bibtex}

\begin{document} \bibliographystyle{plain}

% Use \cite{...} as needed

\bibliography{references} \end{document}

Full details at the BibTeX homepage.

vonbrand
  • 5,473
  • -1. There are three problems with this answer. First, the OP's question is about how to invoke the biber program under TeXmaker; it is not about how to use bibtex. Second, there is no LaTeX package called bibtex.sty -- at least not one recognized by the CTAN. Third, while it is true that a website called bibtex.org exists, that site has all the hallmarks of having been set up by a cybersquatter. For sure, it has no discernible connection to the person who created BibTeX (Oren Patashnik). The fact that the "advice" given on the site contain a gross error is also rather worrisome. – Mico Jun 12 '21 at 05:10
  • @Mico, there is no reference to biber in the question, it asks about .bib. And in my experience, biber is unreliable and messy. – vonbrand Jun 12 '21 at 19:08
  • After the OP is informed by David Carlisle (in a comment) that he/she has to run biber, the OP then asks, "how do I run biber? and which file do i run through biber?" Just because the OP wasn't aware, at the time of posting the question, of the need to run biber, doesn't mean that the focus cannot change significantly in response to comments. – Mico Jun 12 '21 at 19:53
  • Strangly, the references.bib file isn't being generated on my fully updated TeX Live 2021 so there are no references. If I manually create references.bib from the information given running pdflatex, biber, pdflatex and pdflatex gives me the references. – Herb Schulz Mar 09 '22 at 13:23