[Tex/LaTex] How to use full width table in LaTeX

tablestwo-column

i am trying to use full width table in LaTeX.

my latex code looks like this:

 \documentclass[12pt,journal,compsoc]{IEEEtran}
%\usepackage{ifpdf}
\usepackage{cite}
\ifCLASSINFOpdf
  \usepackage[pdftex]{graphicx}
  % \graphicspath{{../pdf/}{../jpeg/}}
  % \DeclareGraphicsExtensions{.pdf,.jpeg,.png}
\else
  \usepackage[dvips]{graphicx}
  % \graphicspath{{../eps/}}
  % \DeclareGraphicsExtensions{.eps}
\fi
%\usepackage[cmex10]{amsmath}
%\usepackage{algorithmic}
\usepackage{amsfonts}
%\usepackage{subfig}
\usepackage{amsmath}

\usepackage{caption}
\usepackage{subcaption}
\usepackage{multirow}
 \usepackage[table,xcdraw]{xcolor}
% \usepackage{graphicx}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{listings}
%\ifCLASSOPTIONcompsoc
%  \usepackage{subfig}
%\else
%  \usepackage{subfig}
%\fi
%\usepackage{fixltx2e}
%\usepackage{stfloats}
% \usepackage{dblfloatfix}
%\ifCLASSOPTIONcaptionsoff
%  \usepackage[nomarkers]{endfloat}
% \let\MYoriglatexcaption\caption
% \renewcommand{\caption}[2][\relax]{\MYoriglatexcaption[#2]{#2}}
%\fi
\usepackage[hyphens]{url}



\begin{document}
\title{network design}
\author{Loren dorem}
\markboth{nreis, May~2016}%
{Shell \MakeLowercase{\textit{et al.}}: Bare Demo of IEEEtran.cls for Computer Society Journals}
\date{\normalsize\today}

\begin{center}

\begin{tabular}{ |p{3cm}|p{3cm}|p{3cm}|p{3cm}|p{3cm}| }
 \hline
 \multicolumn{5}{|c|}{F1-accuracy} \\
 \hline
 \textbf{Methods}& \textbf{first dataset} &\textbf{second dataset} &\textbf{third dataset} & \textbf{forth dataset}\\
 \hline
 first   & 0.878    &0.648&   0.858 & 0.486\\
 second   & 0.879  & 0.654   &0.857 & 0.480\\
third & 0.863&  0.664 & 0.855 & - \\
forth & 0.855    &0.664 & 0.856&  -\\
fifth &0.858   & 0.691  & 0.868&0.528\\
\hline
 \textbf{sixth}& \textbf{0.899} &\textbf{0.686} &\textbf{0.873} & \textbf{0.565}\\
  \hline
\end{tabular}
\end{center}

\begin{figure}[!h]
 \begin{center}
 \includegraphics[width=1.0\linewidth]{final.png}
 \caption{F1-accuracy of reuters and slashdot dataset}
 \label{fig:FeatLearn}
 \end{center}
 \end{figure}

 \begin{figure}[!h]
 \begin{center}
 \includegraphics[width=0.95\linewidth]{final_rc3.png}
 \caption{F1-accuracy of rcv1 and aapd dataset}
 \label{fig:FeatLearn}
 \end{center}
 \end{figure}

For POS data set, we achieved state of the art tagging accuracy with or without the use of extra data
resource. POS data set has been extensively tested
and the past improvement can be realized in Table
4. Our test accuracy is 97.55 which is significantly better than others in the confidence level of
95. In addition, our BI-LSTM-CRF model already reaches a good accuracy without the use of
the Senna embedding

All chunking systems performance is shown in
table 5. Kudo et al. won the CoNLL 2000 challenge with a F1 score of 93.48 Their approach
was a SVM based classifier. They later improved
the results up to 93.91. Recent work include the
CRF based models (Sha and Pereira, 2003; Mcdonald et al., 2005; Sun et al., 2008). More recent is (Shen and Sarkar, 2005) which obtained
95.23 accuracy with a voting classifier scheme,
where each classifier is trained on different tag
representations (IOB, IOE, etc.). Our model outperforms all reported systems except (Shen and
Sarkar, 2005).
The performance of all systems for NER is
shown in table 6. (Florian et al., 2003) presented the best system at the NER CoNLL 2003
challenge, with 88.76 F1 score. They used a
combination of various machine-learning classifiers. The second best performer of CoNLL 2003
(Chieu., 2003) was 88.31 F1, also with the help
of an external gazetteer. Later, (Ando and Zhang.,
2005) reached 89.31 F1 with a semi-supervised
approach. The best F1 score of 90.90 was reported in (Passos et al., 2014) which employed a

\end{document}

But when i am adding two images, images are overlapping the table like this:

enter image description here

How to fix that?

Thank you !

Best Answer

In your code are several issues, for example

  1. You can simply use \usepackage graphicx instead yours

    \ifCLASSINFOpdf
      \usepackage[pdftex]{graphicx}
      % \graphicspath{{../pdf/}{../jpeg/}}
      % \DeclareGraphicsExtensions{.pdf,.jpeg,.png}
    \else
      \usepackage[dvips]{graphicx}
      % \graphicspath{{../eps/}}
      % \DeclareGraphicsExtensions{.eps}
    \fi
    

    because that package is able to evaluate the needed driver pdftex or dvips by its own.

  2. You used a lot of packages not needed for the issue here. I deleted them in the following mwe.

  3. In an two column layout you have to use environment table* to get an table spanning both columns. See the following mwe.

  4. Use inside figure command \centering instead environment center (less white space around the figure).

  5. Do not write "table 6" in your text, use command \ref instead like table~\ref{tab:methods}. See that I added an caption to your table with an following label I used here.

  6. Use \cite{} etc. to add your cited bib entries into your text, do not write them manually, that will only produce errors in the text ...

The corrected MWE

\documentclass[12pt,journal,compsoc]{IEEEtran}

\usepackage{caption}
\usepackage{subcaption}
\usepackage{multirow}
\usepackage[table,xcdraw]{xcolor}
\usepackage{graphicx} % <===============================================
\usepackage{booktabs}


\begin{document}

\title{network design}
\author{Loren dorem}
\markboth{nreis, May~2016}%
{Shell \MakeLowercase{\textit{et al.}}: Bare Demo of IEEEtran.cls for Computer Society Journals}
\date{\normalsize\today}

\maketitle % <==========================================================
\begin{table*} % <======================================================
  \caption{table caption}\label{tab:methods} % <========================
\begin{tabular}{ |p{3cm}|p{3cm}|p{3cm}|p{3cm}|p{3cm}| }
 \hline
 \multicolumn{5}{|c|}{F1-accuracy} \\
 \hline
 \textbf{Methods}& \textbf{first dataset} &\textbf{second dataset} &\textbf{third dataset} & \textbf{forth dataset}\\
 \hline
 first   & 0.878    &0.648&   0.858 & 0.486\\
 second   & 0.879  & 0.654   &0.857 & 0.480\\
third & 0.863&  0.664 & 0.855 & - \\
forth & 0.855    &0.664 & 0.856&  -\\
fifth &0.858   & 0.691  & 0.868&0.528\\
\hline
 \textbf{sixth}& \textbf{0.899} &\textbf{0.686} &\textbf{0.873} & \textbf{0.565}\\
  \hline
\end{tabular}
\end{table*}

\begin{figure}[!h]
  \centering % <========================================================
  \includegraphics[width=1.0\linewidth]{example-image-a} % final.png
  \caption{F1-accuracy of reuters and slashdot dataset}
  \label{fig:FeatLearn}
\end{figure}

\begin{figure}[!h]
  \centering % <========================================================
  \includegraphics[width=0.95\linewidth]{example-image-a} % final_rc3.png
  \caption{F1-accuracy of rcv1 and aapd dataset}
  \label{fig:FeatLearn}
\end{figure}

For POS data set, we achieved state of the art tagging accuracy with or without the use of extra data
resource. POS data set has been extensively tested
and the past improvement can be realized in Table
4. Our test accuracy is 97.55 which is significantly better than others in the confidence level of
95. In addition, our BI-LSTM-CRF model already reaches a good accuracy without the use of
the Senna embedding

All chunking systems performance is shown in
table 5. Kudo et al. won the CoNLL 2000 challenge with a F1 score of 93.48 Their approach
was a SVM based classifier. They later improved
the results up to 93.91. Recent work include the
CRF based models (Sha and Pereira, 2003; Mcdonald et al., 2005; Sun et al., 2008). More recent is (Shen and Sarkar, 2005) which obtained
95.23 accuracy with a voting classifier scheme,
where each classifier is trained on different tag
representations (IOB, IOE, etc.). Our model outperforms all reported systems except (Shen and
Sarkar, 2005).
The performance of all systems for NER is
shown in table~\ref{tab:methods}. (Florian et al., 2003) presented the best system at the NER CoNLL 2003
challenge, with 88.76 F1 score. They used a
combination of various machine-learning classifiers. The second best performer of CoNLL 2003
(Chieu., 2003) was 88.31 F1, also with the help
of an external gazetteer. Later, (Ando and Zhang.,
2005) reached 89.31 F1 with a semi-supervised
approach. The best F1 score of 90.90 was reported in (Passos et al., 2014) which employed a

\end{document}

and its result:

resulting pdf

Please see that the table has moved to page two, because then it is easy to start a one column part! That is the ususal behaviour of that template. If you do not want that you need to make your table shorter, for example by splitting the header into two lines to fit into one column ...

Related Question