To force the content of \include{tables/res_langs} and \include{tables/res_multilingual} to appear on the same page in LaTeX, you need to address how LaTeX handles page breaks and floating environments. Here's a step-by-step solution:
1. Replace \include with \input
The \include command automatically inserts a page break before the included content. Replace it with \input to avoid this:
\input{tables/res_langs}
\input{tables/res_multilingual}
This ensures the two files are included sequentially without page breaks.
2. Use the float package to fix table placement
If the tables are inside floating environments (table), LaTeX might move them to separate pages. Use the float package with the [H] option to force them to stay in place:
\usepackage{float}
% In your document:
\begin{table}[H]
\input{tables/res_langs}
\end{table}
\begin{table}[H]
\input{tables/res_multilingual}
\end{table}
Note: The [H] option (from the float package) forces the table to appear exactly where it is placed, not elsewhere.
3. Adjust float parameters (optional)
If the tables are still split, adjust LaTeX's float placement rules in the preamble:
\renewcommand{\topfraction}{0.9} % Allow more space for top floats
\renewcommand{\bottomfraction}{0.9} % Allow more space for bottom floats
\renewcommand{\textfraction}{0.1} % Reduce the minimum text area
\setcounter{topnumber}{2} % Allow up to 2 top floats
\setcounter{bottomnumber}{2} % Allow up to 2 bottom floats
\setcounter{totalnumber}{4} % Total floats allowed
4. Check for explicit page breaks
Ensure the included files (tables/res_langs.tex and tables/res_multilingual.tex) do not contain \newpage, \clearpage, or \pagebreak commands that force page breaks.
5. Combine tables into one table environment (if possible)
If the tables are small and compatible, combine them into a single table environment:
\begin{table}[H]
\centering
\input{tables/res_langs}
\input{tables/res_multilingual}
\end{table}
6. Use \pagebreak to control placement
If all else fails, manually insert a \pagebreak before the tables to ensure they are placed together:
\pagebreak
\input{tables/res_langs}
\input{tables/res_multilingual}
Summary
- Use
\input instead of \include.
- Use the
float package with [H] to pin tables to their location.
- Avoid page break commands in included files.
- Adjust float parameters if needed.
Let me know if you need help with specific table formatting or conflicts!