The Museum of HP Calculators

HP Forum Archive 19

[ Return to Index | Top of Index ]

How to use a formula in a post
Message #1 Posted by Thomas Klemm on 8 Nov 2010, 4:22 p.m.

cf. How to use a formula in a post

A LaTeX-tag would be cool:

[latex]e^{i\pi}+1=0[/latex]

This would be displayed as:

Best regards
Thomas

      
Re: How to use a formula in a post
Message #2 Posted by Norman Dziedzic on 8 Nov 2010, 5:24 p.m.,
in response to message #1 by Thomas Klemm

Wow, brings back memories. I used to know TeX by heart and a good amount of LaTeX as well. I was in college when it first came out. This one lady at the computer center was just gaga over it.

Another consideration may be MathML. I thought it was dead but it looks like they just updated it... http://www.w3.org/Math/

      
Re: How to use a formula in a post
Message #3 Posted by bill platt on 8 Nov 2010, 5:36 p.m.,
in response to message #1 by Thomas Klemm

Perl is a unix routine. How do I run that on my wodoze machine?

            
Re: How to use a formula in a post
Message #4 Posted by Thomas Klemm on 8 Nov 2010, 6:05 p.m.,
in response to message #3 by bill platt

Quote:
How do I run that on my wodoze machine?

You may install strawberryperl or activeperl. Use a file for the formula instead of the here-document:

perl -MURI::Escape -ne 'chomp; printf "[img:http://latex.codecogs.com/png.latex?%s]\n\n", uri_escape $_' formula.txt

There might be other utilities to uri-escape.

HTH
Thomas


I can't test that right now, but the following should work. Create a file "uri-escape.pl" with your favorite text-editor and enter the following lines:

use URI::Escape;
while (<>) {
    chomp;
    printf "[img:http://latex.codecogs.com/png.latex?%s]\n\n", uri_escape $_;
}

Create a 2nd file "formula.txt". It may contain several formulas each on a separate line:

e^{i\pi}+1=0

Now run in a command prompt:

perl uri-escape.pl formula.txt

      
Re: How to use a formula in a post
Message #5 Posted by Egan Ford on 9 Nov 2010, 10:17 a.m.,
in response to message #1 by Thomas Klemm

If you are too lazy to upload images you can use aamath for "a-text":

$ echo "e^(i*pi)+1=0" | aamath

__ i || e + 1 = 0

$ echo "sum([n-1;r],r = 0 .. min(n-1,4))" | aamath

min(n - 1, 4) ===== \ / n - 1 \ > | | / \ r / ===== r = 0

Edited: 9 Nov 2010, 10:20 a.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall