I'm preparing a presentation using the beamer
class, and I need to put a tabular environment inside it and I always get the errors
Undefined control sequence
\end{frame}
and
Missing number, treated as zero
\end{frame}
The document is not compiling.
I'm kinda new to LaTeX and I keep all my packages from document to document, I forgot what are some for.
Do you have an idea what is happening?
\PassOptionsToPackage{table}{xcolor}
\documentclass[xcolor=dvipsnames]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage[french]{babel}
\usepackage{xlop} %opérations de beau gosse
\hypersetup{pdfpagemode=FullScreen} %probablement fullscreen at launch
\graphicspath{{images/}}
\usepackage{graphicx}
\usetheme{Berkeley}
\definecolor{color1}{RGB}{0,165,50} %creer une couleur
\setbeamercolor{normal text}{bg=white,fg=black}
\usecolortheme[named=color1]{structure} %utiliser une couleur
\setbeamertemplate{navigation symbols}{}
\theoremstyle{definition} %pour des boites a théorèmes
\newtheorem*{dfn}{Définition}
\usepackage{multicol}
\usepackage{setspace}
\usepackage{hyperref}
\usepackage{lastpage}
\usepackage{textcomp}
\usepackage{rotating}
%\usepackage{colortbl}
\usepackage[table]{xcolor}
\addtobeamertemplate{footline}{\hfill\insertframenumber/\inserttotalframenumber\hspace{0.1cm}\null\vspace{0.05cm}} %numéro des diapos
\usepackage{setspace}
\begin{document}
\begin{frame}
\begin{figure}[H]
\doublespacing
\begin{center}
\begin{tabular}{cccc}
\hline
\textbf{Wear mechanisms} & \textbf{Applications} & \textbf{Deposited materials} & \textbf{Deposition processes}\\
\hline
Abrasive wear & Pump shafts & Cr-Co & HOVF, plasma, detonation\\
\hline
Adhesive wear & Pistons, brakes & Mo, Ni-Cr, Cu-Ni-In & Plasma, flame, HOVF\\
\hline
Contact wear & Aircraft leading edge & Tungsten carbide, Co & Detonation HVOF\\
\hline
Erosion & Power plant fan & Tungsten carbide, $\textnormal{Al}_{2}\textnormal{O}_{3}$, $\textnormal{Cr}_{2}\textnormal{O}_{3}$ & Detonation, HVOF\\
\hline
\end{tabular}
\caption{Examples of thermal sprayed coatings against wear}
\end{center}
\end{figure}
\end{frame}
\end{document}
Best Answer
As I told you, the problem with your code was command
\doublespacing
. Commenting it out, your code will compile without problems. You wanted it to "wider" table spacing. If this means a larger distance between tabular text and separation lines you have several alternatives. One of them consists in fixing\extrarowheight
fromarray
package. Next code (taken from "The LaTeX Companion, 2ed") shows how to use it and its effects on rows height.In any case I prefer to use
booktabs
package and its\top-\mid-\bottomrule
commands. I think results are good enough without any other adjustments.Next code shows an example typesetting your table inside a
beamer
frame. I've made some adjustments to fit all table in one frame.\small
to reduce font sizearray
package for>{decl}
and center cell textp{column width}
cell typesbooktabs
packageThe complete code is
The final result is