<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: formulatex.xml 78 2006-08-14 04:07:27Z dret $ -->
<!-- Formulatex documentation (written in XSLidy), please visit http://dret.net/projects/xslidy/formulatex for more information. -->
<?xslidy extension-file="html" ?>
<?xslidy extension-link="" ?>
<?xslidy outline-class="slanty" ?>
<?xslidy outline-title="Outline" ?>
<?xslidy outlink-mark="a" ?>
<?xslidy outlink-prefix="↗ " ?>
<?xslidy part-slide-count="all" ?>
<?xslidy part-slide-text=" (*)" ?>
<?xslidy slidy-prefix="slidy/" ?>
<?xslidy style-uri="slidy-ethz/eth-layout.css" ?>
<xslidy version="0.5" xmlns="http://dret.net/xmlns/xslidy/1">
	<title short="FormuLaTeX">FormuLaTeX – LaTeX in XSLidy</title>
    <author short="Ph. Cattin &amp; E. Wilde &amp;"><a
href="http://www.vision.ee.ethz.ch/~pcattin/">Philippe Cattin</a>, <a href="http://dret.net/netdret/">Erik Wilde</a></author>
    <affiliation short="ETHZ"><a href="http://www.ethz.ch/">ETH Zürich</a></affiliation>
    <date short="07/2006">July 2006</date>
    <layout src="slidy-ethz/eth-layout.xml"/>
    <presentation id="formulatex" cover="eth-title">
        <title short="Introduction">FormuLaTeX Introduction</title>
        <part id="motivation">
	        <title>Motivation</title>
            <slide>
                <title>FormuLaTeX</title>
				<list>
					<li>For many scientific presentations and lectures a means to render formulas is required</li>
					<li>FormuLaTeX is what <a
href="http://texpoint.necula.org/">TeXPoint</a> is for <a href="http://office.microsoft.com/powerpoint/">PowerPoint</a> and <a
href="http://ooolatex.sourceforge.net/">OOoLatex</a> for <a href="http://www.openoffice.org/">OpenOffice</a> but only better</li>
					<li>It allows you to easily integrate <tex>\LaTeX</tex>-formulas or LaTeX snippets into any xslidy presentation</li>
					<li>FormuLaTeX uses the powerfull and flexible extension mechanism of xslidy</li>
				</list>
            </slide>
            <slide>
				<title>Advantages of FormuLaTeX</title>
				<list>
					<li>You can use all the power of <tex>\LaTeX</tex> in your xslidy presentations</li>
					<li>FormuLaTeX scales the formulas and adjusts the baseline automatically and transparently for the user</li>
					<li>The formulas, such as <tex>$y=x^2$</tex>, are dynamically rescaled with the font size</li>
					<li>Multiple occurances of the same <tex>\LaTeX</tex> content such as <tex>$x$</tex> and <tex>$x$</tex> are transparently collapsed to one single PNG/GIF image</li>
					<li>FormuLaTeX renders PNG/GIF images of the <tex>\LaTeX</tex> content with transparency set correctly</li>
					<li>FormuLaTeX uses a sophisticated caching mechanism to avoid the regeneration of already processed formulas</li>
				</list>
			</slide>
			<slide>
				<title>Disadvantages of FormuLaTeX</title>
				<list>
					<li>Some characters in the <tex>LaTeX</tex> code have to be escaped as to not interfere with XML, e.g.   &amp; has to be replaced by &amp;amp; and &lt;&gt; by &amp;lt; and &amp;gt; respectively</li>
					<li>FormuLaTeX is a 3-pass process</li>
						<list type="ol">
							<li>extender.xsl: pass generates the .html files as well as the .tex files with the formulas</li>
							<li>formulatex.pl: generates the PNG/GIF files for all the formulas as well as the scaling and baseline information (.sex files)</li>
							<li>extender.xsl: the second pass re-generates the html files with the correct scaling and baseline information</li>
						</list>
					<li>FormuLaTeX requires perl, perl-magick, ghostscript and a working <tex>\LaTeX</tex> installation</li>
				</list>
			</slide>
        </part>

		<part id="solution">
			<title>Using FormuLaTeX</title>
            <slide>
				<title>Syntax</title>
				The simple syntax of the FormuLaTeX extension:
				<pre>&lt;tex pkg=""&gt;LaTeX-Code&lt;/tex&gt;</pre>
				<list>
					<li>The optional <tt>pkg=""</tt> attribute contains a comma separated list of packages that are required to process the <tex>\LaTeX</tex> content</li>
					<li>The <tex>\LaTeX</tex>-Code can be anything from single letters to complex formulas</li>
					<li>Ampersands <tt>&amp;</tt> in the <tex>\LaTeX</tex> syntax must be replaced by <tt>&amp;amp;</tt> </li>
					<li><tt>&lt;</tt> and <tt>&gt;</tt> must be replaced by <tt>&amp;lt;</tt> and <tt>&amp;gt;</tt> respectively</li>
				</list>
			</slide>
			<slide>
                <title>Entering LaTeX Code</title>
            	Using FormuLaTeX is very easy. The following code snippet
				<pre>&lt;tex&gt;$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$&lt;/tex&gt;</pre>
				for example yields a detailed <tex>\LaTeX</tex> rendering of the<br/>
				<p>Quadratic equation: <tex>$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$</tex></p>
				You don't have to fuzz around with scaling and positioning the image correctly. FormuLaTex scales the formulas correctly and even handles the baseline settings fully automatically, so that <tex>$x$</tex> and <tex>$y$</tex> appear properly aligned.
			</slide>
        </part>
		<part>
			<title>Samples</title>
			<slide>
				<title>Example 1 with Changing Font Size</title>
				<span style="font-size:16pt">As the equation height is bound to the height of the letter 'x', the size of the equations changes with font size:</span>
				<list>
					<li style="font-size:16pt;">16pt: <tex>$y=x^2$</tex></li>
					<li style="font-size:24pt;">24pt: <tex>$y=x^2$</tex></li>
					<li style="font-size:32pt;">32pt: <tex>$y=x^2$</tex></li>
					<li style="font-size:48pt;">48pt: <tex>$y=x^2$</tex></li>
				</list>
			</slide>
			<slide>
				<title>Example 2 with Packages and Special Characters</title>
				The following code snippet
				<pre>&lt;tex pkg="amsmath"&gt;$f(x,y)=\begin{bmatrix}
f(0,0) &amp; f(0,1) &amp; \cdots &amp; f(0,M-1)\\
f(1,0) &amp; \ddots &amp;        &amp; f(1,M-1)\\
\vdots &amp;        &amp; \ddots &amp; \vdots\\
f(N-1,0) &amp; f(N-1,1) &amp; \cdots &amp; f(N-1,M-1)\\
\end{bmatrix}$&lt;/tex&gt;</pre>
				is rendered as<br/>
				<tex pkg="amsmath">$f(x,y)=\begin{bmatrix}
					f(0,0) &amp; f(0,1) &amp; \cdots &amp; f(0,M-1)\\
					f(1,0) &amp; \ddots &amp;        &amp; f(1,M-1)\\
					\vdots &amp;        &amp; \ddots &amp; \vdots\\
					f(N-1,0) &amp; f(N-1,1) &amp; \cdots &amp; f(N-1,M-1)\\
					\end{bmatrix}$</tex>
			</slide>
			<slide class="outline">
				<title>Example 3 with Background</title>
				<span style="background-color:yellow">
					<p>
						As the generated PNG/GIF images use transparency, there is no problem with potential background colours and background images.
					</p>
					<p style="font-size:32pt;">
						<tex>$s=\int_0^{n}\frac{1}{x}dx$</tex>
					</p>
					<p>The faint background image can be clearly seen behind the formula.</p>
				</span>
			</slide>
			<slide >
				<title>Example 4 Colour</title>
				<p>The formulatex can even generate GIF/PNG images using colour.</p>
<pre>&lt;tex pkg="color"&gt;\[{\cal F}\{f(x,y)\}=F(u,v)=\color{red}\frac{1}{N}\color{black}\sum_{x=0}^{N-1}\sum_{y=0}^{N-1}f(x,y)e^{-\mbox{j} 2\pi (ux+vy/N)}\]&lt;/tex&gt;</pre>
                                <p><tex pkg="color">\[{\cal F}\{f(x,y)\}=F(u,v)=\color{red}\frac{1}{N}\color{black}\sum_{x=0}^{N-1}\sum_{y=0}^{N-1}f(x,y)e^{-\mbox{j} 2\pi (ux+vy/N)}\]</tex></p>
			</slide>
		</part>
		<part>
			<title>Installation</title>
			<slide>
				<title>Installation</title>
				Installation is pretty simple
				<list>
					<li>Copy the <tt>extender.xsl</tt> into
your top-level directory and unzip formulatex (see this documentation for an example).</li>
					<li>Verify, that all the prerequisites for <tt>formulatex.pl</tt> are installed:</li>
					<list>
						<li>A working <tex>\LaTeX</tex> installation</li>
						<li>Perl with the modules Image::Magick, Digest::MD5, and Files::Copy</li>
						<li>ghostscript</li>
					</list>
				</list>
			</slide>
			<slide>
				<title>Processing FormuLaTeX Presentations</title>
				The following commands show how to generated the documentation for the formulatex documentation:
				<list type="ol">
					<li>saxon formulatex.xml extender.xsl</li>
					<li>formulatex/formulatex.pl</li>
					<li>saxon formulatex.xml extender.xsl</li>
				</list>
			</slide>
		</part>
	</presentation>
</xslidy>

