1

I face a question: I modify my table with the template as follow,then it shows that

! Missing number, treated as zero [

The following is my partial code:

\documentclass[compress,mathserif,CJK]{beamer}
\usetheme{Darmstadt}
\usefonttheme[onlylarge]{structurebold}
\setbeamerfont*{frametitle}{size=\normalsize,series=\bfseries}
\setbeamertemplate{navigation symbols}{}
\usepackage{tabular}
\usepackage{longtable}
\usepackage{multirow}
\renewcommand{\tablename}{表}    
\usepackage[english]{babel}
\usepackage{CJK}
\newcommand{\Ref}[1]{\mbox{(\ref{#1})}}
\begin{document}

\begin{CJK*}{GBK}{kai}
\newgeometry{textwidth=135mm,textheight=195mm}

\newcommand{\D}{\displaystyle}
\newcommand{\DF}[2]{\dfrac{\D#1}{\D#2}}
\newcommand{\mc}[1]{\multicolumn{1}{>{\columncolor[gray]{0.7}}c}{#1}}
\newcommand{\ml}[1]{\multicolumn{1}{>{\columncolor[gray]{0.7}}c}{#1}}
\makeatletter
\newcommand{\rmnum}[1]{\romannumeral #1}
\newcommand{\Rmnum}[1]{\expandafter\@slowromancap\romannumeral #1@}
\makeatother

\newcolumntype{R}{>{$}r<{$}}
\newcolumntype{V}[1]{>{[\;}*{#1}{R@{\;\;}}R<{\;]}}
\makeatletter\def\@captype{table}\makeatother
\begin{frame}
\begin{spacing}{0.5}\scalebox[0.7]
{\centering
\footnotesize
\begin{longtable}{|c|c|cc|}
\caption{人造数据集上各方法比较}\label{tab1}
\\ \hline
{(m,n)} & p & met\\
\hline
\multirow{19}{*}{(300,400)}
 & 2\% & \begin{tabular}{c}
  rK \\ ST \\ Lm \\ AIe \\ ll\\ mml\\
   \end{tabular}
& \begin{tabular}{c}
    0.0131\\0.0273\\0.0337\\0.0265\\0.0100\\ \bf{0.0102}\\
   \end{tabular}
\\ \hline
\end{longtable}}
\end{spacing}
\end{frame}

\end{CJK*}
\end{document}
  • 2
    It's better to edit a question instead of reposting. On the other hand, your new question is completely unrelated to your previous question. It would have been better to leave the previous one alone. And both should be much shorter so that we can all focus on what is causing the problem. (if nothing else, start commenting out lines of code to see if that makes the problem go away.) – Teepeemm Jul 9 at 4:02
0

You loaded a package tabular, which, to my knowledge, does not exists. I changed that to tabularx. Also, I loaded the package caption, which is in use, but not loaded.

Thereafter, I commented out line 16:

\newgeometry{textwidth=135mm,textheight=195mm}

which gave a weird text block, and line 3 and 48:

%\begin{spacing}{0.5}\scalebox[0.7]
...
%\end{spacing}

because the environment spacing was an undefined command.

Then your code compiled with the following result:

enter image description here

Complete code:

\documentclass[compress,mathserif,CJK]{beamer}
\usetheme{Darmstadt}
\usefonttheme[onlylarge]{structurebold}
\setbeamerfont*{frametitle}{size=\normalsize,series=\bfseries}
\setbeamertemplate{navigation symbols}{}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{multirow}
\renewcommand{\tablename}{表}    
\usepackage[english]{babel}
\usepackage{CJK, caption}
\newcommand{\Ref}[1]{\mbox{(\ref{#1})}}
\begin{document}

\begin{CJK*}{GBK}{kai}
%\newgeometry{textwidth=135mm,textheight=195mm}

\newcommand{\D}{\displaystyle}
\newcommand{\DF}[2]{\dfrac{\D#1}{\D#2}}
\newcommand{\mc}[1]{\multicolumn{1}{>{\columncolor[gray]{0.7}}c}{#1}}
\newcommand{\ml}[1]{\multicolumn{1}{>{\columncolor[gray]{0.7}}c}{#1}}
\makeatletter
\newcommand{\rmnum}[1]{\romannumeral #1}
\newcommand{\Rmnum}[1]{\expandafter\@slowromancap\romannumeral #1@}
\makeatother

\newcolumntype{R}{>{$}r<{$}}
\newcolumntype{V}[1]{>{[\;}*{#1}{R@{\;\;}}R<{\;]}}
\makeatletter\def\@captype{table}\makeatother
\begin{frame}
%\begin{spacing}{0.5}\scalebox[0.7]
{\centering
\footnotesize
\begin{longtable}{|c|c|cc|}
\caption{人造数据集上各方法比较}\label{tab1}
\\ \hline
{(m,n)} & p & met\\
\hline
\multirow{19}{*}{(300,400)}
 & 2\% & \begin{tabular}{c}
  rK \\ ST \\ Lm \\ AIe \\ ll\\ mml\\
   \end{tabular}
& \begin{tabular}{c}
    0.0131\\0.0273\\0.0337\\0.0265\\0.0100\\ \bf{0.0102}\\
   \end{tabular}
\\ \hline
\end{longtable}}
%\end{spacing}
\end{frame}

\end{CJK*}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.