def flatten_latex_file(in_path, out_path): text = file_to_str(in_path) new_text = flatten_latex_str(text) str_to_file(new_text, out_path, do_not_overwrite=False)
def flatten_latex_str(text): return replace_command("input", lambda fname: flatten_latex_str(file_to_str(fname)), text)
def get_bibs_file(path): text = file_to_str(path) return get_bibs_str(text)