How to refer to a document variable in a field/formula

How do I refer to a document variable like ‘Page numbers’ in a formula for a field ?