old-www/HOWTO/Linuxdoc-Reference-9.html

285 lines
9.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>Linuxdoc Reference: Mathematical Formulas</TITLE>
<LINK HREF="Linuxdoc-Reference-10.html" REL=next>
<LINK HREF="Linuxdoc-Reference-8.html" REL=previous>
<LINK HREF="Linuxdoc-Reference.html#toc9" REL=contents>
</HEAD>
<BODY>
<A HREF="Linuxdoc-Reference-10.html">Next</A>
<A HREF="Linuxdoc-Reference-8.html">Previous</A>
<A HREF="Linuxdoc-Reference.html#toc9">Contents</A>
<HR>
<H2><A NAME="formula"></A> <A NAME="s9">9. Mathematical Formulas</A></H2>
<P>They can appear with in the tags listed in table
<A HREF="#tmformula">Places of Mathematical Formulas</A><P>
<CENTER><TABLE BORDER><TR><TD>
<BR>
tag</TD><TD>description</TD><TD>see</TD></TR><TR><TD>
</TD></TR><TR><TD>
f</TD><TD>inline formula</TD><TD>
<A HREF="Linuxdoc-Reference-8.html#f">The Formula Tag</A></TD></TR><TR><TD>
dm</TD><TD>displayed formula</TD><TD>
<A HREF="Linuxdoc-Reference-7.html#mathpar">Mathematical Paragraph</A></TD></TR><TR><TD>
eq</TD><TD>equation</TD><TD>
<A HREF="Linuxdoc-Reference-7.html#mathpar">Mathematical Paragraph</A>
<CAPTION>Places of Mathematical Formulas
<A NAME="tmformula"></A> </CAPTION>
</TD></TR></TABLE></CENTER>
<P>If you view this document mapped to html you will notice that html has no
nice way of displaying mathematical formulas.
<P>After a little hand parsing the contents of a <EM>mathematical</EM> tag looks like:
<HR>
<PRE>
&lt;!element xx - -
(((fr|lim|ar|root) |
(pr|in|sum) |
(#pcdata|mc|(tu|phr)) |
(rf|v|fi) |
(unl|ovl|sup|inf))*)>
</PRE>
<HR>
The <CODE>xx</CODE> stands for <CODE>f</CODE>, <CODE>dm</CODE> or <CODE>eq</CODE>. All of them are the same.
<P>
<P>
<DL>
<DT><B>Note:</B><DD><P>Because neither Netscape nor Microsoft has seen any need
to add mathematical mappings to their browsers (like demanded and defined by
<EM>w3c</EM>), there is no nice way of mapping, or at least displaying the math
stuff in html. So if you view the online version, feel free to wonder what
nonsense this man is telling here. Might be you should take a glance at the
postscript version.
</DL>
<P>
<P>
<H2><A NAME="fr"></A> <A NAME="ss9.1">9.1 Fraction Tag</A>
</H2>
<P>
<HR>
<PRE>
&lt;!element fr - - (nu,de) >
&lt;!element nu o o ((%fbutxt;)*) >
&lt;!element de o o ((%fbutxt;)*) >
</PRE>
<HR>
<P>So what we see from it is, that a <EM>fraction</EM> consits of a <EM>numerator</EM>
and a <EM>denumerator</EM> tag, wich again each one can hold a
<EM>mathematical formula</EM>.
<P>I think an example will tell you more:
<PRE>
&lt;dm>&lt;fr>&lt;nu/7/&lt;de/13/&lt;/fr>&lt;/dm>
</PRE>
<P>results to:
<P>
<DM>
<FR><NU>7</NU><DE>13</DE></FR>
</DM>
<P>In case we want to to place 1/2 instead of the numerator without cleaning it
up, we'll type:
<P>
<PRE>
&lt;dm>&lt;fr>&lt;nu>&lt;fr>&lt;nu/1/&lt;de/2/&lt;/fr>&lt;/nu>&lt;de/13/&lt;/fr>&lt;/dm>
</PRE>
<P>Which results to:
<P>
<DM>
<FR><NU><FR><NU>1</NU><DE>2</DE></FR></NU><DE>13</DE></FR>
</DM>
<P>
<H2><A NAME="prinsum"></A> <A NAME="ss9.2">9.2 Product, Integral and Summation Tag</A>
</H2>
<P>
<HR>
<PRE>
&lt;!element pr - - (ll,ul,opd?) >
&lt;!element in - - (ll,ul,opd?) >
&lt;!element sum - - (ll,ul,opd?) >
</PRE>
<HR>
<P>Each of them has a <EM>lower limit</EM> (<CODE>ll</CODE> tag),
a <EM>upper limit</EM> (<CODE>ul</CODE> tag) and a optional <EM>operand</EM>,
where each of them again may consist of a formula.
The tags are same in syntax like shown in table
<A HREF="#tulllop">Tags with upper-, lower limit and operator</A>.
<P>
<CENTER><TABLE BORDER><TR><TD>
<BR>
name</TD><TD>example</TD><TD>result</TD></TR><TR><TD>
</TD></TR><TR><TD>
Product</TD><TD><CODE>&lt;f>y=&lt;pr>&lt;ll>i=1&lt;ul>n&lt;opd>x&lt;inf/i/&lt;/pr>&lt;/f></CODE></TD><TD>y=<PR><LL>i=1</LL><UL>n</UL><OPD>x<SUB>i</SUB></OPD></PR></TD></TR><TR><TD>
Integral</TD><TD><CODE>&lt;f>y=&lt;in>&lt;ll>a&lt;ul>b&lt;opd>x&lt;sup/2/&lt;/in>&lt;/f></CODE></TD><TD>y=<INT><LL>a</LL><UL>b</UL><OPD>x<SUP>2</SUP></OPD></INT></TD></TR><TR><TD>
Summation</TD><TD><CODE>&lt;f>y=&lt;sum>&lt;ll>i=1&lt;ul>n&lt;opd>x&lt;inf/i/&lt;/sum>&lt;/f></CODE></TD><TD>y=<SUM><LL>i=1</LL><UL>n</UL><OPD>x<SUB>i</SUB></OPD></SUM></TD></TR><TR><TD>
<CAPTION>Tags with upper-, lower limit and operator
<A NAME="tulllop"></A> </CAPTION>
</TD></TR></TABLE></CENTER>
<P>
<P>
<H2><A NAME="lim"></A> <A NAME="ss9.3">9.3 Limited Tag</A>
</H2>
<P>
<HR>
<PRE>
&lt;!element lim - - (op,ll,ul,opd?) >
&lt;!element op o o (%fcstxt;|rf|%fph;) -(tu) >
&lt;!element ll o o ((%fbutxt;)*) >
&lt;!element ul o o ((%fbutxt;)*) >
&lt;!element opd - o ((%fbutxt;)*) >
</PRE>
<HR>
<P>You can use that one for operators with upper and lower limits other than
products, sums or integrals. The for the other types defined <EM>operator</EM> is
destinied by the <CODE>op</CODE>tag, wich can contain again a mathematical formula.
<P>
<DM>
<LIM><OP>B</OP><LL>i=0</LL><UL>n</UL><OPD>x<SUB>i</SUB></OPD></LIM>
</DM>
<P>
<P>
<H2><A NAME="ar"></A> <A NAME="ss9.4">9.4 Array Tag</A>
</H2>
<P>
<HR>
<PRE>
&lt;!element ar - - (row, (arr, row)*) >
&lt;!attlist ar
ca cdata #required >
&lt;!element arr - o empty >
&lt;!element arc - o empty >
&lt;!entity arr "&lt;arr>" >
&lt;!entity arc "&lt;arc>" >
</PRE>
<HR>
Of course a reasonable mathematical document needs a way to describe arrays
and matrices.
The <EM>array</EM> (<CODE>ar</CODE>) is noted down equivalent to a <EM>tabular</EM> (see
section
<A HREF="Linuxdoc-Reference-7.html#tabular">The Tabular Tag</A>).
The differences in handling are:
<UL>
<LI>No <CODE>&lt;hline></CODE> tag.</LI>
<LI>The <CODE>ca</CODE> attribute character <CODE>|</CODE> is not allowd.</LI>
<LI>Columns are not separated by <CODE>colsep</CODE> tag but with the <CODE>arc</CODE> tag
(<EM>array collumn</EM>).</LI>
<LI>Rows are not separated by <CODE>rowsep</CODE> tag but with the <CODE>arr</CODE> tag
(<EM>array row</EM>).</LI>
</UL>
Again the characters <CODE>|</CODE> and <CODE>@</CODE> are mapped to the adequate separator
tag, so you really can note a array same way as a tabular.
<P>
<PRE>
&lt;dm>&lt;ar ca="clcr">
a+b+c | uv &lt;arc> x-y | 27 @
a+b | u+v | z | 134 &lt;arr>
a | 3u+vw | xyz | 2,978
&lt;/ar>&lt;/dm>
</PRE>
<P>Is mapped to:
<P>
<DM>
<AR>a+b+c <ARC>uv <ARC>x-y <ARC>27 <ARR>a+b <ARC>u+v <ARC>z <ARC>134 <ARR>a <ARC>3u+vw <ARC>xyz <ARC>2,978 </AR>
</DM>
<P>
<P>
<H2><A NAME="root"></A> <A NAME="ss9.5">9.5 Root Tag</A>
</H2>
<P>
<HR>
<PRE>
&lt;!element root - - ((%fbutxt;)*) >
&lt;!attlist root
n cdata "">
</PRE>
<HR>
The <EM>root</EM> is noted down by the <CODE>root</CODE> tag, wich contains a <CODE>n</CODE>
attribute, holding the value for the "n'th" root.
<P>
<PRE>
&lt;dm>&lt;root n="3"/x+y/&lt;/dm>
</PRE>
<P>is mapped to:
<P>
<DM>
<ROOT>x+y</ROOT>
</DM>
<P>
<P>
<H2><A NAME="fi"></A> <A NAME="ss9.6">9.6 Figure Tag</A>
</H2>
<P>
<HR>
<PRE>
&lt;!element fi - o (#pcdata) >
</PRE>
<HR>
<P>With the figure tag you can place mathematical figures. The tagged characters
are directly mapped to a mathematical figure. Which character is mapped to which
figure you'll find in
<A HREF="Linuxdoc-Reference-15.html#mflist">Mathematical Figures</A>.
<P>
<P>
<H2><A NAME="rf"></A> <A NAME="ss9.7">9.7 Realfont Tag</A>
</H2>
<P>
<HR>
<PRE>
&lt;!element rf - o (#pcdata) >
</PRE>
<HR>
This tag is placing a real font within a mathematical formula.
<BLOCKQUOTE>I'm really not sure about <CODE>rf</CODE>. What should it be?</BLOCKQUOTE>
No formula is allowed within that tag.
<P>
<PRE>
&lt;dm>&lt;rf/Binom:/ (a+b)&lt;sup/2/=a&lt;sup/2/+2ab+b&lt;sup/2/&lt;/dm>
</PRE>
<P>is mapped to:
<P>
<DM>
<RF>Binom:</RF> (a+b)<SUP>2</SUP>=a<SUP>2</SUP>+2ab+b<SUP>2</SUP>
</DM>
<P>
<P>
<H2><A NAME="omt"></A> <A NAME="ss9.8">9.8 Other Mathematical Tags</A>
</H2>
<P>The remaining tags simply modify the tagged formula, without implying any
other tag. The effect is shown in table
<A HREF="#tomt">Mathematical tags without included tags</A><P>
<CENTER><TABLE BORDER><TR><TD>
<BR>
name</TD><TD>tag</TD><TD>example</TD><TD>&nbsp;</TD><TD>result</TD></TR><TR><TD>
</TD></TR><TR><TD>
<EM>vector</EM></TD><TD><CODE>v</CODE></TD><TD><CODE>&lt;f>&lt;v/a/&amp;times;&lt;v/b/=&lt;v/0/&lt;/f></CODE></TD><TD>-&gt;</TD><TD><V>a</V>&times;<V>b</V>=<V>0</V> </TD></TR><TR><TD>
<EM>overline</EM></TD><TD><CODE>ovl</CODE></TD><TD><CODE>&lt;f>&lt;ovl/1+1/=&lt;ovl/2/&lt;/f></CODE></TD><TD>-&gt;</TD><TD><OVL>1+1</OVL>=<OVL>2</OVL></TD></TR><TR><TD>
<EM>underline</EM></TD><TD><CODE>unl</CODE></TD><TD><CODE>&lt;f>&lt;unl/1+1/=&lt;unl/2/&lt;/f></CODE></TD><TD>-&gt;</TD><TD><UNL>1+1</UNL>=<UNL>2</UNL></TD></TR><TR><TD>
<EM>superior</EM></TD><TD><CODE>sup</CODE></TD><TD><CODE>&lt;f>e=m&amp;times;c&lt;sup/2/&lt;/f></CODE></TD><TD>-&gt;</TD><TD>e=m&times;c<SUP>2</SUP></TD></TR><TR><TD>
<EM>inferior</EM></TD><TD><CODE>inf</CODE></TD><TD><CODE>&lt;f>x&lt;inf/i/:=2x&lt;inf/i-1/+3&lt;/f></CODE></TD><TD>-&gt;</TD><TD>x<SUB>i</SUB>:=2x<SUB>i-1</SUB>+3</TD></TR><TR><TD>
<CAPTION>Mathematical tags without included tags
<A NAME="tomt"></A> </CAPTION>
</TD></TR></TABLE></CENTER>
<P>
<HR>
<A HREF="Linuxdoc-Reference-10.html">Next</A>
<A HREF="Linuxdoc-Reference-8.html">Previous</A>
<A HREF="Linuxdoc-Reference.html#toc9">Contents</A>
</BODY>
</HTML>