+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 20 of 57

Thread: Displaying equations using Tex

  1. #1
    I really should be studying Pete's Avatar
    Posts
    9,809

    Thumbs up Displaying equations using Tex

    Good news, everyone!
    Plazma has told me that we can now use [tex] tags.

    Example:
    [tex]\frac{-b\pm\sqrt{b^2-4ac}}{2a}[/tex]
    Displays as:

    I wonder if someone who is good at LaTex could write a short tutorial of the basics, with some common SciForums examples? I'll write one up myself, but I'm a complete beginner at LaTex so it will take a little while.

    In the meantime, here's an external tutorial site: LaTex Math Tutorial for mimeTeX

    Pete

  2. #2
    Wow! This is a great idea. Thanks, Plazma!

    Ok, basics of LaTeX, very briefly:

    Grouping, where necessary, is done by enclosing expressions in curly brackets: {}

    Superscripts and subscripts:

    a^2 gives a superscript:

    a_2 gives a subscript:

    a^b_c does both:

    Sometimes, grouping is necessary, as in a^{b+c}:


    LaTeX functions are indicated by a backslash followed by the function name. For example \sin \int \pi gives:


    Greek letters are produced with a backslash and the letter name:
    \alpha, \beta, \gamma, \phi


    Fractions use the \frac function, with the numerator and denominator enclosed in curly brackets:
    \frac{mc^2}{a + b + c^3}


    Sums and integrals can be produced as follows:
    \int \limits_a^b 4x^2~dx
    \sum \limits_{n=1}^4 n = 10



    Note that a space is inserted in the integral above using a tilde (~).
    Last edited by James R; 12-20-06 at 06:53 PM.

  3. #3
    Tex is short for LaTeX?

    FREAKIN' SWEET! Now I just have to learn how to use it

  4. #4
    Bloodthirsty Barbarian
    Posts
    9,397
    Nice, but what's up with the automatic "x = " at the starting of every tex input?


  5. #5
    Houston, we have a problem!

  6. #6
    Bloodthirsty Barbarian
    Posts
    9,397
    Quote Originally Posted by Absane View Post
    Tex is short for LaTeX?
    Actually, Tex is a lower-level system that LaTex is built on top of, although it should be said that most people only use Tex in the context of LaTex.

  7. #7
    Some other guy
    Posts
    2,257
    TeX and LaTeX are not the same. TeX is a macro language designed by Donald Knuth back in the 1960s for writing technical papers with lots of math. LaTeX is a macro package for TeX and was written by Leslie Lamport back in the 1980s. Writing in plain TeX is a bear, plain and simple. LaTex makes writing a math paper a breeze.
    Last edited by D H; 12-20-06 at 07:56 PM. Reason: Delete bug report; already noted by quadraphonics

  8. #8
    I really should be studying Pete's Avatar
    Posts
    9,809
    Quote Originally Posted by quadraphonics View Post
    Nice, but what's up with the automatic "x = " at the starting of every tex input?
    Looks like a problem with the parsing of the [tex] tag.
    The mimetex.cgi renderer is working, but "x=" is added to the front of the [tex] element content before being sent to the renderer.

    Plazma is notified!

    Pete

  9. #9
    Registered Senior Member
    Posts
    62

    test math


  10. #10




    My favorite constant.

  11. #11
    Ok, looks like the problem is fixed now.

    I'm excited, people! Ooh, maths. It makes me go all gooey inside.

  12. #12
    Hrm. Does the TeX display incorrectly for IE or is it just this machine I am on (computer at school)? Some of the commands don't show right here (like in my Gamma constant equation, I see 1/[\overx?] instead of 1/x in Tex.

  13. #13
    The space is important after the \over command.
    It should be

    1 \over x

    which comes out as:



    Or, you can use \frac:

    \frac{1}{x}

    is displayed as


  14. #14
    I really should be studying Pete's Avatar
    Posts
    9,809
    Thanks to Plazma for having the bug corrected.

    Should we leave this thread stickied, or just link to it in the FAQ?

  15. #15
    Leave it sticky for now, I think.

  16. #16
    Quote Originally Posted by James R View Post
    The space is important after the \over command.
    It should be

    1 \over x

    which comes out as:



    Or, you can use \frac:

    \frac{1}{x}

    is displayed as

    Well, the code produces the correct equations from my computer. However, it does not output everything from my school's computer. Maybe they are just too old.

  17. #17
    Makes me wish I was a mathematician...

  18. #18
    I haven't returned to sciforums in ages - I'm glad to see that James and Pete are still about and more glad to see that someone has made an equation editor for bb code.

    Absane, could you explain that constant? I can't grasp it! Surely as x approaches inf. then ln(x) also approaches something high too?



    Welcome addition!

  19. #19
    Absane, could you explain that constant? I can't grasp it! Surely as x approaches inf. then ln(x) also approaches something high too?
    Yes, but infinity minus infinity can be finite.

  20. #20
    Quote Originally Posted by Absane View Post
    Quote Originally Posted by Blue_UK View Post
    Absane, could you explain that constant? I can't grasp it! Surely as x approaches inf. then ln(x) also approaches something high too?
    I don't have a proof that the series converges, but I am sure that it is not too hard.

    It goes something like this:

    1 - ln(1) = 1
    1 + 1/2 - ln(2) = 0.806852819
    1 + 1/2 + 1/3 - ln(3) = 0.734721045

    1 + 1/2 + 1/3 + ... + 1/100 - ln(100) = 0.582207331651

    The series converges to 0.5772156649...

    No one knows if this number is irrational. According to Mathworld, "The famous English mathematician G. H. Hardy is alleged to have offered to give up his Savilian Chair at Oxford to anyone who proved gamma to be irrational"

    http://mathworld.wolfram.com/Euler-M...iConstant.html

    But this series is a perfect example as to why we cannot assume infinity - infinity = 0 or any other number for that matter.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •