Firstly, I created a preamble. It differs from the original because there are no equations/mathematics involved so I have not loaded the amsmath and amsthm packages nor included the \newtheorem or \thereoemstyle commands, but included other packages.
I didn’t include natbob or tocbind packages because I used a list instead of a formal bibliography.
Code: Select all
\usepackage[english] {babel}
\usepackage{1modern}
\usepackage{microtype}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage[a4paper, total={7in, 10in}]{geometry}
\usepackage{graphicx}
\usepackage{blindtext}
\usepackage[section]{placeins}
\usepackage{subcaption}
\usepackage[colorlinks]{hyperref}
\pagestyle {empty}
\usepackage[labelformat=empty]{caption}
\usepackage {wrapfig}
\usepackage{microtype}
\usepackage{parskip}
\usepackage{geometry}
%\titleformat*{\section}{\fontsize{12}{14}\selectfont}
\graphicspath{ {D:/a_surf/BB/bgpage/} }\pagecolor{yellow!30}
Code: Select all
\chapter{Introduction}
\section{Background}
\begin{document}
The 2004 edition of Matt Warshaw's Encyclopedia of Surfing describes bellyboarding as "all but
\section {Challenges }
\end{document}[code]
[code] \chapter{New South Wales: Tweed Heads to the Central Coast}
\begin{document}
\begin{figure}[htb]
\centering
\begin{subfigure}{0.50\textwidth}
\includegraphics[width=\linewidth]{n4_1.jpg}
\caption{Bellybogger.}
\label{fig:subfig1}
\end{subfigure}
\hfill
\begin{subfigure}{0.50\textwidth}
\includegraphics[width=\linewidth]{n4_2.jpg}
\caption{Ian Anderson .}
\label{fig:subfig2}
\end{subfigure}
\caption{Source: Photos Dick Ash and Ian Anderson.}
\label{fig:two_images}
\end{figure}
Text
\end{document}
[/code]\documentclass{book}
\input{preamble}
\begin{document}
\tableofcontents
\addcontentsline{toc}{section}{Title of the section}
\include{Chapter1}
\include{Chapter2}
\end{document}[/code]
When I try to compile the preamble I receive this error:
! LaTeX Error: Can be used only in preamble.
I am unsure whether the problem is the preamble, the chapter codes or the top level document?
Any advice is appreciated,
Bob