wikipedia latex formulas solution

R

Roderik

Hi,

I often use formula's on my website. Therefore I often have to make
images of the formula. At wikipedia it is possible to insert formulas
(which are then automatically converted to image) in the latex style.
Does anyone know if there is some script (maybe php/GD, or whatever)
that makes it possible to insert the formulas on my pages, without
making images by hand for each formula?

Suggestions are welcome.
 
D

dorayme

"Roderik said:
I often use formula's on my website. Therefore I often have to make
images of the formula.

Are the facilities in HTML inadequate to the task of the formulae
you use? Give an example.
 
L

Leif K-Brooks

Roderik said:
I often use formula's on my website. Therefore I often have to make
images of the formula. At wikipedia it is possible to insert formulas
(which are then automatically converted to image) in the latex style.
Does anyone know if there is some script (maybe php/GD, or whatever)
that makes it possible to insert the formulas on my pages, without
making images by hand for each formula?

You could install MediaWiki <http://mediawiki.org/>, which is the same
software that Wikipedia uses. It can be set not to allow editing by the
general public, and you can change the theme to match your site.

There's probably a simpler solution that just handles the formulas, but
I don't know what it is.
 
T

Toby Inkster

Roderik said:
Does anyone know if there is some script (maybe php/GD, or whatever)
that makes it possible to insert the formulas on my pages, without
making images by hand for each formula?

If you're able to install it on your server, this should do the job:

http://www.cse.ohio-state.edu/~gurari/TeX4ht/

It can convert LaTeX into various formats, including HTML+images,
HTML+MathML, OpenOffice.org and DocBook.

You probably need to know quite a bit about LaTeX to make it work though.
 
J

Jukka K. Korpela

Scripsit Toby Inkster:
Even something as simple as this:
http://www.teacherschoice.com.au/images/distance_formula_2d.gif
is clumsy in HTML.

Actually, it's fairly simple and natural, if you accept a presentation where
you use, say, sqrt(foo) to denote the square root of foo, instead of
requiring a square root symbol with a vinculum that extends over the
radicand. Even the latter can be handled relatively easily, as the demo page
http://www.cs.tut.fi/~jkorpela/test/dist.html
If you try it using varying font sizes, you will see some of the benefits of
text and HTML over images.

For general and miscellaneous notes on presenting math expressions in HTML
(and CSS), see
http://www.cs.tut.fi/~jkorpela/math/

(I just updated it a bit when I realized that the vinculum is better
constructed using a top border rather than an overline.)
 
D

dorayme

"Jukka K. Korpela said:
Scripsit Toby Inkster:


Actually, it's fairly simple and natural, if you accept a presentation where
you use, say, sqrt(foo) to denote the square root of foo, instead of
requiring a square root symbol with a vinculum that extends over the
radicand. Even the latter can be handled relatively easily, as the demo page
http://www.cs.tut.fi/~jkorpela/test/dist.html
If you try it using varying font sizes, you will see some of the benefits of
text and HTML over images.

True. There are ways to overcome this as AF pointed out in a
recent thread on em based pic dims. It is a drag to do (important
to make the pic reasonably big and let the browser downsize it
rather than up it). Here is something quickly made.

http://tinyurl.com/rzhqn

For general and miscellaneous notes on presenting math expressions in HTML
(and CSS), see
http://www.cs.tut.fi/~jkorpela/math/

(I just updated it a bit when I realized that the vinculum is better
constructed using a top border rather than an overline.)

This last is an interesting article. Thank you for posting the
url.
 
T

Toby Inkster

Jukka said:
Actually, it's fairly simple and natural, if you accept a presentation where
you use, say, sqrt(foo) to denote the square root of foo

This would certainly not be the usual way a mathematician would represent
a square root; and while it may work for one or two isolated formulae,
I can't imagine it being a good solution for a page with a lot of
equations.

It may be a good solution for image alt text though.

It's not bad, and the way you've done it does degrade quite nicely without
stylesheets, but I maintain that for complex formulae, HTML doesn't cut
it. The non-presentational parts of MathML are good, but lack decent
browser support at the moment, so for now, images are the most sensible
option.
 
J

Jukka K. Korpela

Scripsit Toby Inkster:
This would certainly not be the usual way a mathematician would
represent a square root;

Mathematicians, like everyone else, need to adapt their notations to various
possibilities and limitations. They may even need to use plain ASCII text
and to find various special and even ad hoc notations. (I'll skip the issue
that real mathematicians seldom use square roots. Real mathematicians live
in abstract spaces and seldom use numbers or specific algebraic functions.
;-) )

Compared with all the compromises and modifications that are so often
needed, using sqrt(...) is hardly a big deal. You might alternatively
which is actually said:
- - I maintain that for complex formulae, HTML
doesn't cut it.

That was never under dispute. But most of the formulas that people use are
not complex formulas (in either meaning of the word). The original poster of
this thread was asked to clarify what he meant, but unless I have missed
something, we still have no idea of that.
The non-presentational parts of MathML are good,

and as useless as MathML as a whole. MathML is broken by design, since it
hopelessly mixes structure and presentation in an unprecedented manner. Give
us the math part of the HTML 3 draft, a little polished, and make browsers
implement it - a reasonable request -, and people will use it.
so for now, images are the most sensible option.

For formulas that cannot easily be expressed in HTML and CSS, yes. This
typically means material that we are used to seeing in some types of
mathematical textbooks and research, and occasionally in physics.

Many web pages use images excessively for mathematical expressions, even
e.g. for simple variables with subscripts in running text. Try to change the
text size and see what happens. (OK, you _could_ make the images adapt to
font size via image sizing in CSS, but it would mean quite some extra work
and care, and authors just don't do that. Besides, image sizing by browsers
doesn't always produce pretty results.)
 
A

Alan J. Flavell

Mathematicians, like everyone else, need to adapt their notations to
various possibilities and limitations. They may even need to use
plain ASCII text and
[...]

Our theorists also need to discuss such things in email, and they've
become accustomed to writing (and reading) mathematical notation in
the form of latex source. Consequently they're inclined to do the
same thing in HTML. However, this is only good for a specialist
audience who is familiar with the notation.
and as useless as MathML as a whole. MathML is broken by design,
since it hopelessly mixes structure and presentation in an
unprecedented manner.

That was my impression too.
Give us the math part of the HTML 3 draft, a little polished, and
make browsers implement it - a reasonable request -, and people will
use it.

We had it with UdiWWW, around 10 years back. Some things don't get
better with time :-{
For formulas that cannot easily be expressed in HTML and CSS, yes.
This typically means material that we are used to seeing in some
types of mathematical textbooks and research, and occasionally in
physics.

You still have the fun of devising an alt text. And alt text (like
attributes in general) can't use markup. (OBJECT is much better in
this regard, provided that you make some alternative provision for
obsolete browsers, particularly MSIE).
Many web pages use images excessively for mathematical expressions,
even e.g. for simple variables with subscripts in running text.

This is basically what latex2html used to do. I have to admit I've
lost contact with its recent developments, but more complex
expressions will surely still be turned into images. For an
alternative view, one could look at TtH (tex-to-html converter). (But
don't get me started on the way the author uses font face=Symbol)
Try to change the text size and see what happens. (OK, you _could_
make the images adapt to font size via image sizing in CSS, but it
would mean quite some extra work and care, and authors just don't do
that. Besides, image sizing by browsers doesn't always produce
pretty results.)

As I say, I don't know what latex2html is doing currently, but I
reckon it would be simple enough to configure it to size its images in
em units. I tried that by hand a few years back, making the natural
image size somewhat larger than I expected the final result to be
(we've discussed this topic recently on this group in a different
context), and the results were at least acceptable.

The results may not be ideal, but neither is it ideal to have images
in the running text whose size is too different from the size of the
text. So - once the decision has been made to use images - it's a
compromise, and each one is welcome to make their own choice of
compromise.

regards
 
T

Toby Inkster

Jukka said:
(I'll skip the issue that real mathematicians seldom use square roots.
Real mathematicians live in abstract spaces and seldom use numbers or
specific algebraic functions. ;-) )

Depends on the field they work in. People dealing with sets,
rings and fields are very unlikely to come across a square root
in their day to day work. People who work in cryptography
though are more likely to deal with more concrete functions,
including square roots.

n-th roots (which would need to be represented similarly in a
typographical sense) pop up all over the place when dealing with
n-dimentional spaces, including the 4-dimentional space-time of
which Einstein was rather fond, and the cutting-edge string
theories currently proposed in the world of physics, which
operate on a universe with up to 11 dimensions.

I think ultimately the best solution, if at all possible, is
to store the equation in some machine-intelligible format on
the server and serve it up as an image, as MathML, as HTML or
as something else depending on client capabilities and
preferences.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top