Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
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
3  
For the positing part of the question see Keeping tables/figures close to where they are mentioned. Please tell us if this helps, so we can close this question as a duplicate. –  Martin Scharrer Jul 25 '11 at 15:35
    
The main document looks like \documentclass[a4paper,12pt]{article} –  Petter Jul 25 '11 at 15:37
    
You can update the question if you want to add new information. –  Martin Scharrer Jul 25 '11 at 15:38
    
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
show 3 more comments

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

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

Use the float package, and change the [htbp] to [H] Then the tables will not float at all (unless they fall at the bottom of the page, in which case they will have to go to the top of the next page).

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.