表格内的标题不起作用

表格内的标题不起作用

我正在用研究所提供的自定义样式撰写论文。我一直没遇到任何问题,直到最近captions 内部table停止工作。

更奇怪的是,我的论文最新版本停止工作了,为了解决问题,我将 tex 文件的内容复制并粘贴到旧版本论文的文件中,当天它工作正常。但第二天,我又遇到了同样的错误。

    ! Undefined control sequence.
\caption@original@fnum ->\@tablelabel
\space \thetable
l.49 ...xample : Values of the objective function}
\label{tab:ex1_polyak}
The control sequence at the end of the top line
of your error message was never \def'ed.

这是我的最小工作示例。你可以看到没有问题,figure但在table环境中caption却不起作用。

\documentclass[12pt,oneandhalf]{metu_iam} 

\usepackage{amsmath,amsthm,amssymb}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{float}
\usepackage{mathtools}



\begin{document}



\begin{figure}[htp]
    \centering
    \makebox[\textwidth][c]{\includegraphics[width=1.15\textwidth]{figures/somefile.eps}}
    \caption{Example : Convergence results}
    \label{fig:Ex1_uerror}
\end{figure}

\begin{table}[H]
    \caption{Example : Values of the objective function} \label{tab:ex1_polyak}
    \centering
\small{
    \begin{tabular}{c|cccc|cccc}
        & \multicolumn{4}{c}{$\gamma=0$} & \multicolumn{4}{c}{$\gamma=1$}  \\
        \hspace{-2em}   $\beta_P$                                                           & 0.2     & 0.4     & 0.6     & 0.8     & 0.2     & 0.4     & 0.6     & 0.8  \\ \hline
        \multicolumn{1}{l|}{$\widehat{\mathcal{J}}^h_P$}                       & 3.15e-5 & 2.75e-5 & 2.41e-5 & 1.59e-5 & 2.28e-5 & 2.46e-5 & 2.73e-5 & 3.36e-5   \\
        \multicolumn{1}{l|}{$\frac{|\mathcal{J}^* - \widehat{\mathcal{J}}^h_P|}{\mathcal{J}^*}$} & 3.56e-1 & 1.84e-1 & 3.88e-2 & 3.16e-1 & 5.08e-1 & 4.70e-1 & 4.13e-1 & 2.77e-1
    \end{tabular}
}
\end{table}


\end{document}

这是metu_iam.cls文件。我已尽力将其缩短。

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{metu_iam}[2003/06/20 METU Thesis Class]
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
% Use Times New Roman
\RequirePackage{times}

%default options

%spacing - default double
\newif\ifd@uble \d@ublefalse
\newif\ifs@ngle \s@ngletrue

%page numbering - default 
\newif\ifpn@top \pn@topfalse
\newif\ifpn@topr \pn@toprtrue

%chapter numbering (roman/arabic)
\newif\if@rmnchp \@rmnchptrue

%table stuff
\newif\ifmy@t@ble \my@t@blefalse
\newif\ifmy@figur@ \my@figur@false
\newif\ifmy@t@ble \my@t@blefalse

%font size
\newif\if@tenpt \@tenptfalse
\newif\if@elevenpt \@elevenpttrue
\newif\if@twelvept \@twelveptfalse

% seems we need it.
\newif\if@twoside \@twosidetrue 
\@mparswitchtrue \def\ds@draft{\overfullrule 5pt}

\newif\ift@rkish \t@rkishfalse

%Font Options
\DeclareOption{10pt}{\@tenpttrue \@elevenptfalse \@twelveptfalse}
\DeclareOption{11pt}{\@tenptfalse \@elevenpttrue \@twelveptfalse}
\DeclareOption{12pt}{\@tenptfalse \@elevenptfalse \@twelvepttrue}


%Spacing
\DeclareOption{double}{\d@ubletrue \s@nglefalse}
\DeclareOption{oneandhalf}{\d@ublefalse \s@nglefalse}
\DeclareOption{single}{\d@ublefalse \s@ngletrue}





%Unspecified input handler
\DeclareOption*{Invalid Option \CurrentOption }

\ProcessOptions\relax
%\LoadClass{book}




%input the appropriate .def file
\if@tenpt \input{metu10.def} \fi
\if@elevenpt \input{metu11.def} \fi
\if@twelvept \input{metu12.def} \fi



\newcommand{\singlespacing}{\renewcommand{\baselinestretch}{1}%
\let\@tmpcurrentsize=\currentsize \footnotesize \@tmpcurrentsize}
\newcommand{\doublespacing}{\renewcommand{\baselinestretch}{2}
\let\@tmpcurrentsize=\currentsize \footnotesize \@tmpcurrentsize}
\newcommand{\oneandhalfspacing}{\renewcommand{\baselinestretch}{1.15}
\let\@tmpcurrentsize=\currentsize \footnotesize \@tmpcurrentsize}
\def\@prelimsize{\@setsize\@prelimsize{14pt}\xiipt\@xiipt
\let\currentsize=\@prelimsize}




\newcounter {part}
\newcounter {chapter}
\newcounter {section}[chapter]
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
\newcounter {subparagraph}[paragraph]



\newcounter{figure}[chapter]
\def\thefigure{\thechapter.\@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{Figure \thefigure}
\def\figure{\oneandhalfspacing \my@figur@true \@float{figure}}
\let\endfigure\end@float
\@namedef{figure*}{\@float{figure}}
\@namedef{endfigure*}{\end@float}

\newcounter{table}[chapter]
\def\thetable{\thechapter.\@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{\@tablelabel\space\thetable}
\def\table{\oneandhalfspacing \my@t@bletrue \@float{table}}
\let\endtable\end@float
\@namedef{table*}{\@float{table}}
\@namedef{endtable*}{\end@float}




\mark{{}{}}



\@addtoreset{equation}{chapter}
\def\theequation{\thechapter.\arabic{equation}}

\ifpn@top \pagestyle{headings} \else \pagestyle{plain} \fi
\pagenumbering{arabic} \onecolumn

\textheight=23.5cm

\uccode`@=`I \lccode`@="10

\let\@enddoc=\enddocument
\def\enddocument{\label{`@lastpage'}\@enddoc }

如果需要,我也可以提供metu12.def文件。如果您能诊断出错误,我将不胜感激。非常感谢。

相关内容