首先,我对 LaTex 还很陌生。我看了一些教程,但这是我想要创建的第一个真正的文档。
我想在我的文档中添加参考书目,所以我在谷歌上搜索了一下。但是在使用我添加到 .bib 文件的唯一参考后,我收到了两个警告:Please (re)run Biber on the file
和There were undefined references
。为什么我会收到这些警告?我该如何删除它们?
我在 Windows 上使用 MiKTeX 和 TexMaker。我按如下方式设置 TexMaker:
作为快速构建,我选择了第二个选项(PdfLatTeX、Bib(la)tex、PdfLaTeX(2x)、查看 Pdf)。
我的 main.tex 文件如下所示:
% Template for a Scientific Document at the iu International University of Applied Sciences
% Template created by Jan Graf <[email protected]>
% 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}]
参考资料在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.
Sources.bib 文件:
@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]},
}
这日志可以在要点中找到。
有人能帮忙消除警告吗?
答案1
我猜你说的“编译”是指“运行 LuaLaTeX”。但你还需要运行第二个外部程序: 。每次添加或删除-type 命令时biber
,你都需要运行。biber
\cite
满的因此编译运行由 lualatex - biber - lualatex 组成。
顺便说一下,请更换
howpublished = {\url{https://medium.com/data-professor/101-data-science-quotes-afad20d1e6ee}},
note = {[Online; Accessed 17 June.2023]},
和
url = {https://medium.com/data-professor/101-data-science-quotes-afad20d1e6ee},
note = {Online; accessed 17 June 2023},
并确保加载xurl
包,该包允许在字符串的所有点处对 URL 字符串进行换行。
\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}