[tex4ht] tex4ht latex beamer mathml converting (Ubuntu, PHP)

Ivan Ermilov earthquakesan at gmail.com
Thu Jan 5 16:05:49 CET 2012


Dear tex4ht community,

I am one of the developers of the SlideWiki
Project<http://slidewiki.aksw.org/>.
In particular I am working on converting data from different sources (e.g.
Powerpoint, deck.js, LaTeX beamer) to the our MySQL database schema.
Without getting too deep into details, I will describe my problem and what
I managed to achieve up to the point and what I want to achieve. I hope,
that somebody know the solution or can give me some directions. Please,
read this e-mail -)

On the input we have got an .tex file, that uses beamer documentclass. On
the output I want to get a .html file with custom tags around the
enviroments (see the example below to understand, what I meant by this).
Also I want to distinguish slides from each other and to leave the LaTeX
math alone (i.e. math must not be converted at all). For instance the text
in “equation” enviroment must not be parsed nor by tex4ht, nor by LaTeX at
all:
*\begin{equation}
\left[
{\bf X} + {\rm a} \ \geq\
\underline{\hat a} \sum_i^N \lim_{x \rightarrow k} \delta C
\right]
\end{equation}*

To illustrate the problem I will provide a complete example .tex file and
illustrate the output I want to get with the tex4ht program. Input .tex
file:

\documentclass{beamer}

\mode<presentation>
{
 \usetheme{Warsaw}
 \setbeamercovered{transparent}
}

\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}

\title[Short Paper Title]
{Title As It Is In the Proceedings}

\subtitle
{Include Only If Paper Has a Subtitle}

\author[Author, Another]
{F.~Author\inst{1} \and S.~Another\inst{2}}

\institute[Universities of Somewhere and Elsewhere]
{
 \inst{1}%
 Department of Computer Science\\
 University of Somewhere
 \and
 \inst{2}%
 Department of Theoretical Philosophy\\
 University of Elsewhere}
\date[CFP 2003]
{Conference on Fabulous Presentations, 2003}

\subject{Theoretical Computer Science}

\begin{document}

\begin{frame}
 \titlepage
\end{frame}

\begin{frame}{Outline}
   $z=\sqrt{x^2+y^2}$
\end{frame}

\begin{frame}{Make Titles Informative. Use Uppercase Letters.}{Subtitles
are optional.}
   \[
       \forall x \in X, \quad \exists y \leq \epsilon
   \]
\end{frame}

\end{document}

I tested this document on Ubuntu with “pdflatex file.tex” command (or “sudo
pdflatex file.tex”). Everything is fine here.
In this document we’ve got three slides (one title slide and two slides
with math). I want math to stay the same in the .html output. For example,
for the second slide:
<div class=”frame” id=“outline”>$z=\sqrt{x^2+y^2}$</div>
For the third slide:
<div class=”frame” id=”make_titles”>\[ \forall x \in X, \quad \exists y
\leq \epsilon \]</div>

We write out project in PHP, so I wrote a simple .php script to do all the
work (I have not achieved a satisfactory result yet). First of all, I put
the \nonstopmode in the beginning of .tex file. Then I load the
slidewiki.cfg file:
\Preamble{0.0}
\begin{document}
\EndPreamble
And edit this file options (right now, it has only one option 0.0 - I found
out that I can put more options by dividing them with comma - 0.0,
mathml.4ht, html4.4ht etc). Though, I only know that I can define
package_name.4ht or hooks options - I could not find the complete list of
options elsewhere on the web. Please, point me the location, if it exists.
After this I simply call system("mk4ht htlatex $tex_filename \"slidewiki\"
");
Everything works fine with 0.0 option, i.e. when we are not using any .4ht
packages. But in this case on the output I have a plain text file and
processed math. I can solve the problem of dividing slides by providing
“hooks” option (as was suggested in the "Latex web companion" book) and
then configuring “newpage” hook to be the slide beginning, but I don’t get
how to prevent processing of the math.
If I provide options html4.4ht or mathml.4ht - I’ve got too many errors and
no .html output at all. Please, give some guidance - I tried to google for
the documentation and still no luck. I really want to know all the options
available and how can I tweak the behaviour of the hook appearance and
preventing math processing (mathml is okay too). What do I need to know to
tweak the tex4ht behaviour? Where do I need to look (for instance, in the
.4ht files) and how should I do this? I will be very grateful for any
information sources.

Best regards,
Ermilov Ivan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tex4ht/attachments/20120105/48856dce/attachment-0001.html>


More information about the tex4ht mailing list