How does one attach comments that don't appear in the document to a formula?
A comment begins with a double percent sign %%, and extends to the next line-end character (Enter key). Everything that lies in between is ignored and is not printed out. If there are percent signs in the text, they are treated as part of the text.
a^2+b^2=c^2 %% Pitagora teorēma.