You could just use the latex source code of the paper in the context window if you want it to be aware of the math. You can download latex source for any paper or arxiv.
If you have many papers, perhaps upload the latex source code of all of them into some vector database like pinecone and use them with LangChain for retrieval.