endfloat deja espacio incluso cuando el texto del marcador está desactivado

endfloat deja espacio incluso cuando el texto del marcador está desactivado

Estoy usando endfloatpara procesar todas mis tablas al final de mi documento. También estoy usando la opción para suprimir marcadores en el texto. Sin embargo, endfloattodavía parece insertar un espacio donde habría estado el marcador (de hecho, creando un espacio innecesario entre mis párrafos). La razón por la que esto sucede es por las etiquetas de centrado. Eliminarlos soluciona el problema. ¿Por qué pasó esto? 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}

Respuesta1

Ese espacio es causado por centerel medio ambiente. El centerentorno se define como trivlist(o simplemente como list)

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

Como puedes ver, es una \trivlistronda \centering. El efecto de \trivlistes agregar \topsep, \partopsepetc. Para conocer las definiciones de estas cosas, consulte latex.ltx. En conclusión, el centerambiente añade espacio vertical arriba y abajo, lo que, en algunos casos (como este) es innecesario.

Además, la tabla contenida dentro del centerentorno flota (se colocará al final), pero el centerentorno permanece donde está. El espacio en blanco (asociado con centerel entorno) también permanece en la posición original y tableestará fuera del centerentorno y, por lo tanto, no estará centrado.

Evite esos espacios usando solo \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}

ingrese la descripción de la imagen aquí

información relacionada