0

In my research group, we have a recommended thesis file, which uses an \include{} command to bring chapters into the main text. Inside those files, the formats of chapters, sections and subsections work fine, but as soon as I add \part{} either inside the \include{} or instead in the main document, it generates the error "undefined control sequence", and prints the pdf strangely:

Part I
24.8830ptTITLE

\part{} is defined in the custom class, as shown in the class document below.

This is essentially my intended format:

  • Introduction
  • Part I
    • Chapter 1
    • Chapter 2
  • Part II
    • Chapter 3
    • Chapter 4
  • Conclusion

Here is the class document:

\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesClass{ucalgthes1}[1998/03/01 v1.0 University of Calgary Thesis Class]
%\RequirePackage{setspace}[200/12/01] %(NM2005) replacing old doublespace.sty %singlespace,onehalfspace and doublespacing options. (nm2007 commented out)%

%%% DECLARATION OF OPTIONS
%  The type size option is handled by reading a different (THESxx.CLO)
%  file for each  size, as follows, to define font size-specific commands:
%       10pt : THES10, 11pt : THES11, 12pt : THES12
%  Defaults are set to 12pt, onside, final (98/03/01)NM
%
\newcommand\@ptsize{}
\newcommand\@draftmark{}
\newcommand\@includeprompt{}
\newcommand\@chapterprompt{}
%
%% Font Size Options (nm1998/03/01)
\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
\DeclareOption{11pt}{\renewcommand\@ptsize{1}} %11pt option reads THES11.CLO
\DeclareOption{12pt}{\renewcommand\@ptsize{2}} %12pt option reads THES12.CLO
%
%%  Two-side or one-side Printing Option (nm1998/03/01).
\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue}
%
%%  Draft Option (nm1998/03/01)
\DeclareOption{draft}{\renewcommand\@draftmark{1}}
\DeclareOption{final}{\renewcommand\@draftmark{2}}
%
%%  Includeprompt Option(prompt user for includeonly files)(nm1998/03/01)
\DeclareOption{includeprompt}{\renewcommand\@includeprompt{\typein[\includefiles]{Type includeonly filenames {f1,f2,f3}}
\includeonly{\includefiles}}}
%
%%  Chapterprompt Option(prompts user for chapter number and filename)
%%  (nm1998/03/01)
\DeclareOption{chapterprompt}{\renewcommand\chapterprompt{\typein[\chapterfilename]{Type chapter filename }%
\typein[\chapternumber\{Type chapter number }%
\def\chapterprompt{\setcounter{chapter}{\chapternumber}%
\addtocounter{chapter}{-1}%
\include{chapterfilename}}}
%
%%% EXECUTE OPTIONS
\ExecuteOptions{letterpaper,12pt,oneside,final} %(NM2005 added letterpaper)Defaults to 12pt type size, oneside,final

%  Draft Option - options gets implemented
%
% \overfullrule = 0pt             % Default is don't mark overfull hboxes.
\ifnum \@draftmark = 1
\overfullrule 5pt  % Causes overfull hboxes to be marked.
\fi

% The \ProcessOptions command causes the execution of every command FOO
% which is declared and for which the user typed the FOO option in his
% \documentclass command.  For every undeclared option BAR there will be
% a warning message. (nm98/03/01)


\ProcessOptions

%\input setspace.sty %(NM 2005 setspace.sty replacing doublespace.sty)(nm 2007 commented out)
\input doublespace.sty %(nm 2007 re-instated)
\input thes1\@ptsize.clo\relax


%    ****************************************
%    *                LISTS                 *
%    ****************************************
%

% ENUMERATE
%  Enumeration is done with four counters: enumi, enumii, enumiii
%  and enumiv, where enumN controls the numbering of the Nth level
%  enumeration.  The label is generated by the commands \labelenumi
%  ... \labelenumiv.  The expansion of \p@enumN\theenumN defines the
%  output of a \ref command.

\def\labelenumi{\arabic{enumi}.}
\def\theenumi{\arabic{enumi}}

\def\labelenumii{(\alph{enumii})}
\def\theenumii{\alph{enumii}}
\def\p@enumii{\theenumi}

\def\labelenumiii{\roman{enumiii}.}
\def\theenumiii{\roman{enumiii}}
\def\p@enumiii{\theenumi(\theenumii)}

\def\labelenumiv{\Alph{enumiv}.}
\def\theenumiv{\Alph{enumiv}}
\def\p@enumiv{\p@enumiii\theenumiii}

% ITEMIZE
% Itemization is controlled by four commands: \labelitemi, \labelitemii,
% \labelitemiii, and \labelitemiv, which define the labels of the various
% itemization levels.(\bf to \bfseries, \bullet \m@ath\bullet, etc.
%  nm1998/03/01)

\def\labelitemi{$\m@th\bullet$}
\def\labelitemii{\bfseries --}
\def\labelitemiii{$\m@th\ast$}
\def\labelitemiv{$\m@th\cdot$}


% VERSE
%   The verse environment is defined by making clever use of the
%   list environment's parameters.  The user types \\ to end a line.
%   This is implemented by \let'in \\ equal \@centercr.
%
\def\verse{\let\\=\@centercr
  \list{}{\itemsep\z@ \itemindent -1.5em\listparindent \itemindent
          \rightmargin\leftmargin\advance\leftmargin 1.5em}\item[]}
\let\endverse\endlist

% QUOTATION
%   Fills lines
%   Indents paragraph
%
\def\quotation{\list{}{\listparindent 1.5em
    \itemindent\listparindent
    \rightmargin\leftmargin\parsep 0pt plus 1pt}\item[]}
\let\endquotation=\endlist

% QUOTE -- same as quotation except no paragraph indentation,
%
\def\quote{\list{}{\rightmargin\leftmargin}\item[]}
\let\endquote=\endlist

% DESCRIPTION
%
%  To change the formatting of the label, you must redefine
%  \descriptionlabel.

\def\descriptionlabel#1{\hspace\labelsep \bfseries #1}
\def\description{\list{}{\labelwidth\z@ \itemindent-\leftmargin
       \let\makelabel\descriptionlabel}}

\let\enddescription\endlist

\newdimen\descriptionmargin
\descriptionmargin=3em


%    ****************************************
%    *         OTHER ENVIRONMENTS           *
%    ****************************************
%
%
% THEOREM
% \@begintheorem ... \@endtheorem are the commands executed at the
% beginning and end of a (user-defined) theorem-like environment.
% Except \@opargbegintheorem is executed when an optional argument is
% given.  Cf. LATEX.TEX.
%
% \def\@begintheorem#1#2{\it \trivlist \item[\hskip \labelsep{\bfseries #1\ #2}]}
% \def\@opargbegintheorem#1#2#3{\it \trivlist
%       \item[\hskip \labelsep{\bfseries #1\ #2\ (#3)}]}
% \def\@endtheorem{\endtrivlist}


% TITLEPAGE
%  In the normal environments, the titlepage environment does nothing but
%  start and end a page, and inhibit page numbers.  It also resets the
%  page number to zero.  In two-column style, it still makes a one-column
%  page.
\def\titlepage{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
     \else \newpage \fi \thispagestyle{empty}\c@page\z@}

\def\endtitlepage{\if@restonecol\twocolumn \else \newpage \fi}
% Variables for the thesis title page
\def\dept#1{\gdef\@dept{#1}}
\def\degree#1{\gdef\@degree{#1}\gdef\Degree{#1}}
\def\monthname#1{\gdef\@monthname{#1}}
%\def\year#1{\gdef\@year{#1}} %(NM2005 interferred with latex year command for fancyhdr)
      \def\thesisyear#1{\gdef\@year{#1}} % redefined as per above comment (NM2005)
\def\thesis#1{\gdef\Thesis{#1}\gdef\@THESIS{\uppercase{#1}}}
\def\author#1{\gdef\@author{#1}\gdef\Author{#1}}

% SIGNINGPAGE
% environment signing and command signline
\newlength{\signwidth}
\newenvironment{signing}[1]{\settowidth{\signwidth}{#1} %     %width of longest signature
\def\signline{ \null\vskip 1em\makebox[\signwidth]{\hrulefill}\\}   %signature line
\def\newsigncolumn{\end{minipage}\hfill\begin{minipage}[t]{\signwidth}\raggedleft}% added raggedleft 2009nm allow for more than one column of signatures
\singlespace
\noindent\begin{minipage}{\textwidth}
\raggedleft
\null
\begin{minipage}[t]{\signwidth} \raggedleft %added raggedleft 2009nm
}{\null\end{minipage}\end{minipage}
\null
\par
\vfill
\begin{flushright}
\noindent  \rule{2.5in}{.01in}\null
\\
\noindent Date
\end{flushright}
\endsinglespace}

% ARRAY AND TABULAR
%

\arraycolsep 5pt     % Half the space between columns in an array environment.
\tabcolsep 6pt       % Half the space between columns in a tabular environment.
\arrayrulewidth .4pt % Width of rules in array and tabular environment.
\doublerulesep 2pt   % Space between adjacent rules in array or tabular env.

% TABBING
%
\tabbingsep \labelsep   % Space used by the \' command.  (See LaTeX manual.)

% MINIPAGE
%  \@minipagerestore is called upon entry to a minipage environment to
%  set up things that are to be handled differently inside a minipage
%  environment. In the current styles, it does nothing.
%
% \skip\@mpfootins : plays same role for footnotes in a minipage as
%                    \skip\footins does for ordinary footnotes

\skip\@mpfootins = \skip\footins

% FRAMEBOX
%
\fboxsep = 3pt    % Space left between box and text by \fbox and \framebox.
\fboxrule = .4pt  % Width of rules in box made by \fbox and \framebox.


%    ****************************************
%    *        CHAPTERS AND SECTIONS         *
%    ****************************************
%
% DEFINE COUNTERS:
%
% \newcounter{NEWCTR}[OLDCTR] : Defines NEWCTR to be a counter, which is
%                               reset to zero when counter OLDCTR is stepped.
%                               Counter OLDCTR must already be defined.

\newcounter {part}
\newcounter {chapter}
\newcounter {section}[chapter]
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
\newcounter {subparagraph}[paragraph]

% For any counter CTR, \theCTR is a macro that defines the printed version
% of counter CTR.  It is defined in terms of the following macros:
%
%  \arabic{COUNTER} : The value of COUNTER printed as an arabic numeral.
%  \roman{COUNTER}  : Its value printed as a lower-case roman numberal.
%  \Roman{COUNTER}  : Its value printed as an upper-case roman numberal.
%  \alph{COUNTER}   : Value of COUNTER printed as a lower-case letter:
%                         1 = a, 2 = b, etc.
%  \Alph{COUNTER}   : Value of COUNTER printed as an upper-case letter:
%                           1 = A, 2 = B, etc.
%

\def\thepart          {\Roman{part}}
\def\thechapter       {\arabic{chapter}}
\def\thesection       {\thechapter.\arabic{section}}
\def\thesubsection    {\thesection.\arabic{subsection}}
\def\thesubsubsection {\thesubsection .\arabic{subsubsection}}
\def\theparagraph     {\thesubsubsection.\arabic{paragraph}}
\def\thesubparagraph  {\theparagraph.\arabic{subparagraph}}

% \@chapapp is initially defined to be 'Chapter'.  The \appendix
% command redefines it to be 'Appendix'.
%
\def\@chapapp{Chapter}



%    ****************************************
%    *         TABLE OF CONTENTS, ETC.      *
%    ****************************************
%
% A \subsection command writes a
%       \contentsline{subsection}{TITLE}{PAGE}
% command on the .toc file, where TITLE contains the contents of the
% entry and PAGE is the page number.  If subsections are being numbered,
% then TITLE will be of the form
%       \numberline{NUM}{HEADING}
% where NUM is the number produced by \thesubsection.  Other sectioning
% commands work similarly.
%
% A \caption command in a 'figure' environment writes
%    \contentsline{figure}{\numberline{NUM}{CAPTION}}{PAGE}
% on the .lof file, where NUM is the number produced by \thefigure and
% CAPTION is the figure caption.  It works similarly for a 'table' environment.
%
% The command \contentsline{NAME} expands to \l@NAME.  So, to specify
% the table of contents, we must define \l@chapter, \l@section,
% \l@subsection, ... ; to specify the list of figures, we must define
% \l@figure; and so on.  Most of these can be defined with the
% \@dottedtocline command, which works as follows.
%
% \@dottedtocline{LEVEL}{INDENT}{NUMWIDTH}{TITLE}{PAGE}
%    LEVEL    : An entry is produced only if LEVEL < or = value of
%               'tocdepth' counter.  Note, \chapter is level 0, \section
%               is level 1, etc.
%    INDENT   : The indentation from the outer left margin of the start of
%               the contents line.
%    NUMWIDTH : The width of a box in which the section number is to go,
%               if TITLE includes a \numberline command.
%
% This command uses the following three parameters, which are set
% with a \def (so em's can be used to make them depend upon the font).
%   \@pnumwidth : The width of a box in which the page number is put.
%   \@tocrmarg  : The right margin for multiple line entries.  One
%                 wants \@tocrmarg > or = \@pnumwidth
%   \@dotsep    : Separation between dots, in mu units.  Should be \def'd to
%                 a number like 2 or 1.7

\def\@pnumwidth{1.55em}
\def\@tocrmarg {2.55em}
\def\@dotsep{4.5}
\setcounter{tocdepth}{2}


% TABLEOFCONTENTS
%  In thesis class, \tableofcontents, \listoffigures, etc. are always
%  set in single-column style.  @restonecol


\def\tableofcontents{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
  \fi\chapter*{\bf Table of Contents\@mkboth{}{}\addcontentsline{toc}{chapter}{Table of Contents}}
 \@starttoc{toc}\if@restonecol\twocolumn\fi} %added \bf to print Table of Contents in bold on pg 2006nm


\def\l@part#1#2{\addpenalty{-\@highpenalty}
   \addvspace{2.25em plus 1pt}  % space above part line
   \begingroup
   \@tempdima 3em         % width of box holding part number, used by
     \parindent \z@ \rightskip \@pnumwidth             %% \numberline
     \parfillskip -\@pnumwidth
     {%\large \bfseries          % set line in \large boldface 2006nm
     \leavevmode          % TeX command to enter horizontal mode.
     #1\hfil \hbox to\@pnumwidth{\hss #2}}\par
     \nobreak             % Never break after part entry
   \endgroup}


\def\l@chapter#1#2{\pagebreak[3]
   \vskip 1.0em plus 1pt  % space above chapter line
   \@tempdima 1.5em       % width of box holding chapter number
   \begingroup
     \parindent \z@ \rightskip \@pnumwidth
     \parfillskip -\@pnumwidth
     %\bfseries                  % Boldface removed. 2006nm
     \leavevmode          % TeX command to enter horizontal mode.
     #1\hfil \hbox to\@pnumwidth{\hss #2}\par
   \endgroup}

\def\l@chapter{\@dottedtocline{0}{1.5em}{2.3em}}  %added this line 2006nm
\def\l@section{\@dottedtocline{1}{1.5em}{2.3em}} %changed 1 to 0 2006nm
\def\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
\def\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
\def\l@paragraph{\@dottedtocline{4}{10em}{5em}}
\def\l@subparagraph{\@dottedtocline{5}{12em}{6em}}

% LIST OF FIGURES AND ILLUSTRATIONS
%
\def\listoffigures{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
  \fi\chapter*{\bf{List of Figures and Illustrations}\markboth
   {}{}\addcontentsline{toc}{chapter}{List of Figures}}%(NM 2005 added List of Figures to TOC)
   \@starttoc{lof}\if@restonecol\twocolumn
  \fi}

\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}

% LIST OF TABLES
%
\def\listoftables{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
  \fi\chapter*{\bf{List of Tables}\markboth
   {}{}\addcontentsline{toc}{chapter}{List of Tables}}%(NM 2005 added List of Tables to TOC)
   \@starttoc{lot}\if@restonecol\twocolumn
  \fi}

\let\l@table\l@figure

% List of Symbols, Abbreviations and Nomenclature
%
\def\listofsymbols{\input{symbols} \clearpage}
\def\addsymbol #1: #2{$#1$ \> \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \   \parbox{5in}{#2}\\}
\def\newnot#1{\label{#1}}



%    ****************************************
%    *             BIBLIOGRAPHY             *
%    ****************************************
%
% The thebibliography environment executes the following commands:
%
%  \def\newblock{\hskip .11em plus .33em minus -.07em} --
%      Defines the `closed' format, where the blocks (major units of
%      information) of an entry run together.
%
%  \sloppy  -- Used because it's rather hard to do line breaks in
%      bibliographies,
%
%  \sfcode`\.=1000\relax --
%      Causes a `.' (period) not toproduce an end-of-sentence space.

\def\thebibliography#1{\altchapter{Bibliography}\list
  {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
    \advance\leftmargin\labelsep
    \usecounter{enumi}}
    \def\newblock{\hskip .11em plus .33em minus -.07em}
    \sloppy
    \sfcode`\.=1000\relax}

\let\endthebibliography=\endlist


%    ****************************************
%    *              THE INDEX               *
%    ****************************************
%
% THE THEINDEX ENVIRONMENT
% Produces double column format, with each paragraph a separate entry.
% The user commands \item, \subitem and \subsubitem are used to
% produce the entries, and \indexspace adds an extra vertical space
% that's the right size to put above the first entry with a new letter
% of the alphabet.

\newif\if@restonecol

\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
\columnseprule \z@
\columnsep 35pt\twocolumn[\@makeschapterhead{Index}]
    \markboth{}{}\thispagestyle{plain}\parindent\z@
    \parskip\z@ plus .3pt\relax\let\item\@idxitem}

\def\@idxitem{\par\hangindent 40pt}

\def\subitem{\par\hangindent 40pt \hspace*{20pt}}

\def\subsubitem{\par\hangindent 40pt \hspace*{30pt}}

\def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}

\def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}


%    ****************************************
%    *             FOOTNOTES                *
%    ****************************************
%
% \footnoterule is a macro to draw the rule separating the footnotes from
% the text.  It should take zero vertical space, so it needs a negative
% skip to compensate for any positive space taken by the rule.  (See
% PLAIN.TEX.)

\def\footnoterule{\kern-3\p@
  \hrule width .4\columnwidth
  \kern 2.6\p@}                 % The \hrule has default height of .4pt .

\@addtoreset{footnote}{chapter}  % Numbers footnotes within chapters

\long\def\@makefntext#1{\parindent 1em\noindent
            \hbox to 1.8em{\hss$^{\@thefnmark}$}#1}

%    ****************************************
%    *         FIGURES AND TABLES           *
%    ****************************************
%
% Float placement parameters.  See LaTeX manual for their definition.
%
\setcounter{topnumber}{2}
\def\topfraction{.7}
\setcounter{bottomnumber}{1}
\def\bottomfraction{.3}
\setcounter{totalnumber}{3}
\def\textfraction{.2}
\def\floatpagefraction{.5}
\setcounter{dbltopnumber}{2}
\def\dbltopfraction{.7}
\def\dblfloatpagefraction{.5}

\long\def\@makecaption#1#2{
   \vskip 10pt
   \setbox\@tempboxa\hbox{#1: #2}
   \ifdim \wd\@tempboxa >\hsize   % IF longer than one line:
       \unhbox\@tempboxa\par      %   THEN set as ordinary paragraph.
     \else                        %   ELSE  center.
       \hbox to\hsize{\hfil\box\@tempboxa\hfil}
   \fi}

% FIGURE

\newcounter{figure}[chapter]
\def\thefigure{\thechapter.\@arabic\c@figure}

\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{Figure \thefigure}
\def\figure{\@float{figure}}
\let\endfigure\end@float
\@namedef{figure*}{\@dblfloat{figure}}
\@namedef{endfigure*}{\end@dblfloat}

% TABLE
%
\newcounter{table}[chapter]
\def\thetable{\thechapter.\@arabic\c@table}

\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{Table \thetable}
\def\table{\@float{table}}
\let\endtable\end@float
\@namedef{table*}{\@dblfloat{table}}
\@namedef{endtable*}{\end@dblfloat}


%    ****************************************
%    *         TITLE AND ABSTRACT           *
%    ****************************************
%
%
% Uses same title and abstract format as the article style's
% Uses thesistitlepage option
% titlepage option.

\input thesistitlepage.sty

\mark{{}{}}   % Initializes TeX's marks


%    ****************************************  
%    *            MISCELLANEOUS             *  
%    ****************************************  
%  
% DATE  
%  
\def\today{\ifcase\month\or  
  January\or February\or March\or April\or May\or June\or  
  July\or August\or September\or October\or November\or December\fi  
  \space\number\day, \number\year}  
 
\@addtoreset{equation}{chapter}   % Makes \chapter reset 'equation' counter.  

\def\theequation{\thechapter.\arabic{equation}}  


%    ****************************************  
%    *           INITIALIZATION             *  
%    ****************************************  
%  
% Default initializations  

\thesis{thesis}   % default thesis rather than dissertation
\pagenumbering{arabic}      % Arabic page numbers  
\onecolumn                  % Single-column.  
\if@twoside\else\raggedbottom\fi % Ragged bottom unless twoside option.  
\setstretch{1.7}        % Initial baselinestretch  

This is the main tex document:

\documentclass[12pt]{ucalgthes1}  
\usepackage[letterpaper,top=1in, bottom= 1in, left= 1in, right= 1in]{geometry}  
\usepackage{lmodern}  
\usepackage[T1]{fontenc}  
\usepackage[ansinew]{inputenc}  
\usepackage{hyperref}  
\usepackage{makeidx}  
\usepackage{epstopdf}  
\usepackage{ulem}  

\title{Towards a Title \\For Stack Exchange}  

\author{Me}  
\thesisyear{2021}  
\thesis{thesis}  
\newcommand{\thesistitle}{Name}  
\monthname{JUNE}  
\dept{Faculty}  
\degree{Degree}  

\begin{document}  
\makethesistitle  
\pagenumbering{roman}     % resets page counter to one  
\setcounter{page}{2}  

\newpage  
\phantomsection  
\include{./Chapters/C0-Abstract}  

\newpage  
\phantomsection  
\include{./Chapters/C0-Acknowledgements}  


\begin{singlespace}  
\newpage  
\phantomsection  
\tableofcontents  
\pagestyle{plain}  
\newpage  
\phantomsection  
\listoftables  
\pagestyle{plain}  
\newpage  
\phantomsection  
\listoffigures  
\pagestyle{plain}  
\clearpage  
\clearpage         
\end{singlespace}  
\newpage  
\phantomsection  
\chapter*{\bf{List of Symbols, Abbreviations and Nomenclature}\hfill}  
\addcontentsline{toc}{chapter}{List of Symbols}  
\listofsymbols  
\pagestyle{plain}  
\clearpage  

\pagenumbering{arabic}  

%**\part{A Title}**  %It creates errors if I use this part  
\include{./Chapters/C1-Intro}  
\include{./Chapters/Indist}  

\bibliographystyle{ieeetr}  
\bibliography{references}  

\end{document}  

6
  • Welcome to TeX.SX. What document class are you using? Even better, could you show us an MWE? tex.meta.stackexchange.com/questions/228/… – Ingmar Mar 16 at 19:27
  • 2
    Without knowing the "thesis files" you refer to it is difficult to give you an answer. But if \part produces the "undefined control sequence" error it means that \part is not defined in the class you are using. – Ivan Mar 16 at 19:28
  • 2
    we can't use the code you have posted at all, the class is not available and you \include files that we don't have. As Ivan says is \part defined by your class? – David Carlisle Mar 16 at 22:34
  • I've included the class documentation, and it includes a definition of \part{} I've been trying to learn the formatting behind it this afternoon but it's really hard. Are there any obvious errors? To think, I've been using LaTex for 5 years without learning any template programming... – Kaowen Mar 17 at 22:23
  • 1
    What you've included doesn't have a definition of any of the sectioning commands including \part. I think they're probably in the thes12.clo file. – Don Hosek Mar 18 at 3:30
1

\part is a valid class command (of ucalgthes1.cls) and should not need additional packages.

The problem arises from this line (#67) in the thes12.clo file

\newcommand{\Huge}{\fontsizelet\@xxvpt{30pt}\selectfont}

when, I guess, it should have been

\newcommand{\Huge}{\fontsize\@xxvpt{30pt}\selectfont}

It can be solved by adding

\renewcommand{\Huge}{\huge} to the preamble. Then everything works fine.

It is not related with \include.

b

% !TeX TS-program = pdflatex

\documentclass[12pt]{ucalgthes1}  
\usepackage[letterpaper,top=1in, bottom= 1in, left= 1in, right= 1in]{geometry}  
\usepackage{lmodern}  
\usepackage[T1]{fontenc}  
\usepackage[ansinew]{inputenc}  
\usepackage{hyperref}  
\usepackage{makeidx}  
\usepackage{epstopdf}  
\usepackage{ulem}  

\renewcommand{\Huge}{\huge} % added <<<<<<<<<<<<<<<<<<<<<<<<<
%\renewcommand{\Huge}{\fontsize{36pt}{40pt}\selectfont} % or try this alternative

\title{Towards a Title \\For Stack Exchange}  

\author{Me}  
\thesisyear{2021}  
\thesis{thesis}  
\newcommand{\thesistitle}{Name}  
\monthname{JUNE}  
\dept{Faculty}  
\degree{Degree}  

\begin{document}  
\makethesistitle  
\pagenumbering{roman}     % resets page counter to one  
\setcounter{page}{2}  

\newpage  
\phantomsection  
%\include{./Chapters/C0-Abstract}  
\chapter{C0-Abstract}

\newpage  
\phantomsection  
%\include{./Chapters/C0-Acknowledgements}  
\chapter{C0-Acknowledgements}

\begin{singlespace}  
\newpage  
\phantomsection  
\tableofcontents  
\pagestyle{plain}  
\newpage  
\phantomsection  
\listoftables  
\pagestyle{plain}  
\newpage  
\phantomsection  
\listoffigures  
\pagestyle{plain}  
\clearpage  
\clearpage         
\end{singlespace}  
\newpage  
\phantomsection  
\chapter*{\bf{List of Symbols, Abbreviations and Nomenclature}\hfill}  
\addcontentsline{toc}{chapter}{List of Symbols}  
\listofsymbols  
\pagestyle{plain}  
\clearpage  

\pagenumbering{arabic}  

\part{A Title} % OK now
\chapter{C1-Intro}
\chapter{Indist}

%
%\include{./Chapters/C1-Intro}  
%\include{./Chapters/Indist}  

%\bibliographystyle{ieeetr}  
%\bibliography{references}  

\end{document}  

Related with https://tex.stackexchange.com/a/588324/161015

1
  • Hi Simon! Thank you for your answer! This resolves the issue on the PART pages, so I've accepted your answer on this question. Unfortunately it does not solve the table of contents problems, so that problem is still outstanding. – Kaowen Mar 22 at 18:19
0

For anyone who might have this problem in the future, the problem was that part was defined in the class, but defined with some formatting error that I could not find. To solve the problem, I redefined the formatting on the definition using the following command, placed in the main.tex document before the \begin{document} command:

\usepackage{titlesec}   
\titleformat{\part}{\centering \bf \huge}{Part \thepart}{0 pt}{\newline}[\nobreak]

If you want more information about what goes in each of those brackets, the titlesec documentation can be downloaded here:
https://mirror.las.iastate.edu/tex-archive/macros/latex/contrib/titlesec/titlesec.pdf

Thank you for all the comments that pointed to where my error message could be coming from!

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.