Have text continue “behind” a minipage that’s on its own page

minipage

What I'm after is a way to get the following:

  • Page n: text…reference to content of minipage…text to end of page
  • Page n+1: minipage only
  • Page n+2: text continues from end of page n

without having to manually position and reposition the minipage within the .tex document. That is, the order of the relevant content of the .tex document should be:

  1. (text)
  2. (reference to content of minipage)
  3. (minipage content)
  4. (text to end of page)
  5. (text continues etc.)

Is there a way to do this, perhaps with something other than minipage?

Edit: Here is code that does not work:

This text is on page n. There will be a minipage on the next page.

\newpage
\begin{minipage}{\textwidth}
This is my minipage on its own page.
\end{minipage}
\newpage

This text is on the wrong page. 
It should follow the sentence ``There will be a minipage on the next page."

Best Answer

This solution uses the afterpage package.

\documentclass{article}
\usepackage{afterpage}
\usepackage{lipsum}

\begin{document}
\afterpage{\begin{minipage}[c][\textheight][c]{\textwidth}
  \centering\fbox{Minipage contents}
\end{minipage}}

\lipsum[1-8]
\end{document}