开发者

Extracting code from beamer presentation?

Some years ago I created a Beamer presentation (using only 开发者_如何学运维basic features). Unfortunetaly, I've lost the source code but still have the output PDF. Is there a convenient way to extract the original code from the presentation? Simple copy methods does not handle the mathematics well.


No, I don't think it is possible to do that. LaTeX is a typesetting language, in which you say "put a section here, this text here, some formulae here, etc., and use this style file to weight the fonts and spacing" and then compile it to PDF. The PDF document tells the PDF viewer (loosely speaking): "here's the font, place these sets of characters at these places in the document". It has no notion of section/heading/figure/equation/equation number etc.

It would be very hard to do PDF->LaTeX because of the multiple possibilities. i.e., LaTeX->PDF is a many-to-one function, so the inverse operation is going to have ambiguities.

For e.g., here's a test file using two different methods:

\documentclass{article}
\begin{document}
This is a StackOverflow test file.

\section{Method A}
\begin{equation}
  ax^2+bx+c=0
\end{equation}
\end{document}

Extracting code from beamer presentation?

\documentclass{article}
\begin{document}
This is a StackOverflow test file.\\[0.1in]

\noindent {\Large \textbf{1\quad  Method B}}
\begin{center}
$\displaystyle ax^2+bx+c=0$
\end{center}
\vspace{-0.25in}
\hfill{(1)}
\end{document}

Extracting code from beamer presentation?

You can see that you can't tell the two documents apart. A PDF to LaTeX converter will face the same problems.

That said, some word processing applications (open office?) can interpret PDF documents (usually only if all text) and convert it to a word document, and then you can convert that into LaTeX (usually provided by the same application). This might be one option worth trying. Other than that, there is no software that I know of that will do this for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜