# How to fix the location of tables when they're imported with \input? [duplicate]

Possible Duplicate:
Keeping tables/figures close to where they are mentioned

I'm using MiKTeX and TexMaker 2.2.2. Using the latabstat command in Stata I create small tex files of some tables.

They look like:

\begin{table}[htbp]\centering
\begin{tabular}
(table content)
\end{tabular}
\end{table}


When I compile my main document

\begin{document}
\input{tablefromstata}
\end{document}


The tables float around - and I want to fix them.

Since the files contain the table command, putting table outside (in the main document), like

\begin{table}
\input{tablefromstata}
\end{table}


gives error messages.

I tried the floating option [H] after the input string input{}[h] but it seems not to work on input{}. Does anybody know how I can determine the exact location of tables imported using \input?

Thanks!

UPDATE: Problem solved. Anyone with the same problem, just type [h] after the caption command in stata.

## marked as duplicate by Marco Daniel, Joseph Wright♦Oct 1 '11 at 21:22

• Welcome to TeX.sx! The \input command simply inserts the content of the external file at this position, nothing more. Do you have a table inside or around the \input? Please consider to add a minimal working example (MWE) that illustrates your problem. – Martin Scharrer Jul 25 '11 at 15:33
• Apart from the answers in the linked question in Martin's comment, can the latabstat command in Stata create a table not wrapped in a tabular environment? If so, you can insert the tables exactly where you want them, since they won't float at all. – Alan Munn Jul 25 '11 at 16:02