In my document I have two labeled formulas that I want to refer to elsewhere using a pageref. Since my text is likely to change in the future, I do not know yet whether or not the formulas will be on the same page.
Ideally, I would want my pageref to be such that if they are both on the same page, the text would read:
"... the formulas on page 5 ..."
If the second formula falls onto the second page, I would like it to read:
"... the formulas on pages 5 and 6 ..."
Of course, it would look stupid if it read "... the formulas on pages 5 and 5 ..."

To provide a minimal working example of what I mean:
Code: Select all
\documentclass{article}
\begin{document}
Two formula's:
\label{f1} The first formula
\label{f2} The second formula
A lot of other text here.
% code that facilitates the following:
% The formulas on page(s) \pageref{f1} (and \pageref{f2}) ...
\end{document}
