我怎样才能将章节名称分成两行,我有学院提供的样式文件?

我怎样才能将章节名称分成两行,我有学院提供的样式文件?
%
% This is a version of NITC Seminar/Thesis/Dissertation latex format. Modified from the Old Dominion University Latex thesis template to confirm to NITC thesis 
% format. Modifications done by N Arun Mani Kumar (M Tech, Signal Processing) and Dr. Praveen Sankaran, Dept. of Electronics and Communication Engineering,
% National Institute of Technology, Calicut. 
% April 2011.
% work remaining: chart out method to write references/bibliography in IEEE format. 

\setlength{\voffset}{-0.5in} 
\marginparwidth 40pt \marginparsep 10pt
\topmargin 0in \headsep .31in
\textheight 8.94in \textwidth 5.96in
\brokenpenalty=10000


\oddsidemargin 0.60in
\if@twoside
  \evensidemargin 0.0in
\else
  \evensidemargin 0.60in
\fi

\textfloatsep  40pt plus 2pt minus 4pt
\floatsep  40pt plus 2pt minus 4pt
%\intextsep  40pt plus 2pt minus 4pt %%%% added FRW

% \def\textfraction{.4}  %%%%% frw
\def\textfraction{.25}
\def\floatpagefraction{.5}

\def\cl@chapter{\@elt{section}\@elt{footnote}}
\def\thefigure{\@arabic\c@figure}
\def\thetable{\@arabic\c@table}
\def\thechapter{\@arabic\c@chapter}
\def\theequation{\@arabic\c@equation}
\renewcommand{\thefigure}{\thechapter.\arabic{figure}}
\renewcommand{\theequation}{\thechapter.\arabic{equation}}
\renewcommand{\thetable}{\thechapter.\arabic{table}}
%\numberwithin{equation}{chapter}



\renewcommand{\figurename}{Figure}
\renewcommand{\tablename}{TABLE}
\renewcommand{\bibname}{BIBLIOGRAPHY}
\renewcommand{\chaptername}{CHAPTER}
\renewcommand{\appendixname}{APPENDIX}
 % \renewcommand{\publicationname}{PUBLICATION }

%FRW \newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
%FRW the above definition from REPORT.CLS is partially overridden
%FRW (to make room for roman numerals longer than VIII and XIV) by:
%
%\def\l@table{\@dottedtocline{1}{1.5em}{4.0em}}
\def\l@chapter{\@dottedtocline{0}{0em}{2.3em}}
%
% this makes enough room for roman numerals as long as XXVIII and XXXIX
% but is insufficient for XXXVIII -- just increase the 4.0 even more


\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
       \multiply\@tempcnta\@xxxii\advance\@tempcnta\sixt@@n
       \@tfor \@tempa :=#2\do
                        {\if\@tempa h\advance\@tempcnta \@ne\fi
                         \if\@tempa t\advance\@tempcnta \tw@\fi
                         \if\@tempa b\advance\@tempcnta 4\relax\fi
                         \if\@tempa p\advance\@tempcnta 8\relax\fi
         }\global\count\@currbox\@tempcnta}\@fltovf\fi
    \global\setbox\@currbox\vbox\bgroup 
    \def\baselinestretch{1}\@normalsize
    \boxmaxdepth\z@
    \hsize\columnwidth \@parboxrestore}

\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}}}


\def\dept#1{\gdef\@dept{#1}}
\def\branch#1{\gdef\@branch{#1}}
\def\principaladviser#1{\gdef\@principaladviser{#1}}
\def\advis@r{Adviser}
\def\principaladvisor#1{\gdef\@principaladviser{#1}\gdef\advis@r{Advisor}}
\def\firstreader#1{\gdef\@firstreader{#1}}
\def\secondreader#1{\gdef\@secondreader{#1}}
\def\submitdate#1{\gdef\@submitdate{#1}}
%\def\copyrightyear#1{\gdef\@copyrightyear{#1}} % \author, \title in report
\def\degrees#1{\gdef\@degrees{#1}}
\def\abstract#1{\def\@abstract{#1}}
\def\acknowledgement#1{\def\@acknowledgement{#1}}
 %\def\publications#1{\def\@publications{#1}}
%\def\@title{}\def\@author{}\def\@dept{computer science}
%\def\@principaladviser{}\def\@firstreader{}\def\@secondreader{}
\def\@degrees{}
\def\@abstract{}
\def\@acknowledgement{}
 %\def\@publications{}
\def\vita#1{\gdef\@vita{#1}}
\def\@vita{}

\def\@submitdate{\ifcase\the\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\the\year}
\ifnum\month=12
    \@tempcnta=\year \advance\@tempcnta by 1
    \edef\@copyrightyear{\number\the\@tempcnta}
\else
    \def\@copyrightyear{\number\the\year}
\fi
\newif\ifcopyright \newif\iffigurespage \newif\iftablespage \newif\ifabstractpage
\copyrighttrue \figurespagetrue \tablespagetrue \abstractpagetrue\newif\ifabbreviationspage

\newif\ifphd
\phdtrue


%FRW  fix for 2e over 2.09
%
\def\signline#1{\\
                \rule{2.5in}{0.5pt}\\
                 {\small #1} \\}
%FRW \def\signline#1{\vspace*{0pt} 
%FRW                 \rule{2.5in}{0.5pt}\\
%FRW                {\small #1} \\}


\def\@member{}
\def\member#1{\expandafter\def\expandafter\@member\expandafter
{\@member{\signline{#1}}}}

\def\titlep{%
        \def\baselinestretch{1.5}\@normalsize
        \thispagestyle{empty}%
        \begin{center}
                {\bf\uppercase\expandafter{\@title}}
        \end{center}
        \renewcommand{\baselinestretch}{1.0}\@normalsize
        \begin{center}
        \vspace{18pt}
                \textbf{A Report}\\
               \large{\emph{Submitted by}}\\
        \renewcommand{\baselinestretch}{1.0}\@normalsize
               \vspace{18pt}
               \textbf{\uppercase\expandafter{\@author}}\\
    \vspace*{5pt}
               \textbf{M140543EE}
\vspace*{10pt}
                %\@degrees\\    % for if u have higher degrees enable this command
        \end{center}
        %\vspace*{1pt}
        %\vfill

        % here i modified according to our required format. If any one want to get Ph.d/M.Tech Thesis submission can enable this double commented code(after disabling the next section code). 

%%        \begin{center}
%%                A \ifphd Dissertation \else Thesis \fi Submitted to the Faculty of\\
%%                Old Dominion University in Partial Fulfillment of the\\
%%                Requirement for the Degree of\\
%%                \vspace{18pt}
%%                \ifphd \uppercase{Doctor of Philosophy} \else \uppercase{Master of Technology}\fi \\
%%                \vspace{18pt}
%%                \uppercase\expandafter{\@dept}\\
%%                \vspace{18pt}
%%                \uppercase{National Institute of Technology Calicut}\\
%%                \@submitdate\\
%%        \end{center}    

% here it is the starting of next section

                \begin{center} 
                \large{\emph{In partial fulfillment for the award of the Degree of}} \\
                \renewcommand{\baselinestretch}{1.0}\@normalsize
                %\emph{In partial fulfillment for the award of the Degree of}   \\          
                \vspace*{18pt}                            
                \textbf{\uppercase{MASTER OF TECHNOLOGY}} \\
                \vspace*{5pt}
                \textbf{IN} \\
                \vspace*{5pt}
                \textbf{\uppercase\expandafter{\@dept}}\\
                \vspace*{5pt}
                \textbf{\@branch}\\
                \vspace*{18pt}
                Under the guidance of \\
                \vspace*{5pt}
                \renewcommand{\baselinestretch}{1.0}\@normalsize
                \textbf{\expandafter{\@principaladviser}} \\
                \vspace{5pt}

                \begin{figure}[h]
                \begin{center}
                   \includegraphics[scale=.4]{Nitc_logo.png} 
                \end{center}
                \end{figure}


                \textbf{\uppercase\expandafter{department of\\ 
                \vspace*{5pt}
                 \uppercase\expandafter{\@dept}}} \\
                 \vspace*{5pt}
                \textbf{\uppercase\expandafter{National Institute of Technology Calicut \\
                 \vspace*{5pt}
                               NIT Campus po, Calicut\\
                                \vspace*{5pt}
                               Kerala, INDIA 673601.\\
                               }}
                 \vspace*{5pt}
                \textbf{\uppercase\expandafter{\@submitdate}}\\  
                \renewcommand{\baselinestretch}{1.0}\@normalsize            
                \end{center}
        \vfill
%        \hfill\parbox[t]{2.5in}{Approved by:\\
%                                \signline{\@principaladviser\ (Director)}
%                                \@member}
        \vfill\newpage}

\def\abstractpage{\def\baselinestretch{1.3}\@normalsize\pagestyle{plain}
        \begin{center}
                {\large\bf ABSTRACT}\\
                \vspace{10pt}

        \end{center}
        \@abstract
        \vfill\newpage}

% here i am writing the Declaration page and the certificate page. Any modifications needed for change in the format can do in the following sections.
\def\declarationpage{\def\baselinestretch{2}\@normalsize\pagestyle{empty}
        \begin{center}
              {\large\bf DECLARATION} \\
              \vspace{10pt}
              \end{center}
             \emph{\textsl{I hereby declare that this submission is my own work and that, to the best of my knowledge and belief, it contains no material previously published or written by another person nor material which has been accepted for the award of any other degree or diploma of the university or other institute of higher learning, except where due acknowledgement has been made in the text.}} \\
              \vspace{.5in} \\
              \textbf{Place:} \hspace{2in}  \textbf{Signature}  \\
              \vspace{15pt}
              \textbf{Date:} \hspace{2in} \textbf{Name:}\\
              \hspace*{2.7in} \textbf{Reg.No:}
              \vfill\newpage}

\def\certificatepage{\def\baselinestretch{2}\@normalsize\pagestyle{empty}
        \begin{center}
        \begin{figure}[h]
                \begin{center}
                   \includegraphics[scale=.4]{Nitc_logo.png} 
                \end{center}
                \end{figure}
        {\large\bf CERTIFICATE} \\
                 \end{center}
        \emph{\textsl{This is to certify that the Report entitled \textbf{``TRACKING AND BALANCING OF TWO WHEELED INVERTED PENDULUM USING LEGO MINSTORMS EV3"} is submitted by \textbf{Mr. PRAVIN TRINATH BEHERA} to the National Institute of Technology Calicut towards partial fulfillment of the requirements for the award of the Degree of Master of Technology in Electrical Engineering (ICS) is a bonafide record of the work carried out by him under my supervision and guidance.
 }}\\
\vspace*{1.25in}
\begin{table}[ht]
\begin{tabular}{l p{5cm} l}
\textbf{Dr. MIJA S.J.}& &\textbf{Dr. JEEVAMMA JACOB}\\
\textit{Asst. Professor}& &\textit{Professor}\\
\textit{Project Guide}& &\textit{Head of Department}\\
\textit{EED, NIT Calicut}& &\textit{EED, NIT Calicut}
\end{tabular}
\end{table}
\vspace*{0.25in}
\begin{flushleft}
Place: NIT Calicut\\
Date:\\
\end{flushleft}
        %\vspace{25pt}
         %\begin{center}
        %(\textbf{Office seal})
        %\end{center} 
        \vfill\newpage}  

\def\acknowledgementpage{\def\baselinestretch{1.3}\@normalsize\pagestyle{empty}
        \begin{center}
                {\large\bf ACKNOWLEDGEMENT}\\
                \vspace{10pt}

               % \vspace{15pt}

        \end{center}
        \paragraph{}I express my profound sense of gratitude to my project guide, Dr. MIJA S.J.,  Professor, Electrical Engineering Department for her valuable suggestions, inspiration, support, and continuous encouragement.
        \paragraph{}I use this opportunity to thank Dr. JEEVAMMA JACOB, Professor and Head of Department, Electrical engineering Department, for providing me with all the necessary facilities for the work.

\paragraph{}I take this opportunity to thank all the other teaching and non teaching staff members of Electrical Engineering Department for their valuable help. 
 \vspace{25pt}
 \begin{flushright}
 \textbf{Pravin Trinath Behera}
 \end{flushright}
        \@acknowledgement
        \vfill\newpage}



%%\def\vitapage{\def\baselinestretch{1.3}\@normalsize\pagestyle{myheadings}
%%              \chapter*{VITA}
              %%\addtocontents{toc}{\vspace*{12pt}}
              %%\addcontentsline{toc}{chapter}{VITA}
              %%\begin{flushleft}
                %% \@author\\
                 %%Department of \@dept \\
                 %%National Institute of Technology Calicut \\
                 %%Calicut,Kerala-673601.
              %%\end{flushleft}
              %%\@vita
              %%\vfill
              %%\begin{flushleft}
                %% Typeset using \LaTeX .
              %%\end{flushleft}}


% here I am disclosing the Copy right section,Certification and Signature page by double commenting (%%). If needed undo the following section to get back. 


%\def\copyrightpage{%
       % \pagestyle{plain}
       % \vspace*{2in}
       % \begin{center}
               % \copyright Copyright,\ \@copyrightyear,\ by
                %\@author,\
               % All Rights Reserved
       % \end{center}
      % \vfill\newpage}
%%
%%\long\def\signature#1{%
%%\begin{center}
%%\begin{minipage}{4in}
%%\parindent=0pt
%%I certify that I have read this thesis and that in my opinion
%%it is fully adequate, in scope and in quality, as a dissertation for the degree
%%of Doctor of Philosophy.
%%\par
%%\vspace{.5in}
%%\hbox to 4in{\hfil\shortstack{\vrule width 3in height 0.4pt\\#1}}
%%\end{minipage}
%%\end{center}}                                       
%%
%%\def\signaturepage{%
%%        \signature{\@principaladviser\\(Principal \advis@r)}
%%        \vfill
%%        \signature\@firstreader
%%        \vfill
%%        \signature\@secondreader
%%        \vfill
%%        \begin{center}
%%        \begin{minipage}{4in}
%%        Approved for the University Committee on Graduate Studies:\par
%%        \vspace{.5in}
%%        \hbox to 4in{\hfil\shortstack{\vrule width 3in height 0.4pt\\
%%                        Dean of Graduate Studies \& Research}}
%%        \end{minipage}
%%        \end{center}}

\def\beforepreface{
        \pagenumbering{roman}
        \pagestyle{plain}
        \newpage
        \titlep \cleardoublepage
    \acknowledgementpage
        \cleardoublepage

       % \declarationpage
    \cleardoublepage
        \certificatepage

        %\cleardoublepage

       % \ifcopyright\copyrightpage\fi
    %\cleardoublepage 

    %\addcontentsline{toc}{chapter}{Abstract}
        \abstractpage
    \cleardoublepage
}


\def\prefacesection#1{%
      \cleardoublepage
        \def\baselinestretch{1.5}\@normalsize

        \chapter*{#1}}

\def\afterpreface{ \cleardoublepage
        \def\baselinestretch{1.5}\@normalsize
        \tableofcontents  
        \cleardoublepage
    %\addcontentsline{toc}{chapter}{Abstract}
        %\abstractpage




    %\abstractpage  
        %%%\cleardoublepage     \publicationspage



 \iffigurespage
                {\addvspace{18pt}
                \let\saveaddvspace=\addvspace
                \def\addvspace##1{}             
                \addcontentsline{toc}{chapter}{List of Figures}\listoffigures
                \let\addvspace=\saveaddvspace}
                \cleardoublepage
                \cleardoublepage

        \fi

    \iftablespage
                {\addvspace{18pt}
                \let\saveaddvspace=\addvspace
                \def\addvspace##1{} 
                \let\addvspace=\saveaddvspace
               \addcontentsline{toc}{chapter}{List of Tables}\listoftables
                \let\addvspace=\saveaddvspace}
                \cleardoublepage


    %\fi



        \def\baselinestretch{1.3}\@normalsize
        \pagenumbering{arabic}
        %\pagestyle{myheadings} % enable if you want page number top-right corner
    \pagestyle{plain} % page numbers on bottom center of page
        \labelchaptersintableofcontents}

\def\tableofcontents{\pagestyle{plain}\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \fi\chapter*{Table of Contents}%\@mkboth{TABLE OF CONTENTS}{TABLE OF CONTENTS}}
% \fi\chapter*{Table of Contents\@mkboth{TABLE OF CONTENTS}{TABLE OF CONTENTS}}
% {\large{\bf Section}\hfill{\bf Page}}%\newline
 \@starttoc{toc}\if@restonecol\twocolumn\fi
 \addtocontents{toc}{\hfill Page\par}}

\def\listoffigures{\pagestyle{plain}\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \fi\chapter*{List of Figures} %\@mkboth{LIST OF FIGURES}{LIST OF FIGURES}}
% {\large{\bf Number}\hfill{\bf Page}}%\newline
  \@starttoc{lof}\if@restonecol \twocolumn\fi
 \addtocontents{lof}{\hfill Page\par}}

% temporarily block out for seminar report. unblock this to get back the list of tables section on contents page. 
 \def\listoftables{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
  \fi\chapter*{List of Tables}%\@mkboth{LIST OF TABLES}{LIST OF TABLES}}
% {\large{\bf Number}\hfill{\bf Page}}%\newline
   \@starttoc{lot}\if@restonecol
  \twocolumn\fi
  \addtocontents{lot}{\hfill Page\par}}


%\def\l@figure{\vskip 1.0em plus 1pt\@dottedtocline{1}{1.5em}{2.3em}}
%\let\l@table\l@figure

% Start with pagestyle{myheadings} in case front matter isn't processed
%\pagestyle{myheadings}
\thispagestyle{plain} % didnt do much when this was changed
%\markboth{}{} % enable with myheadings

%
% FRW added custom footnote without number for document style phrase
%
\def\nnfootnote{%
     \@ifnextchar [\@xfootnotenext
       {\protected@xdef%
%       \@thefnmark{\thempfn}%   removed the number from FOOTNOTETEXT command:
        \@thefnmark{ }%
    \@footnotetext}}
%
\renewcommand{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi
%                   \thispagestyle{myheadings}%
            \thispagestyle{plain} % puts page number on bottom center in chapter page
                    \global\@topnum\z@ 
                    \@afterindentfalse
                    \secdef\@chapter\@schapter}
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                         \refstepcounter{chapter}%
                         \typeout{\@chapapp\space\thechapter.}%
                         \addcontentsline{toc}{chapter}%
                                   {\protect\numberline{\thechapter}#1}%
                    \else
                      \addcontentsline{toc}{chapter}{#1}%
                    \fi
                    \chaptermark{#1}%
                    \addtocontents{lof}{\protect\addvspace{10\p@}}%
                    \addtocontents{lot}{\protect\addvspace{10\p@}}%
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}
\def\@makechapterhead#1{%
%  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
        \centerline{\large\bfseries \@chapapp\space \thechapter}
        \par\nobreak
        \vskip 12\p@
    \fi
    \interlinepenalty\@M
    \centerline{\large \bfseries \uppercase{#1}}\par\nobreak
    \vskip 18\p@
  }}
\def\@schapter#1{\if@twocolumn
                   \@topnewpage[\@makeschapterhead{#1}]%
                 \else
                   \@makeschapterhead{#1}%
                   \@afterheading
                 \fi}
\def\@makeschapterhead#1{%
  %\vspace*{50\p@}%
  {\parindent \z@ \raggedright
    \normalfont
    \interlinepenalty\@M
    \centerline{\large \bfseries  \uppercase{#1}}\par\nobreak
    \vskip 18\p@
  }}
\renewcommand{\section}{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\normalfont\bfseries\MakeUppercase}}

\renewcommand{\subsection}{\@startsection{subsection}{2}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\normalfont\bfseries}}


\newcommand{\labelchaptersintableofcontents}{%
     \addtocontents{toc}{\vspace*{16pt}\noindent CHAPTERS\vspace*{16pt}}}
\newcommand{\labelappendicesintableofcontents}{%
     \addtocontents{toc}{\vspace*{16pt}\noindent APPENDICES\vspace*{16pt}}}



\renewcommand{\appendix}{\par
  \setcounter{chapter}{0}%
  \setcounter{section}{0}%
  \labelappendicesintableofcontents%
  \gdef\@chapapp{\appendixname}%
  \gdef\thechapter{\@Alph\c@chapter}}

%  \renewcommand{\publications}{\par
%  \setcounter{chapter}{0}%
%  \setcounter{section}{0}%
%  \labelpublicationsintableofcontents%
%  \gdef\@chapapp{\appendixname}%
%  \gdef\thechapter{\@Alph\c@chapter}}
%  

答案1

您需要更新的版本,\@makechapterhead因为当前版本使用 ,因此不允许换行\centerline。请改用\centering

\def\@makechapterhead#1{%
%  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
   \centering
    \ifnum \c@secnumdepth >\m@ne
        \large\bfseries \@chapapp\space \thechapter
        \par\nobreak
        \vskip 12\p@
    \fi
    \interlinepenalty\@M
    \large \bfseries \uppercase{#1}\par\nobreak
    \vskip 18\p@
  }}

\@makeschapterhead如果您希望获得类似的输出,则应该对 执行相同的操作\chapter*。以下最小示例执行此操作:

在此处输入图片描述

\documentclass{report}

\usepackage{collegestyle}% Your college style file

\makeatletter

\def\@makechapterhead#1{%
%  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
   \centering
    \ifnum \c@secnumdepth >\m@ne
        \large\bfseries \@chapapp\space \thechapter
        \par\nobreak
        \vskip 12\p@
    \fi
    \interlinepenalty\@M
    \large \bfseries \uppercase{#1}\par\nobreak
    \vskip 18\p@
  }}
\def\@makeschapterhead#1{%
  %\vspace*{50\p@}%
  {\parindent \z@ \raggedright
    \normalfont
    \interlinepenalty\@M
    \centering\large \bfseries  \uppercase{#1}\par\nobreak
    \vskip 18\p@
  }}

\makeatother

\begin{document}

\chapter{A chapter title that should span multiple lines with having to break it manually}

\end{document}

相关内容