0

I keep getting this error message on my main .tex file. It reads:

Missing }.\subfield{2chaptertwo.tex}.

I have a separate .tex file for each chapter (including one that is entitled 2chaptertwo.tex.

Here's the code for the main tex file.

%DOCUMENT SET UP
\documentclass[11pt,oneside]{book}
\usepackage[margin=1.5in]{geometry}
\setlength\parindent{32pt}

%FONT
\usepackage[english]{babel}
\usepackage[osf, sc]{mathpazo}
\usepackage[T1]{fontenc}
\usepackage{CJKutf8} % Chinese

%GRAPHICS
\usepackage{graphicx}

%MATH PACKAGES
\usepackage{amsthm, amsmath, amsfonts, mathtools, amssymb}
\usepackage{sgame, tikz}
\usetikzlibrary{trees, calc}

%DUMMY TEXT
\usepackage{lipsum}

%FOOTNOTE FORMATTING
\usepackage[hang]{footmisc}
\setlength{\footnotemargin}{4mm}
%SUBFILES


\usepackage{subfiles}

%SPACING
\usepackage[]{setspace}

%QUOTES
\usepackage{etoolbox}
\AtBeginEnvironment{quote}{\singlespacing\small}

%REFERENCE FORMATTING
\usepackage{hyperref}
\usepackage{xcolor}
\definecolor{bleudefrance}{rgb}{0.19, 0.55, 0.91}
\definecolor{blue}{rgb}{0.21, 0.37, 0.23}
\hypersetup{
    colorlinks,
    linkcolor=bleudefrance,
    urlcolor=blue,
    citecolor=huntergreen}

%BIBLIOGRAPHY
%Currently set to APA style
\usepackage[nosectionbib]{apacite}
\usepackage[nottoc,notbib]{tocbibind}

%TABLE OF CONTENTS FORMATTING
\usepackage[titles]{tocloft}
\renewcommand{\cftchapfont}{\normalfont\scshape}
\renewcommand{\cftchappagefont}{\normalfont}

\usepackage{csquotes}

%CHAPTER, SECTION, AND SUBSECTION TITLES
\usepackage{titlesec}
\titleformat{\chapter}{\scshape}{\chaptertitlename}{0pt}{\vskip 0pt}
\titlespacing{\chapter}{0pt}{0pt}{0pt}

\titleformat{\section}
{\scshape}{\thesection}{1em}{}
\renewcommand\thesection{\arabic{section}}

\titleformat{\subsection}
{\normalfont}{\thesection .\thesubsection{}}{1em}{}
\renewcommand\thesubsection{\arabic{subsection}}

\titleformat{\subsubsection}
{\normalfont}{\thesection ..\thesubsection{}}{1em}{}
\renewcommand\thesubsubsection{\arabic{subsubsection}}

%HEADERS
%Change headers based on section titles

\usepackage{fancyhdr}
\setlength{\headheight}{12.6pt} 
\renewcommand{\headrulewidth}{0pt}


\fancypagestyle{chapterone}{
\rhead{\sc\small{Chapter One} \big| \thepage}
\lhead{}
\cfoot{}
}

\fancypagestyle{chaptertwo}{
\rhead{\sc\small{Chapter Two} \big| \thepage}
\lhead{}
\cfoot{}
}

\fancypagestyle{chapterthree}{
\rhead{\sc\small{Chapter Three} \big| \thepage}
\lhead{}
\cfoot{}
}

\fancypagestyle{conclusion}{
\rhead{\sc\small{Conclusion} \big| \thepage}
\lhead{}
\cfoot{}
}

\fancypagestyle{references}{
\rhead{\sc\small{References} \big| \thepage}
\lhead{}
\cfoot{}
}

%------------------------------


\begin{document}

%TITLE PAGE
    \subfile{0title.tex}
    \thispagestyle{empty}

%COPYRIGHT PAGE
\newpage
    \subfile{0copyright.tex}
    \thispagestyle{empty}

%DEDICATION AND ACKNOWLEDGEMENTS
\newpage
  \pagestyle{plain}
  \pagenumbering{roman}
    \setcounter{page}{2}
    \subfile{0dedicationacknowledgments.tex}
    
%ABSTRACT
\newpage
    \subfile{0abstract.tex}

%TABLE OF CONTENTS
\newpage
    \subfile{0tableofcontents.tex}
\clearpage
 \pagenumbering{arabic}

%CHAPTER ONE
\newpage
    \pagestyle{chapterone}
    \setcounter{section}{0}
    \subfile{1chapterone.tex}
    \singlespacing

\clearpage

%CHAPTER TWO
\newpage
    \pagestyle{chaptertwo}
    \setcounter{section}{0}
    \subfile{2chaptertwo.tex}
\clearpage

%CHAPTER 3
\newpage
    \pagestyle{chapterthree}
    \setcounter{section}{0}
    \subfile{3chapterthree.tex}
\clearpage

%REFERENCES
\newpage
    \pagestyle{references}
    \singlespacing
    \bibliographystyle{apacite}
    \bibliography{dissertation.bib}
    \nocite{*}

\end{document}
1
  • 2
    Welcome. // Ok, you don’t show the relevant file. Here’s a way to localize the problem: repeating deletion or commenting out. E.g. disable the include, which indicates where to look further. And so on.
    – MS-SPO
    Jun 18 at 19:09

1 Answer 1

2

This error can be very annoying. For me, there was actually an extra { that had somehow creeped in inside the subfile. Strangely, the subfile was compiling without any error when compiled on its own. The error occurred only while compiling the main file. I identified the problem by cutting the entire contents of the subfile and pasting one paragraph at a time, saving the subfile, and compiling the main file. During this iteration process, an error occurred in a paragraph. I identified the missing { by commenting out the lines of that paragraph one by one and compiling the main. Hope this helps.

New contributor
Yajnya Sapkota is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.