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
|