You change the signatures of some functions (makeXXXFile), and by doing this the name of the function is now "meaningless".makeXxxxFile(ostream & os, ...) is not making a file anymore, is is just outputting to a stream. IMO the names of these functions should change as well.
This is what makeLatexFile is doing.... Do you want to change the name of those functions as well? Any suggestion? Bo