2

So I am writing my first article with Latex and I've got 20 pages so far. I did copy all my references so I could just input them at the end. While starting inserting my references, I found out that there is a way to just copy some bibtex reference and generate a customized reference page. I started reading some guides and following some tutorials but i always ended up having "no reference to citation". I don't know if I missed something out in my project or just horribly failed at some point but I just try to describe my project to you:

I have every chapter split into different files sorted into different folders. I have folder "chapter_1" - "chapter_6". Inside every folder are .tex files and pictures. My first page and table of contents are in the same directory as the main.tex.

So first of I created a file called "reference.bib" and put 1 reference inside to test this out. I went into my main.tex and added

\usepackage[backend=biber]{bibtex}
\addbibresource{reference.bib}

to my preamble. Then I went to the point i want the reference page to be printed and inserted a \printbibliography{reference.bib}. Lastly I went to the part I wanted to cite and put a \cite{1234} (the corresponding number) in the text. Compiling always gave me no references and errors. I did it the exact same way most other did this and I don't know what to do at this point.

If the description is not detailed enough just let me know, i'd go ahead and share most of the code I wrote.

Bernard
  • 271,350
  • Did you run Biber on your document? https://tex.stackexchange.com/q/63852/35864 explains why you need to run Biber. https://tex.stackexchange.com/q/154751/35864 explains how you can make your editor run Biber. – moewe Jan 31 '22 at 19:34
  • \usepackage[backend=biber]{biblatex} – koleygr Jan 31 '22 at 19:37
  • Oh yeah right, the package is called biblatex, not bibtex. So \usepackage[backend=biber]{bibtex} should be \usepackage[backend=biber]{biblatex}. (Same for the title: It should be biblatex and not bibtex.) – moewe Jan 31 '22 at 19:44
  • Thanks for correcting, this was the issue in combination with using wrong parameters and commands. I did try and tweak a little with it but i sadly can't get it to be the APA style my teacher wants me to use.. Is there a way to tweak so the cite state the name + year in square brackets and in the bibliography it starts with [name+year], then the name and everythin but in the second line it gives me an indent? – marcopasta Jan 31 '22 at 21:06
  • 1
    you get apa style with biblatex by using \usepackage[style=apa]{biblatex}. And better use biber instead of bibtex for the processing. – Ulrike Fischer Feb 01 '22 at 08:14
  • @koleygr Do you want to type up a quick answer? (It might be good to also mention having to run Biber even though the only problem visible in the question is the typo.) – moewe Feb 04 '22 at 07:25
  • Done @moewe ... Thanks! – koleygr Feb 04 '22 at 13:30

1 Answers1

1

Welcome to TeX.SX!@marcopasta

There are at least 3 ways to use bibliography in LaTeX related software:

  1. Use BibTeX:

    \documentclass{article}
    \usepackage{natbib}
    \begin{document}
     This is a citation~\citep{SomeOne}
    

    This is a citation about \citet{SomeOther} that \ldots

    \bibliographystyle{apalike} \bibliography{MyBibFile} \end{document}

  2. Use biblatex (actually biber):

    \documentclass{article}
    \usepackage[style=apa,natbib=true]{biblatex} 
    \addbibresource{MyBibFile.bib} 
    \begin{document}
    

    This is a citation~\citep{SomeOne}

    This is a citation about \citet{SomeOther} that \ldots

    \printbibliography \end{document}

  3. Manually added bibliography

The \begin{bibliography} and \end{bibliography} where you are placing \bibitems manually

In your question you just combined the two first methods in a wrong way (they are not combine-able anyway)

moewe
  • 175,683
koleygr
  • 20,105
  • Maybe you could make it clearer that most likely \usepackage[backend=biber]{bibtex} is just a typo for \usepackage[backend=biber]{biblatex}. – moewe Feb 04 '22 at 14:16
  • 1
    Some more examples for the three methods can also be found in https://tex.stackexchange.com/q/134180/35864. It is worth keeping in mind that with biblatex one needs to run Biber instead of BibTeX (https://tex.stackexchange.com/q/154751/35864 can help with the necessary configurations for people's editors). – moewe Feb 04 '22 at 14:18