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