Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to turn a DVI to tex?

Tags:

latex

dvi-tex

Any idea how to take DVI files and turn them into tex?

like image 941
jarer Avatar asked Oct 25 '09 19:10

jarer


2 Answers

This is similar to the problem of turning PDF into XML which is referred to as "trying to turn a hamburger back into a cow". Both TeX->DVI and XML->PDF lose information, both in the structure of the document and its semantics.

It requires a great deal of heuristics and a large corpus to recreate (some of) the original document. It is never usually 100%. The text strings may be possible, the vectors are harder. Bitmaps are almost impossible.

like image 106
peter.murray.rust Avatar answered Oct 05 '22 10:10

peter.murray.rust


What you are asking is not possible. I think that (same as in PostScript) even recognizing words in a DVI files may require heuristics. A DVI file is a description of where to place individual letters on a piece of paper, and nothing more.

You can get partway there by either dvi2tty, or by running dvips followed by ps2ascii, whichever gives the best results.

like image 41
Pascal Cuoq Avatar answered Oct 05 '22 11:10

Pascal Cuoq