I am writing a two-column document in revtex 4.1 and I have a very tall figure, which revtex insists in sending to the very end of the document. The figure is tall but it is short enough that it will fit inside the document's \textheight
, possibly with some text below it. If it becomes necessary to have the figure occupy an entire column then I am OK with it – it is important to me to keep the figure together, with an appropriate caption for it.
The document looks roughly as like this:
and a MWE is this
\documentclass[
twoside,
reprint,
aps,
pra,
a4paper
]{revtex4-1}
\usepackage{lipsum}
\usepackage[draft]{pgf}
\begin{document}
\lipsum[1-4]
\begin{figure}
\begin{pgfpicture}
\pgftext{\pgfimage[width=0.9\columnwidth,height=0.77\textheight]{}}
\end{pgfpicture}
\caption{
This is sample text and it sits inside the caption because lipsum will not
work there. This is sample text and it sits inside the caption because
lipsum will not work there. This is sample text and it sits inside the
caption because lipsum will not work there.
}
\end{figure}
\lipsum[1-3]
\end{document}
Increasing the figure height slightly, or adding another sentence to the caption, will cause TeX to send the entire figure (and all subsequent floats) to the end of the document – not even to a floats page.
For this situation:
- The
floatfix
class option does not seem to help. - Redefining
\renewcommand{\textfraction}{0.001}
, as suggested here, helps somewhat by extending the range of allowed heights, but not by enough for my figure. - Adding (a variable amount of) negative
vspace
at the end of the caption does help, but it feels horribly hackish.
Is there a cleaner way to solve this?
Best Answer
You could work out exactly which constraint is forcing the float to the next page, but such problems are exactly why
[!]
was added to LaTeX, just tell it to ignore the constraints here and the float stays on the first page.