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
from array
package. Next code (taken from "The LaTeX Companion, 2ed") shows how to use it and its effects on rows height.
\begin{tabular}{|>{\large}c|>{\large\bfseries}l|>{\itshape}c|}
\hline A & B & C\\\hline 100 & 10 & 1\\\hline
\end{tabular}
\setlength\extrarowheight{4pt}
\begin{tabular}{|>{\large}c|>{\large\bfseries}l|>{\itshape}c|}
\hline A & B & C\\\hline 100 & 10 & 1\\\hline
\end{tabular}
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.
- Used
\small
to reduce font size
- Used
array
package for >{decl}
and center cell text
- Used
p{column width}
cell types
- Used
booktabs
package
The complete code is
\PassOptionsToPackage{table}{xcolor}
\documentclass[xcolor=dvipsnames]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[french]{babel}
\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}{}
%\usepackage{lastpage}
\usepackage{textcomp}
\usepackage{booktabs}
\usepackage{array}
%\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]
\centering
{\small\begin{tabular}{%
>{\centering\hspace{0pt}}p{.2\textwidth}
>{\centering\hspace{0pt}}p{.2\textwidth}
>{\centering\hspace{0pt}}p{.2\textwidth}
>{\centering\hspace{0pt}}p{.2\textwidth}}
\toprule
\textbf{Wear mechanisms} & \textbf{Applications} & \textbf{Deposited materials} & \textbf{Deposition processes}\tabularnewline
\midrule
Abrasive wear & Pump shafts & Cr-Co & HOVF, plasma, detonation\tabularnewline
\midrule
Adhesive wear & Pistons, brakes & Mo, Ni-Cr, Cu-Ni-In & Plasma, flame, HOVF\tabularnewline
\midrule
Contact wear & Aircraft leading edge & Tungsten carbide, Co & Detonation HVOF\tabularnewline
\midrule
Erosion & Power plant fan & Tungsten carbide, $\textnormal{Al}_{2}\textnormal{O}_{3}$, $\textnormal{Cr}_{2}\textnormal{O}_{3}$ & Detonation, HVOF\tabularnewline
\bottomrule
\end{tabular}}
\caption{Examples of thermal sprayed coatings against wear}
\end{figure}
\end{frame}
\begin{frame}
\begin{tabular}{|>{\large}c|>{\large\bfseries}l|>{\itshape}c|}
\hline A & B & C\\\hline 100 & 10 & 1\\\hline
\end{tabular}
\setlength\extrarowheight{4pt}
\begin{tabular}{|>{\large}c|>{\large\bfseries}l|>{\itshape}c|}
\hline A & B & C\\\hline 100 & 10 & 1\\\hline
\end{tabular}
\end{frame}
\end{document}
The final result is
The column types m
and b
are not defined in the LaTeX kernel. They are provided by package array
, which needs to be loaded:
\usepackage{array}
Also:
- The font size is much, much too small.
- Too many lines, see the documentation of package
booktabs
.
\centering
, \scriptsize
, ... are commands without arguments. A simple
space to end the command name if necessary will do, there is no need for a group ({}
).
\textquoteright
is not a apostrophe, the latter is just a simple '
.
- Tabular cells in latex form already a group, there is no need for an additional pair of braces here, e.g.
& {*} &
→ & * &
.
et al. 2014
has sentence space after the abbreviation al.
. A normal space is set, if the space factor is reset by \@
: et al.\@ 2014
.
A suggestion:
\documentclass{article}
\usepackage{array}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{ragged2e}
\usepackage{tabularx}
\newcommand*{\NarrowCell}{%
\RaggedRight
\hangafter=1
\hangindent=1em\relax
}
\begin{document}
\begin{table}
\centering
\caption{A brief review of previous studies on the GVRP}
\small % not smaller than \small
\def\x#1{\begin{tabular}[b]{@{}c@{}}#1\end{tabular}}
\begin{tabularx}{\linewidth}{>{\NarrowCell}Xcccc}
\toprule
Researchers
& \x{Customers'\\ Management\\ Features}
& \x{Stations\\ Features}
& \x{Vehicles\\ Features}
& \x{Distribution\\ Management\\ Features}
\tabularnewline
\midrule
Conrad and Figliozzi 2011~\cite{key-10}
& * & & * & \tabularnewline
\addlinespace
Erdogan and Miler-Hooks 2012 ~\cite{key-4}
& & & & \tabularnewline
\addlinespace
Omidvar and Tavakkoli-Moghadam 2012~\cite{key-11}
& * & & * & \tabularnewline
\addlinespace
Schneider et al.\@ 2014~\cite{key-12}
& * & & * & \tabularnewline
\addlinespace
Yang and Sun 2015~\cite{key-13}
& & * & * & \tabularnewline
\addlinespace
Felipe et al.\@ 2014~\cite{key-14}
& & * & * & \tabularnewline
\addlinespace
Goeke and Schneider 2015~\cite{key-15}
& * & & * & \tabularnewline
\addlinespace
This research
& & & & * \tabularnewline
\bottomrule
\end{tabularx}
\end{table}
\end{document}
Best Answer
You should remove the '\textwidth' from your code.