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 04:01captionpackage seems like a rather large effort, and seems counter to the "LyX-way": http://wiki.lyx.org/LyX/Figures – Dave Jarvis Jan 24 '11 at 09:16floatpackage. 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:56Select Document→Settings.... In the Float Placement section, unset "Use Default Placement" and select "Top of Page", "Page of Floats", "Here, if possible" and "Ignore LaTeX rules". [...]
If you really insist, you can also simply select "Here definitely". This will insert the figure by all means at the current place. Note, though, that chances are high that this leads to ugly unbalanced pages. Usually, LaTeX does a rather good job in float placement if you do not restrict it too much."
– Seamus Jan 24 '11 at 12:36\raggedbottom) to enumerated lists with large inconsistent spaces between the items (which was the result when LaTeX placed the images where it deemed proper). (4) The results are shown in the question. – Dave Jarvis Jan 24 '11 at 18:24floatpackage, as described in the link you provided. Thank you for that. – Dave Jarvis Jan 24 '11 at 18:27