0

Hell, I'm trying to build the following document, but I get question marks instead of citations, what am I doing wrong?

% Vorlage für eine Bachelorarbeit
% Siehe auch LaTeX-Kurs von Mathematik-Online
% www.mathematik-online.org/kurse
% Anpassungen für die Fakultät für Mathematik
% am KIT durch Klaus Spitzmüller und Roland Schnaubelt Dezember 2011

\documentclass[12pt,a4paper]{scrartcl}
% scrartcl ist eine abgeleitete Artikel-Klasse im Koma-Skript
% zur Kontrolle des Umbruchs Klassenoption draft verwenden


% die folgenden Packete erlauben den Gebrauch von Umlauten und ß
% in der Latex Datei
%\usepackage[utf8]{inputenc}
% \usepackage[latin1]{inputenc} %  Alternativ unter Windows
%\usepackage[T1]{fontenc}
%\usepackage[ngerman]{babel}

\usepackage[nottoc]{tocbibind}

\usepackage[pdftex]{graphicx}
\usepackage{latexsym}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{cite}



% Abstand obere Blattkante zur Kopfzeile ist 2.54cm - 15mm
\setlength{\topmargin}{-15mm}


% Umgebungen für Definitionen, Sätze, usw.
% Es werden Sätze, Definitionen etc innerhalb einer Section mit
% 1.1, 1.2 etc durchnummeriert, ebenso die Gleichungen mit (1.1), (1.2) ..
\newtheorem{Satz}{Satz}[section]
\newtheorem{Definition}[Satz]{Definition} 
\newtheorem{Lemma}[Satz]{Lemma}        

\numberwithin{equation}{section} 

% einige Abkuerzungen
\newcommand{\C}{\mathbb{C}} % komplexe
\newcommand{\K}{\mathbb{K}} % komplexe
\newcommand{\R}{\mathbb{R}} % reelle
\newcommand{\Q}{\mathbb{Q}} % rationale
\newcommand{\Z}{\mathbb{Z}} % ganze
\newcommand{\N}{\mathbb{N}} % natuerliche



\begin{document}
  % Keine Seitenzahlen im Vorspann
  \pagestyle{empty}

  % Titelblatt der Arbeit
  \begin{titlepage}


 \begin{center} \large 

    Bachelor's thesis
    \vspace*{2cm}

    {\huge Uniformization theorem}
    \vspace*{2.5cm}


    Datum der Abgabe
    \vspace*{4.5cm}

        Humboldt-Universit\"at zu Berlin
  \end{center}
\end{titlepage}



  % Table of contents
  \tableofcontents

\newpage


  % Ab sofort Seitenzahlen in der Kopfzeile anzeigen
  \pagestyle{headings}

\section{Introduction}

  The goal of this thesis is to prove the Poincar\'e theorem, also known as the uniformization theorem. The proof given here is a more detailed and completed version of the one given in

Using \texttt{biblatex} you can display bibliography divided into sections, 
depending of citation type. 
Let's cite! The Einstein's journal paper \cite{einstein} and the Dirac's 
book \cite{dirac} are physics related items. 
Next, \textit{The \LaTeX\ Companion} book \cite{latexcompanion}, the Donald 
Knuth's website \cite{knuthwebsite}, \textit{The Comprehensive Tex Archive 
Network} (CTAN) \cite{dirac} are \LaTeX\ related items; but the others Donald 
Knuth's items \cite{knuth-fa,knuth-acp} are dedicated to programming. 

\bibliography{test}
%\bibliographystyle{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \newpage  % neuer Abschnitt auf neue Seite, kann auch entfallen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \medskip

%\printbibliography[title={Whole bibliography}]
\section{Zweiter Abschnitt}

  % Literaturverzeichnis (beginnt auf einer ungeraden Seite)
 \addcontentsline{toc}{section}{References}


  % ggf. hier Tabelle mit Symbolen 
  % (kann auch auf das Inhaltsverzeichnis folgen)


 \thispagestyle{empty}


\vspace*{8cm}

\newpage
\section*{Erkl\"arung}

Ich  versichere  wahrheitsgem\"a\ss,  die  Arbeit selbstst\"andig verfasst,  alle  benutzten  Hilfsmittel  vollst\"andig  und  genau  angegeben  und  alles kenntlich  gemacht  zu  haben,  was  aus  Arbeiten  anderer  unver\"andert  oder  mit  Ab\"anderungen entnommen  wurde,  sowie die Satzung  des  KIT  zur  Sicherung guter wissenschaftlicher Praxis in der jeweils g\"ultigen Fassung beachtet zu haben.
\\[2ex] 

\noindent
Ort, den Datum\\[5ex]

% Unterschrift (handgeschrieben)



\end{document}

And here is my .bib file

@article{einstein,
    author = "Albert Einstein",
    title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
    [{On} the electrodynamics of moving bodies]",
    journal = "Annalen der Physik",
    volume = "322",
    number = "10",
    pages = "891--921",
    year = "1905",
    DOI = "http://dx.doi.org/10.1002/andp.19053221004",
    keywords = "physics"
}

@book{dirac,
    title = {The Principles of Quantum Mechanics},
    author = {Paul Adrien Maurice Dirac},
    isbn = {9780198520115},
    series = {International series of monographs on physics},
    year = {1981},
    publisher = {Clarendon Press},
    keywords = {physics}
}

@online{knuthwebsite,
    author = "Donald Knuth",
    title = "Knuth: Computers and Typesetting",
    url  = "http://www-cs-faculty.stanford.edu/~uno/abcde.html",
    addendum = "(accessed: 01.09.2016)",
    keywords = "latex,knuth"
}

@inbook{knuth-fa,
    author = "Donald E. Knuth",
    title = "Fundamental Algorithms",
    publisher = "Addison-Wesley",
    year = "1973",
    chapter = "1.2",
    keywords  = "knuth,programming"
}
loliki
  • 103
  • 2
    Do you compile pdftex, bibtex, pdftex prdftex? – Zarko Aug 30 '19 at 16:14
  • @Zarko I'm compiling PdfLaTeX – loliki Aug 30 '19 at 16:16
  • this is not sufficient. after than you need to compile with bibtex and than again with pfdtex twice. – Zarko Aug 30 '19 at 16:18
  • @Zarko I tried that just now, and I have this error: The top-level auxiliary file: BachelorArbeit.aux I found no \bibstyle command---while reading file BachelorArbeit.aux. I'm sorry I'm just very new to Texmaker – loliki Aug 30 '19 at 16:19
  • 1
    As far i see from document example, you not load package which define bibliography style. For example natbib. However, now I see that you tagged question with biblatex, but you don't load this package. Please search site with tag biblatex. You will find plenty of examples how to proper use it. – Zarko Aug 30 '19 at 16:28
  • 2
    Perhaps you should delete the auxiliary files and do the cycle again. Also, choose a bibliographic style. – Bernard Aug 30 '19 at 16:29
  • @Zarko thanks man, it works, please answer below so I can choose your answer as "accepted" :) – loliki Aug 30 '19 at 16:36
  • 1
    Oh, you already have an answer which some how summarized our comments :-) – Zarko Aug 30 '19 at 16:40
  • See also our 'standard duplicate' for issues like this: https://tex.stackexchange.com/q/63852/35864 – moewe Aug 30 '19 at 18:28

1 Answers1

1

you need to tell LaTeX, where your .bib file is, compile the .bib file with bibtex and then compile the .tex file twice in order for the References page to be printed well. Furthemore, you need to specify all of your citations in your .bib file (in your example citations like knuth-acp are not given in the .bib file).

Try adding \bibliography{name-of-bib-file-without-extension} and \bibliographystyle{ieeetr} to your document (you need to specify the bibliography style, ieeetr is one of available styles) and then compiling the .tex file with pdflatex, with bibtex and then twice with pdflatex.

More info can be found here.