1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<section output="pdf">
<title>Writing LaTeX Mathematical Equations</title>
<section>
<title>Presentation</title>
<para>DocBook doesn't define elements for writing mathematical equations. Only
few elements exist that tell how equation should be displayed (inlined,
block):</para>
<itemizedlist>
<listitem>
<para><sgmltag>inlineequation</sgmltag> tells that the equation is
inlined,</para>
</listitem>
<listitem>
<para><sgmltag>informalequation</sgmltag> tells that the equation is displayed
as a block, without a title.</para>
</listitem>
<listitem>
<para><sgmltag>equation</sgmltag> tells that the equation is displayed as a
block, with or without a title.</para>
</listitem>
</itemizedlist>
<para>These tags include a graphic (<sgmltag>graphic</sgmltag> or
<sgmltag>mediaobject</sgmltag>) or an alternative text equation, as shown by
the example.</para>
<example>
<title>Equation taken from TDG</title>
<programlisting>
<equation><title>Last Theorem of Fermat</title>
<alt>x^n + y^n &ne; z^n &forall; n &ne; 2</alt>
<graphic fileref="figures/fermat"></graphic>
</equation>
</programlisting>
</example>
</section>
<section>
<title>Implementation choice</title>
<para>The principle is to use only the <sgmltag>alt</sgmltag> element. If
initially <sgmltag>alt</sgmltag> contains actually the text to print, it is
chosen to use this element to embed LaTeX mathematical equations. This choice
has the following advantages:</para>
<itemizedlist>
<listitem>
<para>The translation done by dblatex is really easy, since the equation is
already written in LaTeX.</para>
</listitem>
<listitem>
<para>LaTeX is one of the best word processor to render mathematical
formulas.</para>
</listitem>
<listitem>
<para>One doesn't need to write the equations in MathML.</para>
</listitem>
<listitem>
<para>This method isn't specific to this tool (see the following
section).</para>
</listitem>
</itemizedlist>
<para>Besides, the implementation is as light as possible. This is why it is
up to the writer to properly use the mathematical delimiters ($, \(, \), \[,
\]). By this way the writer fully controls how he writes equations.</para>
</section>
<section>
<title>Compatibility</title>
<para>This implementation is not contradictory nor specific. In partticular,
the <ulink
url="http://ricardo.ecn.wfu.edu/~cottrell/dbtexmath/">DBTeXMath</ulink>
proposal to extend the DSSSL stylesheets used by jade follows the same
approach, and is integrated in the Norman Walsh XSL stylesheets.</para>
</section>
<section>
<title>Examples</title>
<para>The following examples show how to write the equations.</para>
<example>
<title>Inlined Equation</title>
<xi:include href="equation-eg1.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<programlisting><textobject><textdata fileref="math/equation-eg1.xml" /></textobject>
</programlisting>
</example>
<example>
<title>Equation in a block</title>
<xi:include href="equation-eg2.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<programlisting><textobject><textdata fileref="math/equation-eg2.xml" /></textobject>
</programlisting>
</example>
<example>
<title>Equation in a float</title>
<xi:include href="equation-eg3.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<programlisting><textobject><textdata fileref="math/equation-eg3.xml" /></textobject>
</programlisting>
</example>
<example>
<title>Equation without a title</title>
<xi:include href="equation-eg4.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<programlisting><textobject><textdata fileref="math/equation-eg4.xml" /></textobject>
</programlisting>
</example>
</section>
</section>
|