News:

Help! We're trapped in the computer, and the computer is trapped in 2008! Someone call the time police!

Main Menu

PHP LaTeX Rendering

Started by Sidoh, October 05, 2006, 10:51:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Sidoh

    http://latex.sidoh.org/ui.php

    Feel free to use it.  It may make your questions that much more readable!

    Turn this:

    \displaystyle W_{1\rightarrow2} = \int_{x_1}^{x_2}F_x\left(x\right)dx

    Into this!



    Some other examples


    \displaystyle \int x^n=\frac{x^{n+1}}{n+1}


    \displaystyle \frac{d}{dx}x^n=nx^{n-1}

    You can also pass ?render=<LaTeX> to latex.sidoh.org/ to produce an image.  Navigating to latex.sidoh.org without any parameters will redirect you to the "UI."

    Notes / Tips --

    • If you're having problems with a certain portion of a TeX string (ie, some character isn't showing), try encoding the URL variable in base64 and passing ?render64=<Base 64> instead (click the checkbox in the ui).

    • Some tags/functionality of TeX are disabled for security reasons.

    • If you're getting a broken image, that means you did something wrong.  Make sure you spelled everything correctly and that it's not too long (there's a limit to how long a LaTeX formula can be for this).

    d&q

    This will be really helpful at school, thank you!  :-*
    The writ of the founders must endure.

    rabbit

    There needs to be manual page with all the options.

    rabbit

    You should also tell me how to display stuff like function pi and congruence.

    Sidoh

    Quote from: rabbit on October 06, 2006, 08:43:51 AM
    There needs to be manual page with all the options.

    It's LaTeX...

    Quote from: rabbit on October 06, 2006, 08:44:50 AM
    You should also tell me how to display stuff like function pi and congruence.

    \cong

    \displaystyle \prod_{i=m}^{n}

    Sidoh

    I've been playing around with it for the last few days and you can do some pretty neat things!

    $$Surface area and volume of a sphere
    $\displaystyle \\* \indent V_{sphere}=\frac{4}{3}\pi r^{3} \\
    \indent A_{sphere}=4\pi r^{2}$

    $\\$ Volume of a cone
    $\displaystyle \\* \indent V_{cone}=\frac{1}{3}\pi r^{2}h

    $\\$ Volume of a cylinder
    $\displaystyle \\* \indent V_{cylinder}=\pi r^2 h$$



    $$Trigonometric identities
    $\\ \indent \cos^{2}{\theta}+\sin^{2}{\theta}=1
    \\ \indent 1+\tan^{2}{\theta}=\sec^{2}{\theta}
    \\ \indent \cot^{2}{\theta}+1=\csc^{2}{\theta}$

    $\\$
    Double-angle formulas
    $\\ \indent \sin{2\theta}=2\sin{\theta}\cos{\theta}
      \\ \indent \cos{2\theta}=\cos^{2}{\theta}-sin^{2}{\theta}$

    $$




    $$\begin{center} {\bf Chain Rule} \end{center} \\\\

    If $f(u)$ is differentiable at $u=g(x)$ and $g(x)$ is differentiable at $x$, then

    $\\ \displaystyle \indent \frac{d}{dx}f(g(x))=f'(g(x))g'(x)
    $$



    Sidoh

    I threw together a few changes.  I wrote a few lines of mod_rewrite so that you can access renders with a URL that doesn't look like it's dynamic.  This is useful for stupid forums that don't allow dynamically generated images to be embedded.

    This is accomplished with the "short" option that appears on the UI now.

    Example:

    ( http://latex.sidoh.org/d65087fc425aa636b0666b11723b9bd5f925556f/image.gif )

    You can also access the LaTeX that was used to generate the image:
    http://latex.sidoh.org/d65087fc425aa636b0666b11723b9bd5f925556f/tex.txt
    \displaystyle \sum_{i=0}^{\infty}\frac{1}{2^i}=2

    nslay, if you read this, let me know of some of the things that you'd specifically like to see working, and I can look into it.

    Note that this is separate from the plugin we're currently using for the forum, but if I can get this working nicely without too much effort, we can change that.