I want to suppress the page number on a specific page (not the title page) that has a box defined with mdframed, and then be able to refer to the suppressed page number. There is text on this page that is boxed (with mdframed) and I don't want this text to run into the pagenumber. The page numbers on subsequent pages would thus be as follows: 1, [suppressed], 3, ...
I would like to then write "as discussed in Box 1 (p. 2)". Unfortunately, if I put "\thispagestyle{empty}" anywhere within the mdframed, it suppresses the page number of the previous page instead (see MWE). If I put "\thispagestyle{empty}" just after the mdframed, it suppresses the page number of the next page instead. How can I suppress the page number of the page with the mdframed, to avoid the frame from colliding with the page number (and then refer to the suppressed page number with \pageref)?
MWE:
\documentclass{article}
\usepackage{lipsum}
\usepackage[framemethod=TikZ]{mdframed}
\newenvironment{Frame}[1][]{%
\begin{mdframed}[%
frametitle={#1},
skipabove=\baselineskip plus 2pt minus 1pt,
skipbelow=\baselineskip plus 2pt minus 1pt,
linewidth=0.5pt,
frametitlerule=true,
frametitlebackgroundcolor=gray!30
]%
}{%
\end{mdframed}
}
\begin{document}
Refer to box~1 (p.~\pageref{Box:TheBox}).
\begin{mdframed}[style=MyFrame,nobreak=true,align=center,userdefinedwidth=0.9\textwidth]{
\label{Box:TheBox}
\thispagestyle{empty}
\lipsum[1-5]
}
\end{mdframed}
\end{document}
\thispagestye{empty}
and then\label
and\pageref
as usual\thispagestyle{empty}
is the answer to the question as it appears in the title..