<?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>News from MathTran</title>
	<atom:link href="http://mathtran.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mathtran.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Mon, 21 Jul 2008 16:35:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mathtran.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>News from MathTran</title>
		<link>http://mathtran.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mathtran.wordpress.com/osd.xml" title="News from MathTran" />
	<atom:link rel='hub' href='http://mathtran.wordpress.com/?pushpress=hub'/>
		<item>
		<title>JavaScript event handling problems</title>
		<link>http://mathtran.wordpress.com/2008/07/21/javascript-event-handling-problems/</link>
		<comments>http://mathtran.wordpress.com/2008/07/21/javascript-event-handling-problems/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 16:35:48 +0000</pubDate>
		<dc:creator>mystar22</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mathtran.wordpress.com/?p=10</guid>
		<description><![CDATA[For our live preview online TeX editor we would like to handle key events of a textarea. Depending on the context we want to intercept the key events and let the default action happen (i.e. a character will be inserted into the textarea or the cursor will be moved) or prevent the default action and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=10&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For our live preview online TeX editor we would like to handle key events of a textarea. Depending on the context we want to intercept the key events and let the default action happen (i.e. a character will be inserted into the textarea or the cursor will be moved) or prevent the default action and execute our own code based on the information of the key event.</p>
<p>Well, little we knew of how difficult it is to get the event information you need due to various browser incompatibilities. We had to do some research on the topic and would like to share our findings here for future reference.</p>
<p>First of all, Peter-Paul Koch has an interesting <a href="http://www.quirksmode.org/dom/events/index.html">blog entry</a> with event compatibility tables for various browsers. There, you can already see that the key events are not all cross-browser compatible. As we are especially interested in these events, Jan Wolter&#8217;s <a href="http://unixpapa.com/js/key.html">JavaScript Madness: Keyboard Events</a> proved to be an extremely valuable resource.</p>
<p>Based on the above articles we decided to use the keydown event to handle all special keys, which means keys that do not produce a character, i.e. Enter, Backspace, the arrow keys. To handle character input we use the keypress event. The keypress event object has a property which holds the character that corresponds to the pressed key or keys. This property has different names in different browsers but is available in all of them. An additional difficulty is the fact that some browsers do fire keypress events for special keys and some do not.</p>
<p>For jQuery, there exists a plugin called <a href="http://www.koders.com/javascript/fidC59D4E1952DA17E0A87C9BDB30F18E8666538DD9.aspx?s=window">fix_events</a>, which can be used to normalize event properties. Currently we do not use this plugin because our use would be very limited. Instead we incorporated the compatibility checks within our code.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mathtran.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mathtran.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mathtran.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mathtran.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mathtran.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mathtran.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mathtran.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mathtran.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mathtran.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mathtran.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mathtran.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mathtran.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mathtran.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mathtran.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mathtran.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mathtran.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=10&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mathtran.wordpress.com/2008/07/21/javascript-event-handling-problems/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ab7e755331e387a4d1f3b5bc2e92c4f6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mystar22</media:title>
		</media:content>
	</item>
		<item>
		<title>More on testing JavaScript code</title>
		<link>http://mathtran.wordpress.com/2008/07/08/more-on-testing-javascript-code/</link>
		<comments>http://mathtran.wordpress.com/2008/07/08/more-on-testing-javascript-code/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 17:24:38 +0000</pubDate>
		<dc:creator>mystar22</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mathtran.wordpress.com/?p=9</guid>
		<description><![CDATA[In a previous post I talked about how we would like to test &#8216;pure&#8217; (i.e. DOM independent) JavaScript functions in an automated fashion. Spidermonkey offers a command line interpreter and the ability to call scripts like js.exe -f "script1.js" -f "script2.js" -e "run_this();". Unfortunately, both of these features are not available for Windows cscript.exe, cscript [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=9&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In a previous post I talked about how we would like to test &#8216;pure&#8217; (i.e. DOM independent) JavaScript functions in an automated fashion.</p>
<p>Spidermonkey offers a command line interpreter and the ability to call scripts like <code>js.exe -f "script1.js" -f "script2.js" -e "run_this();"</code>. Unfortunately, both of these features are not available for Windows cscript.exe, cscript can only execute one script file and terminates after it is done.</p>
<p>Koby Kahane has created a <a href="http://kobyk.wordpress.com/2007/09/14/a-jscript-interactive-interpreter-shell-for-the-windows-script-host/">workaround</a> to add command line interpreter abilities to cscript (although his code did not work for me). In order to be able to load different script files and execute commands using a single command, we wrote a litle python script which uses the same interface as spidermonkey&#8217;s js.exe, create a temporary file, and call cscript with this file.</p>
<p>Here is the code (no error checking) msjs.py:
<p>&nbsp;</p>
<pre>
import sys, os
import subprocess

def main(argv):

    tmp_filename = 'msjs_tmp_file.wsf'
    includes = ''
    executes = ''

    for i in range(len(argv)) :
        if argv[i]=='-f' :
            includes += '\n' % argv[i+1]
        elif argv[i]=='-e' :
            executes += '\n\t%s\n\n' % argv[i+1]

    code = '\n%s%s\n' % (includes, executes)

    tmp_file = open(tmp_filename,'w')
    tmp_file.write(code)
    tmp_file.close()

    subprocess.Popen('cscript.exe '+tmp_filename).communicate()[0]

    os.remove(tmp_filename)

if __name__ == '__main__' :
    main(sys.argv[1:])
</pre>
<p>&nbsp;</p>
<p>The use of a real temporary file using the <code>tempfile</code> module is not possible, as in Windows you cannot open the temporary file a second time, which cscript would have to do.</p>
<p>Let us assume that we have a file <code>add_def.js</code>
<p>&nbsp;</p>
<pre>
// Provide 'print' command in Windows scripting - cscript.
if (typeof WScript == 'object'){
    function print(str){
        WScript.echo(str)
    }
}

add = function(a,b){return a+b;}
</pre>
<p>&nbsp;</p>
<p>Now, we can do <code>python msjs.py -f "add_def.js" -e "print(add(2,3));"</code> and it will result in the same code being called by cscript as by js.exe for the same command. The generated temporary file looks like this:
<p>&nbsp;</p>
<pre>
&lt;job&gt;
&lt;script language="JScript" src="add_def.js"/&gt;
&lt;script language="JScript"&gt;
	print(add(3,4));
&lt;/script&gt;
&lt;/job&gt;
</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mathtran.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mathtran.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mathtran.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mathtran.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mathtran.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mathtran.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mathtran.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mathtran.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mathtran.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mathtran.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mathtran.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mathtran.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mathtran.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mathtran.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mathtran.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mathtran.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=9&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mathtran.wordpress.com/2008/07/08/more-on-testing-javascript-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ab7e755331e387a4d1f3b5bc2e92c4f6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mystar22</media:title>
		</media:content>
	</item>
		<item>
		<title>JavaScript split problems</title>
		<link>http://mathtran.wordpress.com/2008/06/19/javascript-split-problems/</link>
		<comments>http://mathtran.wordpress.com/2008/06/19/javascript-split-problems/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 18:31:59 +0000</pubDate>
		<dc:creator>mystar22</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mathtran.wordpress.com/?p=8</guid>
		<description><![CDATA[During the development of some string manipulation methods we ran into some problems with the JavaScript implementation of the split method in different browsers when using regular expressions as delimiters. Other people have had this problem before and Steven Levithan has a nice article about the topic including a script which fixes the inconsistencies between [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=8&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>During the development of some string manipulation methods we ran into some problems with the JavaScript implementation of the split method in different browsers when using regular expressions as delimiters. Other people have had this problem before and Steven Levithan has a nice <a href="http://blog.stevenlevithan.com/archives/cross-browser-split">article</a> about the topic including a script which fixes the inconsistencies between the different browsers, and a test page.</p>
<p>We decided not to use his implementation of the split method, because we do not want to rely on third party code which we have to supply with our distribution and which might break with new browser versions coming out. Instead, we will use a work-around only containing JavaScript code which is consistent among different browsers.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mathtran.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mathtran.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mathtran.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mathtran.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mathtran.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mathtran.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mathtran.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mathtran.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mathtran.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mathtran.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mathtran.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mathtran.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mathtran.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mathtran.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mathtran.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mathtran.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=8&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mathtran.wordpress.com/2008/06/19/javascript-split-problems/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ab7e755331e387a4d1f3b5bc2e92c4f6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mystar22</media:title>
		</media:content>
	</item>
		<item>
		<title>Writing testable string manipulation code</title>
		<link>http://mathtran.wordpress.com/2008/06/19/writing-testable-string-manipulation-code/</link>
		<comments>http://mathtran.wordpress.com/2008/06/19/writing-testable-string-manipulation-code/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 14:07:53 +0000</pubDate>
		<dc:creator>mystar22</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mathtran.wordpress.com/?p=7</guid>
		<description><![CDATA[For our project we need a lot of string manipulation code. For example, given a textarea and a selection range, we want to extract the paragraph containing the selection and, later, extract the TeX code parts in that paragraph. We decided to use test driven development for writing cross-browser code for these tasks. A set [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=7&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For our project we need a lot of string manipulation code. For example, given a textarea and a selection range, we want to extract the paragraph containing the selection and, later, extract the TeX code parts in that paragraph.</p>
<p>We decided to use test driven development for writing cross-browser code for these tasks. A set of tests is designed, which consist of input parameters and the expected output a function should return when called with the given input parameters. Whenever our function does not give the expected output an error message is printed and we know that the code is not correct.</p>
<p>The test framework then consists of the function X that we want to test, the tests, and a test runner function which runs the tests on X and compares the actual output with the expected output. To do this in an automated fashion, we call the js file with a JavaScript interpreter. For Windows we use <a href="http://www.mozilla.org/js/spidermonkey/">SpiderMonkey</a> (Mozilla&#8217;s implementation of JavaScript) and the build-in Windows Script Host.</p>
<p>After installing SpiderMonkey, we can call our script with &#8220;js X.js&#8221;, to use the Windows Script Host run &#8220;cscript X.js&#8221;</p>
<p>This setup allows us to test our code on Mozilla&#8217;s and Windows&#8217; JavaScript implementation using the same test data on the command line.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mathtran.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mathtran.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mathtran.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mathtran.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mathtran.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mathtran.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mathtran.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mathtran.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mathtran.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mathtran.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mathtran.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mathtran.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mathtran.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mathtran.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mathtran.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mathtran.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=7&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mathtran.wordpress.com/2008/06/19/writing-testable-string-manipulation-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ab7e755331e387a4d1f3b5bc2e92c4f6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mystar22</media:title>
		</media:content>
	</item>
		<item>
		<title>Demonstration of autocomplete</title>
		<link>http://mathtran.wordpress.com/2008/06/15/demonstration-of-autocomplete/</link>
		<comments>http://mathtran.wordpress.com/2008/06/15/demonstration-of-autocomplete/#comments</comments>
		<pubDate>Sun, 15 Jun 2008 13:36:51 +0000</pubDate>
		<dc:creator>jonathanfine</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mathtran.wordpress.com/?p=6</guid>
		<description><![CDATA[While I&#8217;ve been away on holiday Christoph has completed a demonstration version of TeX-command autocompletion.  You can play with it here. I&#8217;m very please with what he&#8217;s done, and am interested in producing an online version of Scott Pakin&#8217;s Comprehensive LaTeX symbol list (view as PDF), which has several thousand symbols. In most situations, there [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=6&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While I&#8217;ve been away on holiday Christoph has completed a demonstration version of TeX-command autocompletion.  You can play with it <a href="http://www.mathtran.org/toys/chafemeister/autocomplete.html">here</a>.</p>
<p>I&#8217;m very please with what he&#8217;s done, and am interested in producing an online version of Scott Pakin&#8217;s Comprehensive LaTeX symbol list (<a href="http://www.ctan.org/tex-archive/info/symbols/comprehensive/symbols-a4.pdf">view as PDF</a>), which has several thousand symbols.</p>
<p>In most situations, there will be a subset of relevant symbols, which will depend on what is being authored.  Many symbols are required only in special areas.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mathtran.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mathtran.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mathtran.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mathtran.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mathtran.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mathtran.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mathtran.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mathtran.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mathtran.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mathtran.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mathtran.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mathtran.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mathtran.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mathtran.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mathtran.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mathtran.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=6&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mathtran.wordpress.com/2008/06/15/demonstration-of-autocomplete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/242d7f27bd60774efd964dbe680aacda?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jonathanfine</media:title>
		</media:content>
	</item>
		<item>
		<title>Autocomplete for Tex commands</title>
		<link>http://mathtran.wordpress.com/2008/05/04/autocomplete-for-tex-commands/</link>
		<comments>http://mathtran.wordpress.com/2008/05/04/autocomplete-for-tex-commands/#comments</comments>
		<pubDate>Sun, 04 May 2008 18:16:14 +0000</pubDate>
		<dc:creator>mystar22</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mathtran.wordpress.com/?p=5</guid>
		<description><![CDATA[As we have decided on using jQuery for the MathTran online Tex editor, I have been looking for some jQuery plugins to provide autocomplete functionality for Tex commands. The jQuery Autocomplete Mod found at http://www.pengoworks.com/workshop/jquery/autocomplete.htm looks promising but it requires a few changes. Ideally the plugin should work for text in a textarea, suggesting commands [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=5&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As we have decided on using jQuery for the MathTran online Tex editor, I have been looking for some jQuery plugins to provide autocomplete functionality for Tex commands.</p>
<p>The jQuery Autocomplete Mod found at  <a href="http://www.pengoworks.com/workshop/jquery/autocomplete.htm">http://www.pengoworks.com/workshop/jquery/autocomplete.htm</a> looks promising but it requires a few changes. Ideally the plugin should work for text in a textarea, suggesting commands for the last typed characters just underneath the cursor. The plugins I have found so far were designed for input fields of type text and used the whole value of the field to query the database of known words.</p>
<p>I will continue looking for an existing plugin with the required features, but might have to modify one of the existing ones to fit my needs.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mathtran.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mathtran.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mathtran.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mathtran.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mathtran.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mathtran.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mathtran.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mathtran.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mathtran.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mathtran.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mathtran.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mathtran.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mathtran.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mathtran.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mathtran.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mathtran.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=5&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mathtran.wordpress.com/2008/05/04/autocomplete-for-tex-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ab7e755331e387a4d1f3b5bc2e92c4f6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mystar22</media:title>
		</media:content>
	</item>
		<item>
		<title>GSOC: Getting started</title>
		<link>http://mathtran.wordpress.com/2008/04/25/gsoc-getting-started/</link>
		<comments>http://mathtran.wordpress.com/2008/04/25/gsoc-getting-started/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 12:02:57 +0000</pubDate>
		<dc:creator>jonathanfine</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mathtran.wordpress.com/?p=4</guid>
		<description><![CDATA[Why we need some books As part of the Google Summer of Code (GSOC), I will be mentoring Christoph Hafmeister&#8217;s project to create an OnLine TeX Editor. This will be written in JavaScript, and will use the public MathTran server to provide TeX typesetting as a web service. It will offer something close to instant [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=4&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Why we need some books</h2>
<p>As part of the Google Summer of Code (GSOC), I will be mentoring Christoph Hafmeister&#8217;s project to create an OnLine TeX Editor.  This will be written in JavaScript, and will use the public MathTran server to provide TeX typesetting as a web service.  It will offer something close to instant preview for mathematics (network connections permitting).</p>
<p>To help us learn the tricks of the trade, we&#8217;ve decided to buy some books. And to help us communicate, we&#8217;ll both have a copy of these books. That way, it&#8217;s easier for us to share our experiences, even though we&#8217;re not likely to meet during the project. (This is one of the big changes the rise of print made to learning, in the 16th century.)</p>
<p>So here are the books we&#8217;ll be sharing, and why.</p>
<p><span id="more-4"></span></p>
<h2>JavaScript framework</h2>
<p>I&#8217;ve some work to do on MathTran JavaScript between now and the end of May (and then Christoph will start coding). Previously MathTran has not used a JavaScript framework, but now it&#8217;s time. I&#8217;ve done some research, and heard good things about jQuery. I also like the thinking and coding style it encourages. So we&#8217;ll be using that as a starting point, and the goal is to write the OnLine TeX Editor (and some other goodies) in jQuery. A second goal is to develop a MathTran plugin for jQuery, so other jQuery users can make use of our work.</p>
<p>Here&#8217;s the jQuery books we&#8217;ll be using.</p>
<ul>
<li><a href="http://www.packtpub.com/jQuery/book">Learning jQuery</a>, by <a title="Karl Swedberg" href="http://www.karlswedberg.com/">Karl Swedberg</a> and <a title="Jonathan Chaffer" href="http://drupal.org/user/831">Jonathan Chaffer</a></li>
<li><a href="http://www.packtpub.com/jquery-reference-guide-Open-Source/book">jQuery Reference Guide</a>, by the same authors</li>
</ul>
<p>I&#8217;ve got them both already (by PDF download) and they&#8217;re pretty good.  I prefer the Reference Guide, because I like understand the fundamentals (rather than getting on and doing something new).</p>
<h2>JavaScript and DHTML reference</h2>
<p>The jQuery framework is good at selecting items on the page and doing things with them. But we&#8217;ll need to build some custom widgets and controls, and for that we&#8217;ll need to know some low-level JavaScript and DHMTL. For this purpose I&#8217;ve chosen</p>
<ul>
<li><a href="http://www.oreilly.com/catalog/9780596514082/index.html"> JavaScript &amp; DHTML Cookbook</a>, by <a href="http://dannyg.com/">Danny Goodman</a></li>
</ul>
<h2>Hacking into pages</h2>
<p>There&#8217;s lots of pages out there that really need better support for mathematics, and whose users would welcome the OnLine TeX Editor.  WordPress, for example, has amongst the best support for mathematics, but it does not provide anything like instant preview.  Fortunately, add-ons and extensions, such as GreaseMonkey, allow users to provide JavaScript extras that run on selected pages.</p>
<p>Here&#8217;s an example.  Every working day the <a href="http://arxiv.org">arXiv</a> publishes hundreds of new mathematics and physics preprints.  Here&#8217;s the abstracts for <a href="http://http://arxiv.org/list/math/new">the new maths items for today.</a> Many of these abstracts contain TeX-encoded mathematics, displayed as text. Wouldn&#8217;t it be great is the user could click a button and see the rendered form of the mathematics.  (And of course another button to unrender).</p>
<p>Well, that&#8217;s what GreaseMonkey extensions are all about. And here I&#8217;ve chosen</p>
<ul>
<li><a href="http://www.oreilly.com/catalog/greasemonkeyhks/index.html">Greasemonkey Hacks</a>, by <a href="http://diveintomark.org/">Mark Pilgrim</a></li>
</ul>
<p>What I like about this book is that it tells us a lot about annoying things on web pages, and what can be done to fix them.</p>
<h2>Summary</h2>
<p>So we&#8217;ve got four books, with about 1600 pages in total, to use as reference, and to read when we&#8217;re stuck. I&#8217;m pleased with the jQuery books, and the GreaseMonkey book has some inspiring recipes. I&#8217;ve not yet seen Goodman&#8217;s DHTML Cookbook, but from the table of contents it deals with resizing of text, which is a key feature for the display of TeX-rendered mathematics.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mathtran.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mathtran.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mathtran.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mathtran.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mathtran.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mathtran.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mathtran.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mathtran.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mathtran.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mathtran.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mathtran.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mathtran.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mathtran.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mathtran.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mathtran.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mathtran.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=4&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mathtran.wordpress.com/2008/04/25/gsoc-getting-started/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/242d7f27bd60774efd964dbe680aacda?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jonathanfine</media:title>
		</media:content>
	</item>
		<item>
		<title>MathTran gets Google SOC support</title>
		<link>http://mathtran.wordpress.com/2008/04/22/mathtran-gets-google-soc-support/</link>
		<comments>http://mathtran.wordpress.com/2008/04/22/mathtran-gets-google-soc-support/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 12:10:53 +0000</pubDate>
		<dc:creator>jonathanfine</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mathtran.wordpress.com/?p=3</guid>
		<description><![CDATA[I&#8217;m delighted that Google has selected Christoph Hafmeister to work on MathTran, as part of the 2008 Google Summer of Code. This is a TeX User&#8217;s Group (TUG) project. The others are Arthur Reutenauer, who&#8217;s working on improved Unicode compliance in TeX extensions, and Mojca Miklavec, who will be developing the TeXShow documentation system for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=3&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m delighted that Google has selected Christoph Hafmeister to work on <a href="http://www.mathtran.org/">MathTran</a>, as part of the 2008 Google Summer of Code. This is a TeX User&#8217;s Group (TUG) project.  The others are Arthur Reutenauer, who&#8217;s working on improved Unicode compliance in TeX extensions, and Mojca Miklavec, who will be developing the TeXShow documentation system for ConTeXt. You can find out more by following links on the <a href="http://code.google.com/soc/2008/tex/about.html">Google SOC page about TeX</a>.</p>
<p>Nothing exists in isolation. This year Google is funding 1,125 student contributors to 175 Free and Open Source projects, and some of these projects are related to Christoph&#8217;s MathTran project. The rest of this post discusses some of these connections.</p>
<p><span id="more-3"></span></p>
<h2>MathTran Online TeX Editor</h2>
<p><a href="http://code.google.com/soc/2008/tex/appinfo.html?csaid=B437D0CE91AF5615">Christoph&#8217;s Online TeX editor project</a> allows people to compose TeX interactively in a web page.  I&#8217;ve already created a <a href="http://www.mathtran.org/toys/jfine/editor2.html">proof of concept version</a> which shows that something like this is quite possible.  This prototype contains an AJAX style on-line help system, which of course will need to be populated with information about and examples of common TeX commands. The great thing about the public MathTran server, of course, is that it allows users to try out these commands and get almost instant feedback.</p>
<h2>TeXShow: finding and trying out commands</h2>
<p>Now onto the connections. First, of course, if <a href="http://code.google.com/soc/2008/tex/appinfo.html?csaid=DF7C7E9183F2E321">Mojca&#8217;s TeXShow project</a>. This is to develop further an online interface to a database of ConTeXt documentation. The same mechanisms can be used to deliver information about LaTeX and TeX commands. All front-ends, such as LaTeX and ConTeXt, handle mathematics similar to that of plain TeX, and so I hope that TeXShow will be able to supply data to the MathTran TeX editor.</p>
<h2>Usability in Moodle, JavaScript and Fluid</h2>
<p>But there are more. I work at <a href="http://www.open.ac.uk">The Open University</a>, which is a major user and developer of the <a href="http://www.moodle.org">Moodle</a> Virtual Learning Environment (VLE).  Last year Moodle had <a href="http://code.google.com/soc/2007/moodle/about.html">8 GSOC projects</a>, and this year <a href="http://code.google.com/soc/2008/moodle/about.html">they have 12</a>. Of particular interest to MathTran is <a href="http://http://code.google.com/soc/2008/moodle/appinfo.html?csaid=DFFC6CC64A7E6BFF">Laia Subirats Maté&#8217;s project on Usability Issues</a>.  She&#8217;d like to use tools from the <a href="http://fluidproject.org/">Fluid Project</a> in Moodle.  Just a couple of days, the Fluid project <a href="http://fluidproject.org/blog/2008/04/20/fluid-and-javascript-toolkits/">posted recommendations on JavaScript toolkits</a>.</p>
<p>So far, MathTran has not used JavaScript toolkits, but this has to change. For a start, we&#8217;d like MathTran to work well with at least the major toolkits, such as Dojo, MochiKit and several others. Fluid&#8217;s report on JavaScript is very helpful (and they recommend <a href="http://jQuery.com">jQuery</a>). Perhaps Laia&#8217;s usability project could similarly help with Christoph&#8217;s Online TeX Editor.</p>
<h2>Browsing Drupal Help, and usability</h2>
<p><a href="http://drupal.org">Drupal</a> is a web content management system (and <a href="http://acko.net/blog/jquery-is-in-drupal-core">has jQuery in it&#8217;s core</a>).  This year <a href="http://code.google.com/soc/2008/drupal/about.html">it has 21 projects</a>, one  of which <a href="http://code.google.com/soc/2008/drupal/appinfo.html?csaid=1E8D5E869CBD8A88">Gurpartap&#8217;s Singh&#8217;s project to Revamp the Drupal help system</a>.  One of his goals is to lead users from error or warning messages into the documentation. This is, of course, something Christoph wants to do with TeX errors. Gurpartap also wants to ease the maintenance of help files by third-party contributors, which is similar to one of Mojca&#8217;s goals.</p>
<p><a href="http://http://code.google.com/soc/2008/drupal/appinfo.html?csaid=326FA4618E91DBE2">Jimmy Berry&#8217;s Usability Testing Suite project</a> for Drupal will allow data relating to usability to be recorded and analyzed. MathTran also cares about usability, and there may be something here that can help us (particularly if Jimmy&#8217;s project produces a jQuery plug-in for capturing usability data).</p>
<h2>LaTeX support in AbiWord</h2>
<p><a href="http://www.abisource.com/">AbiWord</a> is an open source word processor. This  <a href="http://http://code.google.com/soc/2008/abisource/appinfo.html?csaid=55FCF5B951229D38">Xun Sun&#8217;s project to Improve LaTeX Support</a> will improve its LaTeX export, particularly for mathematics. This is related to a GSOC  project last year, namely <a href="http://code.google.com/soc/2007/scribus/appinfo.html?csaid=74E2F1F23A461169">Hermann Kraus&#8217;s project to Add Math Support</a> to the <a href="http://www.scribus.net/">Scribus</a> desktop publishing program.</p>
<p>(Many thanks to Mojca for telling me of Xun Sun&#8217;s project.)</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mathtran.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mathtran.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mathtran.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mathtran.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mathtran.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mathtran.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mathtran.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mathtran.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mathtran.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mathtran.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mathtran.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mathtran.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mathtran.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mathtran.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mathtran.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mathtran.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mathtran.wordpress.com&amp;blog=3505947&amp;post=3&amp;subd=mathtran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mathtran.wordpress.com/2008/04/22/mathtran-gets-google-soc-support/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/242d7f27bd60774efd964dbe680aacda?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jonathanfine</media:title>
		</media:content>
	</item>
	</channel>
</rss>
