Updated the logic for the build script so it does not unnecessary mkdir the latex file path