Álvaro Tejero Cantero Flattening macros. Sometimes it's annoying the fact that once you have written a macro, you can't touch at it's "constant parts". I call flattening to the process of substituting all macros with LaTeX code. Task: designing a macro substitution system that reads from a file (possibly the same file as the document's) the macros and parses the document doing the appropriate replacements This is very useful, because sometimes you have a big expression in a macro and you want to change an index only. What do you do then?. You retype everything (perhaps several times in the document) or you create extremely generic and parametrizable macros that aren't very fast to fill in the majority of cases.