因此,我正在使用机构提供的 LaTeX 模板(无支持)撰写论文,但在尝试编译文档时,我总是收到错误。这个错误并不严重,文档编译得很好,看起来也正确,但我想了解导致错误的原因以及我将来如何修复它。
文档使用了自定义的类文件,我尽可能的将其浓缩为最小的成功可编译示例:
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{title_abstract}
\DeclareOption{singlespace}{
\renewcommand{\textspace}{\relax}
}
\ProcessOptions
\LoadClass[12pt]{report}[1994/06/01]
\def\versiontag{}
\def\ds@draft{
\overfullrule 5pt
\def\versiontag{{\normalsize\rm - DRAFT \number\month/\number\day{} -}}
}
\setlength\lineskip{1\p@}
\setlength\normallineskip{1\p@}
\renewcommand{\baselinestretch}{1}
\renewenvironment{titlepage}
{\newpage\thispagestyle{empty}
\setcounter{page}{\z@}}
{\newpage}
\newenvironment{abstractpage}
{\newpage}
{\newpage}
\newcommand{\department}[1]{\gdef\@department{#1}}
\newcommand{\advisor}[1]{\gdef\@advisor{#1}}
\department{??DEPARTMENT??}
\advisor{??ADVISOR??}
\date{\number\year}
\newcommand{\@member}[1]{\begin{center}
\raisebox{-8pt}[0pt][17pt]{\rule{2.8in}{.5pt}}\par
\raisebox{pt}[3pt][0pt]{#1}\par\end{center}
}
\newcounter{@members} \newcommand{\@membera}{\@member{\@advisor, Supervisor}}
\setcounter{@members}{1}
\newcounter{@minmembers}
\newcommand{\member}[1]{
\addtocounter{@members}{1}
\ifcase\value{@members}
\typeout{Thesis format internal error. Too few committee members.} \or
\typeout{Thesis format internal error. Advisor left off committee.} \or
\newcommand{\@memberb}{\@member{#1}} \or
\newcommand{\@memberc}{\@member{#1}} \or
\newcommand{\@memberd}{\@member{#1}} \or
\newcommand{\@membere}{\@member{#1}} \or
\newcommand{\@memberf}{\@member{#1}} \or
\newcommand{\@memberg}{\@member{#1}} \or
\newcommand{\@memberh}{\@member{#1}}
\else
\typeout{Error using thesis format. Too many committee members.}
\fi
}
\newcounter{@membersprinted}
\def\maketitle{
\begin{titlepage}
\let\footnotesize\small % Local definitions to make \thanks produce
\let\footnoterule\relax % \normalsize footnotes with no separating rule.
\setcounter{page}{0}
\null
\parskip=0pt
\begin{center}
\vglue -.25in % this makes top margin 2in
{\Large \scshape\expandafter{\@title} \par}
\vglue 2ex
{\normalsize by \par}
{\large\@author\par\par}
\vglue 3ex
{\normalsize Department of \@department\par}
{\normalsize University\par}
\end{center}
\vglue 3ex plus 1fill
\setcounter{@minmembers}{5}
\begin{center}
\parbox{2.8in}{
Date:\hfill\rule[-.4ex]{2.35in}{.5pt}\par
\vspace*{0.01in}
Approved:
\vspace*{0.2in}
{ \centering\normalsize
\setcounter{@membersprinted}{0}
\loop
\ifnum \value{@membersprinted} < \value{@members}
\addtocounter{@membersprinted}{1}
\ifcase\value{@membersprinted}
\typeout{Thesis style--internal error printing members.} \or
\@membera \or
\vspace*{0.2in}
\@memberb \or
\vspace*{0.2in}
\@memberc \or
\vspace*{0.2in}
\@memberd \or
\vspace*{0.2in}
\@membere \or
\vspace*{0.2in}
\@memberf \or
\vspace*{0.2in}
\@memberg \or
\vspace*{0.2in}
\@memberh
\vspace*{0.2in} \else \typeout{Thesis style--internal error printing members.}
\fi
\repeat
\loop
\ifnum \value{@membersprinted} < \value{@minmembers}
\addtocounter{@membersprinted}{1}
\@member{}
\repeat
}
}\hfill
\end{center}
\vglue 3ex plus 1fill
\begin{center}
{\normalsize
Dissertation submitted in partial fulfillment of the \par
requirements for the degree of Doctor of Philosophy \par
in the Department of \@department \par
in the Graduate School of \par
University \par
\vglue 0.75em
\@date \par
}
\end{center}
\par\vglue 1ex\@thanks\null
\end{titlepage}
\setcounter{footnote}{0}
\let\thanks\relax
\let\maketitle\relax
}
然后我使用以下文件生成文档本身:
\documentclass[PhD]{title_abstract}
\usepackage{parskip}
\author{Me}
\advisor{John Smith}
\member{John Doe}
\member{Jane Doe}
\member{John Roe}
\member{Jane Roe}
\department{Departments}
\title{A Really Great Title}
\begin{document}
\maketitle{}
\end{document}
作为回报,我得到了错误:
l.18 \maketitle
{}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Missing number, treated as zero.
<to be read again>
p
每次编译时都会产生 5 次相同的错误。我无法辨别所需的数字在哪里以及为什么 0 是合适的数字。如果有人对此有更深的了解,可以告诉我如何修复此问题,我将不胜感激。我在排版摘要页面时遇到了完全相同的错误(未提供代码),但我想错误来源是并行的,修复一个错误将使我能够修复另一个错误。提前谢谢大家。
答案1
你有
\raisebox{pt}
因此 tex 看p
不到长度,因此
! Missing number, treated as zero.
<to be read again>
p
应该是
\raisebox{1pt}
或任意长度