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.

This is similar, but not the same, as a previous question.

I want to do the following things:

  • Number tables and figures separately
  • Put tables exactly where I want them

To do the first one, I just use 'figure' and 'table' environments in the appropriate place. But the table environment doesn't seem work when I use \begin{table}{H}, which stops me being able to do the second thing. Any suggestions?

Correction: I should have said \begin{table}[H]

share|improve this question
1  
You need to include the float package and use [H] not {H}. –  Werner Mar 4 '12 at 6:58
1  
Please link this to the previous question. –  qubyte Mar 4 '12 at 7:00
1  
H is not a standard placement specifier. Please add a minimal working example (MWE) that illustrates your problem. –  doncherry Mar 4 '12 at 9:20
    
@TomasLycken The question you linked to doesn't seem at all related to this, so I doubt that was what he was referring to. –  Torbjørn T. Mar 4 '12 at 14:47

2 Answers 2

up vote 5 down vote accepted

As Werner noted in a comment, you should have angle brackets ([]) rather than curly braces ({}) around the placement specifier. Also, as doncherry noted in another comment,H isn't a standard placement specifier.

Try \begin{table}[hp] instead, or if that doesn't work, try \begin{table}[!hp] (note the exclamation mark).

If you still do not achieve exactly what you want, then \usepackage{float} and try \begin{table}[H] as Werner suggested.

share|improve this answer
    
yeah, \usepackage{float} does the trick too. –  Lucas Mar 4 '12 at 11:11
    
No. As Herbert provides, he shouldn't use a floating environment at all. –  Martin Schröder Mar 4 '12 at 13:40
    
@MartinSchröder: Not using a floating environment at all does more than just changing the way LaTeX positions the table. Since the question explicitly talked about the table floating envirionment, I assumed they were a requirement. –  Tomas Lycken Mar 4 '12 at 14:39
    
@TomasLycken [h] or even [!h] shouldn't really be used as they almost inevitably take floats to the end of the document, almost always it is better to use [htp] or [!htp] see recent comments in tex.stackexchange.com/questions/46046/… –  David Carlisle Mar 5 '12 at 0:51
    
@DavidCarlisle: Noted, thanks! I chose to edit only to [hp], mainly because the t can induce behavior that is hard to troubleshoot (for example if you want the table after an orphaned line at the top of the page, LaTeX is likely to place the table above...). Now, h should be used whenever possible, and if there is no room a float page will be produced (if for no other purpose, to indicate that there isn't enough room for the table in the intended place). –  Tomas Lycken Mar 5 '12 at 1:48

Since you don't want your tables to float, don't use a float environment like figure but simulate it:

\documentclass[english]{article}
\usepackage{babel}
\usepackage{caption}
\usepackage{blindtext}%% only for demo

\begin{document}
\blindtext

\begin{center}
\captionof{table}{some noinsense text.}
\begin{tabular}{l}
Zeile 1\\
Zeile 2\\
Zeile 3\\
Zeile 4
\end{tabular}
\end{center}

\blindtext
\end{document}
share|improve this answer
    
Ah, so \captionof{table}{some noinsense text.} does all the TOC stuff if I don't put it any kind of float! Excellent. –  Lucas Mar 4 '12 at 11:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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