1

How can I put citations in my text that are just numbers? At the moment, I am using the natbib package, which gives me citations in the form Weisstein [1]. I want citations that are just [1] and the number is displayed next to the corresponding reference. Which package can I use to do this?

The following is my preamble:

%This is the preamble of the document
\usepackage{geometry}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{framed}
\usepackage{amssymb}
\usepackage{float}
\usepackage{apacite}
\usepackage[numbers]{natbib}

and my citations look like this:

\begin{framed}
\noindent \textit{Sidenote:} A polygonal number \citet{Polygonal_number} is a number that can be expressed in dots and arranged in the shape of a polygon. The formula for the $n^{th}$ polygonal number, where the polygon has $s$ sides is: 
\[P(s,n)= \frac{n^2(s-2)- n(s-4)}{2}\]
\end{framed}
4

To just obtain the number, replace \citet with \citep.

The following MWE shows the difference:

\documentclass{article}
\usepackage[numbers]{natbib}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@book{example,
    author = "Michel Goossens and Frank Mittlebach and Alexander Samarin",
    title = "The Latex Companion A",
    year = "1993",
    publisher = "Addison-Wesley",
    address = "Reading, Massachusetts"
}
\end{filecontents}

\begin{document}
\citep{example}

\citet{example}

\bibliographystyle{plainnat}
\bibliography{\jobname}

\end{document}

enter image description here

For a more in depth description of the differences, you can refer to section '2.3 Basic Citation Commands' of the natbib manual (page 7), that contains several examples of code and the corresponding output.

5
  • Thanks! It worked! How can I number my references in the same way? – user83024 Mar 16 '18 at 21:26
  • 1
    @user83024: To obtain numerical labels in the bibliography as well, you might want to use a numerical bibliographystyle as shown in my answer. – leandriis Mar 16 '18 at 21:34
  • Is it supposed to make all the text italic and push it onto one line so it runs off the page? – user83024 Mar 16 '18 at 21:51
  • No, it is definitely not supposed to. Unfortunately, I can not reproduce the error you describe with the information you already provided. Additional question: Why do you load apacite if you want to use a numerical citation and bibliography style? – leandriis Mar 16 '18 at 22:01
  • I forgot to remove it. – user83024 Mar 16 '18 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.