General ⇒ BibTeX & "undefined control sequence"
-
- Posts: 18
- Joined: Tue Mar 20, 2007 7:42 pm
BibTeX & "undefined control sequence"
I've been working with LaTeX since January, so I'm pretty new to this. I've been trying to create a .bib file and make it work with my .tex document. I've basically copied all the procedures, so I believe the input to be right. Even so, it comes out incorrectly. I run LaTeX, BibTeX, and then LaTeX twice. Sometimes I get the error message that it is an udefined control sequence, other times I get the DVI file with my references as ?. I'm not able to see the pattern in these two responses, and in any case, it is no good having references typed out as question marks. I use the stylesheet Chicago. Anyone who knows what I'm doing wrong?
Chrsitine
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- pumpkinegan
- Posts: 91
- Joined: Thu May 03, 2007 10:29 pm
Re: BibTeX & "undefined control sequence"
Open the bbl file with a text editor. If it looks meaningful, then compiling the document again with LaTeX should give a dvi with references. If the bbl file contains nonsense (or is not created at all), then we will have to try other things.
Patrick.
Re: BibTeX & "undefined control sequence"
-
- Posts: 18
- Joined: Tue Mar 20, 2007 7:42 pm
Re: BibTeX & "undefined control sequence"
\begin{thebibliography}{}
\bibitem[\protect\citeauthoryear{Anglade}{Anglade}{1947}]{a}
Anglade, J. (1947).
\newblock {\em Grammaire élémentaire de l'ancien français}.
\newblock Paris: Colin.
\end{thebibliography}
I get the error message from Latex. This reads:
LaTeX Warning: Citation 'a' on page 1 undefined on input line 17.
<bibtest.bbl
! undefined control sequence.
<argument> \protect \citeauthoryear
{Anglade}{Anglade}{1947}
1.3 ...\citeauthoryear{Anglade}{Anglade}{1947}]{a}
I should perhaps add that my LaTeX babel is tuned at French.
Does this at all make any sense?
Christine
- pumpkinegan
- Posts: 91
- Joined: Thu May 03, 2007 10:29 pm
Re: BibTeX & "undefined control sequence"
I would recommend having a look at the attachment. There is a tex file with some text and an article and a book have been referenced using the \cite command with the reference label. At the end of the tex file, there is the reference section:
\bibliographystyle{chicago}
\bibliography{SampleBib}
The first command selects the Chicago bibliography style (which uses chicago.bst). The second command directs chicago.bst to the bib file SampleBib. Note how a bib file should be formatted (with the @article and @book)
First compile the document with LaTeX. Then running BibTeX will generate a bbl file in the style of chicago.bst. Now compile with LaTeX. This should fix the problem. (Note: you will need French babel for your document.)
Patrick.
- Attachments
-
- SampleBibTeX.zip
- (685 Bytes) Downloaded 2763 times
-
- Posts: 18
- Joined: Tue Mar 20, 2007 7:42 pm
Re: BibTeX & "undefined control sequence"
Could it be a problem related to the fact that I use WinEdt?
C
- pumpkinegan
- Posts: 91
- Joined: Thu May 03, 2007 10:29 pm
Re: BibTeX & "undefined control sequence"
Would you consider the natbib package and plainnat.bst as an alternative? From my previous post, just replace:
\bibliographystyle{plainnat}
\bibliography{SampleBib}
You should see something like the attached dvi.
Patrick.
- Attachments
-
- SampleArticle_DVI.zip
- (934 Bytes) Downloaded 1040 times
-
- Posts: 18
- Joined: Tue Mar 20, 2007 7:42 pm
Re: BibTeX & "undefined control sequence"
Could it be I lack some of the programs needed? I have WinEdt (thus LaTeX), MikTeX and Ghostscript - but not Ghostview nor WMF2EPS.
Christine
(still quite eager to make it work)
- pumpkinegan
- Posts: 91
- Joined: Thu May 03, 2007 10:29 pm
Re: BibTeX & "undefined control sequence"
After doing this, compile with LaTeX. Then run BibTeX. A bbl file should be generated. Open the bbl file, and it should contain:
\begin{thebibliography}{2}
\providecommand{\natexlab}[1]{#1}
\providecommand{\url}[1]{\texttt{#1}}
\expandafter\ifx\csname urlstyle\endcsname\relax
\providecommand{\doi}[1]{doi: #1}\else
\providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi
\bibitem[{Surname}(2007{\natexlab{a}})]{article_label}
Firstname~I. {Surname}.
\newblock Title of article.
\newblock \emph{Journal of Publication}, 1:\penalty0 1--2, May
2007{\natexlab{a}}.
\bibitem[{Surname}(2007{\natexlab{b}})]{book_label}
Firstname~I. {Surname}.
\newblock \emph{Title of Book}.
\newblock Publishing House, Address of Publishing House, 1 edition,
2007{\natexlab{b}}.
\end{thebibliography}
The fact that you are not getting an error, but just getting question marks at the \cite points suggests that the bbl file is not right. Is there a bbl file?
Now compile with LaTeX, and then compile again. The dvi should look like my previous post.
Patrick.
Notes:
1. WinEdt is just a nice text editor. MiKTeX is your flavor of LaTeX.
2. If you compile with texify.exe (instead of latex.exe) BibTeX will be run automatically, and the resulting dvi will open in YAP. WinEdt has a TeXify icon beside the LaTeX icon (the brownish lion).
-
- Posts: 18
- Joined: Tue Mar 20, 2007 7:42 pm
Re: BibTeX & "undefined control sequence"

Setting it as the main document really helped, but I'm still unable to change the bibliography settings. It works with {plain}, but the other packages seem to produce error codes. I load them through MikTeX, but that doesn't help. As far as I've understood this, I don't have to define the packages in the preamble?
C