0

I have a latex document with two columns and I want to insert a table and in another place an image over two columns (all columns). I have gone through all the Google results and just can't get it to work. Displaying the environment (images or table) in two columns works, but even with the position h! the images are always in the wrong places and break the reading flow.

In the following example I would like to have an image (PDF) and table (only table shown here) displayed over two lines. The table should be placed directly under "Table right below HERE,":

\RequirePackage[l2tabu, orthodox]{nag}
\documentclass[utf8,biblatex, twocolumn, 11pt]{article}
\usepackage[a4paper,bindingoffset=0.2in,left=0.7in,right=0.7in,top=0.8in,bottom=0.7in,footskip=.25in]{geometry}
\usepackage{color}
\usepackage{afterpage,lipsum,capt-of,graphicx}% http://ctan.org/pkg/{afterpage,lipsum,capt-of,graphicx}
\usepackage[table,xcdraw]{xcolor}

\begin{document}
    \lipsum[3-8]
    Table right below HERE, Table right below HERE, Table right below HERE, Table right below HERE, Table right below \colorbox{yellow}{HERE}:
    \begin{table*}[h!]
        \centering
        \resizebox{\textwidth}{!}{%
        \begin{tabular}{llll}
                                       & \begin{tabular}[c]{@{}l@{}}GloVe\\      Accuracy {[}\%{]}\end{tabular} & \begin{tabular}[c]{@{}l@{}}W2V\\      Accuracy {[}\%{]}\end{tabular} & \begin{tabular}[c]{@{}l@{}}Delta\\      Accuracy {[}\%{]}\end{tabular} \\
        BiLSTM                         & 81                                                                     & 1                                                                    & 80                                                                     \\
        LSTM                           & 80                                                                     & 69                                                                   & 11                                                                     \\
        GRU                            & 80                                                                     & 69                                                                   & 11                                                                     \\
        BiLSTM\_DENSE                  & 80                                                                     & 1                                                                    & 79                                                                     \\
        CNN\_POOLING\_GRU\_DENSE       & 79                                                                     & 69                                                                   & 9                                                                      \\
        CNN\_POOLING\_LSTM\_DENSE      & 69                                                                     & 1                                                                    & 68                                                                     \\
        CNN\_POOLING\_BiLSTM           & 1                                                                      & 69                                                                   & -68                                                                    \\
        BiLSTM\_DENSE                  & 1                                                                      & 69                                                                   & -68                                                                    \\
        CNN\_POOLING\_BiLSTM\_DENSE    & 1                                                                      & 69                                                                   & -68                                                                    \\
        CNN\_POOLING\_GRU\_LSTM\_DENSE & 1                                                                      & 69                                                                   & -68                                                                   
        \end{tabular}%
        }
        \end{table*}

        \colorbox{yellow}{Table Above} this Text, Table Above this Text, Table Above this Text,
        \lipsum[1-3]
\end{document}

If the table was between "Table right below HERE," and "Table Above this Text," the table would be perfectly positioned, if that doesn't work, it would be cool if the table was at least below the "Table right below HERE," text.

Does anyone know how I could achieve this? I have already gone through all the posts here.

  1. Table should be here
  2. Table is on the next Page enter image description here

Ty in advanced

4
  • 2
    table* doesn't have an h option so you are preventing the table being placed at top of page t or on float page p so it is not allowed anywhere and presumably drifts to the end of the document where it is flushed out as error recovery. Dec 29, 2020 at 17:04
  • your image seems to indicate you want a single column table not one that spans both columns so use table not table* Dec 29, 2020 at 17:05
  • @DavidCarlisle i want the table to spawn across the full width (2 columns) Dec 29, 2020 at 17:09
  • a spanning table can not appear where your arrows indicate, it has to be at the top of the page. Dec 29, 2020 at 17:15

1 Answer 1

1

Single column floats need table not table* (Your image showing the desired position indicates a single column)

enter image description here

\documentclass[utf8,biblatex, twocolumn, 11pt]{article}
\usepackage[a4paper,bindingoffset=0.2in,left=0.7in,right=0.7in,top=0.8in,bottom=0.7in,footskip=.25in]{geometry}
\usepackage{color,array}
\usepackage{afterpage,lipsum,capt-of,graphicx}% http://ctan.org/pkg/{afterpage,lipsum,capt-of,graphicx}
\usepackage[table,xcdraw]{xcolor}

\begin{document}
    \lipsum[3-8]
    Table right below HERE, Table right below HERE, Table right below HERE, Table right below HERE, Table right below \colorbox{yellow}{HERE}:
    \begin{table}[htp]
        \centering
\small
\setlength\tabcolsep{1pt}
  % dont' scale tables!!!!!!      \resizebox{\textwidth}{!}{%
        \begin{tabular}{@{}>{\footnotesize}llll@{}}
& \multicolumn{3}{c}{Accuracy [\%]}\\
                                       & GloVe& W2V& Delta\\
        BiLSTM                         & 81                                                                     & 1                                                                    & 80                                                                     \\
        LSTM                           & 80                                                                     & 69                                                                   & 11                                                                     \\
        GRU                            & 80                                                                     & 69                                                                   & 11                                                                     \\
        BiLSTM\_DENSE                  & 80                                                                     & 1                                                                    & 79                                                                     \\
        CNN\_POOLING\_GRU\_DENSE       & 79                                                                     & 69                                                                   & 9                                                                      \\
        CNN\_POOLING\_LSTM\_DENSE      & 69                                                                     & 1                                                                    & 68                                                                     \\
        CNN\_POOLING\_BiLSTM           & 1                                                                      & 69                                                                   & -68                                                                    \\
        BiLSTM\_DENSE                  & 1                                                                      & 69                                                                   & -68                                                                    \\
        CNN\_POOLING\_BiLSTM\_DENSE    & 1                                                                      & 69                                                                   & -68                                                                    \\
        CNN\_POOLING\_GRU\_LSTM\_DENSE & 1                                                                      & 69                                                                   & -68                                                                   
        \end{tabular}%
        
        \end{table}

        \colorbox{yellow}{Table Above} this Text, Table Above this Text, Table Above this Text,
        \lipsum[1-3]
\end{document}
1

You must log in to answer this question.

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