By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,828 Members | 1,862 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,828 IT Pros & Developers. It's quick & easy.

Editing Math Formulas

P: n/a
I am trying to write up a page with Math formulas (statistical ones)
~
http://www.geocities.com/tekmonk2005/OnLineStats02.html
~
The thing is that I am not able to make it look OK using HTML. I
would like to somehow mark up parenthesis using the character entities
for vertical bars and solid front and back slashes, but
~
<td align="left">|</td>
~
doesn't appear to be working
~
Does it make sense to waste your time learning MathML (http://
www.w3.org/TR/REC-MathML/) or is it better using a format like PDF?
~
Also I would prefer to use and authoring tool like scribus and save
files as PDF. Any tutorials that make sense out there. I have had
cases in which "Google" made me waste time. This is why I would rather
ask
~
lbrtchx

Apr 8 '07 #1
Share this Question
Share on Google+
15 Replies


P: n/a
On Apr 8, 6:36 pm, lbrt...@hotmail.com wrote:
I am trying to write up a page with Math formulas (statistical ones)
~
http://www.geocities.com/tekmonk2005/OnLineStats02.html
~
The thing is that I am not able to make it look OK using HTML. I
would like to somehow mark up parenthesis using the character entities
for vertical bars and solid front and back slashes, but
~
<td align="left">|</td>
~
doesn't appear to be working
~
Does it make sense to waste your time learningMathML(http://www.w3.org/TR/REC-MathML/) or is it better using a format like PDF?
~
Also I would prefer to use and authoring tool like scribus and save
files as PDF. Any tutorials that make sense out there. I have had
cases in which "Google" made me waste time. This is why I would rather
ask
~
lbrtchx
You should better use MathML than HTML to code mathematical formulae.
The W3C specification indicates that MathML is not supposed to be
coded directly. You can use a WYSIWYG editor such as Amaya.

Fred

Apr 8 '07 #2

P: n/a
Scripsit lb*****@hotmail.com:
I am trying to write up a page with Math formulas (statistical ones)
I'd suggest checking http://www.cs.tut.fi/~jkorpela/math/ which might give
you both a general idea and some specific hints. The general idea is that
you can't do much with mathematical expressions beyond simple linear or
linearized expressions.
http://www.geocities.com/tekmonk2005/OnLineStats02.html
You're trying to present a general sum (with a summation symbol and with
index expressions below and above it) as well as a two-dimension division,
though a very simple one (1 over N). This gets rather complicated. Although
it can be arranged, to some extent and with some reservations, things get
awkward if you need lots of similar or more complicated expressions.

Using a different strategy, created a demo page for a way to present your
expression:
http://www.cs.tut.fi/~jkorpela/math/mean.html
It gives a reasonably good appearance on IE 7 but falls apart on other
browsers, since they don't support display: inline-block. (The technique
creates two-dimensional constructs from <spanelements wrapped inside an
outer <span>, making the outer <spanan inline block and the inner <span>s
blocks with small widths.) With considerable care and extra markup, you
could probably make it degrade gracefully into something readable and
correct, though flat, on other browsers.

In this case, I'd suggest something simple and linear, like

<p>&mu;<sub>N</sub= (&sum;x<sub>i</sub>)/N,
with i = 1, &hellip;, N</p>

This works reasonably, does not depend on CSS, and produces a readable
presentation. Anyone who can understand the nice two-dimensional equation
can probably understand this flattened presentation as well.

(Note: For simplicity, I haven't added any markup for making variables
appear in italics here.)
The thing is that I am not able to make it look OK using HTML. I
would like to somehow mark up parenthesis using the character entities
for vertical bars and solid front and back slashes, but
~
<td align="left">|</td>
~
doesn't appear to be working
Using a character reference like | is not relevant here. You could just
as well, or better, use the character | itself. But the problem is that you
are trying to construct a parenthesis-like symbol from \, |, and /. That
would not result in a good rendering even under the best circumstances. You
could use the parenthesis character itself in a large font.

On the other hand, when you have just 1 over N as a multiplier, you could
just omit the parentheses and perhaps put a multiplication sign (&times;)
after it.

Using a monospace font doesn't make a good impression. It may superficially
solve some problems, but it really won't take you far.
Does it make sense to waste your time learning MathML (http://
www.w3.org/TR/REC-MathML/) or is it better using a format like PDF?
No. Not for purposes like this. What you use depends on what you aim at and
how complicated your material is.

Notes on characters (my favorite topic):

You've used µ, which denotes the micro sign. It is historically based
on the Greek letter small mu but logically distinct from it, and may look
different, too.

You have used &mdash;&mdash; which is a bit tricky way, and other approaches
produce a long line more reliably. If you need the construct in other
contexts, note that em dashes are not joining in all fonts, i.e. there may
be a small gap between two consecutive dashes (at least unless you set their
font suitably).

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Apr 8 '07 #3

P: n/a
Scripsit fred wang:
You should better use MathML than HTML to code mathematical formulae.
Why? How many browsers render MathML at all? If you present something in
MathML format on the web, how many people will be able and willing to view
it a) instantly without installing new software or b) at all?

If HTML (and CSS) isn't enough for your math purposes, then use some
software to generate math formulas as images (as needed - e.g. MathWorld
uses this approach extensively even for simple formulas where it's not
needed).
The W3C specification indicates that MathML is not supposed to be
coded directly.
Well, it's surely not suitable for that, since it's a confusing mixture of
logical and physical markup.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Apr 8 '07 #4

P: n/a
Why? How many browsers renderMathMLat all? If you present something inMathMLformat on the web, how many people will be able and willing to view
it a) instantly without installing new software or b) at all?
Yes, it is the major reproach we can do to MathML : it is not widely
used (personnaly only a third of people visiting my website uses
Firefox and so are able to view Mathml). Nevertheless is it really a
good reason not to use it ? W3C made MathML not only to solve the HTML
difficulties to display mathematical formulae but also for some
important issues such as accessibility, interaction with computer
algebra system, search engine for mathematical formulae (such as
MathWebSearch)... If nobody starts to use it then all this good plans
will never be applied.
If HTML (and CSS) isn't enough for your math purposes, then use some
software to generate math formulas as images (as needed - e.g. MathWorld
uses this approach extensively even for simple formulas where it's not
needed).
The W3C specification indicates thatMathMLis not supposed to be
coded directly.

Well, it's surely not suitable for that, since it's a confusing mixture of
logical and physical markup.
I disagree with the approach you propose. As I said, MathML is the
right way to display mathematical formulae wheras it is not the
purpose of HTML+CSS. You seem to know a lot about CSS so you can
understand that it is as if somebody uses <tableinstead of CSS for
the layout of his webpage. This does not correspond at all to the idea
of "semantic web".
Moreover, if MathML code is difficult to produce by hand, making
formulae with CSS doesn't appear easier. You admit that your method
could not be applied for more complex formulae and propose images, but
let me tell you that it is worse : bad printing quality, size on
server, time to load pictures, layout not adpated with surrounded
text, problems for visually impaired (Firevox already exists for
MathML), impossibility to zoom in/out...

The fact it could not be displayed by the browser the most used is
really a problem, but we can take great advantages from MathML, so
isn't it worth ?

Cordially,

Fred

Apr 8 '07 #5

P: n/a
lb*****@hotmail.com writes:
Also I would prefer to use and authoring tool like scribus and save
files as PDF.
If you want PS or PDF output, you should have a look at TeX or LaTeX.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
Apr 8 '07 #6

P: n/a
lb*****@hotmail.com wrote:
Does it make sense to waste your time learning MathML (http://
www.w3.org/TR/REC-MathML/) or is it better using a format like PDF?
I use PDF, but there is another reason I use PDF. I generate output that
is intended to be printed, rather than read on screen.

I can't comment on MathML. In the few occasions where I have needed math
formulas on screen, and HTML was not adequate, I have used images.
Also I would prefer to use and authoring tool like scribus and save
files as PDF.
I spent a couple of weeks reading the PDF spec published by Adobe, and
just trying things out using Perl scripts to generate the output. It was
not easy, so it may not be the best approach for you. A good place to
ask about your options would be comp.text.pdf.
Apr 8 '07 #7

P: n/a
I see korpela knows exactly where it hurst ;-), but I also clearly
see Fred's point and since as they say "the client is always right", I
will have to author two files one as mathml and the other as pdf
~
I spent a couple of weeks reading the PDF spec published by Adobe, and
just trying things out using Perl scripts to generate the output.
~
You might know about this OS project, but you should check out
http://podofo.sourceforge.net/ they even have a "PDF browser"
~
http://prdownloads.sourceforge.net/p...ar.gz?download
~
lbrtchx

Apr 8 '07 #8

P: n/a
Scripsit lb*****@hotmail.com:
I see korpela knows exactly where it hurst ;-), but I also clearly
see Fred's point and since as they say "the client is always right", I
will have to author two files one as mathml and the other as pdf
And what would you then offer to the World Wide Web?

Firefox is still a minority browser and will probably remain that way.
Besides, its MathML support does not impress me. When viewing e.g. the
MathML examples at
http://www.zvon.org/HowTo/Output/
(most of which are fairly simple, often nothing more than a sequence of
characters that could be written simply in HTML), I find some good
renderings, many tolerable renderings, and some real failures.

If you really have professional-quality math papers to be distributed as
printed, though in electronic format, then use some flavor of TeX _or_ use
some software that produces PDF for you. It wouldn't really be authoring for
the WWW - just using HTTP as the transport protocol.

If you wish to author for the WWW, you have to adapt to the current and
near-future limitations. There's a lot less you can do than in, say, AMSTeX
in the hands of a competent user, but considerably more than in plain text.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Apr 9 '07 #9

P: n/a
I see korpela knows exactly where it hurst ;-), but I also clearly
see Fred's point and since as they say "the client is always right", I
will have to author two files one as mathml and the other as pdf
I don't know a lot about LaTeX, but I think it is a good choice if you
simply want to produce printable documents. The only reproach I find
is that it is not really accessible for beginners, as you have to
learn its syntax. Nevertheless, it is widespread enough, so you will
not have many problems to find help and tools to produce pdf files.

Now korpela asks "And what would you then offer to the World Wide Web?
". As I said, World Wide Web philosophy is a bit different than
printable documents (that finally is equivalent to the CSS method
proposed) and the choice of MathML is more appropriate. To make web
pages readable by Firefox, you should save it as xml file. Here is an
example : http://www.maths-informatique-jeux.c...set_theory.xml
.. To create web pages, the W3C's web browser/editor can be found
here : http://www.w3.org/Amaya/ .

Fred

Apr 9 '07 #10

P: n/a
I think I will end up going for a three prompt strategy
~
1._ using LaTeX to author Math documents and produce pdf printer-
friendly docs.
I really don't think that the web was design as the next "TV set" or
"book" to me the web is just a "click and go" medium. Besides most
tech people I know like to print out their own papers and jot down
their own notes on them
~
Even the firefox people recommend to use LaTeX
// __ http://www.mozilla.org/projects/mathml/
"The lingua franca for formula-intensive documents is TeX/LaTeX and
the use of MathML is not yet widespread."
~
2._ use these off and online LaTeX MathML translation packages
// __ http://pear.math.pitt.edu/mathzilla/
~
3._ Advising people to install Firefox (which is my site's designed
for and preferred browser)
~
lbrtchx

Apr 9 '07 #11

P: n/a
lb*****@hotmail.com wrote:
3._ Advising people to install Firefox (which is my site's designed
for and preferred browser)
This really isn't a good option. You will be making your site too
cumbersome to read for those who do not already have FireFox installed.

Besides most
tech people I know like to print out their own papers and jot down
their own notes on them
If this is the way you expect the output from your site to be used, just
go with PDF.
Apr 9 '07 #12

P: n/a
On Apr 9, 3:55 pm, lbrt...@hotmail.com wrote:
I think I will end up going for a three prompt strategy
~
1._ using LaTeX to author Math documents and produce pdf printer-
friendly docs.
I really don't think that the web was design as the next "TV set" or
"book" to me the web is just a "click and go" medium. Besides most
tech people I know like to print out their own papers and jot down
their own notes on them
~
Even the firefox people recommend to use LaTeX
// __http://www.mozilla.org/projects/mathml/
"The lingua franca for formula-intensive documents is TeX/LaTeX and
the use ofMathMLis not yet widespread."
~
2._ use these off and online LaTeX >MathMLtranslation packages
// __http://pear.math.pitt.edu/mathzilla/
~
3._ Advising people to install Firefox (which is my site's designed
for and preferred browser)
~
lbrtchx
ok, good luck ! And don't forget to save your page in xml format.

Fred

Apr 9 '07 #13

P: n/a
"fred wang" <fw*******@gmail.comwrote in message
news:11*********************@y80g2000hsf.googlegro ups.com...
You should better use MathML than HTML to code mathematical
formulae.
The W3C specification indicates that MathML is not supposed to be
coded directly. You can use a WYSIWYG editor such as Amaya.
Thanks for motivating me to fix my MathPlayer installation. A few
months ago it quit working after I updated to Internet Explorer 7.
(Not a big deal since normally I use Firefox.) I never got around to
repairing it till seeing your postings. It was time to get a fresh
download anyway; I hadn't been keeping up with the updates. It only
took a few minutes on dial up. Seems to be working fine.

One annoyance is that my IE 7 security settings are fairly strict, and
they block MathML content unless the site is on my "trusted" list. But
I get much the same deal from Firefox: it tells me some content is
blocked, and I have to explicitly give permission to let it through.
Even so, I like equations in MathML better than images.

Just for entertainment I have used Windows Notepad to manually create
the MathML for some horrendous equations. It can be done. The secret
is to first do all of the topmost level, then fill in the detail one
level down, etc. In anything complicated it's too easy to get lost if
you try to code the equation in one pass from left to right.

--
Paul Hirose <jv********@earINVALIDthlink.net>
To reply by email remove INVALID

Apr 18 '07 #14

P: n/a
>Thanks for motivating me to fix my MathPlayer installation. A few
>months ago it quit working after I updated to Internet Explorer 7.
(Not a big deal since normally I use Firefox.) I never got around to
repairing it till seeing your postings. It was time to get a fresh
download anyway; I hadn't been keeping up with the updates. It only
took a few minutes on dial up. Seems to be working fine.
>One annoyance is that my IE 7 security settings are fairly strict, and
they block MathML content unless the site is on my "trusted" list. But
I get much the same deal from Firefox: it tells me some content is
blocked, and I have to explicitly give permission to let it through.
Even so, I like equations in MathML better than images.
I also had this problem with IE7, but I didn't try to update
Mathplayer. I'm a bit surprised that MathML content are blocked with
your browsers... BTW, I forgot to say that IE7 seems to refuse
application/xhtml+xml content, so it could be a problem if MathML is
in a xml file. On my website, I send a text/html header to IE7 thanks
to a PHP script.
>Just for entertainment I have used Windows Notepad to manually create
the MathML for some horrendous equations. It can be done. The secret
is to first do all of the topmost level, then fill in the detail one
level down, etc. In anything complicated it's too easy to get lost if
you try to code the equation in one pass from left to right.
At the beginning, I generated some fragments of MathML with Amaya, I
completed manually, I made several copy/paste etc. I know this is
possible, but I don't think I is a good idea when you have to make
complex formulae. In the W3C MathML specification, it is said a
WYSIWYG editor should better be used. I agree with it and that's why I
contribute to the W3C's editor.

Apr 21 '07 #15

P: n/a
VK
On Apr 8, 8:36 pm, lbrt...@hotmail.com wrote:
Does it make sense to waste your time learning MathML (http://www.w3.org/TR/REC-MathML/) or is it better using a format like PDF?
I say it is a per case question. The deal is that MathML is for "math
amateurs". Any real scientific exchange goes in TeX / LaTeX format, in
this format scientifics are posting, preparing their works for
publishing and it will never change for MathML (and for what sky
blue?)

There is a number of tools to convert (La)TeX to MathML, but because
of principal structure differences this process is "one-wayed". So you
can convert TeX to MathML, but there is no reliable way to say save
TeX as MathML, edit it, save changes as TeX etc.

This way the options are:

1) You want to make a few formula-intensive pages for display without
planning any further shared editing. The pages are intended for a
particular auditory where you know that the troubles to install - if
missing - required software are lesser important than an ability to
have well structured math data in supported format.

MathML may be your friend then. For non-Gecko browsers there is free
MathPlayer plugin
http://www.dessci.com/en/products/ma...r/download.htm

On IE 7 it also leads to security dialog, but see what is said above
about priorities.
2) You want to make a few formula-intensive pages for display AND
planning some further shared editing (scientific feedback,
corrections, additions etc). The pages are intended for a particular
auditory where you know that the troubles to install - if missing -
required software are lesser important than an ability to have well
structured math data in supported format.

In this case use the standard TeX format right away. This plugin
http://groups.google.com/group/sci.m...beac943b52f63c
got a good feedback so far, but there are more of course.
3) You want to make a few formula-intensive pages for display without
planning any further shared editing. The pages are intended for the
most wide Web auditory.

Use images or Flash on your HTML page or make the whole page in PDF.

Apr 22 '07 #16

This discussion thread is closed

Replies have been disabled for this discussion.