Check my working (Web stuff)https://checkmyworking.com/en© 2010-2023 <a href="https://somethingorotherwhatever.com">Christian Lawson-Perfect</a> Fri, 08 Dec 2023 08:54:27 GMTNikola (getnikola.com)http://blogs.law.harvard.edu/tech/rss- MathJax hangout on air Q&Ahttps://checkmyworking.com/2013/11/mathjax-hangout-on-air-qa/Christian Lawson-Perfect<p>I did a <a href="https://plus.google.com/u/0/events/cfoimjlcq9ot1nag47brd81d0ss">Google+ Hangout on Air Q&A session</a> with MathJax’s Peter Krautzberger and cnx.org’s Phil Schatz last Friday. We spent about an hour and a half answering questions and talking about the way we use MathJax.</p>
<p>It was a bit awkward, since I couldn’t see who was watching, and it wasn’t very clear how to interact with the audience apart from them submitting questions, but some people seem to have found it worthwhile.</p>
<p>For your entertainment, here’s the recording:</p>
<p><span class="embed-youtube" style="text-align:center; display: block;"><iframe class="youtube-player" type="text/html" width="640" height="390" src="https://www.youtube.com/embed/rn8ZU6ScLgk?version=3&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1&wmode=transparent" frameborder="0" allowfullscreen="true"></iframe></span></p>
<p>Peter wants to run more of these Q&As in the future. I’ll make sure to attend!</p>web-stuffhttps://checkmyworking.com/2013/11/mathjax-hangout-on-air-qa/Tue, 12 Nov 2013 00:00:00 GMT
- A bookmarklet to replace WordPress.com’s image-based maths with MathJaxhttps://checkmyworking.com/2013/09/a-bookmarklet-to-replace-wordpress-coms-image-based-maths-with-mathjax/Christian Lawson-Perfect<p>I finally got fed up enough with WordPress.com’s blurry image-based maths rendering to write a bookmarklet which goes through the page replacing them with the equivalent MathJax code. I’ve added it to my <a href="https://checkmyworking.com/misc/mathjax-bookmarklet/">MathJax bookmarklet installation page</a>. Drag the “image replacement bookmarklet” to your bookmarks bar, go to a WordPress.com blog (I recommend <a href="http://gowers.wordpress.com/">Gowers’s Weblog</a>), then click the “Replace image maths with MathJax” bookmarklet.</p>
<p><strong>Update 19/09/2013: </strong>Following <a href="https://twitter.com/pkrautz/status/380438292887764992">a suggestion by Peter Krautzberger</a>, I’ve updated the bookmarklet to do the image replacement differently, so the images don’t disappear while MathJax is working. I’ve also made it work on Wikipedia.</p>latexweb-stuffhttps://checkmyworking.com/2013/09/a-bookmarklet-to-replace-wordpress-coms-image-based-maths-with-mathjax/Tue, 17 Sep 2013 23:00:00 GMT
- Talk: Computability of Bass-Serre structures in the Grzegorczyk hierarchyhttps://checkmyworking.com/2013/02/talk-computability-of-bass-serre-structures-in-the-grzegorczyk-hierarchy/Christian Lawson-Perfect<p>My chum <a href="http://www.theadventuresofdavidcushing.blogspot.co.uk/">the inimitable David Cushing</a> has started a postgrad pure maths seminar at Newcastle. Because there are only a few pure postgrads here, he asked me to give a talk about the stuff I was looking at for the PhD I gave up on last year.</p>
<p>I’ve written <a href="https://checkmyworking.com/category/research/">a few posts here</a> in the past about the Grzegorczyk hierarchy, computable groups, and so on, but I think this might be the first time I’ve presented my work to real people (apart from an impromptu hour-long braindump when one of the real seminar speakers cancelled and I decided to test my memory).</p>
<p>
<!-- TEASER_END -->
As usual, I wrote my slides using <a href="https://github.com/christianp/deckjs-maths-template">my deck.js template</a>, which I’ve finally got round to putting on GitHub. I’ve uploaded the slides – <a href="https://checkmyworking.com/misc/pgps-computable-groups-feb-2013/">you can see them here</a> – but I thought I’d have a go at using my laptop to record the audio of the talk as well. Amazingly, the little built-in microphone picked up my voice quite clearly, and you can even just about hear the questions people asked.</p>
<p>We had a few discursions about tangential topics; maybe it’s good that the recording only picked up my attempts to draw everyone back to the maths.</p>
<iframe src="https://www.youtube.com/embed/wRO_DXeI7qE" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<p>At some point I’ll gather up the energy to have another go at finishing off the paper. For now, it’s in <a href="https://github.com/christianp/PHD-Notes">my phd-notes repository on github</a>. Here’s <a href="https://github.com/christianp/PHD-Notes/raw/master/bass_serre_computability.pdf">a direct link to the PDF of the paper in progress</a>.</p>
<p><strong>Update 13/02/2013: </strong>The seminar organisers have set up <a href="http://www.students.ncl.ac.uk/stacey.aston1/postgradpureseminar/">a page with the schedule of talks</a>.</p>researchweb-stuffhttps://checkmyworking.com/2013/02/talk-computability-of-bass-serre-structures-in-the-grzegorczyk-hierarchy/Sat, 09 Feb 2013 00:00:00 GMT
- Slides from a talk about zero-knowledge protocolshttps://checkmyworking.com/2012/10/slides-from-a-talk-about-zero-knowledge-protocols/Christian Lawson-Perfect<p>I’ve just given a talk at Newcastle’s maths & stats Postgraduate Forum about zero-knowledge protocols. I don’t know very much about them but it’s an interesting topic and something fairly accessible to an audience of non-pure mathematicians.</p>
<p><a href="https://checkmyworking.com/misc/pgf/zero-knowledge%20proof/">Click here to see the slides.</a></p>
<p>I used <a href="http://imakewebthings.com/deck.js/">deck.js</a>, along with the <a href="https://checkmyworking.com/cm-web-fonts/">Computer Modern web fonts</a> and <a href="http://www.mathjax.org/">MathJax</a>, to make the slides. I think it looks pretty nice! I’ve also uploaded my <a href="https://checkmyworking.com/misc/deckjs-maths-template.zip">template deck</a>, in case you want to build on it for your own presentations. It’s a bit big because it contains all the files needed to display the Computer Modern fonts on any browser.</p>presentationsweb-stuffhttps://checkmyworking.com/2012/10/slides-from-a-talk-about-zero-knowledge-protocols/Tue, 23 Oct 2012 23:00:00 GMT
- Using Computer Modern on the webhttps://checkmyworking.com/2012/08/using-computer-modern-on-the-web/Christian Lawson-Perfect<p><em><a href="http://en.wikipedia.org/wiki/Computer_Modern">Computer Modern</a></em> is the family of typefaces developed by Donald Knuth for TeX. It’s so good-looking that some scientists do research just so they can write it up in Computer Modern.</p>
<p>The <a href="http://cm-unicode.sourceforge.net/">cm-unicode project</a> compiles versions of the Computer Modern fonts in a few formats, including TTF. I’ve run them through <a href="http://fontface.codeandmore.com/">codeandmore’s @font-face kit generator</a> to get all the weird formats that the various browsers insist on.</p>
<p>I’ve put up <a href="https://checkmyworking.com/cm-web-fonts">a page containing examples of each face in use</a> and links to packages containing everything you need to use them.</p>web-stuffhttps://checkmyworking.com/2012/08/using-computer-modern-on-the-web/Tue, 28 Aug 2012 23:00:00 GMT
- Instant MathJax preview of LaTeX typed into HTML textareashttps://checkmyworking.com/2012/06/instant-mathjax-preview-of-latex-typed-into-html-textareas/Christian Lawson-Perfect<p>I’ve completely rewritten my <em>write maths, see maths</em> library to be a little jQuery plugin that attaches itself to editable areas on pages, like <code>contenteditable</code> elements, textareas, and input boxes. When your cursor is inside some LaTeX, a little preview box appears just above it with the LaTeX rendered through <a href="http://www.mathjax.org">MathJax</a>. I’ve made <a href="http://christianp.github.com/writemaths/">a demo page on GitHub</a>, and <a href="https://github.com/christianp/writemaths">the code itself is available there too</a>. It also works in TinyMCE, if you’re into that sort of thing.</p>
<p>The first I thing I did with it was to write a WordPress plugin which applies the plugin to the comment boxes underneath posts (<a href="https://github.com/christianp/wp-writemaths-plugin">source code</a>). I’ve installed it on this site and <a href="http://aperiodical.com">The Aperiodical</a>, so you can use LaTeX with confidence, knowing that it’ll appear how you want on the page. Please try it in the comments box below!</p>latexweb-stuffhttps://checkmyworking.com/2012/06/instant-mathjax-preview-of-latex-typed-into-html-textareas/Tue, 19 Jun 2012 23:00:00 GMT
- Slides – “Putting maths notation online”https://checkmyworking.com/2012/04/slides-putting-maths-notation-online/Christian Lawson-Perfect<p>On Monday I gave a talk at Birmingham at a workshop titled, <a href="http://mathstore.ac.uk/node/2096">Using social media to engage students in mathematical sciences</a>. I have no experience of doing that, but I was invited to talk a bit about <a href="https://checkmyworking.com/misc/hestemsoc%20talk/">putting maths notation online</a>. It’s basically just a collection of links to the posts I’ve written on the subject previously, but maybe big text in small slides will be more accessible.</p>presentationsweb-stuffhttps://checkmyworking.com/2012/04/slides-putting-maths-notation-online/Thu, 19 Apr 2012 23:00:00 GMT
- A little applet to make maths for screengrabbinghttps://checkmyworking.com/2012/04/a-little-applet-to-make-maths-for-screengrabbing/Christian Lawson-Perfect<p>Paul Taylor wanted an easy way to write some maths he could take a screengrab of, for use as an icon. Before I intervened he was doing something unnatural with wikipedia, so I wrote a little applet using MathJax: “<a href="https://checkmyworking.com/misc/makebigmaths/">make big maths</a>“.</p>
<p>Quite a few tools like this exist, using mimetex or some other CGI tool to run LaTeX on a server and produce an image file. That’s far too slow and rubbish-looking for my liking, so I made my own with MathJax.</p>latexweb-stuffhttps://checkmyworking.com/2012/04/a-little-applet-to-make-maths-for-screengrabbing/Wed, 18 Apr 2012 23:00:00 GMT
- How to get beautifully typeset maths on your bloghttps://checkmyworking.com/2012/01/how-to-get-beautifully-typeset-maths-on-your-blog/Christian Lawson-Perfect<p>Lots of people have blogs where they talk about maths. Lots of these people just use plain text for mathematical notation which, while it gets the point across, isn’t as easy to read or as visually appealing as it could be. <a href="http://www.mathjax.org/" target="_blank">MathJax</a> lets you write LaTeX and get beautifully typeset mathematical notation. And it’s really really easy to set up: you just need to paste some code into the header of your blog’s theme. To make it really really <em>really</em> easy, I’ve written some very detailed instructions of what to do for each big blogging service. (If you’re reading this after I wrote it, which you definitely are, beware that the interfaces I describe may have changed, so the advice below might be inaccurate. If it is, or if you’re just having trouble following along, please leave a comment below.)
<!-- TEASER_END -->
Once you’ve got everything set up, make a post containing this text to check that it works:</p>
<pre>Maths between dollars is inline: \(\sum_{k=1}^n k = \frac{n(n+1)}{2}\).
Maths between slash-square-brackets is display:
\[\sum_{k=1}^n k = \frac{n(n+1)}{2}\]</pre>
<p>Click on the statement which best describes you.</p>
<ul>
<li><a href="https://checkmyworking.com/2012/01/how-to-get-beautifully-typeset-maths-on-your-blog/#disqus">I use Disqus comments on my blog</a></li>
<li><a href="https://checkmyworking.com/2012/01/how-to-get-beautifully-typeset-maths-on-your-blog/#intensedebate">I use IntenseDebate comments on my blog</a></li>
<li><a href="https://checkmyworking.com/2012/01/how-to-get-beautifully-typeset-maths-on-your-blog/#wordpresscom">My blog is hosted by wordpress.com</a></li>
<li><a href="https://checkmyworking.com/2012/01/how-to-get-beautifully-typeset-maths-on-your-blog/#ownwordpress">I run WordPress on my own server</a></li>
<li><a href="https://checkmyworking.com/2012/01/how-to-get-beautifully-typeset-maths-on-your-blog/#blogger">My blog is hosted by Blogger</a></li>
<li><a href="https://checkmyworking.com/2012/01/how-to-get-beautifully-typeset-maths-on-your-blog/#tumblr">My blog is hosted by Tumblr</a></li>
<li><a href="https://checkmyworking.com/2012/01/how-to-get-beautifully-typeset-maths-on-your-blog/#typepad">My blog is hosted by TypePad</a></li>
<li><a href="https://checkmyworking.com/2012/01/how-to-get-beautifully-typeset-maths-on-your-blog/#calepin">My blog is hosted by Calepin</a></li>
<li><a href="https://checkmyworking.com/2012/01/how-to-get-beautifully-typeset-maths-on-your-blog/#scriptogram">My blog is hosted by scriptogr.am</a></li>
<li><a href="https://checkmyworking.com/2012/01/how-to-get-beautifully-typeset-maths-on-your-blog/#weebly">My blog is hosted by Weebly</a></li>
<li><a href="https://checkmyworking.com/2012/01/how-to-get-beautifully-typeset-maths-on-your-blog/#other">I’ve got my own fruity setup or I use a blogging service not mentioned above</a></li>
</ul>
<div></div>
<h2>I use Disqus comments on my blog</h2>
<p><strong>August 2012: </strong>The new version of Disqus, Disqus 2012, loads inside an iframe, which means MathJax can’t touch it. So if you really want MathJax in your comments, don’t upgrade, but it definitely will break at some point in the future. How disappointing! Disqus inserts a comments thread into your posts by using javascript after the rest of the page has loaded, so you need to do a little bit extra to get MathJax to typeset maths written in comments. First of all, get MathJax to work on the rest of your blog by following the instructions in the section which best describes your situation below. Then paste the following at the top of the <code>script</code>tag you used to load MathJax:</p>
<pre> function typeset() {
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
}
function disqus_config() {
this.callbacks.onNewComment = [typeset];
this.callbacks.onInit = [typeset];
}</pre>
<p>This adds some hooks into the Disqus code so that MathJax is told when Disqus has loaded and whenever new comments appear on the page. I can’t work out how to get it to prod MathJax when a comment is edited, but that isn’t so bad. I found <a href="http://www.electrictoolbox.com/running-javascript-functions-after-disqus-loaded/">this page</a> very helpful when writing this code.</p>
<h2><a id="intensedebate"></a>I use IntenseDebate comments on my blog</h2>
<p>I’ve submitted my IntenseDebate plugin to the plugin directory, but I’m still waiting for it to be accepted. While we’re waiting for that, you can go to <a href="http://www.intensedebate.com/pluginEditor/">the plugin editor</a>, and paste in the code below. <strong>Note: </strong>There’s a bug with IntenseDebate where it strips out backslashes in newly-posted comments. Obviously that ruins TeX, but it’s fine after you reload the page.</p>
<pre>var id_mathjax_plugin;
(function() {
var mjp = id_mathjax_plugin = {
load_mathjax: function() {
function e(e){var t='.MathJax .mn {background: inherit;} .MathJax .mi {color: inherit;} .MathJax .mo {background: inherit;}',n=e.createElement('style');n.innerText=t;try{n.textContent=t}catch(r){}e.getElementsByTagName('body')[0].appendChild(n);var i=e.createElement('script'),s;i.src='https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML.js',i.type='text/javascript',s='MathJax.Hub.Config({skipStartupTypeset:true,tex2jax:{inlineMath:[[\'\(\',\'\)\']],displayMath:[[\'\\\\[\',\'\\\\]\']],processEscapes:true}});MathJax.Hub.Startup.onload();',window.opera?i.innerHTML=s:i.text=s,e.getElementsByTagName('head')[0].appendChild(i)}function t(t){t.MathJax===undefined?e(t.document):t.MathJax.Hub.Queue(new t.Array('Typeset',t.MathJax.Hub))}var n=document.getElementsByTagName('iframe'),r,i;t(window);for(r=0;r<n.length;r++)i=n[r].contentWindow||n[r].contentDocument,i.document||(i=i.parentNode),t(i)
},
process_comments: function() {
MathJax.Hub.Queue(['Typeset',MathJax.Hub,'idc-container']);
}
};
id_add_action('idcomments_init',mjp.load_mathjax);
id_add_action('idcomments_func_load',mjp.process_comments);
id_add_action('page_load',mjp.process_comments);
id_add_action('thread_page_load',mjp.process_comments);
id_add_action('comment_post',mjp.process_comments);
})();</pre>
<h2><a id="wordpresscom"></a>My blog is hosted by wordpress.com</h2>
<p>Actually, if your blog is hosted by wordpress.com, you’re flat out of luck. They just will not let you add a script to your page in any way, shape or form. Hopefully they’ll upgrade their old image-based LaTeX system to MathJax at some point, though. For now, you can either muddle on with <a href="http://en.support.wordpress.com/latex/" target="_blank">ugly maths</a>, move your WordPress blog to your own server, or use one of the other blogging services.</p>
<h2><a id="ownwordpress"></a>I run WordPress on my own server</h2>
<p>You can install the <a href="http://wordpress.org/extend/plugins/simple-mathjax/">Simple MathJax plugin</a>, or you can take five minutes to edit your theme by hand. If you decide not to use the plugin: Login to your Dashboard. Click on <em>Appearance</em>, then <em>Editor</em>. Click on the <em>Header</em> template on the right. Paste the following code just below the line with the <code><title></code> tag on it:</p>
<pre><script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['\(','\)'], ['\\(','\\)']],
displayMath: [['\\[','\\]'], ['\(\)','\(\)']]}});
</script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script></pre>
<p>Click <em>Update file</em>, and you’re done! <a href="https://checkmyworking.com/2012/01/testing-mathjax" target="_blank">Here’s how it looks on my self-hosted WordPress blog</a>.</p>
<h2><a id="blogger"></a>My blog is hosted by Blogger</h2>
<p><strong>July 2013: </strong>I’ve given up on Blogger again. I think Google continually change the way their template system works, making maintaining the MathJax code not worth the effort. If you want to give it a go anyway, follow the instructions below.</p>
<p><b>April 2013: </b>Thanks to <a href="http://weiqigao.blogspot.co.uk/2013/03/enabling-mathjax-in-blogger.html">Weiqi Gao</a> for working out how to get MathJax working on blogger again.</p>
<p>Go to your blog and sign in. Click on the <em>Design</em> link in the admin bar at the top. Click on the <em>Edit HTML</em> link. Paste the following code just above the line containing <code></head></code>:</p>
<pre><script type="text/x-mathjax-config">
// <![CDATA[
MathJax.Hub.Config({tex2jax: {inlineMath: [['\(','\)'], ['\\(','\\)']],
displayMath: [['\\[','\\]'], ['\(\)','\(\)']]}});
blogger.ui().viewType_.prototype.onRenderComplete=function(){MathJax.Hub.Queue(['Typeset',MathJax.Hub])};
// ]]>
</script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script></pre>
<p>Click on <em>Save Template,</em> and you’re done! <a href="http://cpforgothisoldbloggeraccount.blogspot.com/2012/01/testing-mathjax.html" target="_blank">Here’s how it looks on my Blogger blog</a>.</p>
<h2><a id="tumblr"></a>My blog is hosted by Tumblr</h2>
<p>Log in to your blog’s dashboard. Click on the <em>Customize appearance</em> link. Click on the <em>Edit HTML</em> button. Paste the following code just below the line with the <code><title></code> tag on it:</p>
<pre><script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['\(','\)'], ['\\(','\\)']],
displayMath: [['\\[','\\]'], ['\(\)','\(\)']]}});
</script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script></pre>
<div> Click on the <em>Appearance</em> button to go back to the normal Customisation interface, then click on the <em>Save</em> button, and you’re done! <a href="http://christianperfect.tumblr.com/post/16628144360/mathjax-test" target="_blank">Here’s how it looks on my Tumblr blog</a>.</div>
<p> </p>
<h2><a id="typepad"></a>My blog is hosted by Typepad</h2>
<p>You’ve got two options here. You can either pay for Typepad Pro to get the ability to create a template from scratch, or you can paste some code at the top of every post you write with maths in.</p>
<h3>I’ve paid for TypePad Pro and I don’t mind making my own design from scratch</h3>
<p>Log in to TypePad.com and go to your <a href="http://www.typepad.com/dashboard" target="_blank">Dashboard</a>. In the <em>Manage my blog</em> sidebar on the right, click on the <em>Design</em> link. Click on the <em>Choose a theme</em> button. Under <em>Customizable</em>, click on <em>Advanced Templates</em>, then click the <em>Choose</em> button on the right. Click on the <em>Main Index Template</em> link, and paste the following code just below the line with the <code><title></code> tag on it:</p>
<pre><script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['\(','\)'], ['\\(','\\)']],
displayMath: [['\\[','\\]'], ['\(\)','\(\)']]}});
</script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script></pre>
<p>Click the <em>Save Changes</em> button, then click on the link to <em>Return to templates</em>. At the bottom of the page, tick the checkbox labelled <em>Apply this design to “XXX’s blog”</em>, then click the <em>Save changes</em> button, and you’re done.</p>
<h3>I haven’t paid for TypePad Pro, or I want to use a ready-made design.</h3>
<p>The other method, if you haven’t paid for TypePad Pro or if you want to use one of the non-customizable designs, is to paste some code into the top of any post with maths in. When you’ve finished writing your post, click on the <em>HTML</em> button at the top right of the editing area, and paste the following code at the top of your post:</p>
<pre><script language="javascript">
if(window.MathJax===undefined){
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js";
var config = 'MathJax.Hub.Config({' +
'tex2jax: {'+
'inlineMath: [ ["\(","\)"],["\\\\(","\\\\)"]],'+
'displayMath: [["\\\\[","\\\\]"],["\(\)","\(\)"]]'+
'}});';
if (window.opera)
script.innerHTML = config;
else
script.text = config;
document.getElementsByTagName("head")[0].appendChild(script);
}
</script></pre>
<p>Click the <em>Publish</em> button straight away after doing that. If you switch back to the Rich Text editor, TypePad will mess up the script tags by inserting <code>CDATA</code> tags, and they won’t get loaded. So if you need to make any changes to your post, you’ll need to delete the old script with the <code>CDATA</code> and paste in the correct version again. Bit of a hassle. Also note that MathJax won’t get loaded when looking at your post in the <em>Preview</em> window. <a href="http://christianp.typepad.com/blog/2012/01/mathjax-test.html" target="_blank">Here’s how it looks on my TypePad blog</a>.</p>
<h2><a id="calepin"></a>My blog is hosted by Calepin</h2>
<p>Calepin doesn’t let you do anything to the page’s HTML at the moment, so you need to paste some code at the top of every post you make. Paste the following code just below the lines where you define the post’s title and publication date:</p>
<pre><style type="text/css">
.math span {
color: inherit;
}
</style></pre>
<pre><script language="javascript">
if(window.MathJax===undefined){
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js";
var config = 'MathJax.Hub.Config({' +
'tex2jax: {'+
'inlineMath: [ ["\(","\)"],["\\\\(","\\\\)"]],'+
'displayMath: [["\\\\[","\\\\]"],["\(\)","\(\)"]]'+
'}});';
if (window.opera)
script.innerHTML = config;
else
script.text = config;
document.getElementsByTagName("head")[0].appendChild(script);
}
</script></pre>
<p>The content of your post should go underneath that code. <a href="http://christianperfect.calepin.co/mathjax-test.html" target="_blank">Here’s how it looks on my Calepin blog</a>.</p>
<h2><a id="scriptogram"></a>My blog is hosted by scriptogr.am</h2>
<p><strong>August 2012: </strong>It looks like scriptogr.am has disabled the use of custom scripts. I’ve <a href="http://support.scriptogr.am/discussions/problems/202-are-scripts-not-allowed-in-the-custom-html-any-more">posted on their support forum</a> asking if anything can be done.</p>
<p>Log into your <a href="http://scriptogr.am/admin/settings" target="_blank">admin page</a>. Click on the <em>HTML Editor</em> button at the top right of the page. Paste the following code just below the line with the <code><title></code> tag on it:</p>
<pre><script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['\(','\)'], ['\\(','\\)']],
displayMath: [['\\[','\\]'], ['\(\)','\(\)']]}});
</script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script></pre>
<p>Click on the <em>Close</em> button, and you’re done! <a href="http://scriptogr.am/christianp/post/mathjax-test" target="_blank">Here’s how it looks on my scriptogr.am blog</a>. Note that I needed to use two backslashes (<code>\\[</code> and <code>\\]</code>) in the display maths delimiters because the Markdown parser seems to be interpreting single slashes as escape codes. There might be other conflicts between Markdown and LaTeX.</p>
<h2><a id="weebly"></a>My blog is hosted by Weebly</h2>
<p>Click on the <em>Design</em> tab at the top of the page, then click on the <em>Edit HTML/</em><em>CSS </em>button at the bottom-left. For each file listed under the <em>Page Layouts</em> section of the editor, paste the following code just after the line with the <code><head></code> tag on it:</p>
<pre><script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['\(','\)'], ['\\(','\\)']],
displayMath: [['\\[','\\]'], ['\(\)','\(\)']]}});
</script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script></pre>
<p>Click on the <em>Save</em> button at the top-right, pick a name for your theme (or leave the default one), and then publish your site. You’re done! <a href="http://cpsmathjaxtest.weebly.com/">Here’s how it looks on my Weebly site.</a></p>
<h2><a id="other"></a>I’ve got my own fruity setup or I use a blogging service not mentioned above</h2>
<p>If you have the ability to edit the HTML of your blog’s header, paste the following code just below the line with the <code><title></code> tag on it:</p>
<pre><script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['\(','\)'], ['\\(','\\)']],
displayMath: [['\\[','\\]'], ['\(\)','\(\)']]}});
</script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script></pre>
<p>If you can’t do that, you can try putting the MathJax code inside each post. In a plain HTML editor (<em>not</em> a “visual” or “rich text” editor), paste the following code at the top of your post:</p>
<pre><script language="javascript">
if(window.MathJax===undefined){
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js";
var config = 'MathJax.Hub.Config({' +
'tex2jax: {'+
'inlineMath: [ ["\(","\)"],["\\\\(","\\\\)"]],'+
'displayMath: [["\\\\[","\\\\]"],["\(\)","\(\)"]]'+
'}});';
if (window.opera)
script.innerHTML = config;
else
script.text = config;
document.getElementsByTagName("head")[0].appendChild(script);
}
</script></pre>
<div></div>latexweb-stuffhttps://checkmyworking.com/2012/01/how-to-get-beautifully-typeset-maths-on-your-blog/Sat, 28 Jan 2012 00:00:00 GMT
- You got your art in my maths!https://checkmyworking.com/2011/08/you-got-your-art-in-my-maths/Christian Lawson-Perfect<p>I’ve started a new tumblog as a collection of maths-art intersections I find on the web. It’s at <a href="http://artymaths.tumblr.com/">artymaths.tumblr.com</a>.</p>web-stuffhttps://checkmyworking.com/2011/08/you-got-your-art-in-my-maths/Mon, 08 Aug 2011 23:00:00 GMT