Background
Writing a manual using LyX. All tables, figures, and source listings are always referenced in the paragraph (or enumerated step) that immediately precedes them. The preamble to the manual includes \raggedbottom to prevent large vertical spaces between list items.
Problem
The problem can be seen here:

The heading "1.1 Hierarchies" (no orphaned headings allowed) and the reference to "Figure 1.1" should be at the top of Page 2, on the same page as the image.
LaTeX Code
The images are added to floats so that they can have captions and cross-references. The LyX documents contain the following commands:
\float_placement H
I have tried changing the commands to:
\float_placement !htbp
These affect figure placement, but do nothing for the cross-references.
LyX Code
This is the code that LyX generates:
\begin{figure}[H]
\includegraphics{drawings/directory-hierarchy-01}
\caption{\label{fig:Example-Directory-Organization}Recommended Directory Organization}
\end{figure}
Possible Solutions
\begin{samepage} ... \end{samepage}\clearpage
The \clearpage option is possible when the manual is complete. The samepage environment needs tweaking.
Question
What needs to be added to the document preamble to force the first cross-reference to remain on the same page as the item that is being referenced?
captionpackage. – Caramdir Jan 23 '11 at 4:01floatpackage. If the answers there are still not good for you, please edit your question to indicate why. Otherwise this question should be closed as duplicate. – Juan A. Navarro Jan 24 '11 at 10:56