0

I am completely new to doing bibliography and watched a youtube video about it. Downloaded JabRef, filled out the list for an article, saved it to the tex.file location, went to TexStudio and wrote \citep(article) using \usepackage{natbib}, \bibliographystyle{plainnat}, \bibliography{file from JabRef}. There are several warning messages and I do see in the code that the natbib package is not found. The citation is not done; only [?], which is strange at all because the citep style would give (Author et al, year) and thus I expect (?). And Also there is nothing in the reference section. Where is the problem?

\documentclass[a4paper,oneside,abstracton]{scrartcl}

\usepackage[utf8]{inputenc}
%\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{natbib}

\usepackage[ngerman]{babel}
%\usepackage{caption}
\addto\captionsngerman{                         
   \renewcommand{\contentsname}{\textrm{Table of Contents}}}
%wird verwendet damit im Inhaltsverzeichnis der englische Name kommt

\usepackage{amsmath,amssymb,amsthm,amsfonts,amsbsy,latexsym}
\usepackage{wasysym} %astronomical symbols
%\usepackage[version=3]{mhchem} %Chemie-Package
\providecommand{\e}[1]{\ensuremath{\times 10^{#1}}}
%\usepackage{dsfont}
%\usepackage{enumerate,url}
\usepackage{graphicx}
\usepackage{a4wide}
\usepackage{titling}
%\renewcommand{\contentsname}{Table of Contents} %funktioniert nur wenn babel nicht verwendet wird.
\usepackage{booktabs}
\usepackage{lscape}
\usepackage{multirow}
\usepackage{subfigure}
\addto\captionsngerman{
    \renewcommand{\figurename}{Fig.}}
\usepackage{afterpage}
\usepackage{gensymb}
\usepackage{soul}
\usepackage{array}
%\usepackage{subcaption} %cannot be used with subfigure
%\setcounter{secnumdepth}{4}
%\setcounter{tocdepth}{4}

%% Control the fonts and formatting used in the table of contents.
%\usepackage[titles]{tocloft}

%% Aesthetic spacing redefined
%\setlength{\cftbeforechapskip}{}
%\setlength{\cftbeforesecskip}{0.5ex}


\begin{document}

\title{\LARGE Advanced Lab Course \\ [1em] \huge \textbf{xyz}}
\author{Hans Muster \hspace{1cm} Muster Hans}
\date{\\[1em] {September 2014} \\ [0.8cm] Supervisor Dr.
 \\ [0.5cm]  Institut \\ University behind the Moon}


\clearpage
\maketitle{}
\thispagestyle{empty} %Keine Seitenzahl auf erster (dieser) Seite %
\renewcommand\abstractname{\textrm{Abstract}}
\renewcommand\tablename{\textrm{Table}}
\addtokomafont{sectioning}{\rmfamily}
\newpage

\begin{abstract}
%\vspace{-0.25cm}
%\setlength{\parindent}{0pt}
blablabla
\end{abstract}

%\skip{}
\tableofcontents{}
\pagestyle{plain}
\newpage

\bibliographystyle{plainnat}
\bibliography{library}

\pagenumbering{arabic}
\section{Introduction}
\citep{Schamb2010}

\section{Theory}

\section{References}

\end{document}

Am I not allowed to make a section References because it is probably created automatically? When everything is working, I would like to configure everything that it is like in a paper such as this http://m.iopscience.iop.org/0004-637X/720/2/1691/pdf/0004-637X_720_2_1691.pdf where you are led to the reference at the paper end when clicking onto a cite and when clicking onto the reference at the end are led to the URL in the internet; also with colour coding.


TeXStudio code with corresponding .bib-entry code afterwards:

\documentclass[a4paper,oneside,abstracton]{scrartcl}

\usepackage[utf8]{inputenc}
%\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{natbib}

\usepackage[ngerman]{babel}
%\usepackage{caption}
\addto\captionsngerman{
      \renewcommand{\contentsname}{\textrm{Table of Contents}}}
%wird verwendet damit im Inhaltsverzeichnis der englische Name kommt

\usepackage{amsmath,amssymb,amsthm,amsfonts,amsbsy,latexsym}
\usepackage{wasysym} %astronomical symbols
%\usepackage[version=3]{mhchem} %Chemie-Package
\providecommand{\e}[1]{\ensuremath{\times 10^{#1}}}
%\usepackage{dsfont}
%\usepackage{enumerate,url}
\usepackage{graphicx}
\usepackage{a4wide}
\usepackage{titling}
%\renewcommand{\contentsname}{Table of Contents} %funktioniert nur wenn babel nicht verwendet wird.
\usepackage{booktabs}
\usepackage{lscape}
\usepackage{multirow}
\usepackage{subfigure}
\addto\captionsngerman{
      \renewcommand{\figurename}{Fig.}}
\usepackage{afterpage}
\usepackage{gensymb}
\usepackage{soul}
\usepackage{array}
%\usepackage{subcaption} %cannot be used with subfigure
%\setcounter{secnumdepth}{4}
%\setcounter{tocdepth}{4}

%% Control the fonts and formatting used in the table of contents.
%\usepackage[titles]{tocloft}

%% Aesthetic spacing redefined
%\setlength{\cftbeforechapskip}{}
%\setlength{\cftbeforesecskip}{0.5ex}


\begin{document}

\title{\LARGE Advanced Lab Course \\ [1em] \huge \textbf{Impact}}
\author{abc \hspace{1cm} ABC}
\date{\\[1em] {September 2014} \\ [0.8cm] Supervisor Dr. 
 \\ [0.5cm] Physikalisches Institut \\ University behind the Moon}


\clearpage
\maketitle{}
\thispagestyle{empty} %Keine Seitenzahl auf erster (dieser) Seite %
\renewcommand\abstractname{\textrm{Abstract}}
\renewcommand\tablename{\textrm{Table}}
\addtokomafont{sectioning}{\rmfamily}
\newpage

\pagenumbering{roman}
\vspace*{120pt}
\begin{center}
blablabla
\end{center}
\newpage

\begin{abstract}
%\vspace{-0.25cm}
%\setlength{\parindent}{0pt}
blablabla
\end{abstract}

%\skip{}
\tableofcontents{}
\pagestyle{plain}
\newpage

\bibliographystyle{plainnat}

\pagenumbering{arabic}
\section{Introduction}
The mean mass density of the primordial solar nebula is estimated to have been $\mathord\sim10^{3} \; M_{\astrosun} \,\textup{pc}^{-3} < \bar{M} < \mathord\sim10^{4} \; M_{\astrosun} \,\textup{pc}^{-3}$ \citep{Schamb2010}.\footnote{corresponding to a central nebula density of $\mathord\sim10^{4} \; M_{\astrosun} \,\textup{pc}^{-3} \stackrel{\sigma=60\%}{<} M_{central} \stackrel{\sigma=95\%}{<} \mathord\sim10^{5} \; M_{\astrosun}\,\textup{pc}^{-3}$, whereas the percentage values indicate the confidence level to which the associated relation is valid}

\section{Theory}
\section{Instrumentation}
\section{Measurements}
\section{Results}
\section{Discussion}
\section{Conclusion}
\section{Acknowledgement}

%\section{References}
\bibliography{library}

\end{document}

.bib-entry:

% This file was created with JabRef 2.10.
% Encoding: Cp1252


@Article{Schamb2010,
  Title                    = {Properties of the Distant Kuiper Belt: Results from the Palomar Distant Solar System Survey},
  Author                   = {(Megan E.) Schwamb and (Michael E.) Brown and (David L.) Rabinowitz and Darin Ragozzine},
  Journal                  = {The Astrophysical Journal},
  Year                     = {2010},

  Month                    = {September},
  Number                   = {2},
  Pages                    = {17},
  Volume                   = {720},

  Abstract                 = {},
  Doi                      = {10.1088/0004-637X/720/2/1691},
  Owner                    = {},
  Timestamp                = {2014.09.21},
  Url                      = {http://m.iopscience.iop.org/0004-637X/720/2/1691/pdf/0004-637X_720_2_1691.pdf}
}
Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
Lucas
  • 1,357
  • Did you run bibtex? The normal cycle to resolve all references is (pdf)latex; bibtex, latex, latex. Btw you should give a try to biblatex(which can emulate natbib, anyway) as it is relatively easy to customise, and compile the bibliography with biber, which understands utf8 encoding and is the default bibliography compiler for biblatex (use option backend=bibtex if you prefer to stick to bibtex). – Bernard Sep 21 '14 at 22:54
  • 1
    Welcome to TeX SE! You should move \bibliography{library} to the point where you have \section{References} and delete the section command because it will be automatically created. However, if natbib is not found, that is obviously going to be a problem. Is MiKTeX configured to install required packages on-the-fly? If not, perhaps you need to use its package manager to install natbib? – cfr Sep 21 '14 at 23:01
  • @Bernard: I'm using TeXStudio and it's working so far. But I don't know what happens behind all this (LaTeX or LaTeXpdf etc.). As I don't know what your commands mean (command/package etc.) can you explain what they mean (as I would be a 6 year old; e.g. compile the bibliography with "biber"...isn't TeXStudio my compiler?). – Lucas Sep 22 '14 at 05:15
  • @cfr: I installed "natbib" using MiKTeX2.9->Maintenance(Admin)->Package Manager (Admin) but when the package was not found tried MiKTeX2.9->Maintenance-Package manager. Still not solved. – Lucas Sep 22 '14 at 05:18
  • @crf: Ok, I updated TexStudio and now it seems to load the natbib package. I also moved \bibliography{library} to where I want the reference section to be created. \bibliographystyle{plainnat} is where it was. Stil no compilation. These warnings appear: Not defining \perthousand, Not defining \micro, Citation 'xyz' on page 1 undefined, No file abc.bbl, There were undefined citations. – Lucas Sep 22 '14 at 06:19
  • 2
    You need to post an MWE we can compile to reproduce in that case. Did you run bibtex and then (pdf)latex twice more? [We can't reproduce right now without the Schamb2010 from library.bib.] Do you get errors from bibtex? – cfr Sep 22 '14 at 12:11
  • Well I don't have enough characters to write the adjusted code here in the comment. But all I adjusted was simply to follow your advice of deleting the '\section{References}' and instead write the code '\bibliography{library}' there. I understand that you don't have the 'library.bib' with my characterised 'Schwamb2010' article; I don't know how to add such things here. Also I don't know how to answer your 'bibtex' and '(pdf)latex' question, as I don't kow what they are, where to look for and use them. Maybe I use them unconsciously. Step-by-step instructions would help me. I try what you say. – Lucas Sep 22 '14 at 17:38
  • I did and wrote one which worked for me a year ago. But it was deleted for an unknown reason this spring. – Lucas Oct 04 '15 at 13:31
  • Lucas, that isn't an answer, just a piece of code. The real answer is Run the commands like you are supposed to do and as you can find in any LaTeX introduction. A youtube video is not a great resource for LaTeX knowledge. I vote to close as duplicate. – Johannes_B May 14 '17 at 07:51

0 Answers0