General ⇒ Main file not compiling anymore
Main file not compiling anymore
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.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10330
- Joined: Mon Mar 10, 2008 9:44 pm
Main file not compiling anymore
\documentclass
.Perhaps post the .log file as an attachment to a forum post. This information could be useful.
Stefan
Main file not compiling anymore
Code: Select all
\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}
\chapter{Theoretical background}
\input{hoofdstuk2}
\chapter{Test setup}
\input{hoofdstuk3}
\chapter{Results}
\input{hoofdstuk4}
\chapter{Conclusion}
\input{conclusion}
\chapter{Recommendations}
\input{recommendations}
\chapter{Acknowledgments}
\input{acknowledgements}
\bibliographystyle{plain}
\bibliography{referenties}
\chapter{Appendices}
\input{appendices}
\end{document}
- Stefan Kottwitz
- Site Admin
- Posts: 10330
- Joined: Mon Mar 10, 2008 9:44 pm
Main file not compiling anymore
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
Main file not compiling anymore
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: 10330
- Joined: Mon Mar 10, 2008 9:44 pm
Main file not compiling anymore
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
Re: Main file not compiling anymore
- Attachments
-
- Samenstelling.log
- (39.46 KiB) Downloaded 401 times
- Stefan Kottwitz
- Site Admin
- Posts: 10330
- Joined: Mon Mar 10, 2008 9:44 pm
Main file not compiling anymore
Code: Select all
C:\Users\Poelaertp\Dropbox\Masterproef\Hoofdstukken\Samenstelling.aux
! Text line contains an invalid character.
Stefan
Main file not compiling anymore
(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 371 times
- Stefan Kottwitz
- Site Admin
- Posts: 10330
- Joined: Mon Mar 10, 2008 9:44 pm
Main file not compiling anymore
\begin{document}
Stefan