未定义控制序列。缺少 \begin 文档

未定义控制序列。缺少 \begin 文档

有人能帮我解决这个错误吗?因为我刚接触 Latex。

抛出错误信息\setlength{\cftbeforelostitleskip}{-64.0truept}

% Dissertation style file by John Shumway.
% Attempts to meet requirements of the Graduate Education of Arizona State 
% University
% No guarantees - PLEASE CHECK FORMAT CAREFULLY!
% 
% Setup the page layout (8 1/2 x 11 one and one-half spaced page, for 12pt font)
% 1.25" side margins, 1.00" top and bottom margins
% 
%\geometry{top=71.0truept,hmargin=90.344truept,height=648.0truept,includefoot,
%letterpaper}%,showframe,showcrop}
%
\geometry{top=1.0in,hmargin=1.25in,height=9.0in,includefoot,
letterpaper}%,showframe,showcrop}
%
% Define singlespace and doublespace commands for 12pt fonts.
%
\newcommand{\doublespace} {
\renewcommand{\baselinestretch}{1.66}\small\normalsize
}
\newcommand{\oneandhalfspace} {
\renewcommand{\baselinestretch}{1.24}\small\normalsize
}
\newcommand{\singlespace} {
\renewcommand{\baselinestretch}{0.9}\small\normalsize
}
\singlespace

%
% Title page.
%
% Define "\defensemonth" "\gradmonth" "\gradyear" commands for title page.
\title{\tt$\backslash$\string title}
\author{\tt$\backslash$\string author}
\newcommand{\defensemonth}[1]{\renewcommand{\@defensemonth}{#1}}
\newcommand{\@defensemonth}{\tt$\backslash$\string defensemonth}
\newcommand{\gradmonth}[1]{\renewcommand{\@gradmonth}{#1}}
\newcommand{\@gradmonth}{\tt$\backslash$\string gradmonth}
\newcommand{\gradyear}[1]{\renewcommand{\@gradyear}{#1}}
\newcommand{\@gradyear}{\tt$\backslash$\string gradyear}
% Define "\chair" and \member commands for title page.
\newcommand{\chair}[1]{\renewcommand{\@chair}{#1}}
\newcommand{\@chair}{\tt$\backslash$\string chair}
\newcommand{\memberOne}[1]{\renewcommand{\@memberOne}{#1}}
\newcommand{\@memberOne}{\tt$\backslash$\string memberOne}
\newcommand{\memberTwo}[1]{\renewcommand{\@memberTwo}{#1}}
\newcommand{\@memberTwo}{\tt$\backslash$\string memberTwo}
\newcommand{\memberThree}[1]{\renewcommand{\@memberThree}{#1}}
\newcommand{\@memberThree}{\tt$\backslash$\string memberThree}
\newcommand{\memberFour}[1]{\renewcommand{\@memberFour}{#1}}
\newcommand{\@memberFour}{\tt$\backslash$\string memberFour}
% Define "\degreeName" command for Title Page.
% (should set to "Doctor of Philosophy")
\newcommand{\degreeName}[1]{\renewcommand{\@degreeName}{#1}}
\newcommand{\@degreeName}{\tt$\backslash$\string degreeName}
%
% Redefine maketitle
\newlength{\fiveblanklines}\setlength{\fiveblanklines}{0.7 in}
\newlength{\tenblanklines}\setlength{\tenblanklines}{1.5 in}
\renewcommand\maketitle{
\enlargethispage{0.5in} %make extra room where page number would go
\thispagestyle{empty}
\noindent
  \begin{minipage}[t][647.0truept][t]{\linewidth}
  \begin{center}
  \@title\\ \ \\
by\\ \ \\
\@author
\end{center}
\vspace{\fiveblanklines}
\begin{center}
\singlespace
A Practicum Presented in Partial Fulfillment\\
of the Requirement for the Degree\\
\@degreeName
\end{center}
\vspace{\tenblanklines}
\begin{center}
\singlespace
Approved \@defensemonth\ \@gradyear\ by the\\
Graduate Supervisory Committee:\\
\ \\
\@chair\\
\end{center}
\vfill
\begin{center}
\doublespace
ARIZONA STATE UNIVERSITY\\
\@gradmonth\ \@gradyear
\end{center} 
\end{minipage}
\clearpage
}

%
% redefine abstract environment
%
\renewenvironment{abstract}{
\setcounter{page}{1}
\begin{center}
\doublespace
ABSTRACT
\end{center}
} {
\clearpage
}

%
% make acknowledgements environment
%
\newenvironment{acknowledgements}{
\begin{center}
\doublespace
ACKNOWLEDGEMENTS
\end{center}
} {
\clearpage
}

%
% define \acknowledgementpage
%
\newcommand{\acknowledgementpage}[1]{
\begin{center}
\doublespace
ACKNOWLEDGEMENTS
{\itshape #1}
\end{center}
\clearpage
}

%
% define \dedicationpage
%
%\newcommand{\dedicationpage}[1]{
%\clearpage\vspace*{0.5\textheight}
%\centerline{\itshape #1}\clearpage
\newcommand{\dedicationpage}[1]{
\begin{center}
\doublespace
DEDICATION
{\itshape #1}
\end{center}
\clearpage  
}

%
% define \blankpage
%
\newcommand{\blankpage}{
\begin{center}
\doublespace
\end{center}
} {
\clearpage
}

%
% define Preface Page
%
\newcommand{\prefacepage}[1]{
\begin{center}
\doublespace
PREFACE
{\itshape #1}
\end{center}
\clearpage  
}

%       
% Define Symbols Page
%
\newcommand{\symbolspage}[1]{
\begin{center}
\doublespace
LIST OF SYMBOLS
{\itshape #1}
\end{center}
\clearpage  
}

%       
% Define Biographical Page
%
\newcommand{\biographicalpage}[1]{
\begin{center}
\doublespace
BIOGRAPHICAL SKETCH
{\itshape #1}
\end{center}
\clearpage  
}

%
% Fix the table of contents
%
%
% Get leader dots right.  They should all be spaced the same and need to be
% added for chapters and parts.
%
\renewcommand{\cftchapdotsep}{1.7}
\renewcommand{\cftchapleader}{\cftdotfill{\cftchapdotsep}}
\renewcommand{\cftpartdotsep}{1.7}
\renewcommand{\cftpartleader}{\cftdotfill{\cftpartdotsep}}
\renewcommand{\cftsecdotsep}{1.7}
\renewcommand{\cftsubsecdotsep}{1.7}
\renewcommand{\cfttabdotsep}{1.7}
\renewcommand{\cftfigdotsep}{1.7}
%
% Fonts for the chapter titles and part titles.
%
\renewcommand{\cftchapfont}{\rm}
\renewcommand{\cftpartfont}{\rm}
\renewcommand{\cftchappagefont}{\rm}
\renewcommand{\cftpartpagefont}{\rm}
%
% Indentations: These are in accordance with the chart at the top of page 4 of
% the document
% ftp://tug.ctan.org/pub/tex-archive/macros/latex/contrib/tocloft/tocloft.pdf
% I simply moved each of the following sections "up" one level to get the
% indentations right.
%
\cftsetindents{chapter}{1.5em}{1.5em}
\cftsetindents{section}{3.0em}{2.3em}
\cftsetindents{subsection}{5.3em}{3.2em}
%
% Spacing between entries is taken care of by the double-spacing in this 
% section, so no need for extra space before chapter or part entries.
%
\setlength{\cftbeforepartskip}{0truept}
\setlength{\cftbeforechapskip}{0truept}
%
% Get the title for the TOC normal sized, centered, and at the right height.
%
\setlength{\cftbeforetoctitleskip}{-64.0truept}
\setlength{\cftaftertoctitleskip}{0truept}
%
\renewcommand{\contentsname}{TABLE OF CONTENTS}
\renewcommand{\cfttoctitlefont}{\hfill\normalsize\rm}
\renewcommand{\cftaftertoctitle}{\hfill}
%
\newcommand{\cftlabel}{CHAPTER}
%
% Get rid of the header underline.
\renewcommand{\headrulewidth}{0pt}
%
% Get the header on subsequent pages right.
\renewcommand{\@cfttocstart}{ 
\newgeometry{top=1.0in,hmargin=1.25in,height=9.0in,
includehead,includefoot,letterpaper}%,showcrop,showframe}

\doublespace
\pagestyle{fancyplain}
\afterpage{\lhead{\cftlabel}\rhead{Page}}
}

\renewcommand{\@cfttocfinish}{
\restoregeometry\clearpage\afterpage{\lhead{}\rhead{}}
}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%\setlength{\cftbeforelostitleskip}{-64.0truept}
%\setlength{\cftafterlostitleskip}{0truept}
%
%\renewcommand{\listsymbolname}{LIST OF SYMBOLS}
%\renewcommand{\cftlostitlefont}{\hfill\normalsize\rm}
%\renewcommand{\cftafterlostitle}{\hfill}
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Get the title for the LOT normal sized, centered, and at the right height.
%
\setlength{\cftbeforelottitleskip}{-64.0truept}
\setlength{\cftafterlottitleskip}{0truept}
%
\renewcommand{\listtablename}{LIST OF TABLES}
\renewcommand{\cftlottitlefont}{\hfill\normalsize\rm}
\renewcommand{\cftafterlottitle}{\hfill}
% 
% Get the title for the LOF normal sized, centered, and at the right height.
%
\setlength{\cftbeforeloftitleskip}{-64.0truept}
\setlength{\cftafterloftitleskip}{0truept}
%
\renewcommand{\listfigurename}{LIST OF FIGURES}
\renewcommand{\cftloftitlefont}{\hfill\normalsize\rm}
\renewcommand{\cftafterloftitle}{\hfill}
% 
% Get the title for the LOS normal sized, centered, and at the right height.
%
\setlength{\cftbeforelostitleskip}{-64.0truept}
\setlength{\cftafterlostitleskip}{0truept}
%
\renewcommand{\listsymbolname}{LIST OF SYMBOLS}
\renewcommand{\cftlostitlefont}{\hfill\normalsize\rm}
\renewcommand{\cftafterlostitle}{\hfill}
% 
% Here is a hack.  The report class automatically adds a bit of extra vertical
% space between table and figure entries in the LOT and LOF if they are from 
% different chapters.  I have simply commmented out the lines in the definition
% of \@chapter which do this.  As far as I can tell, the tocloft package doesn't
% have a command for this so a hack is necessary.
%
\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}%

%These two lines below are commented out.

%\addtocontents{lof}{\protect\addvspace{10\p@}}%
%\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}

%
% Change some of the rules for float placement.
%
\setcounter{topnumber}{2}          %Maximum 2 floats on top
\setcounter{bottomnumber}{1}       %Maximum 1 float on bottom
%\renewcommand{\topfraction}{0.7}    %Top float max size is 70%
%\renewcommand{\bottomfraction}{0.7} %Bottom float max size is 70%
\renewcommand{\topfraction}{0.9}    %Top float max size is 70%
\renewcommand{\bottomfraction}{0.8} %Bottom float max size is 70%
\renewcommand{\floatpagefraction}{0.7}


%
% Fix chapter and section formats
%
% Chapters names are all caps, centered under "Chapter N"
\renewcommand{\@makechapterhead}[1]{
\begin{center}
\chaptername\ \thechapter\vspace{\baselineskip}\\
\uppercase\expandafter{#1}\vspace{\baselineskip}
\end{center}
}
% Numbers chapters, sections, and subsections
\setcounter{secnumdepth}{2}
% Center section titles
\renewcommand{\section}{\@startsection{section}{1}{0 in}{1em}{1em}{\centering}}
% Center and italicize subsection titles
\renewcommand{\subsection}{\@startsection{subsection}{2}{0 in}{1em}{1em}
{\centering\slshape}}

% This is a bit of a hack.  I couldn't figure out a better way, but surely there
% is one.  What I want is for the title page of the appendix to appear with
% just one double space between the words "Appendix A" and the title.  So, here,
% I redefine the command with our \singlespace command, and then inside the 
% actual appendix, I use \doublespace.  This gets the spacing of the appendix
% title page right.

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

% I added this line.

\singlespace}

%
% Fix bibliography header.
%
\renewcommand\bibname{References}
\renewcommand\bibsection{
\begin{center}\uppercase\expandafter{\bibname}\vspace{1em}\end{center}
}

%
% Modify figure captions so that they print singlespace.
%
\renewcommand{\@makecaption}[2]{% #1 is e.g. Figure 1, #2 is captiontext
\singlespace
{\textbf{#1:} #2\par}
}

如果有人有 sharelatex 登录名,请登录并查看https://www.sharelatex.com/3268622724cjgmgfxkmtyw

答案1

页面顶部指出这是一个样式文件(以 结尾.sty),而您的错误消息表明您正尝试将其编译为 TEX 源文件(以 结尾.tex),这是不可能的。

要使用样式文件,请将其包含在您的 TEX 文件中,方法是将以下行添加到您的序言中:\usepackage{mystyle}。(假设样式文件与您的文档位于同一目录中。)

因此你的 tex 文件看起来应该是这样的:

\documentclass[12pt]{article}
\usepackage{mystylefile}
\begin{document}
Hello world!
\end{document}

相关内容