0

I have a long latex file and it is mostly messing up because of a long wide table. Also, this is a two-column file while the table itself occupies both columns. Hence, I used table* instead of table. I wanted to keep the table in the middle of the file and not have it moved towards the end but also have it occupy a full page in the middle. But when I use it with the option table*[p] or table*[!p], it either makes the page blank without the table or moves it to the end of the file. Is there a way around this? If my explanation is not enough, I will try to write a multi-page working example that can demonstrate this problem

Edit- so here is a working example

\documentclass[aps,superscriptaddress,nofootinbib,showpacs,notitlepage, twocolumn]{revtex4-1}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{braket}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{makecell}
\usepackage{blkarray}
\usepackage[dvipsnames]{xcolor}
\usepackage{amssymb}
\usepackage{dsfont}
\usepackage{verbatim}
\usepackage{amsmath,amscd}
\usepackage[all,cmtip]{xy}
\usepackage{multirow}
\usepackage{blkarray}
\usepackage{booktabs}

\AtBeginDocument{
\lightrulewidth=.05em
\cmidrulewidth=.03em
\belowrulesep=.65ex
\belowbottomsep=0pt
\aboverulesep=.4ex
\abovetopsep=0pt
\cmidrulesep=\doublerulesep
\cmidrulekern=.5em
\defaultaddspace=.5em
}

\DeclareMathOperator{\Ima}{Im}
\newcommand{\eX}{\dimexpr\fontcharht\font`X\relax}
\newcommand{\coment}[1]{\textcolor{red}{#1}}

\definecolor{darkblue}{RGB}{0,0,127} 
\definecolor{darkgreen}{RGB}{0,130,80}
\definecolor{darkred}{RGB}{150,10,10}
\hypersetup{
    colorlinks,
    linkcolor=darkblue,
    citecolor=darkgreen,
    filecolor=red,
    urlcolor=blue,
    pdftitle={},
    pdfauthor={}
}

\newcommand{\unsure}[1]{\textcolor{darkred}{#1}}
\newcommand{\todo}[1]{\textcolor{red}{#1}}
\usepackage{afterpage}
\newcommand{\includeTikz}[2]{
\includegraphics{#1}
}
\newcommand{\oline}[1]{\overline{#1}}
\newcommand{\includeTikzrm}[2]{
\tikzset{external/remake next}
\tikzsetnextfilename{#1}#2}


\newcommand\blankpage{%
    \null
    \thispagestyle{empty}%
    \addtocounter{page}{-1}%
    \newpage}
\usepackage{calc}
\graphicspath{{./Figures/}}
\usepackage{tikz,pgfplots}\pgfplotsset{compat=newest}
\usepackage{xtab}
\usetikzlibrary{external,calc,decorations.pathreplacing,decorations.markings,decorations.pathmorphing,arrows.meta,shapes.geometric,cd}
\newlength\figureheight
\newlength\figurewidth

\newcommand{\Uone}{\ensuremath{\mathsf{U}(1)}}
\newcommand{\algebra}[1]{{\ensuremath{\mathcal{#1}}}}
\newcommand{\group}[1]{{\ensuremath{\mathsf{#1}}}}
\newcommand{\Z}{\ensuremath{\mathbb{Z}}}
\newcommand{\N}{\ensuremath{\mathbb{N}}}
\newcommand{\bbR}{\ensuremath{\mathbb{R}}}
\newcommand{\hket}[1]{{\ensuremath{|{#1})}}}
\newcommand{\hbra}[1]{{\ensuremath{({#1}|}}}
\newcommand{\topo}{\text{TO}}
\newcommand{\R}[1]{{Ref.~\onlinecite{#1}}}
\newcommand{\strop}{\ensuremath{S}}

\newtheorem{lemma}{Lemma}
\newtheorem{claim}{Proposition}
\newtheorem{conjecture}{Conjecture}
\newtheorem{definition}{Definition}
\newtheorem{theorem}{Theorem}

\newcommand{\drawgenerator}[8]{%
\xymatrix@!0{%
& #8 \ar@{-}[ld]\ar@{.}[dd] \ar@{-}[rr] & & #7 \ar@{-}[ld]  \\%
#1 \ar@{-}[rr] \ar@{-}[dd] &  & #2 \ar@{-}[dd] &            \\%
& #6 \ar@{.}[ld] &  & #5 \ar@{-}[uu] \ar@{.}[ll]       \\%
#3 \ar@{-}[rr] &  & #4 \ar@{-}[ru]                       %
}%
}

\usepackage{array,floatrow}
\usepackage{graphicx}
\usepackage[caption=false,label font={bf,normalsize}]{subfig}
\floatsetup[figure]{style=plain,subcapbesideposition=top}
\captionsetup{%
    format=plain,%
    textformat=period,
    justification=justified,
    singlelinecheck=false,
}

\newcommand{\FFtwo}{{\mathbb{F}_2}}
\newcommand{\FF}{{\mathbb{F}}}
\newcommand{\mm}{{\mathfrak{m}}}
\renewcommand\dblfloatpagefraction{0.1}
\DeclareMathOperator{\coker}{\mathrm{coker}}

\begin{document}

\title{TTT}
\author{AAAA}
\affiliation{YYY}



\begin{abstract}
ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
\end{abstract}

\maketitle
ttt

\setlength{\tabcolsep}{9pt}
\begin{table*}[!p]
\renewcommand{\arraystretch}{1.4}{
\begin{tabular}{c|ccccccc}

M & D & p & q & r & s & t\tabularnewline
\hline

0 & $ghar$ & 0 &denver \tabularnewline

1 & $pq$ & 0 & WATERLOO\tabularnewline

2 & $pq$ & 0 & WATERLOO\tabularnewline

3 & $pq$ & 0 & WATERLOO\tabularnewline

4 & $pq$ & 0 & WATERLOO\tabularnewline

5 & $ghar$ & 0 &denver\tabularnewline

6 & $ghar$ & 0 &denver\tabularnewline

7 & $pq$ & 0 & WATERLOO\tabularnewline

\end{tabular}}
\caption{orem ipsum dolor sit amet, consectetuer adipiscingelit. In hac habitasse platea dictumst. Morbi ultrices.Pellentesque porta. Sed vestibulum sagittis urna. Doneceros. Curabitur auctor dolor a orci. Curabitur posuereneque nec ante. Sed suscipit. Suspendisse lobortis mol-lis massa. Maecenas interdum magna a pede. Aliquamauctor elit a elit. Etiam vulputate, enim quis faucibuscursus, mauris lacus laciorem ipsum dolor sit amet, consectetuer adipiscingelit. In hac habitasse platea dictumst. Morbi ultrices.Pellentesque porta. Sed vestibulum sagittis urna. Doneceros. Curabitur auctor dolor a orci. Curabitur posuereneque nec ante. Sed suscipit. Suspendisse lobortis mol-lis massa. Maecenas interdum magna a pede. Aliquamauctor elit a elit. Etiam vulputate, enim quis faucibuscursus, mauris lacus laci} 
\label{table_invariants}
\end{table*}
\section{random text}
\label{algo}
orem ipsum dolor sit amet, consectetuer adipiscingelit. In hac habitasse platea dictumst. Morbi ultrices.Pellentesque porta. Sed vestibulum sagittis urna. Doneceros. Curabitur auctor dolor a orci. Curabitur posuereneque nec ante. Sed suscipit. Suspendisse lobortis mol-lis massa. Maecenas interdum magna a pede. Aliquamauctor elit a elit. Etiam vulputate, enim quis faucibuscursus, mauris lacus laci orem ipsum dolor sit amet, consectetuer adipiscingelit. In hac habitasse platea dictumst. Morbi ultrices.Pellentesque porta. Sed vestibulum sagittis urna. Doneceros. Curabitur auctor dolor a orci. Curabitur posuereneque nec ante. Sed suscipit. Suspendisse lobortis mol-lis massa. Maecenas interdum magna a pede. Aliquamauctor elit a elit. Etiam vulputate, enim quis faucibuscursus, mauris lacus laci


\subsection{MORE TEXT}
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In hac habitasse platea dictumst. Morbi ultrices. Pellentesque porta. Sed vestibulum sagittis urna. Donec eros. Curabitur auctor dolor a orci. Curabitur posuere neque nec ante. Sed suscipit. Suspendisse lobortis mollis massa. 
    Maecenas interdum magna a pede. Aliquam auctor elit a elit. Etiam vulputate, enim quis faucibus cursus, mauris lacus lacinia nulla, sit amet commodo felis libero nec lectus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec pulvinar, dui nec aliquet venenatis, eros leo cursus risus, eget pretium turpis turpis quis sem. 
    Pellentesque justo. Ut in elit vel ligula tempus vehicula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed libero diam, pulvinar sed, commodo id, volutpat a, sapien. Curabitur urna. Nam vel nisl sit amet metus dictum imperdiet. 
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In hac habitasse platea dictumst. Morbi ultrices. Pellentesque porta. Sed vestibulum sagittis urna. Donec eros. Curabitur auctor dolor a orci. Curabitur posuere neque nec ante. Sed suscipit. Suspendisse lobortis mollis massa. 
    Maecenas interdum magna a pede. Aliquam auctor elit a elit. Etiam vulputate, enim quis faucibus cursus, mauris lacus lacinia nulla, sit amet commodo felis libero nec lectus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec pulvinar, dui nec aliquet venenatis, eros leo cursus risus, eget pretium turpis turpis quis sem. 
    Pellentesque justo. Ut in elit vel ligula tempus vehicula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed libero diam, pulvinar sed, commodo id, volutpat a, sapien. Curabitur urna. Nam vel nisl sit amet metus dictum imperdiet. 
    In congue ante in nunc. Proin sed augue a erat venenatis varius. Mauris mauris nunc, consequat sed, dictum nec, iaculis et, ligula. Mauris pede. Etiam porttitor. Vestibulum at ipsum. 
    Aliquam semper nunc. Donec adipiscing lacus et erat. Phasellus nibh wisi, facilisis semper, adipiscing sit amet, ultrices at, purus. Curabitur nulla ipsum, lacinia nec, congue non, pellentesque semper, risus. Nunc volutpat. Vivamus blandit. Donec mi. Duis diam ante, malesuada eget, iaculis vel, viverra in, nulla. Praesent volutpat. Nulla volutpat molestie neque. Donec in eros semper est sagittis molestie. Nunc pellentesque. Ut ut mi. Ut elementum, risus nec consectetuer commodo, massa sapien tincidunt nulla, a laoreet dolor metus in nunc. Vivamus turpis purus, suscipit eu, molestie vel, hendrerit et, justo. 
    Morbi viverra. Aliquam vestibulum condimentum lorem. Sed vel lacus. Aliquam justo. Nam cursus feugiat odio. Praesent libero libero, feugiat semper, laoreet non, venenatis vitae, quam. Mauris nulla elit, scelerisque quis, gravida et, faucibus vel, magna. 
    Vivamus eleifend sagittis pede. Fusce semper placerat velit. Praesent in turpis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Cras vitae ligula. Ut dignissim viverra metus. 
    Duis id lacus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Fusce sed risus. Integer sed felis ac enim semper tempor. Nam ligula. Phasellus orci wisi, viverra vel, aliquam a, interdum quis, turpis. 
    Sed sodales. Suspendisse velit eros, lobortis quis, fermentum ut, suscipit ac, purus. Nam egestas nunc ut arcu. Phasellus et quam. Quisque tempor. Aliquam suscipit. 
    Mauris semper lacus in purus tempor faucibus. Donec velit. Sed sed ante. Fusce iaculis pulvinar purus. Aenean pulvinar sem sit amet elit. Sed elementum, odio eget dapibus accumsan, magna purus ultricies justo, in tristique elit neque ut neque. Integer libero diam, fermentum semper, sollicitudin id, scelerisque eget, lorem. 
    Ut condimentum. Phasellus lobortis sodales lectus. Aliquam dapibus. Cras enim. Etiam semper libero. Integer iaculis adipiscing enim. Sed justo. Suspendisse tincidunt aliquam arcu. Vestibulum nisl. Nam pulvinar vestibulum erat. Morbi at magna ac augue viverra sodales. Etiam blandit sem eu tellus. Donec lacus. Nullam elit urna, semper eu, lacinia ut, blandit sit amet, pede. Fusce tincidunt. 
    Cras at nibh eget metus tempus suscipit. Pellentesque sed tortor. Nulla vitae neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam ultrices ante nec erat. Nunc pede purus, fringilla quis, euismod a, mollis ac, leo. Vestibulum id lorem. Sed nec leo ac wisi elementum tristique. Phasellus eget urna. Sed tellus ante, lacinia quis, congue sit amet, elementum vel, massa. Cras dictum. Maecenas hendrerit sollicitudin nulla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; 
    Donec leo. Nullam ullamcorper rutrum ipsum. Duis justo. Aliquam lobortis tortor in justo. In a mi. Nam tellus metus, lacinia nec, eleifend eu, ultrices eget, turpis. 2 min to Spreed

\end{document}

If you remove some of the text in the subsection MORE TEXT, the table would print else it would just show a blank page.

  • 2
    Why you used the option [p] or [!p]? What was you expecting from this option? – koleygr Aug 16 '19 at 5:39
  • I am really not sure but I had read that ! can help override internal LATEX parameters. – user25957 Aug 16 '19 at 18:06
2

page floats are only created if the float occupies enough of the page. In twocolumn mode it must be fuller than \dblfloatpagefraction whose value is by default 0.5. If you make it smaller (or the float fuller) it will not be moved to the end of the document:

\documentclass[twocolumn]{article}
\usepackage{lipsum}
\renewcommand\dblfloatpagefraction{0.1}

\begin{document}
\lipsum[1]
\begin{table*}[p]
\bfseries table
\lipsum[1]
\end{table*}

\lipsum

\end{document}

See also https://tex.stackexchange.com/a/39020/2388 for a general description of float placement.

enter image description here

  • thanks for the answer. Using table*[p], my table completely disappeared and the full page is blank now in the middle of the file. Any idea on what could be happening? I modified the question to include this – user25957 Aug 16 '19 at 18:38
  • 1
    show an example. – Ulrike Fischer Aug 16 '19 at 18:42
  • added an example – user25957 Aug 17 '19 at 18:13
  • 1
    move hyperref and hypersetup directly before \begin{document}. And don't ignore errors. – Ulrike Fischer Aug 17 '19 at 18:29
  • 1
    No, I really don't want to hunt down what happens in revtex and all your packages. But the error message looked like hyperref and the general rule is that hyperref should be loaded late. – Ulrike Fischer Aug 17 '19 at 18:37

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.