Blame docs/math/alttex.xml

Packit Service 76cb02
Packit Service 76cb02
Packit Service 76cb02
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
Packit Service 76cb02
<section output="manual">
Packit Service 76cb02
<title>Writing LaTeX Mathematical Equations</title>
Packit Service 76cb02
Packit Service 76cb02
<section>
Packit Service 76cb02
<title>Presentation</title>
Packit Service 76cb02
Packit Service 76cb02
<para>DocBook doesn't define elements for writing mathematical equations. Only
Packit Service 76cb02
few elements exist that tell how equation should be displayed (inlined,
Packit Service 76cb02
block):</para>
Packit Service 76cb02
Packit Service 76cb02
<itemizedlist>
Packit Service 76cb02
<listitem>
Packit Service 76cb02
<para><sgmltag>inlineequation</sgmltag> tells that the equation is
Packit Service 76cb02
inlined,</para>
Packit Service 76cb02
</listitem>
Packit Service 76cb02
Packit Service 76cb02
<listitem>
Packit Service 76cb02
<para><sgmltag>informalequation</sgmltag> tells that the equation is displayed
Packit Service 76cb02
as a block, without a title.</para>
Packit Service 76cb02
</listitem>
Packit Service 76cb02
Packit Service 76cb02
<listitem>
Packit Service 76cb02
<para><sgmltag>equation</sgmltag> tells that the equation is displayed as a
Packit Service 76cb02
block, with or without a title.</para>
Packit Service 76cb02
</listitem>
Packit Service 76cb02
</itemizedlist>
Packit Service 76cb02
Packit Service 76cb02
<para>These tags include a graphic (<sgmltag>graphic</sgmltag> or
Packit Service 76cb02
<sgmltag>mediaobject</sgmltag>) or an alternative text equation, as shown by
Packit Service 76cb02
the example.</para>
Packit Service 76cb02
Packit Service 76cb02
<example>
Packit Service 76cb02
<title>Equation taken from TDG</title>
Packit Service 76cb02
Packit Service 76cb02
<programlisting>
Packit Service 76cb02
<equation><title>Last Theorem of Fermat</title> 
Packit Service 76cb02
  <alt>x^n + y^n &ne; z^n &forall; n &ne; 2</alt>
Packit Service 76cb02
  <graphic fileref="figures/fermat"></graphic>
Packit Service 76cb02
</equation>
Packit Service 76cb02
   </programlisting>
Packit Service 76cb02
</example>
Packit Service 76cb02
</section>
Packit Service 76cb02
Packit Service 76cb02
<section>
Packit Service 76cb02
<title>Implementation choice</title>
Packit Service 76cb02
Packit Service 76cb02
<para>The principle is to use only the <sgmltag>alt</sgmltag> element. If
Packit Service 76cb02
initially <sgmltag>alt</sgmltag> contains actually the text to print, it is
Packit Service 76cb02
chosen to use this element to embed LaTeX mathematical equations. This choice
Packit Service 76cb02
has the following advantages:</para>
Packit Service 76cb02
Packit Service 76cb02
<itemizedlist>
Packit Service 76cb02
<listitem>
Packit Service 76cb02
<para>The translation done by dblatex is really easy, since the equation is
Packit Service 76cb02
already written in LaTeX.</para>
Packit Service 76cb02
</listitem>
Packit Service 76cb02
Packit Service 76cb02
<listitem>
Packit Service 76cb02
<para>LaTeX is one of the best word processor to render mathematical
Packit Service 76cb02
formulas.</para>
Packit Service 76cb02
</listitem>
Packit Service 76cb02
Packit Service 76cb02
<listitem>
Packit Service 76cb02
<para>One doesn't need to write the equations in MathML.</para>
Packit Service 76cb02
</listitem>
Packit Service 76cb02
Packit Service 76cb02
<listitem>
Packit Service 76cb02
<para>This method isn't specific to this tool (see the following
Packit Service 76cb02
section).</para>
Packit Service 76cb02
</listitem>
Packit Service 76cb02
</itemizedlist>
Packit Service 76cb02
Packit Service 76cb02
</section>
Packit Service 76cb02
Packit Service 76cb02
<section id="sec-alttex-delimiters">
Packit Service 76cb02
<title>Mathematical Delimiters</title>
Packit Service 76cb02
Packit Service 76cb02
<para>The dblatex implementation is as light as possible. This is why it is
Packit Service 76cb02
up to the writer to properly use the mathematical delimiters ($, \(, \), \[,
Packit Service 76cb02
\]). By this way the writer fully controls how he writes equations.</para>
Packit Service 76cb02
Packit Service 76cb02
<para id="pi-texmath-user">By default <command>dblatex</command> checks that
Packit Service 76cb02
consistent mathematical
Packit Service 76cb02
delimiters or environment are used in <sgmltag>alt</sgmltag> and it inserts the
Packit Service 76cb02
default math mode delimiters if dblatex thinks they are missing, but
Packit Service 76cb02
you can ask dblatex to write directly the <sgmltag>alt</sgmltag> content 
Packit Service 76cb02
without any action. To do this, use the <literal>texmath</literal> Processing 
Packit Service 76cb02
Instruction with <literal>delimiters</literal> set to 'user'.</para>
Packit Service 76cb02
Packit Service 76cb02
<para>For example, <xref linkend="eq-with-texmath-pi"/> has user specific
Packit Service 76cb02
delimiters:</para>
Packit Service 76cb02
Packit Service 76cb02
<example id="eq-with-texmath-pi">
Packit Service 76cb02
<title>Equation with user delimiters</title>
Packit Service 76cb02
<xi:include href="equation-eg5.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
Packit Service 76cb02
<para>In the XML source this equation uses a specific <literal>align*</literal> environment and the <literal>texmath</literal> PI to let the equation as is:</para>
Packit Service 76cb02
<programlisting>
Packit Service 76cb02
Packit Service 76cb02
            parse="text"/> </programlisting>
Packit Service 76cb02
</example>
Packit Service 76cb02
Packit Service 76cb02
</section>
Packit Service 76cb02
Packit Service 76cb02
<section>
Packit Service 76cb02
<title>Compatibility</title>
Packit Service 76cb02
Packit Service 76cb02
<para>This implementation is not contradictory nor specific. In particular,
Packit Service 76cb02
the 
Packit Service 76cb02
url="http://ricardo.ecn.wfu.edu/~cottrell/dbtexmath/">DBTeXMath</ulink>
Packit Service 76cb02
proposal to extend the DSSSL stylesheets used by jade follows the same
Packit Service 76cb02
approach, and is integrated in the Norman Walsh XSL stylesheets.</para>
Packit Service 76cb02
</section>
Packit Service 76cb02
Packit Service 76cb02
<section>
Packit Service 76cb02
<title>Examples</title>
Packit Service 76cb02
Packit Service 76cb02
<para>The following examples show how to write the equations.</para>
Packit Service 76cb02
Packit Service 76cb02
<example>
Packit Service 76cb02
<title>Inlined Equation</title>
Packit Service 76cb02
Packit Service 76cb02
<xi:include href="equation-eg1.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
Packit Service 76cb02
Packit Service 76cb02
<programlisting>
Packit Service 76cb02
Packit Service 76cb02
            parse="text"/>
Packit Service 76cb02
</programlisting>
Packit Service 76cb02
</example>
Packit Service 76cb02
Packit Service 76cb02
<example>
Packit Service 76cb02
<title>Equation in a block</title>
Packit Service 76cb02
Packit Service 76cb02
<xi:include href="equation-eg2.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
Packit Service 76cb02
Packit Service 76cb02
<programlisting>
Packit Service 76cb02
Packit Service 76cb02
            parse="text"/>
Packit Service 76cb02
</programlisting>
Packit Service 76cb02
</example>
Packit Service 76cb02
Packit Service 76cb02
<example>
Packit Service 76cb02
<title>Equation in a float</title>
Packit Service 76cb02
Packit Service 76cb02
<xi:include href="equation-eg3.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
Packit Service 76cb02
Packit Service 76cb02
<programlisting>
Packit Service 76cb02
Packit Service 76cb02
            parse="text"/>
Packit Service 76cb02
</programlisting>
Packit Service 76cb02
</example>
Packit Service 76cb02
Packit Service 76cb02
<example>
Packit Service 76cb02
<title>Equation without a title</title>
Packit Service 76cb02
Packit Service 76cb02
<xi:include href="equation-eg4.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
Packit Service 76cb02
Packit Service 76cb02
<programlisting>
Packit Service 76cb02
Packit Service 76cb02
            parse="text"/>
Packit Service 76cb02
</programlisting>
Packit Service 76cb02
</example>
Packit Service 76cb02
</section>
Packit Service 76cb02
</section>