17

First of all I would like to thank you because you helped me out a lot with all your answers to the already online questions.

Now, here is my problem. I am trying to do a bibliography file with TeXworks but I get this error when I try to compile (pdfLaTeX+MakeIndex+bibTeX):

    This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit)
    entering extended mode
    ****PATH here******
    ! Undefined control sequence.
    l.1 \documentclass
        [a4paper,11pt]{report}

I've been reading some similar questions but I don't find the way to fix it (maybe I am missing something). I found one that says that I am trying to compile a LaTeX file using TeX compiler but I don't know how to change the configuration.

This is the .bib fiel content:

    \documentclass[a4paper,11pt]{report}
    \usepackage[english]{babel}     % faire de l'anglais
    \usepackage[latin1]{inputenc}   % accents dans le source
    \usepackage[T1]{fontenc}        % accents dans le DVI
    \usepackage{url}
    \begin{document}

    @Article{ref11,
author={Danihelka, Jiri and Kencl, Lukas},
journal={Cloud Futures Workshop 2012 },
title={Colaborative 3D Environments over Windows Azure},
year={2012},
month={May},
pages={},
note={}
    }

    @book{ref12,
author = {Lee, Henry and Chuvyrov, Eugene},
    title = {Beginning Windows Phone 7 Development},
    publisher = {Apress},
    volume = {},
    number = {},
    series = {},
    address = {},
    edition = {Second edition},
    year = {2011},
    month = {July},
    note = {}
    }

    @Article{ref13,
author={},
journal={},
title={Cloud computing},
year={},
month={},
pages={},
url={\url{http://en.wikipedia.org/wiki/Cloud_computing}}
    }

    \end{document}
jlcivico
  • 385
  • 1
  • 3
  • 9
  • 19
    You are running pdfTeX, not pdfLaTeX. Check carefully which option you have selected in TeXworks. – Joseph Wright Mar 17 '13 at 13:00
  • 3
    Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say "thank you" to users who helped you. – hpesoj626 Mar 17 '13 at 13:31
  • 1
    As I said, I am using pdfLaTeX+MakeIndex+bibTeX to compile. If I go to preferences->compile, and I edit the option pdfLaTeX+MakeIndex+bibTeX, this are the parameters:

    Program: texify.exe Parameters: --pdf --tex-option=$synctexoption $fullname

    What should I change?

    – jlcivico Mar 17 '13 at 14:28
  • 1
    Can you give us some more background? Please provide a minimal working example (MWE) that exhibits this problem. – hpesoj626 Mar 17 '13 at 16:01
  • 3
    @jlcivico Your .bib file should not contain \documentclass, \begin{document}, etc.; only bibtex/biblatex entries! – jub0bs Mar 17 '13 at 16:19
  • 1
    look into your documents source with another Editor and control if you have a first line like %& tex if yes, delete it and it will then use latex –  Mar 17 '13 at 16:22
  • 1
    @JosephWright Wow, just a big silly error. I am following a template and when I open it on TeXworks it showed the pdfLaTeX+MakeIndex+bibTeX without realising that this is the default option of the program and I thought that this way the right way to compile. Now, if I choose pdfLaTeX all goes smooth.

    In spite of that, I try to include the bibliography to my tex file but it does not appear.

        \bibliographystyle{abbrv}
        \bibliography{bibliograhy/biblio}
    
    

    (bilbio.bib file is in /bibliography folder)

    – jlcivico Mar 17 '13 at 16:43
  • 1
    jlcivico retain the incorrect .bib contents in question so that another user in same situation will benefit with your mistakes. Did @Jubobs answer work for you ? – texenthusiast Mar 17 '13 at 16:45
  • 1
    I don't know if I am wrong but, is it possible to compile the .bib file using pdfLaTeX and then include it on my report.tex ? Because maybe the concept is the basis of my error. – jlcivico Mar 17 '13 at 16:59
  • 1
    @jlcivico run pdflatex, bibtex,pdflatex and pdflatex sequence. Note: pdflatex does not run .bib files instead looks for .bblfile generated by bibtex. – texenthusiast Mar 17 '13 at 17:43
  • 1
    @texenthusiast When I run bibtex it shows the next message: The top-level auxiliary file: biblio.aux I found no \citation commands---while reading file biblio.aux I found no \bibdata command---while reading file biblio.aux I found no \bibstyle command---while reading file biblio.aux It is supposed that in the first run of pdflatex, it should place these lines into biblio.aux – jlcivico Mar 17 '13 at 19:07
  • 1
    @jlcivico In TeXworks,File menu--> remove old auxillary .aux files and rerun pdflatex, bibtex,pdflatex and pdflatex sequence. Jubobs answer works well. For reference: verify with andy-roberts bibliographies .tex example and sample.bib – texenthusiast Mar 17 '13 at 19:50
  • 1
    @texenthusiast Ok, after changing the compilation mode in texmaker it works. It shows the bibliography on my report.tex but it does not create the auxiliary files. – jlcivico Mar 17 '13 at 20:26
  • 1
    @jlcivico are you using TeXworks or Texmaker ? both would work with default configuration. once you get the sufficient reputation you can come to chat it is not recommended to have more comments here as TeX.SX recommends a chat discussion. – texenthusiast Mar 18 '13 at 01:04
  • 1
    Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – jub0bs Mar 13 '14 at 16:43

1 Answers1

4

Your .bib file should only contain BibTeX entries (and possibly comments). It should not contain \documentclass, \usepackage, \begin{document}, etc.

If your .bib file has "mybiblio" as base name and contains

@Article{ref11,
    author  = {Danihelka, Jiri and Kencl, Lukas},
    journal = {Cloud Futures Workshop 2012 },
    title   = {Colaborative 3D Environments over Windows Azure},
    year    = {2012},
    month   = {May},
    pages   = {},
    note    = {}
}

@book{ref12,
    author      = {Lee, Henry and Chuvyrov, Eugene},
    title       = {Beginning Windows Phone 7 Development},
    publisher   = {Apress},
    volume      = {},
    number      = {},
    series      = {},
    address     = {},
    edition     = {Second edition},
    year        = {2011},
    month       = {July},
    note        = {}
}

@Article{ref13,
    author  = {},
    journal = {},
    title   = {Cloud computing},
    year    = {},
    month   = {},
    pages   = {},   
    url = {\url{http://en.wikipedia.org/wiki/Cloud_computing}}
}

then running pdflatex, then bibtex, then pdflatex twice on the following code should work and produce the expected output:

\documentclass[a4paper,11pt]{report}
\usepackage[english]{babel}     % faire de l'anglais
\usepackage[latin1]{inputenc}   % accents dans le source
\usepackage[T1]{fontenc}        % accents dans le DVI
\usepackage{url}
\begin{document}

As seen in \cite{ref11}, blah blah blah.

\bibliographystyle{plain}
\bibliography{mybiblio}
\end{document}

enter image description here

jub0bs
  • 58,916
  • 3
    May be it's worthwhile to mention run pdflatex first, then bibtex again pdflatex and again pdflatex to get the final pdf with citations for a new user. – texenthusiast Mar 17 '13 at 17:25