PDA

View Full Version : How to use Latex on Quantnet


Andy
07-06-2007, 05:03 PM
This section will guide you quickly through the steps you need to know to fully utilize the latex features on Quantnet forums.

Download the famous Latex pdf guide from http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf
Open to page 62: List of mathematical symbols. It contains almost everything you ever need.
Now, on to using the tex feature on QN when you post something
Click on the Tex symbol on the editor window (Quick Reply and Quick Edit do not have the full editor panel. You have to click on Post Reply or Go Advanced to see the button) http://www.quantnet.org/forum/images/editor/latex.gif. It's between http://www.quantnet.org/forum/images/editor/php.gif and http://www.quantnet.org/forum/images/editor/youtube.gif symbols
When you click on http://www.quantnet.org/forum/images/editor/latex.gif, it will auto insert the [/tex] (close) and [tex] (open) tags. You will put in between those tags your mathematical symbols. For normal texts, don't put them between tags.
Here is one example

I want to get something like [tex]\int x^3 +2 \sqrt{x}dx
First click on the http://www.quantnet.org/forum/images/editor/latex.gif button or for a quicker way, type in the [tex] open and close tags directly.
We want to put the integration , power and square root in between the tex tags. Look at the pdf guide, it's on page 64. For integration, it's \int, for square root, it's \sqrt, for square root, it's x^3 and so on.
Here is what you insert between the [tex] tags \int x^3 +2 \sqrt{x}dx
The trick would be to know where to get all the symbols. You can find them all in the pdf guide but here are the ones we use the most. The one on the left is what you put between tags. The ones on the right will be how it look

\partial = [tex]\partial
\frac{a}{b} = \frac{a}{b}
\sum = \sum
X_{2}^{a} = X_{2}^{a}
\lim_{\Delta x \to 0} \frac{f(x+ \Delta x)-f(x)}{\Delta x} = \lim_{\Delta x \to 0} \frac{f(x+ \Delta x)-f(x)}{\Delta x}
Don't put text inside [tex] tags = Don't put text inside tex tags
x^2 \cdot dx = x^2 \cdot dx

alain
07-06-2007, 05:10 PM
Latex Installation Instructions for Windows machines are here

Downloads for LaTeX (http://www.artofproblemsolving.com/LaTeX/AoPS_L_Downloads.php)

Jonathan
07-06-2007, 05:51 PM
I found a free online WYSIWIG editor: LaTeX Equation Editor - SITMO (http://www.sitmo.com/latex/)

You can add it to your website or igoogle homepage. Sitmo has other things like an equation archive and option calculators.

Adam
07-12-2007, 10:33 PM
One interesting way to see how others are using LaTeX on Quantnet is to right-click on any of the LaTeX equations you see and choose Properties from the menu. The Location property will begin with some sort of http:\\ nonsense, but it will end with the LaTeX code that created the equation.

The one thing to watch out for, however, is that it replaces all space characters with %20. Which means \int \frac 1 {x^2} \;dx will appear as\int%20\frac%201%20{x^2}%20\;dx

As long as you're willing to parse out the %20s, it's a nice resource to have.

Vadim
07-13-2007, 01:31 AM
How to show define integral?

\int_{\log 3}^{\log 4}x dx = \frac{x^2}{2}+C


\int_{\log 3}^{\log 4}x dx = \frac{x^2}{2}+C

How to show in this example x^2 | log 3....log 4

Andy
07-13-2007, 02:46 AM
How to show define integral?

\int_{\log 3}^{\log 4}x dx = \frac{x^2}{2}+C


\int_{\log 3}^{\log 4}x dx = \frac{x^2}{2}+C

How to show in this example x^2 | log 3....log 4
Ok, this is a definite integrand so the constant C gotta go. To write the evaluation form, here is what you want to write \left[ \frac{x^2}{2}\right]_{\log 3}^{\log 4} which is done by \left[ \frac{x^2}{2}\right]_{\log 3}^{\log 4}

As you can see, the rule for subscript and superscript is the same.

Andy
07-13-2007, 02:56 AM
One interesting way to see how others are using LaTeX on Quantnet is to right-click on any of the LaTeX equations you see and choose Properties from the menu. The Location property will begin with some sort of http:\\ nonsense, but it will end with the LaTeX code that created the equation.

The one thing to watch out for, however, is that it replaces all space characters with %20. Which means \int \frac 1 {x^2} \;dx will appear as\int%20\frac%201%20{x^2}%20\;dx

As long as you're willing to parse out the %20s, it's a nice resource to have.
Good observation, Adam.

Here is how this works. The latex engine I use for Quantnet is a mimetex cgi script. What it does is to convert all the latex formulas into pictures. The address of the script is at http://www.quantnet.org/cgi-bin/mimetex.cgi?

Ok, now, try to add something say x^2 after that address which will be http://www.quantnet.org/cgi-bin/mimetex.cgi?x^2

What will we see ? The cgi script will take whatever after the ? and change it to a picture. And here is the picture we have x^2

Also, you are right about the empty space being converted to %20. It's standard for html protocol.

If you like to play with the latex engine we have, just plug in any formula after ? at http://www.quantnet.org/cgi-bin/mimetex.cgi?

Makes sense now ?

SteveTownsend
07-13-2007, 08:13 PM
Not sure if this is a no brainer for people but I was able to cut and paste Andy's list of qs into a Word document as a baseline for the pre-class homework.

The Latex formatting is lost - perhaps there is a way to fix that but not apparent immediately. Editing the source of the webpage to extract the Latex is just too inefficient. We really want a way to extract the input to the CGI that turns the Latex into a picture for Web rendering. Any ideas Andy?

Latex addins for MS Word - the Aurora addin is $35 (academic rate) from http://www.elevatorlady.ca, and there is a 30-day eval period. Amortized over 3 years of part-time MFE, that does not seem too bad - probably cheaper than Dan S's book once it comes out. Anybody have alternatives? This one seems pretty slick to me. I looked at Equation Editor for MS Office, and I recommend you forget using this unless you have too much time on your hands.

alain
07-14-2007, 02:54 AM
Latex addins for MS Word - the Aurora addin is $35 (academic rate) from http://www.elevatorlady.ca, and there is a 30-day eval period. Amortized over 3 years of part-time MFE, that does not seem too bad - probably cheaper than Dan S's book once it comes out. Anybody have alternatives? This one seems pretty slick to me. I looked at Equation Editor for MS Office, and I recommend you forget using this unless you have too much time on your hands.

This is great!!! I will buy it for myself. If anybody else wants to join me, there is a discount if we buy in in bulk.

Steve, I didn't know LATEX before I joined the program (last fall). I learned pretty quickly (with the help of Andy) to the point I was able to type all my answers for the Risk Final in Latex.

Andy
07-14-2007, 08:43 AM
When I went to check my MikTex installation prior to the Latex workshop, I found out that the new version is out.
I have 2.5 installed and they now have 2.6. I'm downloading and installing 2.6 now.

If you have 2.5, please uninstall it and install the 2.6. If you haven't, then it's a great time to do so.
The link to download is http://miktex.org/2.6/Setup.aspx
Choose the Net installer

Jacob
07-17-2007, 01:34 AM
I made a dirt-simple web page that takes a chunk of LaTex and submits it to the image renderer on QuantNet, and displays the result.

Check it out here: http://ideatruck.net/baruch/

It doesn't have any special capabilities that aren't already available on QuantNet, but it allows you to edit a LaTex expression without starting a new post.

Andy, I'd be happy to give you the php source if you're interested.

Andy
07-17-2007, 01:42 AM
Jacob, that's really efficient and useful interface you did. Thanks a bunch.
I would suggest that people trying to learn Latex use the interface that Jacob did to get the right formula, then copy that formula into Quantnet post and put it between [tex] tags.

Jacob, if you are comfortable with PHP, then I can ask your help for other projects if the homeworks are not enough to keep you busy :)

Danny
07-22-2007, 03:45 PM
I know there have been several previous posts regarding latex. Would someone be kind enough to post explicit instructions on how to create a pdf file using latex. I have downloaded MikTeX and quite honestly, I'm not sure what to do from there. Any help is greatly appreciated.

thanks in advance,
Danny

Jacob
07-22-2007, 04:19 PM
I can't give specifics on MikTex as I'm working on a Mac. However, on my Windows box at work I use PDFCreator, which is free and installs itself as a "printer", and lets you create a PDF from any application, just by printing to it. Nothing specific to LaTex, but it comes in handy quite often.

PDFCreator | pdfforge.org (http://www.pdfforge.org/products/pdfcreator)

Andy
07-22-2007, 04:52 PM
I know there have been several previous posts regarding latex. Would someone be kind enough to post explicit instructions on how to create a pdf file using latex. I have downloaded MikTeX and quite honestly, I'm not sure what to do from there. Any help is greatly appreciated.

thanks in advance,
Danny
Danny,
Make sure you have your Miktex working first. Then install a Tex editor. The one I'm using is TeXnicCenter.org
It's free and very powerful.

Download and install that one too. Then go to Build -> Define Output Profiles
Point to your Miktex installation directory, usually in C:\Program Files\MiKTeX 2.6\miktex\bin

Open the .tex file I uploaded, then Project -> Create active file with main file

When you done with the .tex file, Select Latex-> PDF on the drop down menu. When you done, click F7 you will get a PDF