Edit the text and make the input files so that they get generated by the script and then included into the text, rather than copy-pasted there.
Some renaming and other minor adjustments.