I'm trying to create a layout where images are *always without exception* displayed before their reference, and on a page by themselves without any text above or below the image. I've tried a number of different approaches, but have not been successful.
The text needs to "flow" around the images on the alternate side, so using \FloatBarrier
to force a new page is not an option.
The example below is as close as I've been able to get, but I (a) want to get rid of the text underneath the image on page 1, (b) want to move the leftover text on page 4 to page 5 (leaving the image on a page by itself).
The section that references the image will not always be at the top of the page - because of how I'd like to lay this out, there may be some leftover bits of the previous section(s) that have flowed over. An alternate way of thinking of this would be that the image is inserted as an entire page on the page before the reference would appear, pushing the contents of the book one page out.
\documentclass[]{book}
\usepackage{lipsum}
\usepackage[pagestyles]{titlesec}
\usepackage{float}
\usepackage{placeins}
\usepackage[demo]{graphicx}
\renewcommand{\thesection}{\arabic{section}}
\begin{document}
\begin{figure}[H]
\includegraphics[width=\textwidth,height=0.8\textheight]{dummy}
\end{figure} % must appear before the section on a line below (1)
\section{}
\lipsum[1-2]
\section{}
\lipsum[1]
\section{}
\lipsum[1-6]
\begin{figure}[H]
\includegraphics[width=\textwidth,height=0.8\textheight]{dummy}
\end{figure} % must appear before the section on the line below (4)
\section{}
\lipsum[1-2]
\end{document}
{figure}[p]
(not[H]
), and put the input for the figure before its reference. – barbara beeton May 19 '16 at 19:58\FloatBarrier
immediately after a{figure}[p]
the pages are positioned before the reference, but text before the reference doesn't correctly flow (ie: it inserts a page break). – slipheed May 19 '16 at 20:04\ref
if you had a\label
but you don't have that and seem to mean before the\section
following the figure? – David Carlisle May 19 '16 at 21:53