<?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/"
	>

<channel>
	<title>davinci’s notebook &#187; WordPress</title>
	<atom:link href="http://stargrads.net/blogs/davinci/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://stargrads.net/blogs/davinci</link>
	<description>everything is an experiment</description>
	<lastBuildDate>Mon, 21 Mar 2011 18:31:14 +0000</lastBuildDate>
	<language>fa</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Wikindx macro plug-in for WordPress</title>
		<link>http://stargrads.net/blogs/davinci/2009/09/wikindx-macro-plug-in-for-wordpress/</link>
		<comments>http://stargrads.net/blogs/davinci/2009/09/wikindx-macro-plug-in-for-wordpress/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 16:20:11 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[★grads.net]]></category>
		<category><![CDATA[programming and technical issues]]></category>
		<category><![CDATA[Footnotes]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plug-in]]></category>
		<category><![CDATA[plug-ins]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[regular expressions]]></category>
		<category><![CDATA[Rob Miller]]></category>
		<category><![CDATA[WIKINDX]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=1860</guid>
		<description><![CDATA[
A small plug-in for WordPress, which adds a macro for inserting bibliography information from WIKINDX.
]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://stargrads.net/blogs/davinci/2009/06/using-jsmath-with-wordpress-bbpress-and-wikindx/">this previous post</a>, I had actually made use of a small plug-in I had written for <a href="http://wordpress.org/">WordPress</a>, which creates a macro for pulling bibliographical information from <a href="http://wikindx.sourceforge.net/"><span style="font-variant: small-caps">Wikindx</span></a>, which I use to manage my <a href="http://stargrads.net/bibliography/">bibliography</a>.</p>
<p>The plug-in is rather simple, but since a web search turned up nothing similar (which is kind of surprising), and someone might find it useful, I thought I&#8217;d post it here<span id="more-1860"></span>.</p>
<p>Here is the code for &#8220;wikindx.php&#8221;:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>?php
<span style="color: #666666; font-style: italic;">/* 
Plugin Name: Wikindx
Plugin URL: http://stargrads.net/blogs/davinci/2009/09/wikindx-macro-plug-in-for-wordpress
Description: Adds a macro to WordPress to insert bibliography information from Wikindx.
Author: D. L. Yonge-Mallo
Version: 1.0
Author URI: http://stargrads.net/blogs/davinci/
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> parse_wikindx<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$WikindxPath</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://path.to/wikindx/&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #990000;">preg_match_all</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#&amp;lt;wikindx( resource=&quot;([ \w]+)&quot;)?(&amp;gt;(.*)&amp;lt;/wikindx&amp;gt;| ?/&amp;gt;)#Usi'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wikindxs</span><span style="color: #339933;">,</span> PREG_SET_ORDER<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wikindxs</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$wikindxs</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$wikindx</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wikindx</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;ERROR: WIKINDX MISSING RESOURCE ARGUMENT&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$resourceId</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wikindx</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$WikindxPath}</span>cmsprint.php?action=getResource&amp;amp;id=<span style="color: #006699; font-weight: bold;">{$resourceId}</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">unserialize</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">base64_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$resourceId</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; ([<span style="color: #006699; font-weight: bold;">{$WikindxPath}</span>index.php?action=resourceView&amp;amp;id=<span style="color: #006699; font-weight: bold;">{$resourceId}</span> details])&quot;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;ERROR: WIKINDX RESOURCE &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$resourceId</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; NOT FOUND&quot;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wikindx</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'parse_wikindx'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
?<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Replace &ldquo;<a href="http://path.to/wikindx/">http://path.to/wikindx/</a>&rdquo; in the above with the URL to your installation of <span style="font-variant: small-caps">Wikindx</span>, obviously.  For example, mine is &ldquo;<a href="http://stargrads.net/bibliography/">http://stargrads.net/bibliography/</a>&rdquo;.</p>
<p>Put the file into the &#8220;plugins&#8221; directory on WordPress, or if you are using <a href="http://mu.wordpress.org/">WordPress<sup>&mu;</sup></a>, then into its &#8220;mu-plugins&#8221; directory.</p>
<p>The plug-in creates a new macro &#8220;wikindx&#8221; with one parameter &#8220;resource&#8221;, which can be used inside WordPress posts like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>wikindx resource<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;68&quot;</span> <span style="color: #339933;">/&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>

<p>Replace &#8220;68&#8243; in the example with the resource ID of the bibliography entry whose information you want.  (This ID can be found in the URL of the resource&#8217;s page on <span style="font-variant: small-caps">Wikindx</span>.)  The result is that the macro is replaced by the bibliographical information for that resource.  For the above example, this would be:</p>
<blockquote><p>R. Cleve, D. Gavinsky, and D. L. Yonge-Mallo, “Quantum Algorithms for Evaluating Min-Max Trees,” in <em>Proc. TQC 2008</em>, Tokyo, Japan, 2008, (<a href="http://stargrads.net/bibliography/index.php?action=resourceView&#038;id=68">details</a>)</p></blockquote>
<p>This plug-in can be used to good effect with <a href="http://robm.me.uk/projects/plugins/wordpress/footnotes">Rob Miller&#8217;s Footnotes plug-in for WordPress</a>, like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>ref name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;CGMSY08&quot;</span><span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;&amp;</span>lt<span style="color: #339933;">;</span>wikindx resource<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;206&quot;</span> <span style="color: #339933;">/&amp;</span>gt<span style="color: #339933;">;&amp;</span>lt<span style="color: #339933;">;/</span>ref<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>

<p>The result<sup><a class='footnote' id='note-1860-1' href='#footnote-1860-CGMSY08'>[1]</a></sup> can be seen in the footnote below.</p>
<p>&#8211; davinci 11780</p>
<hr />
<p><b>Update (Sept. 15, 2009):</b> I&#8217;ve added the plug-in to the <a href="http://wordpress.org/extend/plugins/wikindx-macro-plug-in-for-wordpress/">WordPress Plugin Directory</a>.</p>
<img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=1860&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://stargrads.net/blogs/davinci/2009/08/using-the-ajaxified-expand-post-now-plugin-with-rob-millers-footnotes-plugin/' rel='bookmark' title='Using the Ajaxified Expand Post Now plug-in with Rob Miller&#8217;s Footnotes plug-in'>Using the Ajaxified Expand Post Now plug-in with Rob Miller&#8217;s Footnotes plug-in</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/09/annotate-with-jarnal-plug-in-module-for-wikindx/' rel='bookmark' title='Annotate With Jarnal Plug-In Module for Wikindx'>Annotate With Jarnal Plug-In Module for Wikindx</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/06/using-jsmath-with-wordpress-bbpress-and-wikindx/' rel='bookmark' title='Using jsMath with WordPress, bbPress, and Wikindx'>Using jsMath with WordPress, bbPress, and Wikindx</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2009/09/wikindx-macro-plug-in-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using the Ajaxified Expand Post Now plug-in with Rob Miller&#8217;s Footnotes plug-in</title>
		<link>http://stargrads.net/blogs/davinci/2009/08/using-the-ajaxified-expand-post-now-plugin-with-rob-millers-footnotes-plugin/</link>
		<comments>http://stargrads.net/blogs/davinci/2009/08/using-the-ajaxified-expand-post-now-plugin-with-rob-millers-footnotes-plugin/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 04:38:27 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[★grads.net]]></category>
		<category><![CDATA[programming and technical issues]]></category>
		<category><![CDATA[AEPN]]></category>
		<category><![CDATA[Ajaxified Expand Post NOW]]></category>
		<category><![CDATA[Footnotes]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[mashup]]></category>
		<category><![CDATA[plug-ins]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Rob Miller]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=1077</guid>
		<description><![CDATA[
A technical post on how to use the Ajaxified Expand Post NOW plug-in and Rob Miller's Footnotes plug-in for WordPress together.
]]></description>
			<content:encoded><![CDATA[<p>This is a little technical post for anyone who is interested in using the Ajaxified Expand Post NOW plug-in<sup><a class='footnote' id='note-1077-1' href='#footnote-1077-aepn'>[1]</a></sup> and Rob Miller&#8217;s Footnotes plug-in<sup><a class='footnote' id='note-1077-2' href='#footnote-1077-footnotes'>[2]</a></sup> together.  On <a href="http://stargrads.net">this</a> website, I&#8217;m running AEPN version 0.7 beta 7, Footnotes version 1.2.1, and WordPress<sup>&mu;</sup> version 2.8.2, which are the latest versions as of this writing.  </p>
<p>The AEPN plug-in truncates a post and appends an<span id="more-1077"></span> &#8220;[Expand post]&#8221; button, whenever it is displayed other than on a single page by itself.  Clicking on the button fetches and displays the rest of the post.  The Footnotes plug-in should be self-explanatory.</p>
<p>The problem with using these two plug-ins together is that if any citations are made before the fold (i.e., the <code>&lt;!--more--&gt;</code> tag), the corresponding footnotes will appear at the bottom of the (collapsed) post.  When the post is subsequently expanded, those footnotes will appear again at the end of the expansion, so that they are displayed twice.</p>
<p>The fix for this is rather simple.  In the &#8220;footnotes.php&#8221; file, surround the final if-else block with a test to see if a single post is being displayed.  If so, execute the block as before.  Otherwise, return the post&#8217;s content without the accompanying footer.  The code should look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>	
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&amp;lt;references /&amp;gt;'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$footer</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">else</span>
        <span style="color: #b1b100;">return</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&amp;lt;references /&amp;gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$footer</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>When the AEPN plug-in fetches a post to expand it, it is treated as a single post, and so the footnotes will show up correctly &#8212; once, at the bottom of the expansion.</p>
<p>In the &#8220;ajaxified-expand-post-now.php&#8221; file, add the following lines to the top of the &#8220;getPost&#8221; function:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$post</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>ID <span style="color: #339933;">=</span> <span style="color: #000088;">$id</span><span style="color: #339933;">;</span></pre></div></div>

<p>This is needed so that the names for the footnote anchors in the expanded portion of the post are generated correctly.  Citations made before the fold will link to the post&#8217;s single page, whereas citations made after it<sup><a class='footnote' id='note-1077-3' href='#footnote-1077-example'>[3]</a></sup> will link to the footnotes section at the bottom of the expansion, on the current page.</p>
<p>Finally, it may be necessary to use a so-called &#8220;<a href="http://mu.wordpress.org/forums/tags/kses">kses</a> hack&#8221; to prevent the &#8220;ref&#8221; and &#8220;references&#8221; tags needed by the Footnotes plug-in from being stripped by WordPress<sup>&mu;</sup>.  How to do this is beyond the scope of this post.</p>
<p>See also <a href="http://stargrads.net/blogs/davinci/2009/06/using-jsmath-with-wordpress-bbpress-and-wikindx/">this previous post</a> for an example of how the Footnotes plug-in can be used with the <a href="http://wikindx.sourceforge.net/"><span style="font-variant: small-caps">Wikindx</span></a> bibliographical management system to create a bibliographical citation. </p>
<p>&#8211; davinci</p>
<img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=1077&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://stargrads.net/blogs/davinci/2009/09/wikindx-macro-plug-in-for-wordpress/' rel='bookmark' title='Wikindx macro plug-in for WordPress'>Wikindx macro plug-in for WordPress</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/09/annotate-with-jarnal-plug-in-module-for-wikindx/' rel='bookmark' title='Annotate With Jarnal Plug-In Module for Wikindx'>Annotate With Jarnal Plug-In Module for Wikindx</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2009/08/using-the-ajaxified-expand-post-now-plugin-with-rob-millers-footnotes-plugin/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Using jsMath with WordPress, bbPress, and Wikindx</title>
		<link>http://stargrads.net/blogs/davinci/2009/06/using-jsmath-with-wordpress-bbpress-and-wikindx/</link>
		<comments>http://stargrads.net/blogs/davinci/2009/06/using-jsmath-with-wordpress-bbpress-and-wikindx/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 18:27:57 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[★grads.net]]></category>
		<category><![CDATA[programming and technical issues]]></category>
		<category><![CDATA[bbPress]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[jsMath]]></category>
		<category><![CDATA[mashup]]></category>
		<category><![CDATA[WIKINDX]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=867</guid>
		<description><![CDATA[
This post describes how to integrate jsMath with WordPress, bbPress, and Wikindx.
]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s really no special trick to using <a href="http://www.math.union.edu/~dpvc/jsMath/">jsMath</a> with <a href="http://wordpress.org/">WordPress</a>, <a href="http://bbpress.org/">bbPress</a>, or <a href="http://wikindx.sourceforge.net/"><span style="font-variant: small-caps">Wikindx</span></a> &#8212; just follow the <a href="http://www.math.union.edu/~dpvc/jsMath/authors/installation.html">installation instructions</a>.</p>
<p>Essentially, you just need to add the following code in the header of your web site (where &ldquo;<em>path.to</em>&rdquo; should be replaced with the URL to your installation of jsMath):</p>
<blockquote><p>&lt;script type=&quot;text/javascript&quot; src=&quot;http://<em>path.to</em>/jsMath/easy/load.js&quot;&gt;&lt;/script&gt;</p></blockquote>
<p>For <a href="http://stargrads.net"><em>this</em> web site</a>, the above line was added to the headers of each of the template files of the component software packages.  </p>
<p>One <em>minor</em> trick to getting jsMath to work with <span style="font-variant: small-caps">Wikindx</span> is that all special characters have to be escaped properly\(\)<span id="more-867"></span>.  For example, to get the title of Mario Szegedy&#8217;s paper<sup><a class='footnote' id='note-867-1' href='#footnote-867-S04'>[1]</a></sup> on quantum walks to display correctly, as seen <a href="http://stargrads.net/bibliography/index.php?action=resourceView&amp;id=194">here</a>, I had to enter the title as:</p>
<blockquote><p>Spectra of Quantized Walks and a \$\sqrt{{}\delta\epsilon{}}\$-Rule</p></blockquote>
<p>That is, where the LaTeX math syntax requires a left curly bracket, you enter &#8220;{{}&#8221;, and where it requires a right curly bracket, you enter &#8220;{}}&#8221;.  The title then appears as in the footnote below.</p>
<p>I have created a <a href="http://stargrads.net/wiki/Help:Setup">setup help page</a> on the wiki to record details such as these.  Also, see <a href="http://stargrads.net/forums/topic.php?id=3">this forum post</a> for some macros defined for use on this site.</p>
<p>&#8211; davinci</p>
<img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=867&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://stargrads.net/blogs/davinci/2009/09/wikindx-macro-plug-in-for-wordpress/' rel='bookmark' title='Wikindx macro plug-in for WordPress'>Wikindx macro plug-in for WordPress</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/08/using-the-ajaxified-expand-post-now-plugin-with-rob-millers-footnotes-plugin/' rel='bookmark' title='Using the Ajaxified Expand Post Now plug-in with Rob Miller&#8217;s Footnotes plug-in'>Using the Ajaxified Expand Post Now plug-in with Rob Miller&#8217;s Footnotes plug-in</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/09/annotate-with-jarnal-plug-in-module-for-wikindx/' rel='bookmark' title='Annotate With Jarnal Plug-In Module for Wikindx'>Annotate With Jarnal Plug-In Module for Wikindx</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2009/06/using-jsmath-with-wordpress-bbpress-and-wikindx/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Why my own website?</title>
		<link>http://stargrads.net/blogs/davinci/2008/10/why-my-own-website/</link>
		<comments>http://stargrads.net/blogs/davinci/2008/10/why-my-own-website/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 20:00:23 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[open notebook science]]></category>
		<category><![CDATA[arXiv]]></category>
		<category><![CDATA[bbPress]]></category>
		<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[OpenWetWare]]></category>
		<category><![CDATA[UsefulChem]]></category>
		<category><![CDATA[WIKINDX]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=5</guid>
		<description><![CDATA[
An explanation of why I needed my own "open notebook science" web site, instead of attaching myself to an existing one.
]]></description>
			<content:encoded><![CDATA[<p>There are already plenty of open notebook and collaborative science initiatives out there, so why roll my own website?</p>
<p>To begin with, I didn&#8217;t find any ready-made projects which exactly suited my needs.  The most impressive, and the one which came the closest to what I was looking for, is <a href="http://www.openwetware.org/">OpenWetWare</a>, but its focus is on biology and biological engineering.  Chemists have also gotten into the act with <a href="http://usefulchem.wikispaces.com">UsefulChem</a>, which is hosted on <a href="http://www.wikispaces.com">wikispaces</a>.  </p>
<p>I did not locate any project of a similar scope or scale for physics or, perhaps ironically, computer science<span id="more-5"></span>.  The physics community is actually an early adopter of electronic scientific publishing, with its embrace of the <a href="http://www.arxiv.org">arXiv</a> since 1991.  And the quantum community has not just one but two &#8212; count &#8216;em, <em>two</em> &#8212; whole wikis to itself: <a href="http://www.quantiki.org/">Quantiki</a> and <a href="http://qwiki.stanford.edu/">Qwiki</a>.  <a href="http://michaelnielsen.org">Michael Nielsen</a> (the Mike of <a href="http://books.google.com/books?id=65FqEKQOfP8C">Mike and Ike</a>, which is widely considered <em>the</em> standard text for quantum computation) has written an extensive post about <a href="http://michaelnielsen.org/blog/?p=448">the opening up of scientific culture</a>.  </p>
<p>Another reason for building the site myself, instead of relying on a ready-made solution, is the degree of control I would have over its customization.  For a biologist or chemist, communications technologies such as blogs and wikis are only tools.  But for a computer scientist, these technologies are themselves objects of study.  </p>
<p>Following OpenWetWare&#8217;s example, I have installed <a href="http://www.mediawiki.org/">MediaWiki</a> (for wikis) and <a href="http://wordpress.org/">WordPress</a> (for blogs), and I have also added <a href="http://bbpress.org">bbPress</a> (for bulletin boards) and <a href="http://http://wikindx.sourceforge.net/">WIKINDX</a> (for bibliography management) into the mix.</p>
<p>Despite the fact that the name &#9733;grads.net, which came to me in a fit of inspiration, suggests multiple grad(uate student)s, for now this experiment in open notebook science is mine alone.</p>
<p>&#8211; davinci</p>
<img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=5&type=feed" alt="" /><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2008/10/why-my-own-website/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

