I am writing a math paper with a large number of theorems. I'm looking to have a table summarizing my results, and I'd love it if the table could be generated automatically from my paper. I' looking to be able to do something like this
\begin{thm}
\shortTheorem{$x + y = y + x$}
Let $x,y$ be integers. Then $x+y=y+x$.
\end{thm}
Note that shortTheorem is just the name I made up for whatever tag I put my desired text into.
Then, later on, I want to have a table which, for each theorem I define, prints its "shortTheorem" contents. i.e.
- x + y = y + x
Are there existing packages to do this? If not, how would I go about writing my own macro to do so?
(Note: I couldn't figure out if there was a way to actually render a LaTeX table in my question, feel free to edit if you know how.)