def write_tex():
datadir = livvkit.index_dir<EOL>outdir = os.path.join(datadir, "<STR_LIT>")<EOL>print(outdir)<EOL>data_files = glob.glob(datadir + "<STR_LIT>", recursive=True)<EOL>for each in data_files:<EOL><INDENT>data = functions.read_json(each)<EOL>tex = translate_page(data)<EOL>outfile = os.path.join(outdir, os.path.basename(each).replace('<STR_LIT>', '<STR_LIT>'))<EOL>with open(outfile, '<STR_LIT:w>') as f:<EOL><INDENT>f.write(tex)<EOL><DEDENT><DEDENT>
Finds all of the output data files, and writes them out to .tex