如何将 DVI 转为 tex?
知道如何获取 DVI 文件并将其转换为 tex 吗?
Any idea how to take DVI files and turn them into tex?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
知道如何获取 DVI 文件并将其转换为 tex 吗?
Any idea how to take DVI files and turn them into tex?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
这类似于将 PDF 转换为 XML 的问题,即“试图将汉堡变回牛”。 TeX→DVI 和 XML→PDF 都丢失了文档结构及其语义方面的信息。
它需要大量的启发式方法和大量的语料库来重新创建(部分)原始文档。它通常不是 100%。文本字符串可能是可能的,矢量更难。位图几乎是不可能的。
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.
你所问的是不可能的。我认为(与 PostScript 中相同)即使识别 DVI 文件中的单词也可能需要启发式方法。 DVI 文件是对在一张纸上放置各个字母的位置的描述,仅此而已。
您可以通过
dvi2tty
或运行dvips
后运行ps2ascii
来达到此目的,以提供最佳结果为准。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 runningdvips
followed byps2ascii
, whichever gives the best results.还有 catdvi、dvitype 和 dvi2tty,可从 ctan。
There's also catdvi, dvitype, and dvi2tty, available from ctan.
我很确定这是不可能的。 DVI 包含有关渲染页面的信息,而不包含它具有哪些 tex 命令。
I am pretty sure this is not possible. DVI contains informations about rendering the page and not which tex commands it has.
对于谁再次发现这个问题,或者对于所有回答我的人,我找到了最适合我的答案:
我正在寻找的是确实有多困难,它试图找出可以编译为给定DVI(或pdf,因为我可以轻松地将DVI转换为pdf)的原始tex。 InftyReader 做到了。它工作完美,我尝试了一堆 pdf 文件,然后将它们重新制作成 pdf 文件,非常完美!
for whom ever finds this question again, or for all you who answered I found the best answer for me:
what I was looking for is how indeed difficult, it's trying to figure out what could be an original tex that would compile to a given DVI (or pdf for that matter since i can turn the DVI into pdf easily). and InftyReader does it. it works prefect, i tried i a bunch of pdfs on it and then re-made them into pdfs and it was perfect!
阅读DVI 文件格式的说明并编写程序。您的程序的结果将不是原始文本,但它将是合适的。
Read Description of the DVI file format and write the programm. Result of your program will not be original text but it will be suitable.
呃,好吧,有点。
我认为阻力最小的路径将涉及 DVI->RTF 转换器。我发布了一个问题:Q#1859373 dvi2rtf:谁可以将 DVI 文件转换为 RTF。我在那里发布了一个未经测试的实现,它提供了一个糟糕的解决方案,丢弃了所有格式。
有了这样的东西,你就可以使用 word2007/8 和优秀的 docx2tex 实用程序将 rtf 转换为 tex。
结果读起来会很不愉快,但我可以看到一些这样做的用例。
Err, well, sort of.
The path of least resistance will involve, I think, a dvi->rtf convertor. I've posted a question: Q#1859373 dvi2rtf: who can convert DVI files to RTF. And there I post an untested implementation, which gives a bad solution that throws away all formatting.
With such a thing, then you could use word2007/8 and the excellent docx2tex utility to turn the rtf to tex.
The results would be unpleasant to read, but I can see some use cases for doing such.