The old Google Groups will be going away soon, but your browser is incompatible with the new version.
MathJax on TiddlyWiki
 There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic. There was an error processing your request. Please try again. Standard view   View as tree
 5 messages

From:
To:
Cc:
Followup To:
Subject:
 Validation: For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon.

More options Oct 28 2010, 4:17 pm
From: RobertM <robe...@dessci.com>
Date: Thu, 28 Oct 2010 13:17:15 -0700 (PDT)
Local: Thurs, Oct 28 2010 4:17 pm
Subject: MathJax on TiddlyWiki
[Previous posted at http://sourceforge.net/projects/mathjax/forums/forum/948701/topic/364...]

thedos
2010-03-26 15:11:37 UTC

I'm trying to get MathJax working on a TiddlyWiki (TiddlyWiki.org , a
one file wiki project).  I have an TiddlyWiki plugin which uses jsMath
(Plugin:jsMath from http://bob.mcelrath.org/tiddlyjsmath-2.0.3.html)
and it seems to work fairly well.  My idea was to simply load MathJax
instead of jsMath and tweek the jsMath plugin to use MathJax instead.
However, I have yet to accomplish this.

I'm sure it should be very easy but, despite being a decent
programmer, I'm very new to javascripts and web development in
general.   Is anyone out there working on something similar who has
already done this or can help me?
I'm almost sure its very simple for someone with more experience/
knowledge on the subject.
Thx

--------------

robertminer
2010-03-26 15:26:27 UTC

Thedos,

TiddlyWiki last week as well. We haven't had time to look at it yet,
so if someone else out there has an idea, that would be great!
However, it's in the queue and one of us will try to find to time look
at it soon.  At the moment, we are trying to focus on getting out a
new beta with MathML support enabled, so it might not be until after
that.

--Robert

--------------

victor_ivrii
2010-03-27 01:36:26 UTC

I use MathJax with mediawiki wiki - just substituted in jsMath plug-
in. Just in
LocalSettings.php:
$wgJsMathRoot = "http://weyl.math.toronto.edu:8888/mathjax";; and in extensions/JsMath/JsMath.php:$wgOut->addScript( '<script type="' . $wgJsMimeType . '" src="' .$wgJsMathRoot . '/MathJax.js"></script>' );

No doubt something like this should work

--------------

dpvc
2010-03-28 14:14:28 UTC

Bob McElrath was one of the first people to incorporate jsMath into a
Wiki setting, and TiddlyWiki did a lot to help establish jsMath in
that environment.  Because Bob's plugin was an early adopter, not all
of jsMath's current features were available at the time; for example,
the easy/load.js mechanism for configuring jsMath wasn't available,
and I think maybe even the tex2math preprocessor might not have been
there (I know for sure that its processing of latex environments
outside of math mode was not implemented yet).  So the plugin does
more than it would have to if he wrote it today.  So it might not be
the best choice of template for MathJax.

I took a very quick look at it, and there are a number of things that
will have to be changed to work with MathJax.  First, it makes very
specific use of some internals of jsMath that are not the same for
MathJax (setting the root location of jsMath, turning off the initial
processing pass, and so on).  It also seems to use XmlHttpRequest as
its AJAX method, and that will not be effective for MathJax (since
MathJax relies on the fact that it is loaded with a SCRIPT tag in
order to handle its configuration).

So the section of the plugin that loads jsMath would have to be
substantially changed for MathJax.  Something like

(function () {
var SCRIPT = document.createElement("script");
SCRIPT.src = String(document.location).replace(/[^\/]*$/,'MathJax/ MathJax.js'); HEAD.appendChild(SCRIPT); })(); might work to load MathJax from a MathJax subdirectory of the directory where the tiddlywiki file is stored. That would cause MathJax to use its MathJax/config/MathJax.js file for configuration, where you can set what input and output jax to use, the preprocessors to run, and so on. It looks like Bob took some pains to prevent jsMath from doing its initial processing pass (it seems to process the tiddlers as they open), so you may want to turn off MathJax's initial pass by changing the value of skipStartupTypeset in the config file. The rest of the plugin (from "Define wikifiers for latex" on) seems to be doing much of the same sort of thing that the tex2jax preprocessor will do, so I'd say you can remove that and let tex2jax handle that part. The only thing I think you need to include is the last routine, which looks like it is there simply to call jsMath.ProcessBeforeShowing() at the right time. You want to have it call MathJax.Hub.Typeset() instead. I haven't tried any of this, but that's what it looks like to me. Give it a try and see if that gets you anywhere, and report back when you have any news. Thanks. Davide -------------- thedos 2010-03-30 16:09:27 UTC Thank you very much for your prompt replies. I still haven't gotten around to do much testing as this is something I'm working on on the side, but I thought I'd at least send my appreciation. To be honest, the instructions are going a bit over my head, sorry I'm very new at this. I have a friend whom is working with TiddlyWiki also, perhaps my friend is better able to get this going. I'll let you know how it goes, any further instruction/help is very welcomed. Thanks, David -------------- pdfion 010-03-30 16:11:30 UTC It did seem the obvious thing to hope that MathJax could become a TiddlyWiki plugin as Bob McElrath had arranged for jsMath. But I found understanding what was going on in his embedding beyond me, so couldn't try for MathJax. We have had a version of the TiddlyWiki form of the Math Subject Classification MSC2010 working happily with jsMath, though the present form uses the LaTeXMathML Plugin http://msc2010.org/MSC-2010-server.html[\url]. The plugin allows a user to make simple notes with math in a downloaded personal copy of the MSC from [url]http://msc2010.org/MSC-2010-personal.html[\url]. Since the AMS is going on to MathJax it will be better to be using that for the MSC as well. This new posting gives hope that we can get a MathJax TW plugin and I'm grateful for something more to try. It also explains, perhaps: MathJax does not work inside a minBrowser in TiddlyWiki. For a view of this not working see [url=http://www-personal.umich.edu/~pion/WebGeom/ TiddlyGeom.html#[[MathJax%20MiniBrowser]]]http://www- personal.umich.edu/~pion/WebGeom/TiddlyGeom.html#[[MathJax %20MiniBrowser]] and you can also see that Soares's MathSVG Plugin does a pretty good job of dealing with some of the same material, if you have a MathML rendering browser like a recenrt FireFox, by visiting [url=http://www-personal.umich.edu/~pion/WebGeom/ TiddlyGeom.html#[[MathJax%20Preview]]]http://www-personal.umich.edu/ ~pion/WebGeom/TiddlyGeom.html#[[MathJax%20Preview]] Other heavy JavaScript pages, like another TW page, perform fine in a miniBrowser. Note that the rest of the material on that TiddlyGeom is pretty scrappy and not ready for prime time. Patrick -------------- dpvc 2010-03-31 14:16:25 UTC @David: You're welcome, and I hope we can get the plugin working eventually (I don't use TiddlyWiki myself, and can't take time at the moment to learn how to write plugins for it, but perhaps after MathJax v1.0 is out I can do that). @Patrick: I'll check into the miniBrowser problem (Firefox's security policy is blocking it from working, and the problem has to do with MathJax's interaction with the IFRAME that contains the miniBrowser). I'll need to do some experimenting. Davide -------------- dpvc 2010-04-03 00:05:26 UTC @Patrick: I have fixed the problem with MathJax in an IFRAME, but haven't yet updated the copy on www.mathjax.org, so your example still won't work until I do that. that should be sometime next week. But if you try it from a site that has an up-to-date copy of MathJax, it should work. Davide -------------- pdfion 2010-04-03 01:41:25 UTC Davide, That's great. Thank you very much. TiddlyWiki's IFRAME use, such as in miniBrowser and External Tiddlers can be very handy sometimes. Patrick -------------- dbonk 2010-09-26 11:56:29 UTC I have been working on this and have it in an intermediate state here: http://myweb.dal.ca/haines/#Plugin-MathJax It works as is right now, but check the MathJax Sample tiddler - not rendered... But when I load it in the MarkupPostHead Tiddler as I have in the instructions it all works fine... but I'd rather load it dynamically as you suggest. But if I do (as currently) the two calls to MathJax.Hub.Typeset that I have currently commented out are undefined... So how do I reference the dynamically loaded MathJax in this case? I will play with skipping the other code and using tex2math once I get past this. (as well as addressing the IE8 bug - I have tried all the usual suggestions to no avail) The old jsMath plugin used an ajax call to load jsmath, and I experimented with using the TiddlyWiki embedded jQuery ajax request directly... But I like loading it as you suggest... just how to call it? It will process on its own startup, but if I turn off the the initial typeset it does not render the math (as I desire). I want to call it on demand... I can if I put the MathJax script tag and config in the MarkupPostHead tiddler (as in the current plugin instructions - but not currently done), but I'd rather load it dynamically for fewer edits for the user to install... Hopefully you can see where I'm going here, I don't think I've explained it very well, but I think you'll get it... (note: not working in IE8, works in IE9 and all other browsers though - go figure...) -------------- dbonk 2010-09-26 14:30:45 UTC I totally redid it. I figured it out: let majthjax/tex2jax do all the work, as you suggested, and just tuck the window.wikify redifinition inside the appended MathJax script tag. Works in all browsers now too. (have not added X-UA compat tag for IE tho...) -------------- dbonk 2010-09-26 16:57:16 UTC I renamed it to ... You must Sign in before you can post messages. To post a message you must first join this group. Please update your nickname on the subscription settings page before posting. You do not have the permission required to post. More options Nov 30 2010, 12:38 pm From: xuanops <jua...@tel.uva.es> Date: Tue, 30 Nov 2010 09:38:57 -0800 (PST) Local: Tues, Nov 30 2010 12:38 pm Subject: Re: MathJax on TiddlyWiki Dear dbonk, I have been testing your plugin. Thank you very much for your work. I have seen that e.appendChild(document.createTextNode(text)) is not allowed in IE8 if "e" is a script element. But I found a solution in http://www.phpied.com/dynamic-script-and-style-elements-in-ie/ I think that there is no colateral problems, but I cannot confirm... In particular, I have discovered that using this new definition for createTiddlyElement, there are no problems using IE8 with your plugin. and now the other plugin (sintaxhightight) works, also. In addition there are other plugins that work now also, like a FCKeditor based plugins function createTiddlyElement(parent,element,id,className,text,attribs) { var e = document.createElement(element); if(className != null) e.className = className; if(id != null) e.setAttribute("id",id); if(text != null){ if(element=="script") e.text=text; else e.appendChild(document.createTextNode(text)); } if(attribs) { for(var n in attribs) { e.setAttribute(n,attribs[n]); } } if(parent != null) parent.appendChild(e); return e; } --Juan You must Sign in before you can post messages. To post a message you must first join this group. Please update your nickname on the subscription settings page before posting. You do not have the permission required to post. More options Dec 10 2010, 6:44 pm From: Jerry He <enk...@gmail.com> Date: Fri, 10 Dec 2010 15:44:34 -0800 (PST) Local: Fri, Dec 10 2010 6:44 pm Subject: Re: MathJax on TiddlyWiki Hi dbonk, your website seems unavailable from the UK (both http://myweb.dal.ca/haines/#Plugin-MathJax and http://tiddlywiki.canada-east.ca/). Could anyone with a working version of this plugin send a copy to me? Many many thanks, Jerry On Nov 30, 5:38 pm, xuanops <jua...@tel.uva.es> wrote: You must Sign in before you can post messages. To post a message you must first join this group. Please update your nickname on the subscription settings page before posting. You do not have the permission required to post. More options Jan 23 2011, 4:16 pm From: creatorlarryli <creatorlarr...@gmail.com> Date: Sun, 23 Jan 2011 13:16:05 -0800 (PST) Local: Sun, Jan 23 2011 4:16 pm Subject: Re: MathJax on TiddlyWiki Actually MathJax will automatically parse all the math expressions in the html file. So there is no need to use wikifiy(). I wrote a very simple plugin, which simply call MathJax at the end of the tiddler to render the LaTeX code. You can find it here: http://www.math.umn.edu/~lixx1445/#MathJaxTiddlyPlugin Cheers, Larry. On Dec 10 2010, 5:44 pm, Jerry He <enk...@gmail.com> wrote: You must Sign in before you can post messages. To post a message you must first join this group. Please update your nickname on the subscription settings page before posting. You do not have the permission required to post. More options Aug 27 2011, 7:00 pm From: Victor Ivrii <viv...@gmail.com> Date: Sat, 27 Aug 2011 16:00:57 -0700 (PDT) Local: Sat, Aug 27 2011 7:00 pm Subject: Re: MathJax on TiddlyWiki I thought that I managed to hack SMF 2.0 (including betas) when I inserted line on l.3309 in Subs.php [code] // ]]></script>'; echo "<script type='text/javascript' src='/mathjax/MathJax.js?config=default'></script>"; if (!isset($context['page_title']))
[/code]

However it appears that while everything works in Webkit-based browsers
(Safari, Chrome, Omniweb) Firefox and Opera hang on Post Preview (even if
there is no need to use MJ.

I tried to use "Custom And Scripts" SMF package but it solves the above
problem but Preview Post does not use MJ even in Safari.

Does anyone has a solution free of such defects?