f

#### LaTeX Warning: !h' float specifier changed to !ht'

Hi,

I am trying to add a caption to an imported document. I created the
following code to wrap it in a float:

\usepackage{caption}         % Captions for graphviz figures.
\usepackage{float}           % For custom floats.
\newfloat{graphvizfigure}{!h}{graphvizfigure}
\floatname{graphvizfigure}{Figure}
\newcommand{\mygraph}[2]{%
\begin{graphvizfigure}
\input{figures.gen/#1}
\caption{#2}
\end{graphvizfigure}
}

This correctly adds a caption, but the float is rendered at the top of
the following page, instead of being inserted at the position at which it
was imported.

pdflatex also produces the following warning:

LaTeX Warning: !h' float specifier changed to !ht'

Any idea how to prevent Latex from changing the !h specifier?

-Samuel

 0
3/8/2008 12:45:08 AM
comp.text.tex 39027 articles. 3 followers.

3 Replies
7845 Views

Similar Articles

[PageSpeed] 56

Samuel wrote:
> pdflatex also produces the following warning:
>
> LaTeX Warning: !h' float specifier changed to !ht'
>
> Any idea how to prevent Latex from changing the !h specifier?

LaTeX is telling you that "!h" means "If the float can't go here, it can't
go anywhere".  "!ht" allows the float to appear at the top of the next
page if it doesn't fit on the current page.

You may find the following FAQ answer useful:

http://www.tex.ac.uk/cgi-bin/texfaq2html?label=figurehere

-- Scott

 0
ctt (1173)
3/8/2008 1:32:57 AM
On Fri, 07 Mar 2008 18:32:57 -0700, Scott Pakin wrote:

> LaTeX is telling you that "!h" means "If the float can't go here, it
> can't go anywhere".

That'd be cool, except it should easily fit there. It is in fact placed
correctly, as long as it's not wrapped in a float.

> You may find the following FAQ answer useful:
>
>      http://www.tex.ac.uk/cgi-bin/texfaq2html?label=figurehere

Yay, that helped. Using the following snippet it works just fine:

\newcommand{\mygraph}[2]{%
\vspace{1em}
\input{figures/#1}
\captionof{figure}{#2}
\vspace{1em}
}

Thanks,
-Samuel

 0
3/8/2008 1:48:05 AM
On Mar 7, 5:48 pm, Samuel <newsgro...@debain.org> wrote:
> On Fri, 07 Mar 2008 18:32:57 -0700, Scott Pakin wrote:
> > LaTeX is telling you that "!h" means "If the float can't go here, it
> > can't go anywhere".
>
> That'd be cool, except it should easily fit there. It is in fact placed
> correctly, as long as it's not wrapped in a float.

That leads to a lot of confusion about what "fits".  The picture plus
caption plus twice \intextsep spacing has to fit, and there must be at
least \textfraction portion of the page containing text (not floats),
and no more than \totalnumber floats on the page, and there is not
another float already moved to the next page (else floats would be out
of order).  The FAQ tells about these parameters that LaTeX must obey
when placing floats.

Donald Arseneau                                asnd@triumf.ca

 0
asnd (4601)
3/8/2008 6:18:07 AM