# Remove beamer markup

I have a main.book.tex and a main.beamer.tex which then \input the same source files. In those source files, I have a lot of \mode<> designations and generally, a lot of beamer markup -\overlayarea's, \only<>'s, etc. My problem is that I also want to output to HTML. Now, tex4ht is generally awesome, generally plays nice with beamer and beamerarticle, and I've spend a lot of time customizing it to get it to do what I want. But, I'd like to try other conversion tools (e.g. pandoc) that can't handle beamer markup. Are there any good tools I could run my files through to remove the beamer markup? I've started writing a script to do this, but I thought maybe tex.sx already knows of such tools or has better ideas.

-

Candidates are sed (http://www.grymoire.com/Unix/Sed.html), Perl (perldoc.perl.org/perlre.html , perldoc.perl.org/perlretut.html), and Python (http://docs.python.org/2/library/re.html).
You can have these scripts run automatically if you incorporate calling them into an automated build system like make or SCons.