# How to extract expanded equations that use commands? [duplicate]

I have a document with a lot of equations that use commands to maintain consistency. For example, it looks like this

\documentclass{article}
\usepackage{amsmath}

\newcommand{\numberOfDocuments}{\mathcal{N}}
\newcommand{\someSimpleCommand}{\mathcal{F}}
\newcommand{\someComplexCommand}[1]{\sum_{i = #1}^{#1+5} i}

\begin{document}

This is $\numberOfDocuments = 1$ document with equations
\begin{align}
\someSimpleCommand \approx \someComplexCommand{\numberOfDocuments}
\end{align}

\end{document}

In order to use the resulting equations for example at MathOverflow or other places where I can not provide a complex document, I want to extract the plain TeX equations like

\mathcal{N} = 1
\mathcal{F} \approx \sum_{i = \mathcal{N}}^{\mathcal{N}+5} i

Is there any way to do this? Is there maybe an intermediate step in the LaTeX compilation process that I could access? It does not really matter if I get the whole document with the expanded equations or only the equations itself.