Document ClassesEmergency stop error in running preamble

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
bgreen
Posts: 38
Joined: Wed Nov 22, 2023 11:02 am

Emergency stop error in running preamble

Post by bgreen »

Because of the file size I decided to work with individual documents rather than the book class. I've returned to the book class after a year off and found code that previously worked, no longer does. The Texmaker version is 5.1.4 (I'll download the newer version but thought I'd see if the problem was the code first as other documents seem to compile). Any assistance is appreciated.

With the preamble code below I received this error:

! Emergency stop.
<*> preamble.tex
*** (job aborted, no legal \end found)

Code: Select all

\documentclass [a4paper, 12pt]{book}
\usepackage[english] {babel}
\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}
 \parindent=15pt
 \raggedbottom 
Here is the code that links to the preamble

Code: Select all

\documentclass [openany]{book}
\setcounter{secnumdepth}{7}
\setcounter{tocdepth}{13}
\input{preamble}
\begin{document}
\begin{titlepage}
	\centering
 \vspace*{\fill}
   
  {\Huge Paipo - Bellyboarding in Australasia\\}
  
   {\large Riding prone on wood and fibreglass boards in Australia and New Zealand.\\}
    \vspace*{\fill}
   {\Large Bob Green\\[1in]}
  \vfill
    {\itshape Updated 21 March 2024. }
      \vfill
  {\itshape Feel free to cite this work.  }
  
  
\end{titlepage}
\tableofcontents
\include{Chapter1}
\include{Chapter2}
\include{Chapter3}
\include{Chapter4}
\include{Chapter5}
\include{Chapter6}
\include{Chapter7}
\include{Chapter8}
\include{Chapter9}
\include{Chapter10}
\include{Chapter11}
\include{Chapter12}
\include{Chapter13}
\include{Chapter14}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
TikZ book
User avatar
Stefan Kottwitz
Site Admin
Posts: 10314
Joined: Mon Mar 10, 2008 9:44 pm

Re: Emergency stop error in running preamble

Post by Stefan Kottwitz »

Hi Bob,

you have \documentclass[a4paper,12pt]{book} in the preamble, but \documentclass[openany]{book} in the document, you cannot have both. Remove one (better from the preamble) and see if it's better.

Stefan
LaTeX.org admin
bgreen
Posts: 38
Joined: Wed Nov 22, 2023 11:02 am

Re: Emergency stop error in running preamble

Post by bgreen »

Hello Stefan,

Thanks for your reply. I only added that document class line in recently because I received this message without it:
Attachments
PreambleErrorLog.txt
(7.63 KiB) Downloaded 15 times
Last edited by bgreen on Sun May 25, 2025 10:03 pm, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10314
Joined: Mon Mar 10, 2008 9:44 pm

Re: Emergency stop error in running preamble

Post by Stefan Kottwitz »

Hi Bob,

that's probably you compile preamble.tex (that starts without \documentclass as preamble.tex is actually be input after \documentclass in your document, and of course it contains no \end as in your first post's error message) and not your document. Ensure that your editor compiles your document's TeX file.

By the way, please add log files as attachments. Otherwise, forum posts get super long. Thanks!

Stefan
LaTeX.org admin
bgreen
Posts: 38
Joined: Wed Nov 22, 2023 11:02 am

Re: Emergency stop error in running preamble

Post by bgreen »

Thanks again Stefan,

I had also mistakenly been trying to compile individual chapters.

I see I need to leave myself some notes.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10314
Joined: Mon Mar 10, 2008 9:44 pm

Re: Emergency stop error in running preamble

Post by Stefan Kottwitz »

No problem, that's why we have a forum for LaTeX users to talk. :-)

And by the way, after an update, the email notifications stopped working in the forum; when I noticed your posts without receiving a notification, I found it and fixed it; another good reason to talk here.

Stefan
LaTeX.org admin
bgreen
Posts: 38
Joined: Wed Nov 22, 2023 11:02 am

Re: Emergency stop error in running preamble

Post by bgreen »

Thanks, much appreciated.
Post Reply