When I insert \frontmatter into my LaTeX document, it causes all of the text to be centered and in the wrong font. I'm using a template called Legrand Orange Book http://www.latextemplates.com/template/the-legrand-orange-book with Scrivener and TeXShop.
I'm able to get the template to compile (albeit with some errors) as long as I leave out \frontmatter
The template compiles with no problems.


Partial code showing where I placed \frontmatter
\documentclass[11pt,fleqn]{book} % Default font size and left-justified equations
\usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,a4paper]{geometry} % Page margins
\usepackage{xcolor} % Required for specifying colors by name
\definecolor{ocre}{RGB}{243,102,25} % Define the orange color used for highlighting throughout the book
% Font Settings
\usepackage{avant} % Use the Avantgarde font for headings
%\usepackage{times} % Use the Times font for headings
\usepackage{mathptmx} % Use the Adobe Times Roman as the default text font together with math symbols from the Sym­bol, Chancery and Com­puter Modern fonts
\usepackage{microtype} % Slightly tweak font spacing for aesthetics
\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
% Bibliography
\usepackage[style=alphabetic,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}
\addbibresource{bibliography.bib} % BibTeX bibliography file
\defbibheading{bibempty}{}
% Index
\usepackage{calc} % For simpler calculation - used for spacing the index letter headings correctly
\usepackage{makeidx} % Required to make an index
\makeindex % Tells LaTeX to create the files required for indexing
%----------------------------------------------------------------------------------------
\input{structure} % Insert the commands.tex file which contains the majority of the structure behind the template
\begin{document}
\frontmatter
%----------------------------------------------------------------------------------------
% TITLE PAGE
%----------------------------------------------------------------------------------------
\begingroup
\thispagestyle{empty}
\AddToShipoutPicture*{\put(6,5){\includegraphics[scale=1]{background}}} % Image background
\centering
\vspace*{9cm}
\par\normalfont\fontsize{35}{35}\sffamily\selectfont
Commodore 64 Programming and Recollections\par % Book title
\vspace*{1cm}
{\Huge Kevin P. Kilburn}\par % Author name
\endgroup
%----------------------------------------------------------------------------------------
% COPYRIGHT PAGE
%----------------------------------------------------------------------------------------
\newpage
~\vfill
\thispagestyle{empty}
\noindent Copyright \copyright\ 2013 Kevin P. Kilburn\\ % Copyright notice
\noindent \textsc{Published by Cold Stream Books}\\ % Publisher
\noindent \textsc{lorum ipsum}\\ % URL
\noindent Licensed under the Creative Commons Attribution-NonCommercial 3.0 Unported License (the ``License''). You may not use this file except in compliance with the License. You may obtain a copy of the License at \url{http://creativecommons.org/licenses/by-nc/3.0}. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \textsc{``AS IS'' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND}, either express or implied. See the License for the specific language governing permissions and limitations under the License.\\ % License information
\noindent \textit{First printing, March 2013} % Printing/edition date
%----------------------------------------------------------------------------------------
% TABLE OF CONTENTS
%----------------------------------------------------------------------------------------
\chapterimage{chapter_head_1.pdf} % Table of contents heading image
\pagestyle{empty} % No headers
\tableofcontents % Print the table of contents itself
\cleardoublepage % Forces the first chapter to start on an odd page so it's on the right
\pagestyle{fancy} % Print headers again
\chapter{Preface}
\label{preface}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque tortor orci, ultricies ac adipiscing ac, mollis at dui. Vivamus placerat varius sapien. Integer malesuada porttitor nisi et lacinia. Pellentesque volutpat ornare nisi, vitae egestas odio suscipit non. In velit dui, pellentesque sed rhoncus vitae, bibendum et enim. Phasellus nulla sem, pharetra eu blandit sit amet, fringilla vulputate ante. Nullam porttitor convallis justo et ultricies. Sed diam dui, sodales id laoreet non, molestie non felis. Morbi mollis tortor ac lectus dapibus accumsan.
Praesent elit lectus, rutrum eget tempor eget, ullamcorper sed lectus. Nunc nibh orci, varius eu laoreet vitae, bibendum ac purus. Phasellus varius ultrices mi eget auctor. Proin justo sem, tempor sit amet malesuada quis, cursus feugiat magna. Phasellus diam leo, auctor pharetra eleifend vitae, tristique et mauris. Cras molestie iaculis dolor, et rhoncus mauris accumsan id. Quisque et est in nisi interdum tincidunt eu eget nulla. Vivamus posuere ligula in risus auctor nec feugiat magna posuere. Donec adipiscing, lorem non dictum aliquam, massa arcu pretium lorem, vel volutpat orci dolor quis urna. Phasellus vestibulum nunc non ante semper ullamcorper. Integer rutrum leo non neque euismod tincidunt. Donec ut eros non turpis feugiat dapibus a vitae velit.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque tortor orci, ultricies ac adipiscing ac, mollis at dui. Vivamus placerat varius sapien. Integer malesuada porttitor nisi et lacinia. Pellentesque volutpat ornare nisi, vitae egestas odio suscipit non. In velit dui, pellentesque sed rhoncus vitae, bibendum et enim. Phasellus nulla sem, pharetra eu blandit sit amet, fringilla vulputate ante. Nullam porttitor convallis justo et ultricies. Sed diam dui, sodales id laoreet non, molestie non felis. Morbi mollis tortor ac lectus dapibus accumsan.