3

First of all, I'm quite new to LaTex. I watched some tutorials but this is my first real document i want to create.

I wanted to add a bibliography to my document, so i did some googling around. But after using my only refrence that I added to the .bib file, I receiving two warnings: Please (re)run Biber on the file and There were undefined references. Why do I receive these warnings? How can I remove them?

I used MiKTeX and TexMaker on Windows. I set TexMaker up like the following:TexMaker Setup

As quick build I choosed the second option (PdfLatTeX, Bib(la)tex, PdfLaTeX (2x), View Pdf).

My main.tex file looks like this:

% Template for a Scientific Document at the iu International University of Applied Sciences
% Template created by Jan Graf <jan.graf@iu-study.org>

% Set document class to article and define basics \documentclass[11pt,a4paper,oneside]{article}

%% Packaes and formalities \usepackage[T1]{fontenc} % use T1 for font encoding \usepackage[english]{babel} % set language to english \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} % set margins \usepackage{setspace} % allow configuration of line spacing \onehalfspacing % set line spacing to 1.5 \usepackage{titlesec} % use package for style titles \usepackage{graphicx} % package for images \usepackage[export]{adjustbox} % package for boxing \usepackage{titling} % package for subtitles

% Package und setup for table of contents \addto\captionsenglish{\renewcommand{\contentsname}{Table of Contents}} % Change heading to "Table of Contents" (needs to be placed before package import) \usepackage{tocloft} % package for styling the table of contents

% Add citation package \usepackage{csquotes} \usepackage[ backend=biber, bibencoding=utf8, style=apa ]{biblatex} \addbibresource{Sources.bib}

% Font Setup \usepackage{fontspec} % use package for font styling \setmainfont{Arial} % set font family to arial \titleformat{\section}{\normalfont\fontsize{12pt}{1.5}\bfseries}{\thesection}{1em}{} % set font for headings (fontsize, linespacing, arabic numbers and horizontal space between number and text) \titleformat{\subsection}{\normalfont\fontsize{12pt}{1.5}\bfseries}{\thesubsection}{1em}{} % set font for headings (fontsize, linespacing, arabic numbers and horizontal space between number and text) \titleformat{\subsubsection}{\normalfont\fontsize{12pt}{1.5}\bfseries}{\thesubsubsection}{1em}{} % set font for headings (fontsize, linespacing, arabic numbers and horizontal space between number and text)

% Load package to change the layout of a single or multiple pages \usepackage{changepage} \setlength{\parindent}{0pt} % no indent \setlength{\parskip}{1.5pt}{} % linespace of 1.5pt after line break

%% Basic Defintions of the document \def \DocumentTitle {Data Visualization in Python} \def \DocumentSubTitle {A comparison of different data visualiation libraries} \def \DocumentType {Written Assignment} \def \DocumentAuthor{Jan Graf} \def \MatriculationNumber{4236721} \def \Course{Computer Science (M.Sc.)\} \def \CourseCode{DLMDSPW01 - Programming with Python\} \def \Tutor{Dr. Cosmina Croitoru}

\author{\DocumentAuthor} \title{\DocumentTitle}

\begin{document} \include{Pages/Cover}

\include{Pages/TableOfContents}

\include{Pages/Introduction} \include{Pages/Main Body} \include{Pages/Conclusion}

\printbibliography \end{document}]

The reference is inside the Introduction.tex:

\section{Introduction}
For almost every offer on the internet, you have to agree to the collection of cookies. This goes hand in hand with the storage of personal data. Every day, billions of people collect an inconceivably large amount of data. Big data is no longer a new term, but is on everyone's lips. A central reason for storing the enormous amounts of data is the information it contains. This is a commodity that has long been an integral part of modern society. Carly Fiorina, an US american politician, once said: "The goal is to turn data into information and information into insight" \autocite{Nantasenamat2020}. \\
To get the information out of data and turn it into insight the processing and visualization is an important part. Raw data needs to be processed to get the informations needed. An equally important part is the visualition to make the containend informations more accessible to humans. It is in the nature of a human brain, that graphs, charts and images are easier to understand as a huge amount of data, especially if there are correlations involved.

The Sources.bib file:

@misc{Nantasenamat2020,
  author = {Chanin Nantasenamat},
  title = {101 Data Science Qutotes},
  howpublished = {\url{https://medium.com/data-professor/101-data-science-quotes-afad20d1e6ee}},
  year = {2020}, 
  note = {[Online; Accessed 17 June.2023]},
}

The log can be found in gist.

Can anyone help to remove the warnings?

  • 1
    If the warnings appear only on the first run through lua/xe/pdf-latex then they are fine, on the first run the references are undefined as biber has not yet run on the document. Can you edit into your question the log generated (.log) if it appears after biber has run please? – JamesT Jun 17 '23 at 15:15
  • 1
    Added the log as gist because the file is to big... The warnings appear after every complilation, even if I try compiling the same document multiple times... – Enter name here Jun 17 '23 at 15:23
  • Related: https://tex.stackexchange.com/questions/63852/question-mark-or-bold-citation-key-instead-of-citation-number – cabohah Jun 17 '23 at 16:10
  • 1
    Hmmm, the .log file shows that a .bbl file is read, yet there is still the warning that something is missing. As explained in https://tex.stackexchange.com/q/687935/35864 this message should go away if you run LaTeX (LuaLaTeX, XeLaTeX, pdfLaTeX, ...) again. Indeed the quick build should already run LaTeX often enough for this message never to occur. Can you delete the .aux, .bbl and .bcf files and try again? Does the warning still occur? Does the .log look the same? Does the warning go away if you rerun LuaLaTeX once again (manually, not via quick build)? ... – moewe Jun 17 '23 at 20:58
  • 1
    ... Unfortunately, the code shared so for is not compilable for us because it contains references to files we don't have. If I change the code so it is compilable for me I cannot reproduce an issue: The compile sequence LuaLaTeX, Biber, LuaLaTeX, LuaLaTeX produces the desired result and no warnings. Can you try compiling a small example like https://gist.github.com/moewew/55c52128101dd82fd4ae2f86c8973984 in a new, empty folder (the linked example is compilable on all systems with biblatex installed - no changes are necessary, the file biblatex-examples.bib will be found automatically). – moewe Jun 17 '23 at 21:01
  • @moewe Thanks for your response. After deleting the .aux, .bbl and .bcf file, there is only one warning left, unfortunately a new one: "Underfull \hbox (badness 10000) in paragraph at lines 2--62". Can you help here too? Your provided gist works completly fine without any errors or warnings... – Enter name here Jun 19 '23 at 05:37
  • That warning is not primarily connected to anything discussed here so far. I suggest you ask a new question that reproduces the warning with as little code as possible. Make sure that we can compile your example document by running it in a new, empty folder first. General hints about underfull/overfull boxes are at https://tex.stackexchange.com/q/138/35864, but the best solution for your specific problem depends on the exact causes, which we can only investigate once we see code that reproduces the problem. (The number one cause of undefull boxes are \\ where they don't belong...) – moewe Jun 19 '23 at 05:45
  • Okay, i found out that te new warning appears because of the \ ... I will find out how to prevent in a new question or with google :D And also I noticed that after changing somethin in the .bib file I always have to delete the .aux, .bbl and .bcf files again... – Enter name here Jun 19 '23 at 05:46

1 Answers1

3

I guess by "compiling", you mean "running LuaLaTeX". But what you need is to also run a second external program: biber. You need to run biber each time you add or delete \cite-type commands. A full compilation run thus consists of lualatex - biber - lualatex.

Incidentally, please do replace

howpublished = {\url{https://medium.com/data-professor/101-data-science-quotes-afad20d1e6ee}},
note = {[Online; Accessed 17 June.2023]},

with

url  = {https://medium.com/data-professor/101-data-science-quotes-afad20d1e6ee},
note = {Online; accessed 17 June 2023},

and be sure to load the xurl package, which allows line breaking of URL strings at all points in the string.

enter image description here

\documentclass[11pt,a4paper,oneside]{article}

\begin{filecontents}[overwrite]{Sources.bib} @misc{Nantasenamat2020, author = {Chanin Nantasenamat}, title = {101 Data Science Quotes}, year = {2020}, url = {https://medium.com/data-professor/101-data-science-quotes-afad20d1e6ee}, note = {Online; accessed 17 June 2023}, } \end{filecontents}

%% Packages and formalities %%%\usepackage[T1]{fontenc} % not useful with LuaLaTeX \usepackage[english]{babel} % set language to US English \addto\captionsenglish{\renewcommand{\contentsname}{Table of Contents}} \usepackage[margin=2cm]{geometry} % set margins \usepackage{setspace} % line spacing options \onehalfspacing % set line spacing to 1.5 \usepackage{graphicx} % package for images \usepackage[export]{adjustbox} % package for boxing \usepackage{titling} % package for subtitles

\usepackage{tocloft} % package for styling the table of contents

\usepackage{csquotes} % define \enquote macro

% Citation management package \usepackage[ backend=biber, bibencoding=utf8, style=apa ]{biblatex} \addbibresource{Sources.bib}

% Font Setup \usepackage{fontspec} % package for font styling \setmainfont{Arial} % set font family to arial

\usepackage{titlesec} % package to modify titles \titleformat{\section}{\normalfont\fontsize{12pt}{1.5}\bfseries}{\thesection}{1em}{}

% Load package to change the layout of a single or multiple pages \usepackage{changepage} \setlength{\parindent}{0pt} % no indent \setlength{\parskip}{1.5pt}{} % linespace of 1.5pt after line break

%% Basic Definitions of the document \def \DocumentTitle {Data Visualization in Python} \def \DocumentSubTitle {A comparison of different data visualiation libraries} \def \DocumentType {Written Assignment} \def \DocumentAuthor{Jan Graf} \def \MatriculationNumber{4236721} \def \Course{Computer Science (M.Sc.)\} \def \CourseCode{DLMDSPW01 -- Programming with Python\} \def \Tutor{Dr.\ Cosmina Croitoru}

\author{\DocumentAuthor} \title{\DocumentTitle} \date{}

% new: \usepackage{xurl} % allow line breaks at all points in a URL string

\begin{document} \maketitle

\section{Introduction}

For almost every \dots\ \autocite{Nantasenamat2020}.

\printbibliography \end{document}

Mico
  • 506,678
  • With an up-to-date biblatex you usually need 2 LuaLaTeX after biber to get no more LaTeX Warning: There were undefined references. and no more Package biblatex Warning: Please rerun LaTeX. as in your example. – cabohah Jun 17 '23 at 16:08
  • @cabohah - Not sure I follow you. For the example code posted above, running LuaLaTeX - biber - LuaLaTeX (a single run) is exactly what's needed. – Mico Jun 17 '23 at 19:31
  • @Mico The PDF is already fine with your example after LuaLaTeX - biber - LuaLaTeX but have a look at the log file. There are still the two messages (and the question was about one of them). See also: https://tex.stackexchange.com/q/687935/277964 – cabohah Jun 17 '23 at 19:39
  • @cabohah - Thanks for this clarification/elaboration. I can only conclude that the warning message -- LaTeX Warning: There were undefined references. -- is itself faulty. For sure, by the end of the single LuaLaTeX run there are, in fact, no more undefined references. Not sure if this fault is specific to LuaLaTeX. – Mico Jun 17 '23 at 19:49
  • 1
    If one only runs LaTeX, Biber, LaTeX (I'm using "LaTeX" as a catch-all for your favourite LaTeX flavour) the references may already look fine (they do in this case), but biblatex will indeed request a rerun (see the recent https://tex.stackexchange.com/q/687935/35864 for more details), so that the recommended compile sequence is indeed LaTeX, Biber, LaTeX, LaTeX. The OP, however, says that their editor is already set up to do call this sequence. So in theory this shouldn't be the problem. Indeed the .log shows that a .bbl is present, so Biber was run. – moewe Jun 17 '23 at 20:52
  • 1
    I would go all the way with using dedicated fields and would replace note = {Online; accessed 17 June 2023}, with urldate = {2023-06-17},. By default this may not add the "Online", but I believe that is largely redundant anyway. If it is really required it can be added in automatically. – moewe Jun 17 '23 at 20:53
  • Yeah, with compiling i mean a quick build: LuaTex, Biber, Luatex, Luatex. Tried your changes with no result... – Enter name here Jun 19 '23 at 05:41
  • @Enternamehere - You should be running LuaLaTeX, not LuaTeX. – Mico Jun 19 '23 at 05:57
  • @Mico Sorry, my fault. Of course I meant LuaLaTeX, not LuaTeX... – Enter name here Jun 19 '23 at 09:56
  • @Enternamehere - The code I posted above clearly works. If it's the case that you've adapted my code somehow for your document and the adapted code doesn't "work" for you, then there must be at least one fault in the way you performed the adaptation. Unfortunately -- but probably not surprisingly -- my divination skills are absolutely worthless. Unless you tell me in sufficient detail how your code deviates from mine, and which error and/or warning messages (if any) you get, the odds that I will be able to figure out what's going on at your end are decidedly poor. – Mico Jun 19 '23 at 16:45
  • I just copied your code from here into my "Data Visualization in Python.tex" file and still get the errors "There were undefinded references" and "Please (re)run Biber on the file". Log file can be found here: https://gist.github.com/Jan-Graf/5c85dd2274144cb1f1cdf79b6037e131. If you need anything else, let me know – Enter name here Jun 22 '23 at 06:20
  • @Enternamehere - My preliminary question, before looking at the log file you kindly posted in any detail, is: Does the code I posted, as shown above, run correctly, i.e., does it produce the screenshot I posted? – Mico Jun 22 '23 at 13:39
  • Nope, i still get the two mentioned warnings: "Undefined reference" and "Rerun Biber" – Enter name here Jun 22 '23 at 19:34
  • @Enternamehere - In that case, you're definitely doing one more more things wrong, since my example does run correctly. Are you running biber? Do you have the correct argument in \addbibresource? – Mico Jun 22 '23 at 22:55
  • Interesting... I copied your code in my existing project and the error occured again. After creating a new, plain tex file and copying your code into it, all worked fine. I now adapted your code step by step and now everything works fine... A bit strange in my opionon, but while it works, everythings alright. Thank you very much :) – Enter name here Jun 23 '23 at 08:29
  • @Mico If i want to add another refrence, have I to do it like you did with \begin{filecontents} and add it there or can I add it directly to the bib file? If I'm adding it directly to the file I'm receiving errors again, but i would prefer it to have the database in the bib file and not inside the main tex file... – Enter name here Jun 23 '23 at 09:28
  • 1
    @Enternamehere - Glad to learn you worked it out. About the filecontents device: I used it merely to create a sample .bib file "on the fly", to make the code shown above compilable. You don't need to follow this route. Just place all of your bib entries in a text file called, say, MySources.bib, and then point to it via \addbibresource{MySources.bib}. It's necessary to re-run biber each time to add to delete \cite directives. – Mico Jun 23 '23 at 15:09
  • @Mico Okay, thanks for your help :D – Enter name here Jun 23 '23 at 16:12