* math ml support in context
@ 2001-01-24 18:29 Hans Hagen
2001-01-26 18:40 ` Mathematics under ConTeXt Tarik Kara
0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2001-01-24 18:29 UTC (permalink / raw)
Hi All,
Although much of the mathml 2 draft is puzzling, i'm trying as good as
possible to implement math ml support. Content markup is largely done,
although i still have some border cases to take care of. I also want more
options. Of course many entities are still missing [if existing at all].
Presentational markup is less finished.
Currently I can process all examples in chapter 4 of the draft, and the big
mathml testsuite does not give errors. On and off I will finish bits and
pieces, since it teaches me a liitle math -)
If you want to play with it
http://216.109.141.43/codindex.htm
follow the mathml link, key in a formula (or cut and paste one in the text
frame), and voila. If there is an error, you get a typeset error message
[thanks to tidy for testing on symmetry]. Since this is the first text
input based example of context on demand ... i hope it does not fail. [i
had a long fight with permissions on the machine and i hope it will keep
working].
[math ml looks like:]
<math>
<apply>
<eq/>
<apply>
<ci> x </ci>
<co> + </co>
<ci> y </ci>
</apply>
<ci> y </ci>
</apply>
</math>
that is, in simple cases,
Hans
PS. Make sure you refresh you cache since it's a new page.
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | pragma@wxs.nl
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Mathematics under ConTeXt
@ 2001-01-26 18:52 David Arnold
2001-01-28 22:07 ` Tarik Kara
0 siblings, 1 reply; 4+ messages in thread
From: David Arnold @ 2001-01-26 18:52 UTC (permalink / raw)
Cc: ntg-context
[-- Attachment #1: Type: text/plain, Size: 312 bytes --]
Tar{\i}k,
Here is a little something we are working on at the moment.
At 08:40 PM 1/26/01 +0200, you wrote:
>Is there any documentation or sample code that I can use to get some idea
>about typesetting mathematics under context (like aligned equations, black
>board bold characters, etc.)
>
>Tar{\i}k Kara
>
>
[-- Attachment #2: section4.tex --]
[-- Type: text/plain, Size: 8127 bytes --]
%output=pdf
\environment layout
\starttext
\section{Absolute Value}
One of the most important applications of piecewise functions is
absolute value. In previous courses, a simplistic notion of
absolute value is sufficient, but this will not be the case in
advanced courses such as calculus. However, your intuitive notion
of absolute value remains valid: the absolute value of a number
produces a nonnegative\footnote{A nonnegative number is a number
that is not negative; i.e., the number is either positive or
zero.} result.
There are two distinct cases to consider. First, if a number is
nonnegative (positive or zero) its absolute value is itself. For
example,
\placeformula[-]
\startformula
\eqalign{
|0|&=0,\cr
|1|&=1,\cr
|2|&=2,\cr
}
\stopformula
that is, if $x\ge 0$, then $|x|=x$. The second case is similar,
but somewhat counter intuitive at first inspection. If a number
is negative, then the absolute value negates the number so that
the resulting number is positive. For example,
\placeformula[-]
\startformula
\eqalign{
|-3|&=-(-3)=3,\cr
|-2|&=-(-2)=2,\cr
|-1|&=-(-1)=1.\cr
}
\stopformula
That is, if $x<0$, then $|x|=-x$. Let's summarize these results
in a definition.
\startdefinition[section4:definition1] If x is any real number
then
\placeformula[-]
\startformula
|x|=
\cases{
-x,& if $x<0$,\cr
x,& if $\ge 0$.\cr
}
\stopformula
\stopdefinition
It is helpful to be familiar with the graph of the absolute value
function.
\startexample[section4:example1] Sketch the graph of $y=|x|$.
{\bf Solution}. According to
\in{Definition}[section4:definition1], there are two cases. First,
if $x<0$, then $y=-x$. The graph of $y=-x$ is a line with the
slope $-1$ that passes through the origin. Calculate two points
that satisfy the equation $y=-x$. If is essential you use the
endpoint at $x=0$, but you can select any other $x$-value,
provided $x<0$. Thus,
\placeformula[-]
\startformula
\eqalign{
x&=0\Longrightarrow y=-0=0,\cr
x&=-1\Longrightarrow y=-(-1)=1.\cr
}
\stopformula
Plot these points, then draw a ray, emanating from $(0,0)$ and
passing through the point $(-1,1)$, as shown in
\in{Figure}[section4:fig1].
%\placefigure
% [here][section4:fig1]
% {The graph of $y=-x$, $x<0$.}
% {\externalfigure[section4figs.pdf][page=1]
In the second case, if $x\ge 0$, the
\in{Definition}[section4:definition1] tells us that $y=x$. This
is a line with slope 1 that passes through the origin. However,
$y=x$ only if $x\ge 0$, so we must keep this in mind when
selecting $x$-values. We have to use the endpoint at $x=0$, but
we are free to pick any second value of $x$ as long as it is
greater than zero. Thus,
\placeformula[-]
\startformula
\eqalign{
x&=0\Longrightarrow y=0,\cr
x&=1\Longrightarrow y=1.\cr
}
\stopformula
Plot these points, then draw a ray, emanating from the origin at
$(0,0)$ and passing through the point $(1,1)$. This result is
added to \in{Figure}[section4:fig1] and shown in
\in{Figure}[section4:fig2].
%\placefigure
% [here][section4:fig2]
% {Adding the line $y=x$, $x\ge 0$, to the partial result shown in \in{Figure}[section4:fig1]}
% {\externalfigure[section4figs.pdf][page=2]
The final graph, shown in \in{Figure}[section4:fig3], should be
memorized, as it is absolutely fundamental to a proper
understanding of absolute value.
%\placefigure
% [here][section4:fig3]
% {The completed graph of $y=|x|$.}
% {\externalfigure[section4figs.pdf][page=3]
\subsection{Using the Number Line}
When working with absolute value, it's helpful to summarize sign
information on a number line.
\startexample[section4:example2] Analyze the sign of $f(x)=x-2$
and summarize your findings on a number line.
{\bf Solution}. First, note that the function is zero at $x=2$.
The value $x=2$ is ``critical'' to the discussion of the sign
$f(x)=x-2$. Locate $x=2$ on a number line, as shown in
\in{Figure}[section4:fig4].
%\placefigure
% [here][section4:fig4]
% {A ``critical'' value at $x=2$.}
% {\externalfigure[section4figs.pdf][page=4]
Note that the critical value at $x=2$ divides the number line in
two pieces. You need to evaluate the sign of $f(x)=x-2$ on each
side of the critical value on the number line. This is most
easily accomplished by evaluating the function at a particular
$x$-value on each side of the critical value. For example, if
$x=1$, then $f(1)=1-2=-1$ is negative. Indeed, the function is
negative for any $x$-value selected to the left of 2 (check this).
This fact is indicated by placing a negative sign below the number
line to the left of 2, as shown in \in{Figure}[section4:fig5].
%\placefigure
% [here][section4:fig5]
% {Caption}
% {\externalfigure[section4figs.pdf][page=5]
Next, evaluate the function at an $x$-value that lies to the right
of the critical value at $x=2$. For example, if $x=3$, then
$f(x)=3-2=1$ is positive. Again, the function is positive for any
$x$-value you select to the right of 2 (check this). This fact is
indicated by placing a plus sign below the number line, as shown
in \in{Figure}[section4:fig6].
%\placefigure
% [here][section4:fig6]
% {Caption}
% {\externalfigure[section4figs.pdf][page=6]
Therefore, if $x<2$, $f(x)=x-2$ is negative, and if $x>2$, then
$f(x)=x-2$ is positive.
\stopexample
\subsection{Piecewise Definition of Absolute Value}
By analyzing the sign of the function bound by absolute value
bars, you can remove the absolute value bars and craft a piecewise
definition for your function.
\startexample[section4:example3] Craft a piecewise definition for
$f(x)=|x-2|$. Use your definition to sketch the graph of $f$.
{\bf Solution}. We did complete analysis of the sign of $x-2$ in
\in{Example}[section4:example2]. If $x<2$, we see in
\in{Figure}[section4:fig6] that $x-2$ is negative. If $x-2$ is
negative, then the absolute value must change $x-2$ into a
positive number. This is accomplished by negating $x-2$. Thus,
\placeformula[-]
\startformula
x-2<0\Longrightarrow|x-2|=-(x-2).
\stopformula
Equivalently,
\placeformula[-]
\startformula
x<2\Longrightarrow|x-2|=-x+2.
\stopformula
That is, if $x$ is to the left of the critical number at 2. Then,
$|x-2|=\x+2$. This fact is summarized on the number line in
\in{Figure}[section4:fig7].
%\placefigure
% [here][section4:fig7]
% {If $x<2$, then $|x-2|=-x+2$.}
% {\externalfigure[section4figs.pdf][page=7]
On the other hand, in \in{Figure}[section4:fig6], not that $x-2$
is positive, then the absolute value has nothing to do. That is,
\placeformula[-]
\startformula
x-2>0\Longrightarrow|x-2|=x-2.
\stopformula
Equivalently,
\placeformula[-]
\startformula
x>2\Longrightarrow|x-2|=x-2.
\stopformula
That is, if $x$ lies to the right of the critical number at 2,
then $|x-2|=x-2$. This is summarized on the number line in
\in{Figure}[section4:fig8].
%\placefigure
% [here][section4:fig8]
% {If $x\ge 2$, then $|x-2|$=x-2$.}
% {\externalfigure[section4figs.pdf][page=8]
The information provided by the number line in
\in{Figure}[section4:fig8] allows us to easily create a piecewise
definition for the function $f(x)=|x-2|$.
\placeformula[-]
\startformula
f(x)=|x-2|=
\cases{
-x+2,& if $x<2$,\cr
x-2,& if $x\ge 2$.\cr
}
\stopformula
If $x<2$, then $f(x)=-x+2$ and the graph is a line with slope $-1$
and intercept 2. Calculate two points, one of which is the
endpoint at $x=2$, the other having $x$-value less than 2.
\placeformula[-]
\startformula
\eqalign{
f(2)&=-2+2=0\cr
f(1)&=-1+2=1\cr
}
\stopformula
Thus, the graph of $f(x)=-x+2$ is a ray, emanating from the point
$(2,0)$ and passing through the point $(1,1)$, as shown in
\in{Figure}[section4:fig9].
%\placefigure
% [here][section4:fig9]
% {If $x<2$, then $|x-2|=-x+2$.}
% {\externalfigure[section4figs.pdf][page=9]
If $x>2$, then $f(x)=x-2$ and the graph is aline with slope 1 and
intercept $-2$. Calculate two points, one of which is the
endpoint at $x=2$, the other having $x$-value greater than 2.
\placeformula[-]
\startformula
\eqalign{
f(2)&=2-2=0\cr
f(3)&=3-2=1\cr
}
\stopformula
\stopexample
\stoptext
[-- Attachment #3: Type: text/plain, Size: 292 bytes --]
-
David Arnold
College of the Redwoods
Mathematics Department
7351 Tompkins Hill Rd
Eureka, CA 95501
(707) 476-4222 Office
(707) 476-4424 Fax
http://online.redwoods.cc.ca.us/instruct/darnold/
Ordinary Differential Equations Using MATLAB, 2/e
http://www.prenhall.com/books/esm_0130113816.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Mathematics under ConTeXt
2001-01-26 18:52 David Arnold
@ 2001-01-28 22:07 ` Tarik Kara
0 siblings, 0 replies; 4+ messages in thread
From: Tarik Kara @ 2001-01-28 22:07 UTC (permalink / raw)
Thank you David,
Your file was very usefull. However I still have some questions. In some
cases the equations in the eqalign does not fit into a page and has to be
broken over two (or more) pages. The \allowdisplaybreaks of AMSLaTeX does
not work. Does anybody know a command in ConTeXt that has a similar
function. Also how can I get blackboard bold R (and N) in ConTeXt (the
equivalent of $\mathbb{R}$ of AMSLaTeX).
Thanks in advance
Tar{\i}k Kara
On Fri, 26 Jan 2001, David Arnold wrote:
> Tar{\i}k,
>
> Here is a little something we are working on at the moment.
>
>
> At 08:40 PM 1/26/01 +0200, you wrote:
> >Is there any documentation or sample code that I can use to get some idea
> >about typesetting mathematics under context (like aligned equations, black
> >board bold characters, etc.)
> >
> >Tar{\i}k Kara
> >
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-01-28 22:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-24 18:29 math ml support in context Hans Hagen
2001-01-26 18:40 ` Mathematics under ConTeXt Tarik Kara
2001-01-26 18:52 David Arnold
2001-01-28 22:07 ` Tarik Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).