# source:spip-zone/_plugins_/_test_/jsMath/jsMath/test/sample.html@22697

Last change on this file since 22697 was 22697, checked in by vbeffara+ml@…, 13 years ago

Mise à jour (jsMath 3.6) pour avoir les numéros d'équations

File size: 6.5 KB
Line
1<HTML>
3<TITLE>jsMath (Test):  jsMath Sample Page</TITLE>
5<!--
6 | -----------------------------------------------------------
7 | The following line loads and initializes jsMath.
8 | You may need to edit the load.js file to set the
9 | root URL for your site before this file will
10 | display properly
11 | -----------------------------------------------------------
12-->
15<BODY>
16
17<!--
18 | -----------------------------------------------------------
19 | Include this NOSCRIPT block to inform users that JavaScript
20 | is required if they don't have it enabled.
21 | -----------------------------------------------------------
22-->
23<NOSCRIPT>
24<DIV STYLE="color:#CC0000; text-align:center">
25<B>Warning: <A HREF="http://www.math.union.edu/locate/jsMath">jsMath</A>
27If your browser supports JavaScript, be sure it is enabled.<B>
28</DIV>
29<HR>
30</NOSCRIPT>
31
32<BLOCKQUOTE>
33
34<H1>jsMath Sample Page</H1>
35
36This is a sample file showing you how to use jsMath to display mathematics
37in your web pages.  Be sure you have followed the <A
38HREF="http://www.math.union.edu/locate/jsMath/authors/installation.html">installation
39instructions</A> before loading this file.  Also, you may need to edit the
40<CODE>jsMath/easy/load.js</CODE> file to set the root URL for where jsMath
41can be found on your web site.  The rest of this document gives examples of
42how to enter mathematics in your pages.  Depending on the settings in
43<CODE>jsMath/easy/load.js</CODE>, not all of the mathematics below will be
44processed by jsMath.  Experiment with the settings in that file to see how
45they work.
46<p>
47
48<HR>
49<p>
50
51<H2>Some mathematics using <CODE>tex2math</CODE></H2>
52
53The easiest way to enter mathematics is to use jsMath's <A
54HREF="http://www.math.union.edu/locate/jsMath/authors/tex2math.html">tex2math</A>
55plugin to identify the mathematics in your document by looking for <SPAN
56class="math">\rm\TeX</SPAN>-like math delimiters.  Here are some math
57equations using those markers.  Some inline math: $\sqrt{1-x^2}$ or $$ax^2+bx+c$$,
58and some displayed math:
59$$\int {1\over x}\,dx = \ln(x)+C$$
60and
61$\sum_{i=1}^n i = {n(n+1)\over 2}.$
62Note that the first of these will not be processed unless you have enabled
64which is disabled by default.  That is because a single dollar sign can
65appear in normal text (as in "That will cost from <SPAN>$</SPAN>3.50 to 66<SPAN>$</SPAN>5.00 to repair"), and you don't want jsMath to try to typeset
67the "3.50 to " as mathematics.
68<p>
69
70If you enable <CODE>processSingleDollars</CODE>, you might also want to
71enable <CODE>fixEscapedDollars</CODE>, so that it is possible to enter
72dollar signs by preceding them with a backslash.  Here's one that you can
73use to see the results of these settings:  \$(an escaped dollar) and$x+1$74(not escaped). 75<p> 76 77It is also possible to use your own custom delimiters for marking the 78mathematics within your pages. If you uncomment the <CODE>customDelimiters</CODE> 79array in <CODE>jsMath/easy/load.js</CODE>, then the following math will be 80typeset by jsMath: some inline math $\sin(2\pi x)$ and some 81display math [display]x={-b\pm \sqrt{b^2-4ac}\over 2a}.[/display] 82You may change the delimiters to nearly anything you want, but they can not 83look like HTML tags, since some browsers will eliminate unknown tags, and 84jsMath doesn't get to look for the custom delimiters until <I>after</I> the 85browser has interpreted the page. 86<p> 87 88<DIV CLASS="tex2math_ignore"> 89You can prevent the <CODE>tex2math</CODE> plugin from processing a portion 90of a page by enclosing it in a tag that is of 91<CODE>CLASS="tex2math_ignore"</CODE>. Often, that tag will be a 92<CODE>DIV</CODE> or <CODE>SPAN</CODE>, but it can be anything. This 93paragraph is wrapped in a DIV tag with 94<CODE>CLASS="tex2math_ignore"</CODE>, and so no math delimiters will be 95processed:$f\colon X\to Y$, $$x^2 \gt 5$$, $$1\over 1+x^2$$ and 96$\matrix{a& b\cr c& d}.$ 97Note that this includes the processing of escaped dollars (\$) and
98custom delimiters ($a \mapsto a^2$) as well.
99This makes it possible to produce examples of how to enter mathematics on
101</DIV>
102<P>
103JsMath will automatically ignore the text within
104<CODE>PRE</CODE> tags, so you can easily enter examples that way as well:
105<PRE>
106   $f\colon X\to Y$, $$x^2 \gt 5$$,
107   $$1\over 1+x^2$$ and $\matrix{a& b\cr c& d}.$
108</PRE>
109<P>
110
111Note that since the &lt; and &gt; symbols are used to denote HTML tags,
112these can be hard to incorporate into your <SPAN CLASS="math">\rm\TeX</SPAN>
113code.  Often, putting spaces around the &lt; or &gt; will make it work, but
114it is probably better to use <CODE>\lt</CODE> and <CODE>\gt</CODE> instead.
115Also note that the <CODE>tex2math</CODE> plugin does not allow any HTML
116tags to be within the math delimiters, with the exception of
117<CODE>&lt;BR&gt;</CODE>, which is ignored.
118<p>
119
120See the <A
121HREF="http://www.math.union.edu/locate/jsMath/authors/tex2math.html">tex2math
123<p>
124
125<HR>
126<p>
127
128<H2>Mathematics without <CODE>tex2math</CODE></H2>
129<p>
130
131If you are not using <CODE>tex2math</CODE>, then you will need to enclose
132your mathematics within <CODE>SPAN</CODE> or <CODE>DIV</CODE> tags that
133are of <CODE>CLASS="math"</CODE>.  Use a <CODE>SPAN</CODE> for in-line math
134and a <CODE>DIV</CODE> for displayed math.  For instance, <SPAN
135CLASS="math">P = (x_1,\ldots,x_n)</SPAN> and
136<DIV CLASS="math">
137  A = \left\lgroup\matrix{a_{11}& \cdots& a_{1m}\cr
138                \vdots& \ddots& \vdots\cr
139                a_{n1}& \cdots& a_{nm}\cr}\right\rgroup.
140</DIV>
141<p>
142<HR>
143<P>
145<p>
146
147See the <A HREF="http://www.math.union.edu/locate/jsMath/examples">jsMath
148example files</A> for more examples of using jsMath.  There are several <A
149HREF="http://www.math.union.edu/locate/jsMath/examples/extensions.html">extensions</A>
150to <SPAN CLASS="math">\rm\TeX</SPAN> that allow jsMath to interact better
151with HTML. These provide features such as colored text, tagging mathematics
152with CSS styles, and so on.
153<p>
154