wikipedia latex formulas solution

Discussion in 'HTML' started by Roderik, Sep 28, 2006.

  1. Roderik

    Roderik Guest

    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.
    Roderik, Sep 28, 2006
    #1
    1. Advertising

  2. Roderik

    dorayme Guest

    In article
    <>,
    "Roderik" <> wrote:

    > 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.

    --
    dorayme
    dorayme, Sep 28, 2006
    #2
    1. Advertising

  3. Roderik wrote:
    > 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.
    Leif K-Brooks, Sep 29, 2006
    #3
  4. Roderik

    Toby Inkster Guest

    Toby Inkster, Sep 29, 2006
    #4
  5. Roderik

    Toby Inkster Guest

    Roderik wrote:

    > 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.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Sep 29, 2006
    #5
  6. 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.)

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Sep 29, 2006
    #6
  7. Roderik

    dorayme Guest

    In article <tCeTg.22754$>,
    "Jukka K. Korpela" <> wrote:

    > 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.
    >


    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.

    --
    dorayme
    dorayme, Sep 29, 2006
    #7
  8. Roderik

    Toby Inkster Guest

    Jukka K. Korpela wrote:

    > 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.

    > http://www.cs.tut.fi/~jkorpela/test/dist.html


    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.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Sep 29, 2006
    #8
  9. Scripsit Toby Inkster:

    > Jukka K. Korpela wrote:
    >
    >> 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;


    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
    represent the square root as a power, (...)<sup>½</sup>, which is actually
    preferred to the radix expression by many.

    > - - 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.)

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Sep 30, 2006
    #9
  10. On Sat, 30 Sep 2006, Jukka K. Korpela wrote:

    > 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 :-{

    > > 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.


    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
    Alan J. Flavell, Sep 30, 2006
    #10
  11. Roderik

    Toby Inkster Guest

    Jukka K. Korpela wrote:

    > (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.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Sep 30, 2006
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. microsoft.private.windows.netserver.setup

    Evaluating Formulas in ASP.NET

    microsoft.private.windows.netserver.setup, Mar 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    367
    Steve C. Orr [MVP, MCSD]
    Mar 4, 2004
  2. Sergio

    ntree formulas

    Sergio, Jan 6, 2005, in forum: C++
    Replies:
    1
    Views:
    400
    Thomas Matthews
    Jan 6, 2005
  3. Marco Aschwanden

    PyExcelerator - mishandling of formulas?

    Marco Aschwanden, Nov 16, 2005, in forum: Python
    Replies:
    2
    Views:
    835
    Marco Aschwanden
    Nov 17, 2005
  4. Aaron Gray
    Replies:
    1
    Views:
    432
    Aaron Gray
    Dec 27, 2006
  5. Kevin Howe
    Replies:
    6
    Views:
    216
    Kevin Howe
    Feb 6, 2005
Loading...

Share This Page