1

Hello I am newbie with Latex and I couldn't compile my bibliography.tex when I comment it the pfd work well but when I uncomment it. the PDF doesn't appear and I couldn't resolve it I tried a lot this is my code

\documentclass[a4paper,12pt,oneside,latin1,utf8]{StyleRapport}
\include{formatAndDefs}
\usepackage{breakcites}
\usepackage{makeidx}
%\makeindex
\usepackage{multirow}
\usepackage{latexsym}
\usepackage{cite}
%\usepackage[latin1]{inputenc}
%\usepackage[utf8]{inputenc}
\usepackage{float}
\usepackage{epsfig}
\usepackage{epstopdf}
\usepackage{array}
\usepackage{acronym}
\usepackage{colortbl}
\usepackage[table]{xcolor}
\usepackage{fancyhdr}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{titletoc}
\usepackage{minitoc}
\usepackage{ragged2e}
\usepackage{xcolor}
\usepackage{slashbox,booktabs,amsmath}
\pagestyle{fancy}
\newcommand{\chaptertoc}[1]{\chapter*{#1}
\addcontentsline{toc}{chapter}{#1}
\markboth{\slshape\MakeUppercase{#1}}{\slshape\MakeUppercase{#1}}}
\renewcommand{\headrulewidth}{0.3pt}
\fancyhf{}
\renewcommand{\chaptermark}[1]{\markboth{\bsc{\chaptername~\thechapter{} :} #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection{} \ #1}}
\renewcommand{\headrulewidth}{0.3pt}
\lhead[]{\small{\rightmark}}
\rhead[\small{\leftmark}]{}
\cfoot[\small{\thepage}]{\thepage}

\begin{document}
\include{PageDeGarde}
\dominitoc
\pagenumbering{roman}
\frontmatter
\chapter*{Remerciements}
\mainmatter
\include{IntroductionGenerale}
%\mainmatter
\include{Chapter1}
\bibliographystyle{StyleRapport}
\bibliography{Bibliographie}
\cleardoublepage
\end{document}

My bibtex file called bibliography.tex and there is no bibliography.aux or bibliography.bll

Torbjørn T.
  • 206,688
MakBad
  • 15
  • 1
    Welcome to TeX.SX! Thank you for posting a working example! At the same time, much of your code does not seem to be relevant to the question you're asking here. Please limit the example to only the code required for your issue to appear. You can have a look at this guide for how to prune your code for this purpose. This is tedious, but is also a good way to find where the error comes from... and maybe to solve it by yourself! – ebosi May 25 '16 at 10:06
  • Well, do you \cite{} a reference somewhere in your code ? Do you compile with bibtex ? Please, as @ebo told you, give a clear and reproducible code. Here we miss a lot of code that you include, and we have tons of code that is probably not related to your problem. – Paul Giroud May 25 '16 at 10:19
  • yes i used \cite{} in chapter1.tex and i use bibtex – MakBad May 25 '16 at 10:36
  • As a side note, you have duplicate declarations of \usepackage{fancyhdr} and \usepackage{xcolor} – samthecodingman May 25 '16 at 11:01
  • @MakBad What is the exact error message you get? Is it related to no bibliography.aux or bibliography.bbl files present? – samthecodingman May 25 '16 at 11:03
  • @Samuel when I compiled my code it works but the bibliography doesn't appear I just had [?] in my PDF. I couldn't find the file Bibliography. aux or bibliography.bbl So i changed the name of bibliography to the same name of my main file which is Rapport.tex – MakBad May 25 '16 at 11:12
  • @MakBad, That means you need to run BibTeX over your file. When you compile with TeX, you need to compile once, compile your bibliography and then compile another couple of times. Are you using a TeX IDE such as TeXStudio? (F8 compiles BibTeX in TeXStudio) – samthecodingman May 25 '16 at 11:14
  • 2
    Is your file called bibliography.tex or bibliography.bib? The latter works. The former, I think, does not. – Ritz May 25 '16 at 11:21
  • I am using Textmaker. my biblio file called bibliography.bib. I compile it with PDFLatex+Bibtex+PDFLatex+PDFLatex+SeePDF but I have [?] in my text – MakBad May 25 '16 at 11:29
  • @MakBad so you should try \bibliography{bibliography} (with lowercase b and y instead of ie). The command is used as following: \bibliography{<name-of-your-.bib-file>} – ebosi May 25 '16 at 11:44
  • @ebo what's the diff it's just a file name no? the problem is that's I can't find my bibliography.aux and in the pdf I had [?] and a white paper – MakBad May 25 '16 at 11:51
  • @MakBad In your document, you call the command \bibliography{Bibliographie}, so natbib (that uses biblatex processing) will look for the file Bibliographie.bib. If you don't have this file (but rather bibliography.bib as you explained), your references will never be found! Btw, as your example is far from minimal, I think (but not sure) you don't load \usepackage{natbib} that defines the \cite command and enables the processing of you .bib file... – ebosi May 25 '16 at 11:56
  • If your .tex file is called file.tex, then you will get a file called file.aux when you run pdfLaTeX. And it has to be the correct filename. If your .bib file is called Bibliographie.bib, then you should have \bibliography{Bibliographie} in the .tex file. – Torbjørn T. May 25 '16 at 11:58
  • @ebo biblatex? And you don't need natbib to use \cite. – Torbjørn T. May 25 '16 at 12:00
  • @TorbjørnT. of course, I meant BibTeX (for one's interrest: bibtex vs. biber and biblatex vs. natbib). I didn't knew you could use \cite without natbib. Is it the case for \bibliography as well? – ebosi May 25 '16 at 12:04

1 Answers1

1

Okay, you have several errors in your code.

First, we do not know where your used class StyleRapport comes from. Therefore I just changed it to standard class article and commented the class options not useable with class article.

Second, we do not have your used bibliography style StyleRapport, so I changed it in the following MWE to plain.

Now please have a look to the following lines:

\documentclass[%
  a4paper,12pt,
% oneside,latin1,utf8 % choose latin1 or utf8!
]{article} % StyleRapport

%\include{formatAndDefs} % ========= no, never \include her, only \input !!
\usepackage[latin1]{inputenc}
%\usepackage[utf8]{inputenc} % == You can't use latin1 and utf8 together!

You can only use file encoding latin1 or utf8, but not both together! So please for your class choose one of them, I activated latin1 for the MWE.

Your line \include{formatAndDefs} is simply wrong there, in the preamble you can only use \input{formatAndDefs.tex}. Please see that in an MWE that \input is not helpful, because we do not have the file formatAndDefs.tex (you saw \input with extension .tex?).

Then you called several packages double or more. Please do only call packages you know, be careful with the order you call them, and please read the documentations. Then for example you can learn that \usepackage{colortbl}is the same as \usepackage[table]{xcolor}. I left the last one commented in the MWE.

Then I reduced the definition for the page header to a minimum and added with package filecontents (only for the MWE to have TeX code and Bib file together in one compilable MWE!) an example bib file because you gave us no file.

Now please copy the following MWE to your computer and compile it three times. It should compile with no errors. Then please study my code and change one step by one step your own code. Compile after each step (one changing) to see errors at once!

Changed MWE:

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Book{Goossens,
  author    = {Goossens, Michel and Mittelbach, Frank and 
               Samarin, Alexander},
  title     = {The LaTeX Companion},
  edition   = {1},
  publisher = {Addison-Wesley},
  location  = {Reading, Mass.},
  year      = {1994},
}
@Book{adams,
  title     = {The Restaurant at the End of the Universe},
  author    = {Douglas Adams},
  series    = {The Hitchhiker's Guide to the Galaxy},
  publisher = {Pan Macmillan},
  year      = {1980},
}
\end{filecontents*}


\documentclass[%
  a4paper,12pt,
% oneside,latin1,utf8 % choose latin1 or utf8!
]{article} % StyleRapport

%\include{formatAndDefs} % ========= no, never \include her, only \input !!
\usepackage[latin1]{inputenc}
%\usepackage[utf8]{inputenc} % == You can't use latin1 and utf8 together!

\usepackage{breakcites}
\usepackage{cite}

%\usepackage[table]{xcolor} % == use only this, delete other color calls!

\usepackage{fancyhdr}
\pagestyle{fancy}

\renewcommand{\headrulewidth}{0.3pt}
\fancyhf{}
\lhead[]{\small{\rightmark}}
\rhead[\small{\leftmark}]{}
\cfoot[\small{\thepage}]{\thepage}


\begin{document}

\include{Chapter1}
text \cite{adams} text 
\nocite{*}  % =============== To have all bib entrys in the bibliography ...
\bibliographystyle{plain} % =========== StyleRapport
\bibliography{\jobname} % ========== uses file created with filecontents!
\end{document}

and the result:

enter image description here

If possible, can you provide a link to your used class?

Mensch
  • 65,388