Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to use the natbib package?

968 views
Skip to first unread message

Mark Thompson

unread,
Mar 31, 2003, 7:56:15 PM3/31/03
to
Hello,

I've posted several questions with problems that I have run into with the
natbib package. I spent a fair bit of time changing each \cite{key} to
correspond with the requirements of natbib. Has anybody else used this
package, and if so did you have any problems? When I first started using
natbib, everyting seemed to be running smooth, but now my thesis is showing
40 errors in places where none existed before.

Regards,
Mark


Joris Desmet

unread,
Apr 1, 2003, 4:24:45 AM4/1/03
to
"Mark Thompson" <mdth...@ucalgary.ca> wrote in message news:<b6asuu$obg$1...@nserve1.acs.ucalgary.ca>...

You should probably provide some more information about the type of
errors you are getting. I use natbib all the time without any
problems.
Can you provide a minimal example that has some of the errors you are
referring to?

Joris.

Mark Thompson

unread,
Apr 1, 2003, 12:13:11 PM4/1/03
to
Thanks for your response Joris,

I'm using the latest version of MikTex in TeXnicCenter and in conjunction
with WinBibDB for windows. I've been using latex to write my thesis.
Forgive me if my explanation is a little poor, I'm not all too familiar with
latex. The first problem I have is that I have to sit and wait while I get
warnings for every citation:

Package natbib Warning: Citation 'xxx' on page xxx undefined on input line
xxx.

The first two errors say:

! Undefined control sequence.
\@xfloat ...\fi \global \setbox \@currbox
\vbox \bgroup
\def \baselin...

1.582 \begin
{center}

! Missing number, treated as zero.
<to be read again>
\vbox

1.582 \begin
{center}

And I get many other errors, the following one appear frequently:

! Paragraph ended before \@xnext was complete

These sorts of errors didn't appear before I implemented natbib. I'm not
sure what other information I could provide that would help pinpoint the
error. Also since using natbib I have not seen the literature cited appear
at the end of my thesis. Just to find out that I'm using the package
correctly, of course I indicate \usepackage{natbib}, and then when I want my
bibliography I put the following:

\bibliographystyle{harvard}
\bibliography{thesisbib}

Thanks for any help that you may be able to provide.

Regards,
Mark

Mark Thompson

unread,
Apr 1, 2003, 4:12:36 PM4/1/03
to
I should also mention that I have to shut TexnicCenter down, re-open my
project, and compile the document every time I want to see any changes. If
I don't do this the file is said to be corrupt and I cannot view it.

Regards,
Mark


lin

unread,
Apr 2, 2003, 5:34:35 AM4/2/03
to
Just to find out that I'm using the package
> correctly, of course I indicate \usepackage{natbib}, and then when I want my
> bibliography I put the following:
>
> \bibliographystyle{harvard}
> \bibliography{thesisbib}
>

perhaps try setting \citestyle{harvard} before \begin{document}
and \bibliographystyle{plainnat} (or abbrnat or unsrtnat depending on
what you need)

that might do the trick

Mark Thompson

unread,
Apr 2, 2003, 4:43:31 PM4/2/03
to
Tried this - no luck. Still can't see my bibliography. This is turning out
to be very very frustrating. I have no idea why these errors suddenly
appeared. I was 200 pages into my thesis before the errors started. Any
further suggestions would be greatly appreciated.

Regards,
Mark

"lin" <l...@where.com> wrote in message
news:10492796...@seven.kulnet.kuleuven.ac.be...

Donald Arseneau

unread,
Apr 2, 2003, 7:17:17 PM4/2/03
to
"Mark Thompson" <mdth...@ucalgary.ca> writes:

> The first two errors say:
>
> ! Undefined control sequence.
> \@xfloat ...\fi \global \setbox \@currbox
> \vbox \bgroup
> \def \baselin...
>
> 1.582 \begin
> {center}


The huge amount of space there makes me suspect you have corrupt files.

In answer to your original question: other people have no such
difficulties with natbib.

Other than that possibility, people will likely have to see a short
but full demonstration document to see what is wrong.

Donald Arseneau as...@triumf.ca

Mark Thompson

unread,
Apr 2, 2003, 11:44:05 PM4/2/03
to
I don't think the figures are corrupt, they're just big. I my document on
the web:

http://www.ucalgary.ca/~mdthomps/Latex

Someone has suggested for another error that I was trying to troubleshoot
that I use the floats package. Could the confusion over the floating of my
figures cause the type of error that I'm experiencing with my bibliography??

Regards,
Mark

"Donald Arseneau" <as...@triumf.ca> wrote in message
news:yfi65pw...@triumf.ca...

Dr Engelbert Buxbaum

unread,
Apr 3, 2003, 2:58:26 AM4/3/03
to
Mark Thompson wrote:

>
> Package natbib Warning: Citation 'xxx' on page xxx undefined on input line
> xxx.


this is no error, just do a second LaTeX run and those messages will
vanish. When Latex first encounters your \citep statement, it does not
know whether or not the reference exists, so it complains. During the
run a nuber of files are created, which contain the necessary
information for the second run. Sometimes, even a third run is required
to resolve all cross-references.

the following example shows how to use natbib:


\documentclass{scrartcl}

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

\begin{document}

\section{The principle of SDS-PAGE}

Electrophoretic separation of proteins is probably one of
the most widely used techniques in biochemical
laboratories. This is true in particular for SDS-PAGE
\citep{Lae-70}.

begin{thebibliography}[99]

\bibitem{Lae-70}
\textsc{Laemli,U.K.} (1970) Cleavage of Structural Proteins During
the Assembly of the Head of Bacteriophage T4 \textit{Nature}
\textbf{227} 680-685


\end{thebibliography}

\end{document}

Robin Fairbairns

unread,
Apr 6, 2003, 4:42:12 AM4/6/03
to
"Mark Thompson" <mdth...@ucalgary.ca> writes:
>I don't think the figures are corrupt, they're just big. I my document on
>the web:
>
>http://www.ucalgary.ca/~mdthomps/Latex

what donald asked for was a minimum document that demonstrates the
problem. since you claim you're 200 pages in (about twice the
permitted page count, here), i doubt your complete thesis is a minimum
example of the problem.

create a document with a bibliography and one citation, using your
original set of packages.

cut it down until

>Someone has suggested for another error that I was trying to troubleshoot
>that I use the floats package. Could the confusion over the floating of my
>figures cause the type of error that I'm experiencing with my bibliography??

not in the slightest. however,

>"Donald Arseneau" <as...@triumf.ca> wrote...


>> > ! Undefined control sequence.
>> > \@xfloat ...\fi \global \setbox \@currbox
>> > \vbox
>\bgroup
>> > \def \baselin...
>> >
>> > 1.582 \begin
>> > {center}
>>
>>
>> The huge amount of space there makes me suspect you have corrupt files.

i bet you copied this thing rather than cutting-and-pasting ... and
that you had to type lots of space to get things to line up. remember
that some of us use a fixed-width fonts to read news -- precisely
because it's necessary for reading cut-and-paste text. so you don't
need to tidy things up, in your posts, for the benefit of the people
who might help you.

however, the error probably has nothing to do with natbib, since it's
in the start of processing a float. it could be that your
university's class is incompatible with float.sty...
--
Robin Fairbairns, Cambridge

0 new messages