1
votes

I am fairly new to Latex. I have written my thesis in Latex. I have 6 chapters and have made individual stand-alone files for each chapter. The main \thesis folder has a total pf 8 folders containing chapters 1 to 6, bibliography and acknowledgments, (\thesis\ChapterOne.. so on) for each chapter with all the necessary figures, tables, etc.

I tried to put the thesis together using main.tex

\documentclass[12pt,a4paper,oneside]{report}

\begin{document}
\input{\...\thesis\acknowledgements\cacknowledgements.tex}
\input{\...\thesis\ChapterOne\ChapterOne.tex}
\input{\...\thesis\ChapteroTwo\ChapteroTwo.tex}
.
.
\end{document}

I am not able to compile the file and get this error

Can be used only in preamble. \usepackage

How do I get around this? I also need help with adding the table of contents and list of figures and tables. Any help is greatly appreciated.

1
Have a look at the subfiles packagesamcarter_is_at_topanswers.xyz
Any \usepackage command in any file that is not main.tex? Your preamble is only before \begin{document}, so exclusively within main.tex.MattAllegro
@MattAllegro, yes there are\usepackage files in each of the chapter files. They are standalone files like I mentioned.sck

1 Answers

1
votes

I managed to do something similar with the subfiles package and a conditional like the one used here: http://xpt.sourceforge.net/techdocs/language/latex/latex23-Conditioning/ar01s02.html.