Articles, Essays, and Journal Templateshow to add reference in my paper?

IEEE, Elsevier, ACM, ACE, Science, AGU, PNAS, PLOS, RSoC, Springer, Stylish articles and Essays
Post Reply
yaozhao
Posts: 57
Joined: Sat Oct 27, 2018 10:38 pm

how to add reference in my paper?

Post by yaozhao »

Hi,

I don't know how to add reference section in my paper. I tried to google, but the tutorial I saw is very hard to understand.

I write my paper in overleaf. I have one main.tex and one bibliography.bib

Code: Select all

%in the preamble
%--------------------------------
  \usepackage[
    backend=biber,
    style=apa,
  ]{biblatex}

 \addbibresource{bibliography}
%--------------------------------

%Where the bibliography will be printed
\printbibliography
In my bibliography.bib, it contains one reference:

Code: Select all

@article{glaze2008parents,
  title={Parents in prison and their minor children},
  author={Glaze, Lauren E},
  year={2008},
  publisher={Bureau of Justice Statistics}
}
It doesn't work, The reference doesn't show up in my paper.

Can anyone help me?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Bartman
Posts: 366
Joined: Fri Jan 03, 2020 2:39 pm

how to add reference in my paper?

Post by Bartman »

Please read the section on bibliography commands in the package documentation. The resource you are adding is missing the filename extension.

Furthermore, the incomplete example does not show us whether you cited the reference.
yaozhao
Posts: 57
Joined: Sat Oct 27, 2018 10:38 pm

how to add reference in my paper?

Post by yaozhao »

Code: Select all

\documentclass[12pt, a4paper]{article}
\setlength{\oddsidemargin}{0.5cm}
\setlength{\evensidemargin}{0.5cm}
\setlength{\topmargin}{-1.6cm}
\setlength{\leftmargin}{0.5cm}
\setlength{\rightmargin}{0.5cm}
\setlength{\textheight}{24.00cm} 
\setlength{\textwidth}{15.00cm}
\parindent 0pt
\parskip 5pt
\pagestyle{plain}

%in the preamble
%--------------------------------
  \usepackage[
    backend=biber,
    style=apa,
  ]{biblatex}

 \addbibresource{bibliography.bib}
%--------------------------------

\title{Research Proposal}
\author{}
\date{}

\newcommand{\namelistlabel}[1]{\mbox{#1}\hfil}
\newenvironment{namelist}[1]{%1
\begin{list}{}
    {
        \let\makelabel\namelistlabel
        \settowidth{\labelwidth}{#1}
        \setlength{\leftmargin}{1.1\labelwidth}
    }
  }{%1
\end{list}}

\begin{document}
\maketitle

\begin{namelist}{xxxxxxxxxxxx}
\item[{\bf Title:}]
	Jailed parents
\item[{\bf Keywords:}]
	Financial Stress
\end{namelist}

\section*{Abstract} 
%Where the bibliography will be printed
\printbibliography



\end{document}
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

how to add reference in my paper?

Post by Ijon Tichy »

By default, only cited references are shown in the bibliography. So you have to add something like \autocite{glaze2008parents} or \nocite{*}.

Off-topic note: \bf is deprecated. You should use either {\bfseries Title} or \textbf{Title}. And instead of manipulation if layout lengths like \oddsidemargin it is recommended to use a package like geometry.
\begin{filecontents}{\jobname.bib}
@article{glaze2008parents,
  title={Parents in prison and their minor children},
  author={Glaze, Lauren E},
  year={2008},
  publisher={Bureau of Justice Statistics}
}
\end{filecontents}

\documentclass[12pt, a4paper]{article}
\usepackage{geometry}% recommended to change layout
\geometry{left=3.04cm,top=0.94cm,includehead,textheight=24cm,textwidth=15cm}
\usepackage{parskip}% Recommended, if you want parskip instead of indent with standard classes
\setlength{\parskip}{5pt}% strange value

%in the preamble
%--------------------------------
\usepackage[
  backend=biber,
  style=apa,
]{biblatex}

\addbibresource{\jobname.bib}
%--------------------------------

\title{Research Proposal}
\author{}
\date{}

\newcommand{\namelistlabel}[1]{\textbf{#1:}\hfil}% label format moved to the definition
\newenvironment{namelist}[1]{%1
\begin{list}{}
    {
        \let\makelabel\namelistlabel
        \settowidth{\labelwidth}{#1}
        \setlength{\leftmargin}{1.1\labelwidth}
    }
  }{%1
\end{list}}

\begin{document}
\maketitle

\begin{namelist}{xxxxxxxxxxxx}
\item[Title]% label format moved to the definition
    Jailed parents
\item[Keyword]% label format moved to the definition
    Financial Stress
\end{namelist}

\section*{Abstract} 

Example cite: \autocite{glaze2008parents}% to have it in the references, cite it

\printbibliography

\end{document}
After running pdflatex, biber, pdflatex, pdflatex this results in:
Image
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
yaozhao
Posts: 57
Joined: Sat Oct 27, 2018 10:38 pm

how to add reference in my paper?

Post by yaozhao »

Code: Select all

\begin{filecontents}{\jobname.bib}
@article{glaze2008parents,
  title={Parents in prison and their minor children},
  author={Glaze, Lauren E},
  year={2008},
  publisher={Bureau of Justice Statistics}
}
\end{filecontents}
These codes are just on the top of main.tex file? I don't need to create a new .bib file?
Also, what if I want to cite a lot of papers?
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

how to add reference in my paper?

Post by Ijon Tichy »

Using filecontents is usual for creating Infominimal working examples. For real documents you would just create the bib file either using an editor and a separate file or an application like JabRef.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
yaozhao
Posts: 57
Joined: Sat Oct 27, 2018 10:38 pm

how to add reference in my paper?

Post by yaozhao »

Sorry, I don't figure it out. I'm totally stuck.
Post Reply