General ⇒ Main file not compiling anymore
Main file not compiling anymore
Hi all,
I have a main thesis document in which i put the various chapters. Now I finished another chapter. When I Want to compile the main file, I get following error:
! LaTeX Error: Can be used only in preamble.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1 \documentclass
[11,a4paper,twoside, openodd, final]{report}
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
The red errors all go to my titlepage. So I tried removing the input titlepage, without a result, the same errors come up but now my abstract giving the error. This is a copy of my original file, as my original file gave the following error:
! Text line contains an invalid character.
l.3
All red errors in this file refer to line 3, which is \usepackage [section]{placeins}.
Posting a minimal working example probably doesn't make any sense as all the files in it are missing for you guys...I hope someone can help me out! Please note, i haven't changed a thing in my main file, only added some text (no formula's or even images) to one of the chapters.
I have a main thesis document in which i put the various chapters. Now I finished another chapter. When I Want to compile the main file, I get following error:
! LaTeX Error: Can be used only in preamble.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1 \documentclass
[11,a4paper,twoside, openodd, final]{report}
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
The red errors all go to my titlepage. So I tried removing the input titlepage, without a result, the same errors come up but now my abstract giving the error. This is a copy of my original file, as my original file gave the following error:
! Text line contains an invalid character.
l.3
All red errors in this file refer to line 3, which is \usepackage [section]{placeins}.
Posting a minimal working example probably doesn't make any sense as all the files in it are missing for you guys...I hope someone can help me out! Please note, i haven't changed a thing in my main file, only added some text (no formula's or even images) to one of the chapters.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Main file not compiling anymore
Possibly you include a document, which itself starts like a document with
Perhaps post the .log file as an attachment to a forum post. This information could be useful.
Stefan
\documentclass
.Perhaps post the .log file as an attachment to a forum post. This information could be useful.
Stefan
LaTeX.org admin
Main file not compiling anymore
Code: Select all
Code, edit and compile here:
\documentclass[11]{book}\usepackage{amssymb,amsmath,nccmath,graphicx}\usepackage[section]{placeins}\usepackage{fixltx2e}\usepackage{titlesec}\usepackage{hyperref}\usepackage{fancyhdr}\pagestyle{fancy}\usepackage{caption}\usepackage{nomencl}\begin{document}\nocite{*}\input{titlepage}\chapter*{Abstract}\input{abstract}\chapter*{Dedication}The price of success is hard work, dedication to the job at hand, and the determination that whether we win or lose, we have applied the best of ourselves to the task at hand.\chapter*{Declaration}\chapter*{Acknowledgements}I want to thank my promotor, XXXXXXXX for guiding me through this thesis and the 3 years at the VUB in general. I also want to thank my co-promotorsXXXXX and XXXXXXXXXX, for the practical advices and change of thoughts. I'd also like to thank XXXXXXXXXX to book the semi-anechoic room at the XXX campus. Last but not least, I'd like to thank my family and close friends for their support on this long journey.\tableofcontents\listoffigures\listoftables\begin{figure}\centerline{\includegraphics{nomencl}}\end{figure}\chapter{Introduction}\input{hoofdstuk1}
Last edited by Stefan Kottwitz on Sun Apr 27, 2014 2:50 pm, edited 1 time in total.
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Main file not compiling anymore
Your document uses the book class, as we can see in the first line. However, the error shows
It's obviously not another package, since that error message and your document show the same wrong class option
The .log file is stored in the same folder as the main document.
Stefan
report
in \documentclass[11,a4paper,twoside, openodd, final]{report}
. So you are loading report
in one of your files.It's obviously not another package, since that error message and your document show the same wrong class option
11
, there is no such option, you probably mean 11pt
.The .log file is stored in the same folder as the main document.
Stefan
LaTeX.org admin
Main file not compiling anymore
I changed all the files to book and included 11pt instead of 11. But this still gives me the same errors. I suppose the .log file is this one:
https://www.dropbox.com/s/9dgpobjma9yqo ... elling.log
I'm not a hero in reading the .log file. Is it common that Texmaker just can't compile anymore without changing anything to the main file? I originally had an error with chapter 4, which gives me "A funny symbol that I can't read has just been input.
Continue, and I'll forget that it ever happened."
The log file of this chapter is this one:
https://www.dropbox.com/s/qaqdm4tbnjs04 ... dstuk4.log
https://www.dropbox.com/s/9dgpobjma9yqo ... elling.log
I'm not a hero in reading the .log file. Is it common that Texmaker just can't compile anymore without changing anything to the main file? I originally had an error with chapter 4, which gives me "A funny symbol that I can't read has just been input.
Continue, and I'll forget that it ever happened."
The log file of this chapter is this one:
https://www.dropbox.com/s/qaqdm4tbnjs04 ... dstuk4.log
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Main file not compiling anymore
Please always attach files directly to a forum post, don't post external links to files. We don't want users to be forced to visit dropbox or other file hosters.
Your chapter 4 loads the report document class. However, it should not call a document class, it simply uses the class of the main document. A chapter file should not have a preamble, it should not have a
Stefan
Your chapter 4 loads the report document class. However, it should not call a document class, it simply uses the class of the main document. A chapter file should not have a preamble, it should not have a
\documentclass
or \usepackage
command, except a rare case that it will be independently compiled. In that case it cannot be loaded via \include
or \input
. You cannot mix document classes.Stefan
LaTeX.org admin
Re: Main file not compiling anymore
Sorry for the attachments, will remember in the future. Removing all the usepackages and document classes doesn't make a change it seems. Error still continues. It really amazes me, as I only have added some text and it used to work before. It's the first time I see this error appear. Thanks for clearing some things for me.
- Attachments
-
- Samenstelling.log
- (39.46 KiB) Downloaded 404 times
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Main file not compiling anymore
It seems to start here:
So there's a problem reading the .aux file. Delete Samenstelling.aux and compile again. That .aux file will be generated each time you compile.
Stefan
Code: Select all
Code, edit and compile here:
C:\Users\Poelaertp\Dropbox\Masterproef\Hoofdstukken\Samenstelling.aux! Text line contains an invalid character.
Stefan
LaTeX.org admin
Main file not compiling anymore
I deleted the .aux file and indeed that specific error is gone. There is still an error stating:
(C:\Users\Poelaertp\Dropbox\Masterproef\Hoofdstukken\titlepage.tex
! LaTeX Error: Can be used only in preamble.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.3 \begin{document}
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
- Attachments
-
- Samenstelling.log
- (17.09 KiB) Downloaded 374 times
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Main file not compiling anymore
Edit titlepage.tex and remove that line
Stefan
\begin{document}
Stefan
LaTeX.org admin