但我想写
第一章—简介。
你能告诉我如何格式化吗?谢谢 Palai
我使用的文档类为“报告”。我使用的样式文件如下:
\parindent 0.8cm % set paragraph indentation to 0.8cm
\oddsidemargin 16mm %% changed from 10 to 16
\evensidemargin 0mm
\marginparwidth 40pt
\marginparsep 10pt
\textwidth 144mm
\topmargin -5mm %% ratnkar changed from -12 to -5mm
\headheight 5mm
\headsep 15mm %% ratnakar changed from 5 to 15 mm
%--\topskip 0pt
\textheight 221mm %% ratnakar changed from 245 to 221mm
%\footskip 0pt
%%
%% Line Spacing...
%%
\usepackage{doublespace}
\setstretch{1.66}
% \setstretch{1.66} % Double Space (Latex adds 20% to this)
% \setstretch{1.24} % 1 1/2 Space
% \setstretch{1} % Single Space
%\def\arraystretch{1.2} % Spacing for tabular data
%%
%% Indentation... Stolen from indentfirst.sty by David Carlisle
%%
%%
%% Make the first line of all sections etc be indented by the usual
%% paragraph indentation.
\usepackage{indentfirst}
\setlength{\parindent}{25pt}
%%
%% Store Thesis Info in a set of variable that will
%% be used in the \maketitle and abstract environment
%% (\author and \date are also used)
%%
\newcommand \degree[1]{\gdef \@degree{#1}}
\newcommand \dept[1]{\gdef \@dept{#1}}
\newcommand \advisor[1]{\gdef \@advisor{#1}}
\newcommand \committee[1]{\gdef \@committee{#1}}
%%
%% redefine the title-page format
%%
\renewcommand{\maketitle}
{\begin{titlepage}% Start of Titlepage
\let\footnotesize\small
\let\footnoterule\relax
\null\vfil
\vskip 0\p@
\begin{singlespace}
\begin{center}%
\vskip 3em%
{\LARGE \bf \@title \par} % Sets the Title layout.
\vskip 4em%
{\large
\lineskip .75em%
\vspace{3.5cm}
\begin{tabular}[t]{c}% This starts the table enviroment.
\@degree \\
\vspace{35mm} \\
\@dept
\vspace{5mm} \\
\Large
\@author \\
\vspace{5mm} \\
\@date
\end{tabular}\par}% This ends the table enviroment.
\vskip 1.5em%
%{\large \@date \par}% % Set date in \large size.
\end{center}\par
%\@thanks
%\vfil\null
\vfill
%\begin{singlespace}
%\begin{list}
%{\leftmargin 0.5in\topsep 0pt\partopsep 0pt}
%\item
%\@committee
%\end{list}
%\vfill
\end{singlespace}
\end{titlepage} % End of Titlepage
%\setcounter{footnote}{0}%
%\let\thanks\relax\let\maketitle\relax
%\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
%\gdef\@background{}\gdef\@committee{}\gdef\advisor{}
}
%%
%% redefine the Abstract Format
%%
\def\@absapp{ABSTRACT}
\renewenvironment{abstract}{
\begin{center}
{ \LARGE \bf ABSTRACT}
\end{center}
}{}
%\addcontentsline{toc}{chapter}{ABSTRACT}
%%
%% redefine the format for chapter
%%
\def\@chapapp{CHAPTER}
\renewcommand{\chapter}{\clearpage\global\@topnum\z@
%\@afterindentfalse
\renewcommand\thechapter{\Roman{chapter}}
\secdef\@chapter\@schapter}
\renewcommand{\@makechapterhead}[2]{
{
%\parindent 0pt \raggedright
\ifnum \c@secnumdepth >\m@ne
\begin{center}\huge \bf \@chapapp{} \thechapter \par
\vskip 0in \fi \huge \bf #1\par
\nobreak \vskip 0.4in
\end{center}
\parindent 0.8cm
\thispagestyle{plain} %Set for final draft ##
%\thispagestyle{fancy} %Set for draft printing with version
% NB:- USE OF "##" REFERS TO NOTE AT START OF thesis.tex
}}
%%
%% redefine the format for captions
%%
%\newcommand{\captionsmall}[1]{\caption{\sf \footnotesize #1}} % NA
\renewcommand\figurename{\sl \footnotesize Figure}
\renewcommand\tablename{\sl \footnotesize Table}
%%
%% redefine the format for false-chapter
%%
\renewcommand{\@makeschapterhead}[1]{{\parindent 0pt
\raggedright
\huge \bf #1\par
\nobreak \vskip 0.5in} }
%%
%% redefine the format for section
%%
\renewcommand{\section}{\@startsection {section}{10}{\z@}
{-3.25ex plus -1ex minus -.2ex}{2ex plus .2ex}{\LARGE \bf}}
%%
%% redefine the format for subsection
%%
\renewcommand{\subsection}{\@startsection{subsection}{10}{\z@}
{-3ex plus -1ex minus -.2ex}{1ex plus .2ex}{\large\bf}}
%%
%% redefine the format for footnotes
%%
%%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
%% redefine the name of reference section
%%
\renewcommand{\thebibliography}[1]{\section*{References\@mkboth
{References}{References}}\list
{[\Roman{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
\advance\leftmargin\labelsep
\usecounter{enumi}}
\def\newblock{\hskip .11em plus .33em minus .07em}
\sloppy\clubpenalty4000\widowpenalty4000
\sfcode`\.=1000\relax
\addcontentsline{toc}{chapter}{References}
% Bibtex database file: "references.bib"
}
%%
%% redefine the chapter-level toc entry to include dots.
%%
\renewcommand{\l@chapter}[2]{
\vspace{\baselineskip} \bfseries
\@dottedtocline{0}{0em}{1.3em}{#1}{#2}
%\newlength(\NumberWidth}
%\settowidth{\NumberWidth}{#1}
%\@dottedtocline{0}{0em}{\NumberWidth}{#1}{#2}
\normalfont }
%
\newcommand{\l@appendix}[2]{
% \vspace
{\baselineskip} \bfseries
\@dottedtocline{0}{0em}{1.3in}{#1}{#2}
\normalfont }
%%
%% redefine the heading for toc
%%
%
\renewcommand{\tableofcontents}{\@restonecolfalse
\if@twocolumn\@restonecoltrue\onecolumn
\fi\chapter*{\Large \begin{center}TABLE OF CONTENTS \end{center}
\addcontentsline{toc}{chapter}{TABLE OF CONTENTS}
\@mkboth{\begin{center}Table of Contents}{Table of Contents}}
\@starttoc{toc}\if@restonecol\twocolumn\fi}
\renewcommand{\thesection}{}
%%
%% redefine the heading for lof
%%
\renewcommand{\listoffigures}{\@restonecolfalse
\if@twocolumn\@restonecoltrue\onecolumn
\fi\chapter*{\begin{center} LIST OF FIGURES \end{center}
\@mkboth
{List of Figures}{List of Figures}}
\addcontentsline{toc}{chapter}{LIST OF FIGURES}\@starttoc{lof}\if@restonecol
\twocolumn\fi}
%%
%% redefine the heading of lot
%%
\renewcommand{\listoftables}{\@restonecolfalse
\if@twocolumn\@restonecoltrue\onecolumn
\fi\chapter*{\begin{center}LIST OF TABLES \end{center}
\@mkboth
{List of Tables}{List of Tables}}
\addcontentsline{toc}{chapter}{LIST OF TABLES}\@starttoc{lot}\if@restonecol
\twocolumn\fi}
%%
%% Appendix Junk required by Grad School
%%
\renewcommand{\appendixname}{APPENDIX}
\renewcommand\appendix{\par
\setcounter{chapter}{0}%
\setcounter{section}{0}%
\renewcommand\@chapapp{\appendixname}%
\renewcommand\thechapter{\Alph{chapter}}
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
\thispagestyle{plain}%
\global\@topnum\z@
\@afterindentfalse
\secdef\@myappendix\@schapter}
}
\def\@myappendix[#1]#2{\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{appendix}%
{\protect\numberline{\@chapapp\space\thechapter}}%
\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}
答案1
修改 的定义\l@chapter
使得它包含\@dottedtocline{0}{0em}{1.3em}{CHAPTER #1}{#2}
。
\documentclass{report}
\makeatletter
\newcommand\ch@name{}
\renewcommand{\l@chapter}[2]{%
\vspace{\baselineskip}%
\bfseries
\@dottedtocline{0}{0em}{7em}{\renewcommand\ch@name{CHAPTER} #1}{#2}%
\normalfont
}
\renewcommand{\numberline}[1]{%
\hb@xt@\@tempdima{\ch@name\ #1\hfil--}%
\renewcommand\ch@name{}%
\space
}
\makeatother
\usepackage{blindtext}
\begin{document}
\tableofcontents
\chapter*{Unnumbered}
\addcontentsline{toc}{chapter}{Unnumbered}
\Blinddocument
\end{document}