2

I am using wrapfigure to include both a table and a picture. However, because it's in wrapfigure, the table caption comes out labeled as "Figure X" rather than table x.

Is there any way I can get around this?

Thank you! Here's a snippet of my direct code!

\begin{wrapfigure}{l}{8.5cm}
\begin{tabular}{|c|c|c|c|c|}
    \hline
    Cluster  & Start & End & Muts. in Cluster & P-Value    \\ \hline
    1 & 751   & 858 & 4 & 1.35E-04 \\ 
    2 & 719   & 751 & 2 & 2.41E-03 \\ 
    3 & 790   & 858 & 2 & 2.82E-03 \\
    \hline
\end{tabular}
\caption{The three most significant clusters found in EGFR for the 2GS7 structure.}
\label{tab:EGFRClust}

\includegraphics[width = 0.5\textwidth]{EGFRDrawing.eps}
\caption{The 2GS7 structure color coded by region: 1) cluster 1 - orange, 2) cluster 2 - blue and 3) cluster 3 - yellow. The boundary $\alpha$-carbon amino acids of 719, 751, 768, 790 and 858 are shown as purple spheres.}
\label{fig:EGFR-2GS7}
\end{wrapfigure} 
2
  • use the capt-of package then \captionof{table}{The three....} will give you a table caption. – David Carlisle Apr 2 '13 at 20:32
  • Thank you, your suggestion (as well as the answer below) worked great. – user1357015 Apr 2 '13 at 21:46
3

You can use the \captionof command provided either by the capt-of or the caption packages:

\documentclass{article}
\usepackage{wrapfig}
\usepackage{capt-of}
\usepackage[demo]{graphicx}
\begin{document}

\begin{wrapfigure}{l}{8.5cm}
\begin{tabular}{|c|c|c|c|c|}
    \hline
    Cluster  & Start & End & Muts. in Cluster & P-Value    \\ \hline
    1 & 751   & 858 & 4 & 1.35E-04 \\ 
    2 & 719   & 751 & 2 & 2.41E-03 \\ 
    3 & 790   & 858 & 2 & 2.82E-03 \\
    \hline
\end{tabular}
\captionof{table}{The three most significant clusters found in EGFR for the 2GS7 structure.}
\label{tab:EGFRClust}

\includegraphics[width = 0.5\textwidth]{EGFRDrawing.eps}
\captionof{figure}{The 2GS7 structure color coded by region: 1) cluster 1 - orange, 2) cluster 2 - blue and 3) cluster 3 - yellow. The boundary $\alpha$-carbon amino acids of 719, 751, 768, 790 and 858 are shown as purple spheres.}
\label{fig:EGFR-2GS7}
\end{wrapfigure} 

\end{document}

enter image description here

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

3
  • Perfect, exactly what I needed. – user1357015 Apr 2 '13 at 21:47
  • Hmm, when I try \captionof{table}{tablecaption} in my file in a wrapfigure below a tabular, I get 'Figure 1: tablecaption' as the output. When I put it at the top, I get an error: Extra }, or forgotten \endgroup.. – equaeghe Aug 5 '13 at 19:32
  • @equaeghe Almost impossible to detect the problem without the offending code. Feel free to open a new question with this issue, and make sure to provide there a MWE allowing to reproduce the problem mentioned. – Gonzalo Medina Aug 5 '13 at 21:34

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.