2

Possible Duplicate:
How to convert PDF to (La)TeX?

is there a way to convert pdf to LaTeX? I don't need the conversion to be very accurate. It's fine for me as long as it is "almost there".

I found a project that looks promising http://sourceforge.net/projects/pdf2latex/ but there are no files there.

Thank you.

ceiling cat
  • 2,167
  • The pdf2latex project seems to be dead or better said a still birth: No files, no docs, no nothing, not on CVS or WWW, not now, not never. – Martin Scharrer Feb 07 '11 at 21:41
  • 1
    So why not trying PDF to TXT (pdftotext from Xpdf utils) then TXT to Markdown (with some manual edits or a ruby/python/perl script or whatever) and then pandoc? – chl Feb 07 '11 at 22:32
  • 1
    Yes I second pdftotext, then some tool (I hacked once a Perl script together to convert (start of line)1. Text into \chapter{Text} etc.). – Martin Scharrer Feb 07 '11 at 22:36
  • Sorry I didn't give enough details. It would be nice (although not essential) to be able to retain some formatting info. In particular, the pdf's that I am trying to convert has chunks of programming code scattered throughout the document and they are in monospace font. pdftotext converts the text but it doesn't preserve the typeface and I would have to write a script to try to detect the code. It would be much easier if a pdf-to-latex or pdf-to-txt tools can do this automatically. Thanks again. – ceiling cat Feb 07 '11 at 22:47
  • I don't think you will find a suitable tool. You will need to add special environments for this kind of code anyway. – Martin Scharrer Feb 07 '11 at 22:51
  • Did you try to open the pdf in OpenOffice and export it as TeX? I don't have OpenOffice installed, and I seem to remember that the TeX code it produced was sort of messy, but you may be able to do some search and replace afterwards. – Jan Hlavacek Feb 07 '11 at 23:11
  • @Jan: I just tried that. OO is open it in Draw, i.e. as image and only allows you to export it as such. I could get the LaTeX export plugin to work with it. But I might just have done something wrong. I normally never use OO. – Martin Scharrer Feb 07 '11 at 23:15
  • 1
    OO has LaTeX export? Do you mean the separate Writer2LaTeX? I'm not a fan. Abiword has both PDF import and a TeX export options, but I wouldn't expect too much. I frankly think your best option might be Open Office's PDF import, export to RTF, and then use rtf2latex2e. I guess xpdf's pdftohtml with pdfreflow along with an HTML>LaTeX converter might be something to look at too. – frabjous Feb 07 '11 at 23:26
  • LaTeXiT (http://pierre.chachatelier.fr/programmation/latexit_en.php) can convert pdfs that he has created. – PHL Feb 08 '11 at 17:37

0 Answers0