1

I am using endfloat to process all my tables at the end of my document. I am also using the option to suppress in-text markers. However, endfloat still seems to insert a space where the marker would have been (in effect creating an unnecessary space between my paragraphs). The reason this is happening is because of the centering tags. Removing them fixes the problem. Why does this happen? MWE:

\documentclass[english]{article}
\usepackage[nolists,tablesfirst,nomarkers]{endfloat}


\begin{document}
Some text here Some text here Some text here Some text here Some text
here Some text here Some text here Some text here Some text here Some
text here Some text here Some text here Some text here Some text here
Some text here Some text here Some text here Some text here Some text
here Some text here Some text here Some text here Some text here Some
text here Some text here Some text here Some text here Some text here
Some text here 

\begin{center}
\begin{table}
\protect\caption{My Table}


\begin{tabular}{|c|c|c|c|c|}
\hline 
a &  &  &  & \tabularnewline
\hline 
\hline 
 & b &  &  & \tabularnewline
\hline 
 &  &  &  & \tabularnewline
\hline 
 &  &  &  & \tabularnewline
\hline 
 &  &  &  & \tabularnewline
\hline 
\end{tabular}
\end{table}

\par\end{center}

Some more text here Some more text here Some more text here Some more
text here Some more text here Some more text here Some more text here
Some more text here Some more text here Some more text here Some more
text here Some more text here Some more text here Some more text here
Some more text here Some more text here Some more text here Some more
text here Some more text here Some more text here 
\end{document}
4
  • Please edit your question so that it includes a complete example code that reproduces the problem. Without this it may be difficult for anyone to help you. Sep 29, 2014 at 21:32
  • i am attempting to come up with one but it is not easy
    – Alex
    Sep 29, 2014 at 22:33
  • I tried as well, but it's even harder for me, since I've never seen the problem! Sep 29, 2014 at 22:57
  • got it. mwe added; the solution to the original question is to remove the centering and then all the spacing looks fine. the question is why?
    – Alex
    Sep 29, 2014 at 23:53

1 Answer 1

1

That space is caused by center environment. The center environment is defined as a trivlist (or simply as a list)

\def\center{\trivlist \centering\item\relax}
\def\endcenter{\endtrivlist}

As you can see, it is a \trivlist around \centering. The effect of \trivlist is to add \topsep, \partopsep etc. For the definitions of these things, please refer to latex.ltx. In conclusion, the center environment adds vertical space above and below, which, in some cases (like this) is unnecessary.

Further, the table contained inside the center environment floats (to be put at the end), but the center environment stays where it is. The white space (associated with center environment) stays too at the original position and the table will be out of center environment and hence won't be centered.

Avoid those spaces by using just \centering.

\documentclass[english]{article}
\usepackage[nolists,tablesfirst,nomarkers]{endfloat}


\begin{document}
Some text here Some text here Some text here Some text here Some text
here Some text here Some text here Some text here Some text here Some
text here Some text here Some text here Some text here Some text here
Some text here Some text here Some text here Some text here Some text
here Some text here Some text here Some text here Some text here Some
text here Some text here Some text here Some text here Some text here
Some text here

%\begin{center}
\begin{table}
\caption{My Table}    %% no need of \protect use \caption[short title] instead

\centering         %%<--- here
\begin{tabular}{|c|c|c|c|c|}
\hline
a &  &  &  & \tabularnewline
\hline
\hline
 & b &  &  & \tabularnewline
\hline
 &  &  &  & \tabularnewline
\hline
 &  &  &  & \tabularnewline
\hline
 &  &  &  & \tabularnewline
\hline
\end{tabular}
\end{table}

%\par\end{center}

Some more text here Some more text here Some more text here Some more
text here Some more text here Some more text here Some more text here
Some more text here Some more text here Some more text here Some more
text here Some more text here Some more text here Some more text here
Some more text here Some more text here Some more text here Some more
text here Some more text here Some more text here
\end{document}

enter image description here

2
  • @barbarabeeton Thanks. I have modified the answer. Feel free to edit if needed.
    – user11232
    Sep 30, 2014 at 15:30
  • explanation is nice and clear, no edits needed. Sep 30, 2014 at 15:39

You must log in to answer this question.

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