0

I tried to find an answer on the forum but I could not.

I have some tables in separate files, which I want to organize in a single file. The preamble is the same for all tables. I use:

\begin{document}
\input{table1.tex}
\input{table2.tex}
\end{document}

The two tables are put into the same page. I tried to add a \pagebreak between the first and the second \input but it does not work.

Then I tried with \include:

\begin{document}
\include{table1.tex}
\include{table2.tex}
\end{document}

In this case, I try to compile, I do not get any error message but the pdf does not come out.

Any guess on how I could resolve my problem? Thanks in advance.

ADDENDUM

The big file containing all the tables is:

\documentclass{article}
\usepackage{rotating}
\usepackage{xcolor}
\usepackage{longtable}
\usepackage[labelfont=bf]{caption}
\usepackage[utf8]{inputenc}
\usepackage{caption, booktabs, makecell, siunitx}
\usepackage{eqparbox}
\pagenumbering{gobble}
\usepackage{booktabs}
\usepackage[referable,para]{threeparttablex}
\usepackage[scale=.75,textheight=27cm, textwidth=15cm]{geometry}
\usepackage{multirow}
\usepackage{pdflscape}
\sisetup{group-separator={,}, table-format=1.3, table-space-text-post=***, 
table-number-alignment =center}
\newcommand*{\MyIndent}
{\hspace*{1.5cm}}

\begin{document}
\input{table1.tex}
\input{table2.tex}
\end{document}

In table1.tex I have the following code (table2.tex is pretty similar with different variables):

\begin{table}
\setlength{\tabcolsep}{9pt}
\centering
\normalsize
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{threeparttable}
\caption{Baseline model \label{table3}}
\begin{tabular}{l*{5}{c}}
\toprule \toprule
                    &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}&\multicolumn{1}{c}{(5)}\\
                    &\multicolumn{1}{c}{POLS}&\multicolumn{1}{c}{WG}&\multicolumn{1}{c}{Kiviet--WG}&\multicolumn{1}{c}{DIF--GMM}&\multicolumn{1}{c}{SYS-GMM}\\

\midrule \noalign{\medskip}

$(ln)y_{i,t-1}$             &        .984\sym{***}&        .674\sym{***}&        .895\sym{***}&        .519\sym{***}&        .957\sym{***}\\
                    &      (.007)         &      (.043)         &      (.036)         &      (.128)         &      (.013)         \\
$PC$                  &       -.029\sym{**} &       -.045\sym{***}&       -.033\sym{***}&       -.103\sym{***}&       -.107\sym{***}\\
                    &      (.015)         &      (.013)         &      (.013)         &      (.039)         &      (.036)         \\
$PC^{2}$                 &        .003\sym{**} &        .004\sym{***}&        .003\sym{***}&        .010\sym{***}&        .011\sym{***}\\
                    &      (.001)         &      (.001)         &      (.001)         &      (.004)         &      (.003)         \\
\midrule
Observations        &         681         &         681         &         681         &         553         &         681         \\
R$^2$               &        .989         &        .723         &                     &                     &                     \\
F-test              &    5531.466         &      85.460         &                     &                     &                     \\
Log--likelihood     &     401.638         &     621.943         &                     &                     &                     \\
\bottomrule \bottomrule
\end{tabular}
\begin{tablenotes}
\small
      \item[]{\textit{Notes}: ***, ** and * denote significance at 1\%, 5\% and 10\% level. Geographic and period dummies included but not reported. Robust standard errors in brackets.}
      \end{tablenotes}
\end{threeparttable}
\end{table}

    enter code here

The point is that I cannot insert a \pagebreak

If I tried with \include I cannot generate a pdf file (I can compiles the tex file with no errors, but the pdf does not come out).

Thanks

  • 1
    \clearpage would help. But you can also put the preamble in the main file \begin{documen} ...preamble ... an then you can use \include{table1.tex} \include{table2.tex} instead of \input. Include is like 1.\clearpage and 2.input{} When should I use \input vs. \include?. – Bobyandbob Apr 28 '17 at 12:50
  • 3
    Can you show a minimal version of what you have in table1.tex? Note also that \include must be used without the .tex extension. – egreg Apr 28 '17 at 12:57
  • @Bobyandbob Thanks for your reply. \clearpage works, although it does not center the second table in the page. I tried to use include, but as I said the file can be compiled but the pdf does not come out. – Dario Apr 28 '17 at 13:19
  • @egreg. Thanks for your reply. I will edit my previous question including the content of table1.tex – Dario Apr 28 '17 at 13:19
  • Maybe you have to delete old files. \documentclass{article} \usepackage[labelfont=bf]{caption} \usepackage[utf8]{inputenc} \usepackage{caption, booktabs, makecell, siunitx} \usepackage[referable,para]{threeparttablex} \usepackage[scale=.75,textheight=27cm, textwidth=15cm]{geometry} \sisetup{group-separator={,}, table-format=1.3, table-space-text-post=***, table-number-alignment =center} \begin{document} \include{table1} \include{table1} \end{document} works for me. – Bobyandbob Apr 28 '17 at 13:31
1

Changing \begin{table} into \begin{table}[p] and using

\input{table1}

\clearpage

\input{table2}

will solve your problem.

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.