composing HTML documents with text + Maxima stuff



On 27-11-2013 19:44, Robert Dodier wrote:
> For code, looks like a simple <pre>...</pre> is enough, although I
> wouldn't mind colorization. Haven't figured that out.
Hi Robert,
I use LaTeX, rather than Texinfo, because I prefer the PDF files 
obtained with Pdflatex. In the preamble I define a verbatim environment 
called "maxima", where I put the maxima commands. I have written a 
couple of PHP scripts. The first one will find all the commands in the 
"maxima" environments, execute them with the current version of Maxima 
and put the update result into the .tex file, introducing some basic 
coloring.

I use the second script to transform the .tex file into an UTF8 file 
suitable for Mediawiki+Mathjax. I only have to do some minor adjustments 
before publishing the file in Mediawiki. You can see a simple example here:
http://def.fe.up.pt/pt/Equa%C3%A7%C3%B5es_diferenciais
At the top of the page there is a link to the PDF file created by Pdflatex.

For each figure I create a PDF and a PNG version, for Pdflatex and 
Mediawiki. The Mathjax in the HTML pages looks fine even in Android and 
the Raspberry Pi. The only problem is that with too many equations the 
browser takes a long time to process them. Therefore, my script will try 
automatically to convert equations into simple UTF8 HTML strings when 
possible. For instance, $x_1 \le y^2$ becomes <i>x</i><sub>1</sub> ? 
<i>y</i><sup>2</sup>.

If you're interested, I can send you my PHP scripts.
Regards,
Jaime