# How can I use the full page width (\textwidth) while importing a table with \includegraphics?

I'm in a 2-column environment. I need to use the entire pagewidth (\textwidth) while importing a table with \includegraphics.

\begin{table}
\centering
\includegraphics[width=\textwidth]{./myfile.pdf}
\caption{Beautiful stuff here}
\label{tab:myfile}
\end{table}


(I have tried tabular* without success.)

-
Perhaps you meant textwidth instead of pagewidth? – Gonzalo Medina Aug 27 '12 at 1:56
Not sure. Want it to use the whole page (less the margins). – Jodi Schneider Aug 27 '12 at 1:59
Interestingly, pagewidth seems to break while textwidth doesn't, with table*. Hmm... – Jodi Schneider Aug 27 '12 at 2:02
Then yes, it's textwidth (the width of the area reserved for text). Are you using the multicol package as one of the tags suggests? – Gonzalo Medina Aug 27 '12 at 2:02
There's no \pagewidth dimension; there is \paperwidth (the total width of the physical page), but according to a previous comment you need is \textwidth. – Gonzalo Medina Aug 27 '12 at 2:26
show 1 more comment

The multicols environment doesn't completely support floats; you can

1. Use the starred version of floats (table* or figure*) but the float will appear on the top of the next page:

\documentclass{article}
\usepackage{multicol}
\usepackage[demo]{graphicx}
\usepackage{lipsum}

\begin{document}

\begin{multicols}{2}
\lipsum[4]
\begin{table*}
\centering
\setlength\fboxsep{0pt}
\includegraphics[width=\textwidth]{./myfile.pdf}
\caption{Beautiful stuff here}
\label{tab:myfile}
\end{table*}
\lipsum[4]
\end{multicols}

\end{document}

2. End the multicols, typeset the table inside, for example, a minipage or a center environment (\captionof from the capt-of or caption packages can be used to provide a caption) and then start another multicols:

\documentclass{article}
\usepackage{multicol}
\usepackage{caption}
\usepackage[demo]{graphicx}
\usepackage{lipsum}

\begin{document}

\begin{multicols}{2}
\lipsum[4]
\end{multicols}
\begin{center}
\setlength\fboxsep{0pt}
\includegraphics[width=\textwidth]{./myfile.pdf}
\captionof{table}{Beautiful stuff here}
\label{tab:myfile}
\end{center}
\begin{multicols}{2}
\lipsum[4]
\end{multicols}

\end{document}


### Remark:

The demo option for graphicx simply replaces actual figures with black rectangles; do not use that option in your actual document.

-

I thought I'd tried this already -- but table* seems to be doing what I want:

\begin{table*}
\centering
\includegraphics[width=\textwidth]{./myfile.pdf}
\caption{Beautiful stuff here}
\label{tab:myfile}
\end{table*}


Other approaches?

-
I've updated my answer with the only two (as far as I know) options available when using multicols. – Gonzalo Medina Aug 27 '12 at 2:56
Why are you setting \fboxsep to zero? This parameter has no role whatsoever in what you're doing. – egreg Aug 27 '12 at 9:26
No idea. Thanks for the feedback! :) – Jodi Schneider Aug 28 '12 at 14:24