latexpand
Simplify LaTeX source files by removing comments and resolving \includes, \inputs, etc. tldr-pages
On several platforms
Several platforms
Simplify the specified source file and save the result to the specified output file
latexpand --output path/to/output.tex path/to/file.texIdentifyDo not remove comments
latexpand --keep-comments --output path/to/output.tex path/to/file.texIdentifyDo not expand \includes, \inputs etc.
latexpand --keep-includes --output path/to/output.tex path/to/file.texIdentifyExpand \usepackages as far as the corresponding STY files can be found
latexpand --expand-usepackage --output path/to/output.tex path/to/file.texIdentifyInline the specified BBL file
latexpand --expand-bbl path/to/bibliography.bbl --output path/to/output.tex path/to/file.texIdentify