I am facing a problem, where I generate tabular environments using Stata for a scientific project, and try to include them in Latex via the "input" command. But in the end, all my tables, whether from external files or composed directly in the document, are in the "table"-environment.
Nonetheless, there seems to be an incompatibility between the endfloat package and inputting tabulars from another file into the tables.
In the following MWE, not using the endfloat package (commenting out line 4) gives me everything finely. But if I use endfloat, I end up with one paragraph (paragraph 4, as the numbers show) in the back of the file, where only the tables are supposed to be. This is the first paragraph after an external file is "inputted" for the first time.
In addition, there appears an additional table marker out of nowhere--- there are five tables in the text, but I receive table markers up to [Insert table 6 around here]. So, the whole document is useless.
My target is, for a journal submission, to put tables in the back as they require. A workaround would be to manually move all tables to the back in the latex code, but that would make working on the document unnecessarily tiring. Are you aware of alternative solutions to send tables to the back?
\documentclass[12pt]{scrartcl}
\usepackage[english]{babel}
\usepackage{tabularx}
\usepackage[markers]{endfloat}
\usepackage{blindtext}
\begin{document}
\section{Normal Sections, text}
11111111111111111111111
\blindtext
\begin{table}[ht]
\begin{center}
\begin{tabularx}{\textwidth}{l|X}
\hline \hline
variable & description\\ \hline
var 1 & binary; 1 if and only if ... \\ \hline \hline
\end{tabularx}
\end{center}
\caption{The independent variables}\label{variabletable}
\end{table}
22222222222222222222222222
\blindtext
\begin{table}[ht]
\begin{center}
\begin{tabularx}{\textwidth}{l|X}
\hline \hline
Variable & Description\\ \hline
Revenue & revenue\\
logta&natural logarithm of total assets\\
\hline \hline
\end{tabularx}
\end{center}
\caption{The dependent variables}\label{deptable}
\end{table}
33333333333333333333333333333
\blindtext
{\renewcommand\footnotesize{\normalsize}%
\normalsize
\begin{table}[ht]
\begin{center}
\begin{scriptsize}
\makebox[\textwidth][c]{\input{regcompare1.tex}}
\end{scriptsize}
\end{center}
\caption{Summary statistics}\label{1}
\end{table}}
444444444444444444444444444
\blindtext[1]
\begin{table}[ht]
\begin{center}
\begin{scriptsize}
\makebox[\textwidth][c]{\input{regcompare1.tex}}
\end{scriptsize}
\end{center}
\caption{Models with selections of dependent corporate performance variables}
\label{regcompare1}
\end{table}
5555555555555555555555555555555555
\blindtext[1]
\begin{table}[ht]
\begin{center}
\begin{scriptsize}
\makebox[\textwidth][c]{\input{regcompare1.tex}}
\end{scriptsize}
\end{center}
\caption{Models with selections of dependent corporate performance variables}
\label{regcompare2}
\end{table}
6666666666666666666666666666666666666666666
\blindtext[1]
\section{Last section, references}
\end{document}
In addition, the loaded file regcompare1 has exactly these contents (note the tabular environment):
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{tabular}{l*{9}{c}}
\hline\hline
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}&\multicolumn{1}{c}{(5)}&\multicolumn{1}{c}{(6)}&\multicolumn{1}{c}{(7)}&\multicolumn{1}{c}{(8)}&\multicolumn{1}{c}{(9)}\\
&\multicolumn{1}{c}{Test \newline test}&\multicolumn{1}{c}{estprof2}&\multicolumn{1}{c}{estprof3}&\multicolumn{1}{c}{estneti}&\multicolumn{1}{c}{estneti2}&\multicolumn{1}{c}{estroa}&\multicolumn{1}{c}{estroa2}&\multicolumn{1}{c}{estroa3}&\multicolumn{1}{c}{estroa4}\\
\hline
logta & -0.0578\sym{***}& -0.0458\sym{***}& -0.0515\sym{***}& -0.0119\sym{***}& -0.0121\sym{***}& -0.0192\sym{***}& -0.0181\sym{***}& -0.0180\sym{***}& -0.0186\sym{***}\\
& (0.000) & (0.000) & (0.000) & (0.000) & (0.000) & (0.000) & (0.000) & (0.000) & (0.000) \\
\hline\hline
\multicolumn{10}{l}{\footnotesize \textit{p}-values in parentheses}\\
\multicolumn{10}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\
\end{tabular}
}
I appreciate your help.
\input{regcompare1}
with the file contents you give lead to the exact same result. Theinput
tag should be removed (andjournal
tag also).{...}
for your third table.