Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I was wondering if I can use the \citenum{} command of natbib without actually using it. I prefer using \bibitem{} instead of .bib file. Any idea?

share|improve this question
    
You can load natbib without needing to use BibTeX: all you have to do is use the correct format for the \bibitem entries. Is that what you are getting at? –  Joseph Wright Jan 26 '13 at 9:30
    
If I add natbib package I get an error! –  Nicholas Jan 26 '13 at 9:41
add comment

2 Answers 2

up vote 4 down vote accepted

You can use natbib without needing to run BibTeX, and can then use \citenum

\documentclass{article}
\usepackage[numbers]{natbib}
\begin{document}

\citenum{Other2013}

\begin{thebibliography}{1}
  \bibitem{Other2013}
    A.~N. Other, F. Bloggs and D. Nobacon, \emph{J.~Irrep. Res.}, 2013,
    1--10.   
\end{thebibliography}
\end{document}

To get the best out of natbib you need to use the extended \bibitem format that it works with, which includes the full author details:

\documentclass{article}
\usepackage[numbers]{natbib}
\begin{document}

\citenum{Other2013}

\begin{thebibliography}{1}
  \bibitem[Other \emph{et al.}(2013)Other, Bloggs and Nobacon]{Other2013}
    A.~N. Other, F. Bloggs and D. Nobacon, \emph{J.~Irrep. Res.}, 2013,
    1--10.   
\end{thebibliography}
\end{document}
share|improve this answer
    
You are a genius! Thank you very much! It worked perfectly –  Nicholas Jan 26 '13 at 10:16
add comment

With the following, you can use both the standard \cite and \citenum, and the (in my opinion most important) feature sort&compress works as well:

\documentclass{article}

\usepackage[numbers,square,sort&compress]{natbib}

\makeatletter
\let\oldbibitem\bibitem
\newcounter{bibstep}
\def\bibitem{\stepcounter{bibstep}\@ifnextchar[\oldbibitem{\oldbibitem[A(\arabic{bibstep})]}}
\makeatother

\begin{document}

\cite{cite:1,cite:20,cite:7,cite:2}, \citenum{cite:1}, \cite[chap. 3]{cite:26}

\begin{thebibliography}{10}

\bibitem{cite:2}
{\sc {Abiteboul}, S.}
\newblock A deployment of 16 bit architectures using {RETTE}.
\newblock In {\em {Proceedings} of the {Workshop} on {Data} {Mining} and
  {Knowledge} {Discovery}\/} (Oct. 2003).

\bibitem{cite:17}
{\sc {Agarwal}, R., {Stearns}, R., {Harichandran}, K., {Wirth}, N., {Lee}, B.,
  and {Nehru}, R.}
\newblock A construction of {IPv7} using {\em {lustrumlin}}.
\newblock {\em {Journal} of Robust, Perfect Methodologies 91\/} (June 1993),
  20--24.

\bibitem{cite:12}
{\sc {Anderson}, R., and {Sasaki}, a.}
\newblock Decoupling {a}* search from the memory bus in 802.11b.
\newblock In {\em {Proceedings} of the {Workshop} on Cacheable, Relational
  Theory\/} (June 1990).

\bibitem{cite:4}
{\sc {Clark}, D., XX, XX, {Rivest}, R., and {Li}, M.}
\newblock A case for the producer-consumer problem.
\newblock In {\em {Proceedings} of the {Workshop} on Empathic, Perfect
  Epistemologies\/} (Jan. 1992).

\bibitem{cite:14}
{\sc {Cook}, S.}
\newblock The {UNIVAC} computer considered harmful.
\newblock In {\em {Proceedings} of the {Workshop} on Robust Archetypes\/} (July
  2003).

\bibitem{cite:6}
{\sc {Culler}, D., and {Zhao}, F.}
\newblock Towards the simulation of redundancy.
\newblock In {\em {Proceedings} of {SIGGRAPH}\/} (May 2002).

\bibitem{cite:10}
{\sc {Culler}, D., {Zheng}, O., {Wilson}, Z.~I., and {Chomsky}, N.}
\newblock Analyzing the producer-consumer problem and {RPCs} with {REW}.
\newblock {\em {Journal} of {Automated} {Reasoning} 99\/} (Sept. 2005), 77--97.

\bibitem{cite:15}
{\sc {Davis}, C., and {Ashwin}, U.}
\newblock Studying rasterization and linked lists using {UppentWapp}.
\newblock In {\em {Proceedings} of {NSDI}\/} (Nov. 2003).

\bibitem{cite:28}
{\sc {Davis}, H.}
\newblock Knowledge-based archetypes for object-oriented languages.
\newblock In {\em {Proceedings} of {SIGGRAPH}\/} (Dec. 2001).

\bibitem{cite:16}
{\sc {Davis}, J., and {Hoare}, C. A.~R.}
\newblock Deconstructing digital-to-analog converters with {Fur}.
\newblock In {\em {Proceedings} of {INFOCOM}\/} (Sept. 1997).

\bibitem{cite:7}
{\sc {Feigenbaum}, E., {Takahashi}, X., {Milner}, R., and {Corbato}, F.}
\newblock Constructing architecture and web browsers.
\newblock {\em {Journal} of Ambimorphic, Cooperative Communication 68\/} (June
  2002), 45--53.

\bibitem{cite:20}
{\sc {Gray}, J.}
\newblock Decoupling {I/O} automata from the {UNIVAC} computer in context- free
  grammar.
\newblock {\em {Journal} of Reliable, Constant-Time Symmetries 28\/} (July
  1999), 71--87.

\bibitem{cite:1}
{\sc {Hennessy}, J., {Jacobson}, V., and {Backus}, J.}
\newblock Deconstructing the location-identity split.
\newblock {\em {TOCS} 8\/} (May 2002), 20--24.

\bibitem{cite:24}
{\sc {Karp}, R., and {Lamport}, L.}
\newblock Cooperative, classical models for {XML}.
\newblock {\em {Journal} of Trainable, Encrypted Symmetries 35\/} (Oct. 2001),
  74--91.

\bibitem{cite:22}
{\sc {Nygaard}, K.}
\newblock Deploying reinforcement learning and the memory bus using {CRATE}.
\newblock In {\em {Proceedings} of the {Workshop} on Certifiable, Empathic
  Symmetries\/} (Feb. 2005).

\bibitem{cite:23}
{\sc {Nygaard}, K., and {Quinlan}, J.}
\newblock Deconstructing {RAID}.
\newblock {\em {Journal} of Collaborative, {Bayesian} Epistemologies 2\/} (July
  2004), 76--95.

\bibitem{cite:11}
{\sc {Patterson}, D.}
\newblock {Mason}: Empathic, interposable epistemologies.
\newblock {\em {TOCS} 49\/} (Nov. 1999), 154--193.

\bibitem{cite:19}
{\sc {Qian}, W.}
\newblock Decoupling {IPv7} from simulated annealing in extreme programming.
\newblock {\em {Journal} of Unstable Modalities 2\/} (May 2000), 1--14.

\bibitem{cite:13}
{\sc {Shenker}, S.}
\newblock Architecting systems using peer-to-peer archetypes.
\newblock {\em {Journal} of Introspective, Pervasive, Random Symmetries 46\/}
  (June 1993), 52--64.

\bibitem{cite:0}
{\sc {Sutherland}, I., and {Anderson}, O.}
\newblock Deconstructing {B-Trees}.
\newblock {\em {Journal} of Lossless, Interactive Archetypes 40\/} (Sept.
  2003), 1--10.

\bibitem{cite:25}
{\sc {Takahashi}, J., and {Wilkinson}, J.}
\newblock {I/O} automata considered harmful.
\newblock In {\em {Proceedings} of {PLDI}\/} (Sept. 2003).

\bibitem{cite:8}
{\sc {Tanenbaum}, A.}
\newblock Simulating {a}* search and the producer-consumer problem using
  {Canoe}.
\newblock In {\em {Proceedings} of {MICRO}\/} (Dec. 2001).

\bibitem{cite:27}
{\sc {Taylor}, P.}
\newblock {SICCA}: Significant unification of write-ahead logging and agents.
\newblock {\em {Journal} of Certifiable Algorithms 650\/} (June 2005), 1--19.

\bibitem{cite:5}
{\sc {Turing}, A.}
\newblock A case for lambda calculus.
\newblock {\em {Journal} of Omniscient, Adaptive Methodologies 87\/} (Aug.
  2004), 75--83.

\bibitem{cite:26}
{\sc {Watanabe}, P.}
\newblock A case for operating systems.
\newblock Tech. Rep. 1146/3851, {UT} {Austin}, June 1991.

\bibitem{cite:18}
{\sc {Welsh}, M.}
\newblock Simulating architecture using interposable theory.
\newblock In {\em {Proceedings} of the {Workshop} on Flexible, Permutable,
  Secure Models\/} (May 2005).

\bibitem{cite:9}
{\sc {Welsh}, M., {Lampson}, B., and {Garey}, M.}
\newblock Studying superpages and access points using {Seg}.
\newblock {\em {Journal} of Wireless, Trainable Theory 49\/} (Jan. 2002),
  158--191.

\bibitem{cite:3}
{\sc XX}.
\newblock A methodology for the development of superpages.
\newblock {\em {Journal} of Replicated, Reliable Algorithms 96\/} (Sept. 2003),
  157--196.

\bibitem{cite:21}
{\sc {Zhou}, D.}
\newblock Deconstructing {Internet} {QoS} using {JougsSacrum}.
\newblock In {\em {Proceedings} of {OSDI}\/} (Apr. 2004).

\end{thebibliography}

\end{document}

Thanks SCIgen for the example bibliography.

share|improve this answer
    
That is amazing and very useful! Thank you so much –  Nicholas Jan 26 '13 at 10:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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