I like the solution + implementation, but I'm hanging on the naming of variables a bit. E.g. I'd expect TBIL.typeset_trigpowers to return a string or LatexExpr. Since I think you have another PR depending on this, I'll do the renaming in a separate PR.
Originally posted by @StevenClontz in #829 (comment)