8

Due to time constraints I'm considering cheating a little and importing some tables I've created in Excel into my latex document. I realise I can do this quite nicely as a 'figure' using something like the following,

\begin{figure} [t]
\centering
\includegraphics[width=\textwidth,scale=1]{abc}
\caption{Plot of Testing Time Frame vs Gross Profit/.Total Commission.}
\label{fig:abc}
\end{figure}

However, obviously this is now recognised as a figure... and appears in my list of figures rather than my list of tables.

Question, is there a way of doing this but for the PDF image imported to be recognised and labelled as a table?

7
  • 8
    \begin{table} instead of figure should do the trick.
    – guillem
    Aug 31, 2012 at 12:42
  • 7
    Just a comment: I'm a graphical editor of a journal, and I'm very angry when authors do this. At least get the correct font in your Excel. In the case of "default font" Computer Modern or Latin Modern, you can get the font files here
    – yo'
    Aug 31, 2012 at 12:44
  • Another comment: the options [width=\textwidth,scale=1] are surely fighting and one of them does not take effect.
    – yo'
    Aug 31, 2012 at 12:48
  • 6
    Maybe your better off using this tool: excel2latex. i think its also faster to use this than export images from excel and then try to import them to latex.
    – jrast
    Aug 31, 2012 at 12:51
  • 1
    Either use the booktabs package or uncheck the "Booktabs-style formatting" checkbox in the export dialog of excel2latex.
    – jrast
    Aug 31, 2012 at 13:41

2 Answers 2

22

Use table instead of figure.

enter image description here

\documentclass{article}
\usepackage{graphicx}

\begin{document}
\begin{table}[hbtp]
\centering
\includegraphics[width=0.5\linewidth]{exceltable}
\caption{This is an excel table.}
\label{tab:ExcelTable}
\end{table}
\end{document}

Note:

  • Adjust the width until it suits your preferences.
  • The table example is taken from this site.
1
  • 7
    very classy! -- an oak table, indeed... Sep 1, 2012 at 8:25
10

It's better to export the table as latex source than an image. By using the excel2latex tool, this is a very easy task.

To include the exported table you have to include the following packages to your main tex file: booktabs, multicol and multirow

\usepackage{booktabs, multicol, multirow}

If you don't want to use the booktabs package, you can uncheck the "Booktabs-style formatting" chechkbox in the export dialog. multicol and multirow are used as soon as you have merged cells in your excel sheet. If you don't see any \multicol or \multirowcommand in your exported table, you don't have to include these packages.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .