<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>under the sun</title>
	<atom:link href="http://randomku.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://randomku.wordpress.com</link>
	<description>time and chance happen to them all</description>
	<lastBuildDate>Thu, 21 Feb 2013 15:55:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='randomku.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>under the sun</title>
		<link>http://randomku.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://randomku.wordpress.com/osd.xml" title="under the sun" />
	<atom:link rel='hub' href='http://randomku.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Stock data from Yahoo into Matlab</title>
		<link>http://randomku.wordpress.com/2013/02/21/stock-data/</link>
		<comments>http://randomku.wordpress.com/2013/02/21/stock-data/#comments</comments>
		<pubDate>Thu, 21 Feb 2013 15:55:05 +0000</pubDate>
		<dc:creator>matkcy</dc:creator>
				<category><![CDATA[Quantitative Finance]]></category>

		<guid isPermaLink="false">http://randomku.wordpress.com/?p=102</guid>
		<description><![CDATA[1. Save the following Matlab code as stock_data.m, say in C:\Desktop. 2. Open Matlab and change the current directory to C:\Desktop. 3. At the Matlab Command &#62;&#62; type     &#62;&#62;[hist_date, hist_high, hist_low, hist_open, hist_close, hist_vol] = stock_data(&#8216;GOOG&#8217;); Here, GOOG is the stock symbol for Google Inc. 4. Among others, the above will return hist_close as a (column) vector [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=randomku.wordpress.com&#038;blog=22529061&#038;post=102&#038;subd=randomku&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>1. Save the following Matlab code as <strong>stock_data.m</strong>, say in C:\Desktop.</p>
<p>2. Open Matlab and change the current directory to C:\Desktop.</p>
<p>3. At the Matlab Command &gt;&gt; type</p>
<p><span style="color:#2233ff;">    &gt;&gt;[hist_date, hist_high, hist_low, hist_open, hist_close, hist_vol] = stock_data(&#8216;GOOG&#8217;);</span></p>
<p>Here, GOOG is the stock symbol for Google Inc.</p>
<p>4. Among others, the above will return <span style="color:#2233ff;">hist_close </span> as a (column) vector of daily closing stock prices starting from the 1st trading day of 2005 to the present day. Depending on your needs, you may wish to change the start year on Line 06 below. We can later use <span style="color:#2233ff;">hist_close </span> to analyse the continuously compounnded returns of the stock.</p>
<p><strong>stock_data.m</strong></p>
<pre class="brush: matlabkey; title: ; notranslate">

% Script to Retrieve Historical Stock Data from Yahoo! Finance
% modified from LuminousLogic.com
function [hist_date, hist_high, hist_low, hist_open, hist_close, hist_vol] = stock_data(stock_symbol)

% Define starting year (the further back in time, the longer it takes to download)
start_year = '2005';

% Get current date
[this_year, this_month, this_day, dummy, dummy, dummy] = datevec(date);

% Build URL string
url_string = 'http://ichart.finance.yahoo.com/table.csv?';
url_string = strcat(url_string, 's=', upper(stock_symbol));
url_string = strcat(url_string, '&amp;d=', num2str(this_month-1));
url_string = strcat(url_string, '&amp;e=', num2str(this_day));
url_string = strcat(url_string, '&amp;f=', num2str(this_year));
url_string = strcat(url_string, '&amp;g=d&amp;a=0&amp;b=1&amp;c=', start_year);
url_string = strcat(url_string, '&amp;ignore.csv');

% Open a connection to the URL and retrieve data into a buffer
buffer = java.io.BufferedReader(...
         java.io.InputStreamReader(...
         openStream(...
         java.net.URL(url_string))));

% Read the first line (a header) and discard
dummy   = readLine(buffer);

% Read all remaining lines in buffer
ptr = 1;
while 1

% Read line
buff_line = char(readLine(buffer));

% Break if this is the end
if length(buff_line)&lt;3, break; end

% Find comma delimiter locations
commas    = find(buff_line== ',');

% Extract high, low, open, close, etc. from string
DATEvar   = buff_line(1:commas(1)-1);
OPENvar   = str2num( buff_line(commas(1)+1:commas(2)-1));
HIGHvar   = str2num( buff_line(commas(2)+1:commas(3)-1));
LOWvar    = str2num( buff_line(commas(3)+1:commas(4)-1));
CLOSEvar  = str2num( buff_line(commas(4)+1:commas(5)-1));
VOLvar    = str2num( buff_line(commas(5)+1:commas(6)-1));
adj_close = str2num( buff_line(commas(6)+1:end));

% Adjust for dividends, splits, etc.
DATEtemp{ptr,1} = DATEvar;
OPENtemp(ptr,1) = OPENvar  * adj_close / CLOSEvar;
HIGHtemp(ptr,1) = HIGHvar  * adj_close / CLOSEvar;
LOWtemp (ptr,1) = LOWvar   * adj_close / CLOSEvar;
CLOSEtemp(ptr,1)= CLOSEvar * adj_close / CLOSEvar;
VOLtemp(ptr,1)  = VOLvar;

ptr = ptr + 1;
end

% Reverse to normal chronological order, so 1st entry is oldest data point
hist_date  = flipud(DATEtemp);
hist_open  = flipud(OPENtemp);
hist_high  = flipud(HIGHtemp);
hist_low   = flipud(LOWtemp);
hist_close = flipud(CLOSEtemp);
hist_vol   = flipud(VOLtemp);
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/randomku.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/randomku.wordpress.com/102/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=randomku.wordpress.com&#038;blog=22529061&#038;post=102&#038;subd=randomku&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://randomku.wordpress.com/2013/02/21/stock-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c939517ec889b9317c98790937da243b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">timcyku</media:title>
		</media:content>
	</item>
		<item>
		<title>Futures Price</title>
		<link>http://randomku.wordpress.com/2011/04/26/futures-price/</link>
		<comments>http://randomku.wordpress.com/2011/04/26/futures-price/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 06:19:47 +0000</pubDate>
		<dc:creator>matkcy</dc:creator>
				<category><![CDATA[Quantitative Finance]]></category>

		<guid isPermaLink="false">http://randomku.wordpress.com/?p=6</guid>
		<description><![CDATA[The futures price of an index can be treated like the price of an asset which pays a dividend yield equal to the risk-free rate. Recall that the Black&#8217;s price of a European futures option is where The above can be obtained if we substitute by and by into the Black-Scholes call price formula; that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=randomku.wordpress.com&#038;blog=22529061&#038;post=6&#038;subd=randomku&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<blockquote><p>
<span style="color:#0000ff;"> The futures price of an index can be treated like the price of an asset which pays a dividend yield equal to the risk-free rate. </span></p>
</blockquote>
<p>Recall that the Black&#8217;s price of a European futures option is
<p align="center"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle++F%28t%29e%5E%7B-r%5Ctau%7DN%28d_%7B%2B%7D%29-Ke%5E%7B-r%5Ctau%7DN%28d_%7B-%7D%29+&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='&#92;displaystyle  F(t)e^{-r&#92;tau}N(d_{+})-Ke^{-r&#92;tau}N(d_{-}) ' title='&#92;displaystyle  F(t)e^{-r&#92;tau}N(d_{+})-Ke^{-r&#92;tau}N(d_{-}) ' class='latex' /></p>
<p> where
<p align="center"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle++d_%7B%5Cpm%7D+%3D+%5Cfrac%7B%5Cln+F%28t%29%2FK+%5Cpm+%5Cfrac%7B1%7D%7B2%7D%5Csigma%5E%7B2%7D%5Ctau%7D%7B%5Csigma+%5Csqrt%7B%5Ctau%7D%7D.+&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='&#92;displaystyle  d_{&#92;pm} = &#92;frac{&#92;ln F(t)/K &#92;pm &#92;frac{1}{2}&#92;sigma^{2}&#92;tau}{&#92;sigma &#92;sqrt{&#92;tau}}. ' title='&#92;displaystyle  d_{&#92;pm} = &#92;frac{&#92;ln F(t)/K &#92;pm &#92;frac{1}{2}&#92;sigma^{2}&#92;tau}{&#92;sigma &#92;sqrt{&#92;tau}}. ' class='latex' /></p>
<p> The above can be obtained if we substitute <img src='http://s0.wp.com/latex.php?latex=%7BS%28t%29%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{S(t)}' title='{S(t)}' class='latex' /> by <img src='http://s0.wp.com/latex.php?latex=%7BF%28t%29%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{F(t)}' title='{F(t)}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%7Bq%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{q}' title='{q}' class='latex' /> by <img src='http://s0.wp.com/latex.php?latex=%7Br%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{r}' title='{r}' class='latex' /> into the Black-Scholes call price formula; that is if we regard <img src='http://s0.wp.com/latex.php?latex=%7BF%28t%29%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{F(t)}' title='{F(t)}' class='latex' /> as the price of a stock which pays dividend yield <img src='http://s0.wp.com/latex.php?latex=%7Bq%3Dr%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{q=r}' title='{q=r}' class='latex' />. </p>
<p>
Alternatively, let us think of <img src='http://s0.wp.com/latex.php?latex=%7BF%28t%29%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{F(t)}' title='{F(t)}' class='latex' /> as a price of a hypothetical asset, say A. Let <img src='http://s0.wp.com/latex.php?latex=%7BT%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{T}' title='{T}' class='latex' /> denote the maturity date of the futures contract. Since <img src='http://s0.wp.com/latex.php?latex=%7BF%28t%29%3DS%28t%29e%5E%7B%28r-q%29%28T-t%29%7D%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{F(t)=S(t)e^{(r-q)(T-t)}}' title='{F(t)=S(t)e^{(r-q)(T-t)}}' class='latex' />, owning one unit of the asset A with price <img src='http://s0.wp.com/latex.php?latex=%7BF%28t%29%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{F(t)}' title='{F(t)}' class='latex' /> per unit is like owning <img src='http://s0.wp.com/latex.php?latex=%7Be%5E%7B%28r-q%29%28T-t%29%7D%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{e^{(r-q)(T-t)}}' title='{e^{(r-q)(T-t)}}' class='latex' /> units of the index underlying the futures contract.</p>
<p>
Now, at time <img src='http://s0.wp.com/latex.php?latex=%7Bt%27%3CT%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{t&#039;&lt;T}' title='{t&#039;&lt;T}' class='latex' />, the value of our position in the index is <a name="e1">
<p align="center"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle++S%28t%27%29e%5E%7B%28r-q%29%28T-t%29%7D+%5Ctimes+e%5E%7Bq%28t%27-t%29%7D+%5C+%5C+%5C+%5C+%5C+%281%29&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='&#92;displaystyle  S(t&#039;)e^{(r-q)(T-t)} &#92;times e^{q(t&#039;-t)} &#92; &#92; &#92; &#92; &#92; (1)' title='&#92;displaystyle  S(t&#039;)e^{(r-q)(T-t)} &#92;times e^{q(t&#039;-t)} &#92; &#92; &#92; &#92; &#92; (1)' class='latex' /></p>
<p></a> since the index pays a dividend yield of <img src='http://s0.wp.com/latex.php?latex=%7Bq%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{q}' title='{q}' class='latex' />. We can write <a href="#e1">(1)</a> as <a name="e2">
<p align="center"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle++S%28t%27%29e%5E%7B%28r-q%29%28T-t%27%29%7De%5E%7B%28r-q%29%28t%27-t%29%7De%5E%7Bq%28t%27-t%29%7D+%3D+F%28t%27%29e%5E%7Br%28t%27-t%29%7D+%5C+%5C+%5C+%5C+%5C+%282%29&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='&#92;displaystyle  S(t&#039;)e^{(r-q)(T-t&#039;)}e^{(r-q)(t&#039;-t)}e^{q(t&#039;-t)} = F(t&#039;)e^{r(t&#039;-t)} &#92; &#92; &#92; &#92; &#92; (2)' title='&#92;displaystyle  S(t&#039;)e^{(r-q)(T-t&#039;)}e^{(r-q)(t&#039;-t)}e^{q(t&#039;-t)} = F(t&#039;)e^{r(t&#039;-t)} &#92; &#92; &#92; &#92; &#92; (2)' class='latex' /></p>
<p></a> since <img src='http://s0.wp.com/latex.php?latex=%7BF%28t%27%29+%3D+S%28t%27%29e%5E%7B%28r-q%29%28T-t%27%29%7D%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{F(t&#039;) = S(t&#039;)e^{(r-q)(T-t&#039;)}}' title='{F(t&#039;) = S(t&#039;)e^{(r-q)(T-t&#039;)}}' class='latex' />.</p>
<p>
The right-hand side of <a href="#e2">(2)</a> shows that if we long one unit of asset A at time <img src='http://s0.wp.com/latex.php?latex=%7Bt%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{t}' title='{t}' class='latex' />, our position would grow to <img src='http://s0.wp.com/latex.php?latex=%7Be%5E%7Br%28t%27-t%29%7D%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{e^{r(t&#039;-t)}}' title='{e^{r(t&#039;-t)}}' class='latex' /> units at time <img src='http://s0.wp.com/latex.php?latex=%7Bt%27%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{t&#039;}' title='{t&#039;}' class='latex' />, i.e. asset A pays a dividend yield of <img src='http://s0.wp.com/latex.php?latex=%7Br%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{r}' title='{r}' class='latex' />.</p>
<p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/randomku.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/randomku.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=randomku.wordpress.com&#038;blog=22529061&#038;post=6&#038;subd=randomku&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://randomku.wordpress.com/2011/04/26/futures-price/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c939517ec889b9317c98790937da243b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">timcyku</media:title>
		</media:content>
	</item>
		<item>
		<title>Latex2wordpress</title>
		<link>http://randomku.wordpress.com/2011/04/26/hello-world/</link>
		<comments>http://randomku.wordpress.com/2011/04/26/hello-world/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 05:43:21 +0000</pubDate>
		<dc:creator>matkcy</dc:creator>
				<category><![CDATA[Computing]]></category>

		<guid isPermaLink="false">http://randomku.wordpress.com/?p=1</guid>
		<description><![CDATA[I was looking for the method that people use to write their beautiful math equations on their blogs. I found this program called LaTeX2WP (written in Python), which converts Latex file to HTML that is ready to be cut and pasted into WordPress editor. Thanks to its creator Luca Trevisan! However, I could not find [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=randomku.wordpress.com&#038;blog=22529061&#038;post=1&#038;subd=randomku&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I was looking for the method that people use to write their beautiful math equations on their blogs. I found this program called LaTeX2WP (written in Python), which converts Latex file to HTML that is ready to be cut and pasted into WordPress editor. Thanks to its creator  <a href="http://lucatrevisan.wordpress.com/latex-to-wordpress/">Luca Trevisan</a>!</p>
<p>However, I could not find a single instruction on the web that gets the program to run immediately on my Windows 7. After several hours of trial and error, I finally figured it out! For those who are puzzled as much as I was, I hope the following steps can be useful.</p>
<p>(1) Download <a href="http://www.python.org/download/"> Python 2.7.1 </a> and install it on C:\.</p>
<p>(2) Download <a href="http://lucatrevisan.wordpress.com/latex-to-wordpress/download/"> LaTeX2WP</a> and unzip the folder into C:\Python27</p>
<p>(3) Go to Control Panel &gt; System and Security &gt; System and click on the Advanced system settings tab. On the popup window, click on the Environment Variables tab. Scroll down the System variable menu until you see the variable `Path&#8217;. Select the variable Path and click the Edit button. Add the following to the end of the Variable value: </p>
<p><span style="color:#0000ff;">;c:\Python27</span>, </p>
<p>(4) Next, go to Accessories  and open the Command Prompt. If the prompt is not on the C drive, type C: and press Enter. Now, at the C:\&gt; prompt, type the following and press Enter:</p>
<p><span style="color:#0000ff;">python c:\Python27\latex2wp.py c:\Python27\example.tex</span></p>
<p>(5) Note that example.tex already exists in the latex2wp package. The action in the preceding step generates the  HTML file, example.html, which is now placed in the folder where the corresponding tex file is.  Open example.html in Microsoft Office. Copy and paste the entire html file into the wordpress post editor which has been set to the HTML mode.</p>
<p>Publish the post and the following should now appear on your blog. Good luck!</p>
<p>Look at the document source to see how to <s>strike out</s> text, how to use</span> <span style="color:#00ff00;">different</span> <span style="color:#0000ff;">colors</span>, and how to <a href="http://www.google.com">link to URLs with snapshot preview</a> and how to <a class="snap_noshots" href="http://www.google.com">link to URLs without snapshot preview</a>.</p>
<p>
There is a command which is ignored by pdflatex and which defines where to cut the post in the version displayed on the main page<span id="more-1"></span></p>
<p>
Anything between the conditional declarations <em>ifblog . . . fi</em> is ignored by LaTeX and processed by latex2wp. Anything between <em>iftex . . . fi</em> is processed by LaTex and ignored by latex2wp.</p>
<p>
 <span style="color:#00ff00;">This green sentence appears only in WordPress </span> </p>
<p><p>
This is useful if one, in desperation, wants to put pure HTML commands in the <em>ifblog . . . fi</em> scope.</p>
<blockquote><p><b>Lemma 1 (Main)</b> <em> <a name="lmmain"></a> Let <img src='http://s0.wp.com/latex.php?latex=%7B%5Ccal+F%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{&#92;cal F}' title='{&#92;cal F}' class='latex' /> be a total ramification of a compactifier, then <a name="eqlemma">
<p align="center"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle+++%5Cforall+g+%5Cin+%7B%5Ccal+F%7D.+g%5E2+%3D+%5Ceta+%5C+%5C+%5C+%5C+%5C+%281%29&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='&#92;displaystyle   &#92;forall g &#92;in {&#92;cal F}. g^2 = &#92;eta &#92; &#92; &#92; &#92; &#92; (1)' title='&#92;displaystyle   &#92;forall g &#92;in {&#92;cal F}. g^2 = &#92;eta &#92; &#92; &#92; &#92; &#92; (1)' class='latex' /></p>
<p></a> </em></p></blockquote>
<p><p>
The (modifiable) numbering scheme is that lemmas, theorems, propositions, remarks and corollaries share the same counters, while exercises and examples have each their own counter.</p>
<blockquote><p><b>Theorem 2</b> <em> <a name="thad"></a> The ad&egrave;le of a number field is never hyperbolically transfinite. </em></p></blockquote>
<p><p>
<em>Proof:</em>  Left as an exercise. <img src='http://s0.wp.com/latex.php?latex=%5CBox&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='&#92;Box' title='&#92;Box' class='latex' /></p>
<blockquote><p><b>Exercise 1</b> <em> Find a counterexample to Theorem <a href="#thad">2</a>. </em></p></blockquote>
<p>
<blockquote><p><b>Exercise 2 (Advanced)</b> <em> Prove Lemma <a href="#lmmain">1</a>. </em></p></blockquote>
<p><p>
Note that accented characters are allowed. Unfortunately, Erd&ouml;s&#8217;s name cannot be properly typeset in HTML. (Note that to get the above approximation, you need to type backslash-H-space-o, rather than backslash-H-{o}. Both are good in LaTeX, but only the second is recognized by LaTeX2WP.)</p>
<p>
One can correctly type the names of H&aring;stad, Szemer&eacute;di, &#268;ech, and so on.</p>
<p>
It is possible to have numbered equations</p>
<p>
<a name="eqtest">
<p align="center"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle+++%5Cfrac+1+%7Bx%5E2%7D+%5Cge+0+%5C+%5C+%5C+%5C+%5C+%282%29&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='&#92;displaystyle   &#92;frac 1 {x^2} &#92;ge 0 &#92; &#92; &#92; &#92; &#92; (2)' title='&#92;displaystyle   &#92;frac 1 {x^2} &#92;ge 0 &#92; &#92; &#92; &#92; &#92; (2)' class='latex' /></p>
<p></a></p>
<p>
and unnumbered equations</p>
<p><p align="center"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle++t%28x%29+-+%5Cfrac+12+%3E+x%5E%7B%5Cfrac+13%7D+&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='&#92;displaystyle  t(x) - &#92;frac 12 &gt; x^{&#92;frac 13} ' title='&#92;displaystyle  t(x) - &#92;frac 12 &gt; x^{&#92;frac 13} ' class='latex' /></p>
<p>
Unnumbered equations can be created with the double-dollar sign command or with the backslash-square bracket command.</p>
<p><p align="center"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle++f%28x%29+%3D+%5Cint_%7B-%5Cinfty%7D%5E%7Bx%7D+%5Cfrac+1+%7Bt%5E2%7D+dt+&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='&#92;displaystyle  f(x) = &#92;int_{-&#92;infty}^{x} &#92;frac 1 {t^2} dt ' title='&#92;displaystyle  f(x) = &#92;int_{-&#92;infty}^{x} &#92;frac 1 {t^2} dt ' class='latex' /></p>
<p>
It is possible to refer to equations and theorems via the <em>ref</em>, <em>eqref</em> and <em>label</em> LaTeX commands, for example to Equation (<a href="#eqtest">2</a>), to Equation <a href="#eqlemma">(1)</a>, and to Lemma <a href="#lmmain">1</a> above.</p>
<p>
eqnarray* is supported, but not eqnarray:</p>
<p><p align="center"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle++%5Cbegin%7Barray%7D%7Brcl%7D++f%28x%29+%26+%3C+%26+x%5E2+-+y%5E2%5C%5C+%26+%3D+%26+%28x%2By%29+%5Ccdot+%28x-y%29+%5Cend%7Barray%7D+&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='&#92;displaystyle  &#92;begin{array}{rcl}  f(x) &amp; &lt; &amp; x^2 - y^2&#92;&#92; &amp; = &amp; (x+y) &#92;cdot (x-y) &#92;end{array} ' title='&#92;displaystyle  &#92;begin{array}{rcl}  f(x) &amp; &lt; &amp; x^2 - y^2&#92;&#92; &amp; = &amp; (x+y) &#92;cdot (x-y) &#92;end{array} ' class='latex' /></p>
<p>
<em>You <b>can</b> nest a <b>bold</b> text inside an emphasized text or viceversa.</em></p>
<p>
The theorem-like environments <em>theorem</em>, <em>lemma</em>, <em>proposition</em>, <em>remark</em>, <em>corollary</em>, <em>example</em> and <em>exercise</em> are defined, as is the <em>proof</em> environment.</p>
<p>
The LaTex commands to type &#036;, &#037;, and &amp; are supported outside math mode, and &#037; and &amp; are supported in math mode as well:</p>
<p><p align="center"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle++30+%5C%26+10+%5C%25+&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='&#92;displaystyle  30 &#92;&amp; 10 &#92;% ' title='&#92;displaystyle  30 &#92;&amp; 10 &#92;% ' class='latex' /></p>
<p>
The section symbol &sect; is also supported.</p>
<p>
WordPress has trouble if a LaTeX expression containing a <img src='http://s0.wp.com/latex.php?latex=%7B%3C%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{&lt;}' title='{&lt;}' class='latex' /> symbol, such as <img src='http://s0.wp.com/latex.php?latex=%7Bx%5E2+%3C+x%5E2+%2B+1%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{x^2 &lt; x^2 + 1}' title='{x^2 &lt; x^2 + 1}' class='latex' /> is followed by an expression containing a <img src='http://s0.wp.com/latex.php?latex=%7B%3E%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{&gt;}' title='{&gt;}' class='latex' /> symbol, such as <img src='http://s0.wp.com/latex.php?latex=%7B%28x%2By%29%5E2+%3E+%28x%2By%29%5E2+-+3%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{(x+y)^2 &gt; (x+y)^2 - 3}' title='{(x+y)^2 &gt; (x+y)^2 - 3}' class='latex' />. This is fixed by converting the inequality symbols into &#8220;HTML character codes.&#8221; Always write the symbols <img src='http://s0.wp.com/latex.php?latex=%7B%3C%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{&lt;}' title='{&lt;}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%7B%3E%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{&gt;}' title='{&gt;}' class='latex' /> in math mode.</p>
<p>
It it is possible to have tabular environments, both with borders (the border will not be displayed in the LaTeX preview), as in </p>
<p><table border="1" align="center">
<td align="left"> blog </td>
<td align="right"> quality</td>
</tr>
<tr>
<td align="left"> what&#8217;s new </td>
<td align="right"> excellent</td>
</tr>
<tr>
<td align="left"> in theory </td>
<td align="right"> poor </td>
</tr>
</table>
<p>
and without borders as in</p>
<p><table align="center">
<tr>
<td align="center"> <img src='http://s0.wp.com/latex.php?latex=%7Ba%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{a}' title='{a}' class='latex' /> </td>
<td align="center"> <img src='http://s0.wp.com/latex.php?latex=%7B%5Crightarrow%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{&#92;rightarrow}' title='{&#92;rightarrow}' class='latex' /> </td>
<td align="center"> <img src='http://s0.wp.com/latex.php?latex=%7Bb%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{b}' title='{b}' class='latex' /></td>
</tr>
<tr>
<td align="center"> <img src='http://s0.wp.com/latex.php?latex=%7B%5Cdownarrow%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{&#92;downarrow}' title='{&#92;downarrow}' class='latex' /> </td>
<td align="center"> </td>
<td align="center"> <img src='http://s0.wp.com/latex.php?latex=%7B%5Cuparrow%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{&#92;uparrow}' title='{&#92;uparrow}' class='latex' /></td>
</tr>
<tr>
<td align="center"> <img src='http://s0.wp.com/latex.php?latex=%7Bc%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{c}' title='{c}' class='latex' /> </td>
<td align="center"> <img src='http://s0.wp.com/latex.php?latex=%7B%5Crightarrow%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{&#92;rightarrow}' title='{&#92;rightarrow}' class='latex' /> </td>
<td align="center"> <img src='http://s0.wp.com/latex.php?latex=%7Bd%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{d}' title='{d}' class='latex' /> </td>
</tr>
</table>
<p>
(The tabular environments will be centered in WordPress, but not in the LaTeX preview.)</p>
<p>
And it is possible to include a picture so that the pdf file produced with pdflatex imports it from a local image file (which has to be pdf, gif, jpeg, or png) and the WordPress post imports it from a URL.</p>
<p><p align="center"><img width="400" src="http://imgs.xkcd.com/comics/donald_knuth.png"></p>
<p>
The <em>image</em> command used to generate the above image has three parameter: a size parameter for either the width or the height, expressed in pixels (if different from the original resolution, the picture will be scaled), a URL for the location of the image (this will be used by WordPress) and a local file name (which will used by pdflatex).</p>
<p>
It is possible to have numbered and unnumbered sections and subsections. References to <em>label</em> commands which are not in the scope of a numbered equation or a numbered theorem-like environment will refer to the section number, such as a reference to Section <a href="#sec">1</a> below.</p>
<p>
HTML does not have good support for itemized list with descriptors (what one gets in LaTeX using the <em>itemize</em> environment with optional parameters in square brackets after the <em>item</em> commands). We can only offer the following rather ugly rendering:</p>
<p><ul>
<li>Case a. Description of case a
<li>Case b. Description of case b
</ul>
<p>
<p><b> Examples of Sections </b></p>
<p>
<p><b> And Subsections </b></p>
<p>
<p><b>1. A section </b></p>
<p> <a name="sec"></a></p>
<p>
<p><b>  1.1. And a subsection </b></p>
<p>
<p><b>2. Changing the style </b></p>
<p><p>
The file latex2wpstyle.py contains several definitions that determine the appearance of the WordPress translation. It should be self-explanatory to change the way sections, subsections, proofs and theorem-like environments are typeset, and to change the numbering scheme for theorem-like environments.</p>
<p>
The variable <img src='http://s0.wp.com/latex.php?latex=%7BM%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{M}' title='{M}' class='latex' /> in latex2wpstyle.py contains a list of pairs of strings. For every pair, every occurrence of the first string in the document is replaced by an occurrence of the second before proceeding to the conversion from LaTeX to WordPress. If you want to use simple macros (which do not involve parameter-passing) then edit <img src='http://s0.wp.com/latex.php?latex=%7BM%7D&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='{M}' title='{M}' class='latex' /> to add support for your own LaTeX macros. (You will have to define the macros in macrosblog.tex as well, otherwise you will not be able to compile your LaTeX file and preview it.)</p>
<p>
Some macros are already defined. For example, backslash-E produces an expectation symbol:</p>
<p><p align="center"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle++%5Cmathop%7B%5Cmathbb+E%7D_%7Bx+%5Cin+X%7D+f%28x%29+%3A%3D+%5Csum_%7Bx%5Cin+X%7D+%5Cmathop%7B%5Cmathbb+P%7D+%5Bx%5D+%5Ccdot+f%28x%29+&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='&#92;displaystyle  &#92;mathop{&#92;mathbb E}_{x &#92;in X} f(x) := &#92;sum_{x&#92;in X} &#92;mathop{&#92;mathbb P} [x] &#92;cdot f(x) ' title='&#92;displaystyle  &#92;mathop{&#92;mathbb E}_{x &#92;in X} f(x) := &#92;sum_{x&#92;in X} &#92;mathop{&#92;mathbb P} [x] &#92;cdot f(x) ' class='latex' /></p>
<p>
Some more macros (see the LaTeX source)</p>
<p><p align="center"><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle++%5C%7B+0%2C1+%5C%7D%2C+%7B%5Cmathbb+R%7D+%2C+%7B%5Cmathbb+C%7D%2C+%7B%5Cmathbb+Z%7D%2C+%7B%5Cmathbb+N%7D+%2C+%7B%5Cmathbb+Q%7D%2C+%5Cepsilon+&amp;bg=ffffff&amp;fg=000000&amp;s=0' alt='&#92;displaystyle  &#92;{ 0,1 &#92;}, {&#92;mathbb R} , {&#92;mathbb C}, {&#92;mathbb Z}, {&#92;mathbb N} , {&#92;mathbb Q}, &#92;epsilon ' title='&#92;displaystyle  &#92;{ 0,1 &#92;}, {&#92;mathbb R} , {&#92;mathbb C}, {&#92;mathbb Z}, {&#92;mathbb N} , {&#92;mathbb Q}, &#92;epsilon ' class='latex' /></p>
<p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/randomku.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/randomku.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=randomku.wordpress.com&#038;blog=22529061&#038;post=1&#038;subd=randomku&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://randomku.wordpress.com/2011/04/26/hello-world/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c939517ec889b9317c98790937da243b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">timcyku</media:title>
		</media:content>

		<media:content url="http://imgs.xkcd.com/comics/donald_knuth.png" medium="image" />
	</item>
	</channel>
</rss>
