# Fixing a LaTeX thesis style issues with formatting section headings

I am fairly new to LaTeX, but I decided to take it upon myself to use the .sty file the computer science department at my school had for the university's thesis style. As it turns out, there are a bunch of issues with the format, so I've been trying to fix them one by one. I managed to fix issues related to the TOC, but I am having a tough time getting the headings right.

According to my school's guidlines, the primary, secondary, and tertiary headers should look as follows:

but it is coming out like:

Here is the code in the .sty file that controls the section header format:

    \def\section{\@startsection{section}{1}{\z@}
{-7ex}{0.01ex \@plus 0.01ex}
{\ssp\centering\underline}}
\def\subsection{\@startsection{subsection}{2}{\z@}
{-5ex}{0.01ex \@plus 0.01ex}
{\ssp\underline}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}
{-4ex}{-0.01ex}
{\ssp\underline}}


It appears that the \underline tag messes things up, because when removed, the section header gets centered and the subsection header stops having an indent. How can I fix this code so that the text can be underlined without messing up the rest of the formatting? Also, is it possible to automatically append a period and space at the end of the subsubsection title?

UPDATE:

\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}
\typeout{\@chapapp\space\thechapter.}
\numberline{APPENDIX \thechapter.}\hspace*{0.95in}#1}}
\chaptermark{#1}
\if@twocolumn


Here is a MWE document:

\documentclass[12pt]{report}
\usepackage{csuf-thesis}
\usepackage{hyperref}
\setcounter{secnumdepth}{0}

\begin{document}
\maketitle
\begin{abstract}
Abstract goes here
\end{abstract}

\tableofcontents

\startbody
%% Assuming these .tex files exist...
\include{Chapter1}
\include{Chapter2}
\include{Chapter3}
\include{Chapter4}

\end{document}


Where ChapterX.tex looks something like this:

\chapter{CHAPTER X}


Here is the full csuf-thesis.sty file I am currently working with:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                                                                   %%
%%  This is a LaTeX style file created by Dr. Shawn X. Wang for CSUF Theses.         %%
%%  Several existing style files were referenced during the process, in particular,  %%
%%  University of California, Princeton University, Harvard University, Standford    %%
%%  University and New Jersey Institute of Technology.                               %%
%%                                                                                   %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%
% DECLARATIONS %
%%%%%%%%%%%%%%%%
\newif\ifcsufappend             % appendixswitch

\csufappendfalse

\def\@chapapp{CHAPTER}          %caps for chapter

\gdef\csufthisdegree{Master of Arts}
\def\thisdegree#1{\gdef\csufthisdegree{#1}}

\gdef\csufthesistype{Thesis}
\def\thesistype#1{\gdef\csufthesistype{#1}}

%% Changed to reflect the semester by month instead of actual month
\gdef\csufthesissemester{\ifcase\month\or
Fall\or Spring\or Spring\or Spring\or Spring\or Spring\or
Summer\or Summer\or Summer\or Summer\or Fall\or Fall\fi}
\def\thesismonth#1{\gdef\csufthesissemester{#1}}

\gdef\csufthesisyear{\number\year}
\def\thesisyear#1{\gdef\csufthesisyear{#1}}

\gdef\csufmajor{(*MAJOR GOES HERE*)}
\def\major#1{\gdef\csufmajor{#1}}

\gdef\csuffirstcomm{(*first committee member's name*)}
\def\firstcomm#1{\gdef\csuffirstcomm{#1}}
\gdef\csuffirstcommdept{(*first committee member's department*)}
\def\firstcommdept#1{\gdef\csuffirstcommdept{#1}}

\gdef\csufsecondcomm{(*second committee member's name*)}
\def\secondcomm#1{\gdef\csufsecondcomm{#1}}
\gdef\csufsecondcommdept{(*second committee member's department*)}
\def\secondcommdept#1{\gdef\csufsecondcommdept{#1}}

\gdef\csufblank{blank}

% If you want copyright, do the following
}

}

%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MARGINS AND PAGE LAYOUT %
%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Pages are numbered at the upper right,
% except that the first page of each chapter
% is numbered at the bottom.

\pagestyle{plain}

% This counter is used to select which sections should be displayed in TOC.
\newcounter{csufsec}
\setcounter{csufsec}{2}

\newcounter{csufcommittee}
\setcounter{csufcommittee}{3}

\newcounter{csufnum}

% We need 1 1/2" margin
% Theses are single-sided, so we don't care about \evensidemargin

\evensidemargin=0in
%%\footheight=0.2in
\footskip=0.5in    % default is 0.5 in and page numbers come out too low
\headsep=0.25in          % Distance between page nums and text
\itemindent=0.8in
%\marginparsep=10pt
%\marginparwidth=40pt
\oddsidemargin=0.5in          % was 0.495
\parindent=0.4in
\textheight=8.22in          %changed to make 1" at the bottom
\textwidth=5.95in
\topmargin=-0.175in             % Put the pagenumber in the correct place

% Disallow page breaks at hyphens, except where the only alternative
% is a widow or orphan (club)
\brokenpenalty=9900

% Disallow all widows and orphans (clubs)
\widowpenalty=10000
\clubpenalty=10000

% Use 1.65 times the normal baseline-to-baseline skip
% for the appearance of double spacing
\renewcommand{\baselinestretch}{1.65}

% Print footnotes in small (not tiny) type
\let\footnotesize\small

% Single space tabular environment - cdp
\def\tabular{\ssp \def\@halignto{}\@tabular}

% Redefine the macro used for floats (including figures and tables)
% so that single spacing is used.
% (Note \def\figure{\@float{figure}set single spacing} doesn't work
%  because figure has an optional argument)
\def\@xfloat#1[#2]{\ifhmode \@bsphack\@floatpenalty -\@Mii\else
\@floatpenalty-\@Miii\fi\def\@captype{#1}\ifinner
\@parmoderr\@floatpenalty\z@
\else\@next\@currbox\@freelist{\@tempcnta\csname ftype@#1\endcsname
\@tfor \@tempa :=#2\do
}\global\count\@currbox\@tempcnta}\@fltovf\fi
\global\setbox\@currbox\vbox\bgroup
\def\baselinestretch{1}\@normalsize
\boxmaxdepth\z@
\hsize\columnwidth \@parboxrestore}

% Redefine the macro used for footnotes to use single spacing
\long\def\@footnotetext#1{\insert\footins{\def\baselinestretch{1}\footnotesize
\interlinepenalty\interfootnotelinepenalty
\splittopskip\footnotesep
\splitmaxdepth \dp\strutbox \floatingpenalty \@MM
\hsize\columnwidth \@parboxrestore
\edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext
{\rule{\z@}{\footnotesep}\ignorespaces
#1\strut \\ }}}

% Define environment 'singlespace', which can be used within other
% environments such as 'quote' (but not 'verbatim') to force single
% spacing.  From doublespace.sty; originally credited to MIT.

\def\singlespace{%
\vskip\parskip%
\vskip\baselineskip%
\def\baselinestretch{1}%
\ifx\@currsize\normalsize\@normalsize\else\@currsize\fi%
%\tiny\normalsize%
\vskip-\parskip%
\vskip-\baselineskip%
}

\def\endsinglespace{\par}

% Redefine 'verbatim' so that it always single-spaces.
% If you want 'verbatim' to double-space, simply make your own
% copy of csuf-thesis.sty in which this code is commented out.

\def\@verbatim{%
\trivlist%
\vskip\topskip%
%\vskip\parskip%
%\setlength{\partopsep}{0pt}%
\def\baselinestretch{1}%
\ifx\@currsize\normalsize\@normalsize\else\@currsize\fi%
%\tiny\normalsize%
\vskip-\topskip%
%\vskip-\parskip%
\item[]\if@minipage\else\vskip\parskip\fi
\leftskip\@totalleftmargin\rightskip\z@
\parindent\z@\parfillskip\@flushglue\parskip\z@
\@tempswafalse \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par}
\obeylines \tt \catcode=13 \@noligs \let\do\@makeother \dospecials}

\def\verbatim{\@verbatim \frenchspacing\@vobeyspaces \@xverbatim}
\let\endverbatim=\endtrivlist

%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%

% Centered at top of page, in imitation of Turabian et al.
% This code is from rep12.sty, somewhat modified.

%

\vspace*{.38in}                    % Space at top of text page.
{ \parindent 0pt \raggedright
\ifnum \c@secnumdepth >\m@ne     % IF secnumdepth > -1 THEN
\ssp
\centerline{\@chapapp{} \thechapter} % Print 'CHAPTER' and number.
\par
\vskip 10pt
\fi                              % Space between number and title.
\ssp
\center                      % Title.
#1 \par
\nobreak                         % TeX penalty to prevent page break.
\vskip 27pt                      % Space between title and text.
} }

%

%\vspace*{50pt}                    % Space at top of page.
{ \parindent 0pt \raggedright
\ssp
\bf \center              % Title
#1 \par
\nobreak                         % TeX penalty to prevent page break.
\vskip 15pt                      % Space between title and text.
} }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This was done to place the appendix chapter title on the TOC. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\chapter{\clearpage \thispagestyle{plain} \global\@topnum\z@
\@afterindentfalse \secdef\@chapter\@schapter}
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}
\typeout{\@chapapp\space\thechapter.}
\numberline{APPENDIX \thechapter.}\hspace*{0.95in}#1}}
\chaptermark{#1}
\if@twocolumn

%
% Do the right thing for an appendix
%
\def\appendix{
\par
\setcounter{chapter}{0}
\setcounter{equation}{0}
% \def\@chapapp{}
% \def\thechapter{APPENDIX \Alph{chapter}}
\def\@chapapp{APPENDIX}
\def\thechapter{\Alph{chapter}}
\def\thesection{\Alph{chapter}.\arabic{section}}
\renewcommand{\theequation}{\Alph{chapter}.\arabic{equation}}
\csufappendtrue
\setcounter{csufsec}{0}  % do not print appendix sections
% The following lines would do what I want, but they are set BEFORE the
% begin{document} :-(
% \setcounter{tocdepth}{1}      % List appendix and sections on toc
% \def\l@chapter{\@dottedtocline{1}{0.000001mm}{10em}}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SECTION AND SUBSECTION HEADINGS %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% from rep12.sty - with local mods
\def\section{\@startsection{section}{1}{\z@}
{-7ex}{0.01ex \@plus 0.01ex}
{\ssp\centering\underline}}
\def\subsection{\@startsection{subsection}{2}{\z@}
{-5ex}{0.01ex \@plus 0.01ex}
{\ssp\underline}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}
{-4ex}{-0.01ex}
{\ssp\underline}}

%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%

\newsavebox{\toctopbox}
\savebox{\toctopbox}[\textwidth]{Chapter \hfill}
%
\def\tableofcontents{\pagestyle{plain}
\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn \fi
%
\global\@colht\textheight\onecolumn
%  Figure \hfill Page \par %\vspace{1em}
% The next line puts the heading in the **FIRST** toc page.  Here it
%  goes in with the text.
%\usebox{\toctopbox} \par\vspace{1ex}
% No we define @texttop so it will redefine itself when this, the
% **FIRST** page is output.
\gdef\@texttop{\toc1}
% process the actual entries
\vskip -1em
{\ssp \@starttoc{toc}}
%the  next 2 lines make sure we are at a page break and reset
% the textheight
\newpage
\global\@colht\textheight\onecolumn
%and finally redefine @texttop to do nothing at all
\gdef\@texttop{}
\if@restonecol
\twocolumn\fi
\newpage

\def\toc1{%
\vspace{.6in}       %% add top margin to 2in
\gdef\@texttop{
\parindent 0pt \raggedleft \par \par\vspace{2ex}}}

% The following section is for chapter and section titles in the body
% It will not split words
\addvspace{2.25em plus 11pt}            % space above part line
\begingroup
\@tempdima 3em                  % width of box holding part number,
\parindent \z@ \rightskip \@pnumwidth   % used by \numberline
\parfillskip -\@pnumwidth
{\bf
\leavevmode                             % TeX command to enter horizontal mode
#1\hfil \hbox to\@pnumwidth{\hss #2}
}\par
\nobreak                                % Never break after part entry
\endgroup}

\def\thedots{\cleaders\hbox{$\m@th \mkern4.5mu . \mkern4.5mu$}\hfill}
% a sinlge line space is added in front of each chapter title in the TOC

\def\l@chapter{\vspace{12pt} \@dottedtocline{1}{0.000001mm}{1.4em}}

%\def\l@section{\@dottedtocline{1}{2em}{2em}}
\def\l@section{\@dottedtocline{1}{1.4em}{2.3em}}
%\def\l@subsection{\@dottedtocline{2}{4em}{3em}}
\def\l@subsection{\@dottedtocline{2}{3.7em}{3em}}
\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 %
%%%%%%%%%%%%%%%%%%%

\newsavebox{\loftopbox}
\savebox{\loftopbox}[\textwidth]{\hspace{-0.8in}Figure \hspace{5.1in}Page}
%
\def\listoffigures{\pagestyle{plain}
\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn \fi
\global\@colht\textheight\onecolumn
\chapter*{\centerline{\normalfont LIST OF FIGURES}\@mkboth {LIST OF FIGURES}{LIST OF FIGURES}}
\usebox{\loftopbox} \par\vspace{1ex}
% No we define @texttop so it will redefine itself when this, the
% **FIRST** page is output.
\gdef\@texttop{\lof1}
% process the actual entries
\vskip 1.8ex
{\ssp \@starttoc{lof}}
%the  next 2 lines make sure we are at a page break and reset
% the textheight
\newpage
\global\@colht\textheight\onecolumn
%and finally redefine @texttop to do nothing at all
\gdef\@texttop{}
\if@restonecol
\twocolumn\fi \newpage

\def\lof1{%
\vspace{.6in}          %% add top margin to 2in
\gdef\@texttop{
\parindent 0pt \raggedleft \par \usebox{\loftopbox} \par\vspace{2ex}}}

\def\l@figure{\@dottedtocline{1}{0.001em}{2.5em}}

%%%%%%%%%%%%%%%%%%
% List of Tables %
%%%%%%%%%%%%%%%%%%

\newsavebox{\lottopbox}
\savebox{\lottopbox}[\textwidth]{\hspace{-0.8in}Table \hspace{5.2in}Page}
%
\def\listoftables{\pagestyle{plain}
\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn \fi
%
\global\@colht\textheight\onecolumn
\chapter*{\centerline{\normalfont LIST OF TABLES}\@mkboth {LIST OF TABLES}{LIST OF TABLES}}
%  Figure \hfill Page \par %\vspace{1em}
% The next line puts the heading in the **FIRST** toc page.  Here it
%  goes in with the text.
\usebox{\lottopbox} \par\vspace{1ex}
% No we define @texttop so it will redefine itself when this, the
% **FIRST** page is output.
\gdef\@texttop{\lot1}
% process the actual entries
\vskip 1.8ex
{\ssp \@starttoc{lot}}
%the  next 2 lines make sure we are at a page break and reset
% the textheight
\newpage
\global\@colht\textheight\onecolumn
%and finally redefine @texttop to do nothing at all
\gdef\@texttop{}
\if@restonecol
\twocolumn\fi \newpage

\def\lot1{%
\vspace{.6in}      %% add top margin to 2in
\gdef\@texttop{
\parindent 0pt \raggedleft \par \usebox{\lottopbox} \par\vspace{2ex}}}

\let\l@table\l@figure

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TITLE, COPYRIGHT, AND SIGNATURE PAGES %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Code taken from titlepage.sty and modified extensively.
% \maketitle generates title page, copyright page, and signature page.

\def\maketitle{
%
% Title page
%
\newpage
\setcounter{page}{1}
\thispagestyle{empty}
\pagenumbering{roman}
\hspace{.7in}
\begin{minipage}[t]{3in}
{\ssp
\begin{center}
\@title
\end{center}
}
\vspace{-.3in}
\begin{tabular}[t]{p{3in}}
\ \\
\hline
\end{tabular}

\vspace{-9pt}
\begin{center}
A Thesis   \\
%\vspace{-3pt}
Presented to the \\
%\vspace{-3pt}
Faculty of \\
%\vspace{-3pt}
California State University, Fullerton \\
\end{center}

\vspace{-.35in}
\begin{tabular}[t]{p{3in}}
\ \\
\hline
\end{tabular}

\vspace{-9pt}
\begin{center}
in Partial Fulfillment \\
%\vspace{-3pt}
of the Requirements for the Degree \\
%\vspace{-3pt}
\csufthisdegree \\
%\vspace{-3pt}
in \\
%\vspace{-3pt}
\csufmajor
\end{center}

\vspace{-.35in}
\begin{tabular}[t]{p{3in}}
\ \\
\hline
\end{tabular}

\vspace{-9pt}
\begin{center}
By \\
%\vspace{-3pt}
\@author \\
\ \\
\ \\
\end{center}
\end{minipage}

%\hspace{.7in}
\begin{minipage}[t]{4.4in}{\ssp
\begin{center}
Thesis Committee Approval: \\
\ \\
\csuffirstcomm, \csuffirstcommdept \\
\csufsecondcomm, \csufsecondcommdept \\
\ \\
\ \\
\csufthesissemester, \csufthesisyear
\end{center}
}
\end{minipage}

{
\typeout{* }
\typeout{* }
\newpage
\thispagestyle{empty}
\vspace*{3.5in}
\begin{center}
\@author \par
\end{center}
\stepcounter{page}
}
\else {
\typeout{* }
\typeout{* No copyright page created (page number has been incremented.)}
\typeout{* Remember to insert a blank page in your thesis in this location.}
\typeout{* MS students use \noexpand\yescopyright if you want one (you will need to file}
\typeout{* paperwork with the United States Copyright Office to make it official).}
\typeout{* }
}
\fi
%
%
%
\setcounter{footnote}{0}       % Footnotes start at zero again.
\gdef\@thanks{}
%\gdef\@author{}
\gdef\@title{}
\let\maketitle\relax}

%%%%%%%%%%%%%%%%%%%%
% ABSTRACT PAGE(S) %
%%%%%%%%%%%%%%%%%%%%

% Delimited by \begin{abstract} and \end{abstract}, which
% should enclose only the text of the abstract.

% The abstract should be no more than one page

\def\abstract{
\pagestyle{empty}
{\begin{center}
\vspace*{0.25in}
ABSTRACT
\vskip 0.25in
\end{center}
}
\par
}

\def\endabstract{
\thispagestyle{plain}
\vskip 12pt
\par \noindent
\par
\vfil\null
}

\def\dedication{
\newpage
\ssp
\thispagestyle{plain}
\vspace*{\fill}
\begin{center}
}

\def\enddedication{
\end{center}
\vspace*{\fill}
\dsp
}

\def\acknowledgement{
\par
\dsp
\newpage
\thispagestyle{plain}
\vspace*{.27in}
{\par \normalsize \centerline {ACKNOWLEDGMENT}}
\vskip 1em
}

\def\endacknowlegdement{
\newpage
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% References                                                       %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\@bibitem#1{\item\if@filesw \immediate\write\@auxout
{\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces
\hskip -0.45in}
\def\@lbibitem[#1]#2{\item[\@biblabel{#1}\hfill]\if@filesw
{\def\protect##1{\string ##1\space}\immediate
\write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces
\hskip -0.45in}
\def\thebibliography#1{\chapter*{\vspace*{.43in} \centerline{\normalfont REFERENCES}
\@mkboth{BIBLIOGRAPHY}{BIBLIOGRAPHY}}\list
% {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
{\arabic{enumi}.}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
\usecounter{enumi}}
\def\newblock{\hskip .11em plus .33em minus .07em}
\sloppy\clubpenalty4000\widowpenalty4000
\sfcode\.=1000\relax \ssp}
\let\endthebibliography=\endlist

\long\def\@makecaption#1#2{
\vskip 10pt
\setbox\@tempboxa\hbox{\small{{\bf #1} #2}}
% \ifdim \wd\@tempboxa >\hsize #1: #2\par \else \hbox
%to\hsize{\hfil\box\@tempboxa\hfil}
% \fi}
\ifdim \wd\@tempboxa >\hsize \small{{\sl #1.} #2}\par \else \hbox
to\hsize{\hfil\box\@tempboxa\hfil}
\fi}

% Wanted () instead of []
%\def\@cite#1#2{({#1\if@tempswa , #2\fi})}
%\def\@biblabel#1{(#1)\hfill}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This allows single spacing easily in the figure mode - from ucthesis.sty %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\ssp{\def\baselinestretch{1.0}\large\normalsize}
\def\msp{\def\baselinestretch{1.2}\large\normalsize}
\def\dsp{\def\baselinestretch{1.65}\large\normalsize}

\def\startbody{
\markboth{}{}
\newpage
\pagenumbering{arabic}
\setcounter{chapter}{0}
}

%%%%%%%%%%%%%%
% All done ! %
%%%%%%%%%%%%%%

\typeout{* }
\typeout{* --------------------------------------------------------------------------}

• Thanks. The class I'm using is from the University's website and I've heavily edited it, so I suppose I can just post the entire thing on here... it just seemed excessive. I will include a MWE as well. – saltthehash Feb 7 '16 at 0:57
• Welcome! Oh, dear. You are plagued by both typographically uglifying rules and horrible inherited code. You might try using titlesec. It will give you a lot more control over the headings. I don't get on with it myself and it may disagree with other aspects of the code you've got, but many people swear by it and it is at least worth a shot. If it works, it will be a lot cleaner and easier. If not, you won't have lost much. – cfr Feb 7 '16 at 1:28
• Have you edited it to add underlining? Because it seems odd that a LaTeX style file would require that. Which school? – A Feldman Feb 7 '16 at 2:57
• One of them was underlined, I forgot which. The thing is, the formatting wasn't designed for LaTeX, it's designed for ms word. But I prefer using LaTeX so I can easily integrate my results from R into the document and automatically produce a references page. The style sheet I found was from the computer science dept, and it was known to be a bit broken. However, I looked closer at the formatting requirements and apparently we can use APA style headings if we'd like, which luckily does not include underlining. – saltthehash Feb 7 '16 at 19:15
• From (hard won) experience at a school with a somewhat working legacy LaTeX template and a bunch of Word-derived requirements, start transitioning to using packages like titlesec and titletoc, or maybe a class like memoir that includes their functionality. I've got around 30 lines of code that define all the header formatting, and they're much more readable than what you're changing. – Mike Renfro Feb 7 '16 at 23:10

Assuming that you do not need the star versions of the \section et al:

\documentclass[12pt]{report}
\usepackage{csuf-thesis}
\usepackage{hyperref}
\setcounter{secnumdepth}{0}
\makeatletter
\def\section#1{\@startsection{section}{1}{\z@}
{-7ex}{2ex \@plus 0.01ex}
{\centering\ssp}{\underline{#1}}}
\def\subsection#1{\@startsection{subsection}{2}{\z@}
{-5ex}{1ex \@plus 0.01ex}
{\ssp}{\underline{#1}}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}
{4ex}{-1em}
{\kern\parindent\ssp\underline }}
\makeatother
[ ... ]
`

• Thanks for the response! This makes it work in the document, but it underlines each section/subsection entry in the TOC :-\ – saltthehash Feb 7 '16 at 19:12