0

I'm getting the following warning when I compile my file:

`h' float specifier changed to `ht'.

The float specifier 'h' is too strict of a demand for LaTeX to place your float in a nice way here. Try relaxing it by using 'ht', or even 'htbp' if necessary. If you want to try keep the float here anyway, check out the float package.
Learn more

But it's not telling me a line. Usually it says which line in the code is causing the problem so I can fix it but not sure how to do that here except by changing each figure from [H] to [HT] until I find it. Any ideas? Thanks

3
  • 1
    Welcome to TeX.SE. The positions specifiers are case sensitive; hence [h] and [H] are not the same. The message is a warning message. If you can't stand seeing this warning message, by all means feel free to replace all instances of [h] with [ht]. All that's going to happen is that the warning message(s) will cease.
    – Mico
    Commented Mar 15, 2023 at 15:46
  • Without minimal working example, we cannot tell you, where the change has been done. From the log-file you should at least be able to find out the page. However, usually it is not a good idea, to use h as the only possible location of a float. Always add at least p.
    – cabohah
    Commented Mar 15, 2023 at 15:47
  • you can see from the log which page tex is on, you usually do not have that many floats on a page, but changing all [h] is good practice anyway. Commented Mar 15, 2023 at 16:00

1 Answer 1

0

In this kind of situation (not just for floats), there is a brute force approach. I use it all the time.

In your document, use the \typeout{message} command, to write something to the log file. Then you can keep track of where things happen in processing, by reading the log. If you are compiling via command line, your message may be just above the point where you hit the warning (or error). Use % to end the extra line, if necessary.

Example:

... and they lived happily ever after.
\typeout{next: image of castle}%
\includegraphics{castle.png}
But that was long ago and far away. Since then...

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