100

I'm new to LaTeX and trying to understand the reason why I'm getting the warning:

`h' float specifier changed to `ht'

I'm not attempting to change the float property of anything - the warning is showing up if I attempt to simply encapsulate some words in quotation marks:

``highly distributed''

As far as I'm aware, there's no open sections anywhere and the file seems to render properly. So realistically it doesn't matter if the issue gets solved or not; but I'd like to know the reason I'm getting the warning.

Thanks in advance.

3
  • 3
    I was not able to create an example that reproduced this warning due to quotation usage. The LaTeX source I tried compiling can be found here. Could you distil a minimal example that reproduces the behavior and post it?
    – Sharpie
    Aug 11, 2010 at 2:31
  • 2
    @Sharpie - you're right. From your example and looking at the log file for my file it doesn't look like my ''highly distributed'' line is the issue. There was a figure that had a float specified which I must have included from elsewhere. I've removed that and thus silenced the warning too. Thanks for your help.
    – Geodesic
    Aug 11, 2010 at 4:19
  • 4
    No problem. A good maxim to remember is "If you see hoofprints in your code, think horses not zebras". I.E.: it is possible LaTeX is yanking your chain but more probably that the error really does have to do with a float and not a quotation mark.
    – Sharpie
    Aug 11, 2010 at 5:34

2 Answers 2

130

You did not change the float specifier, LaTeX did that for you and informed you. The reason is, that you provided just the optional placement argument h or !h for a float (figure or table), but the float didn't fit on the current page. It had to be put on top of the next page, corresponding to a placement argument t.

I recommend to use at least ht as positioning argument. If you mean "exactly here", then use the argument H of the float package or one of the possibilities listed here: Prevent floating of figures or tables.

Often it's satisfying to specify all possible placement options !htbp, so still letting the figures and tables float.

h means here allowed, t means top, b means bottom, p means on a float-page, ! means try harder! to place it earlier.

For more information about the algorithm for placing floats, see How to influence the position of float environments like figure and table in LaTeX?

added: If a previous compilation using the [h] option worked with no error reported, the addition of text before the float may decrease the amount of space available for placing the float as specified, triggering a new error. This may not be obvious to an inexperienced user. (See `h' float specifier changed to `ht', where the OP associated the error with the content of the added text, not with the float.)

2
  • 1
    Thanks Stefan, I learnt all of that soon after I looked into Sharpie's response. What threw me was the error stating 'h was changed; so when I searched my text for it, only the result was my 'highly ... line. Your response elucidates the entire problem space for n00b like me, so hopefully it helps out other beginners in the future too.
    – Geodesic
    Aug 11, 2010 at 23:30
  • 2
    My thesis, which is what this relates to, is made up of several separate tex file chapters and when compiling I get the aforementioned h' float specifier changed to ht' for a chapter with no floats. I assumed as the OP did that it was for quotations. Fast forward, and I had a number of tables three chapters away where the floats were [h] only. I changed these to [ht] and it's error free now.
    – Braz
    Nov 1, 2018 at 11:24
0

Well, there are suggestions to replace [h] with [ht] etc. or using some packages for floats, but if you decided that none of those are really necessary and you just prefer to not see this warning message. Then you can add these two lines in your tex file. The first one is calling silence package that helps to stop warnings that annoys you to appear. And the second line is asking the float warning h bla bla to not appear.

\usepackage{silence}
\WarningFilter{latex}{`h' float specifier changed to `ht'}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .