from tex import tex, plain document = 'My beautiful \\TeX\ document.\n' (dvi, log) = tex(plain, document)