I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
Index » Products » LaTeX Equation Editor »

Square bracket incompatibility in TiddlyWiki code

msgray\′s Photo
19 Jan 09, 7:36AM
(4 replies)
Square bracket incompatibility in TiddlyWiki code
Hi will,

Unfortunately I've found out that square brackets [...] in latex code breaks the image tag in TiddlyWiki. for example
\sqrt[3]{x+y}
It's probably best not to try to use the TiddlyWiki markup at all.

I have a macro for TiddlyWiki that can render the equations without using the standard wiki markup. The CodeCogs URL is in the macro; so all the CodeCogs editor has to return to TiddlyWiki is the equation wrapped like so
<<Math sqrt[3]{x+y}>>

You can see the demonstration here http://twmath.tiddlyspot.com/#SquareBracketBug

Is this possible? or I will happily listen to any other suggestion.

Morris
CodeCogs\′s Photo
22 Jan 09, 11:00PM
I would like to see how to solve the underlying problem with the square brackets. I suspect there is an error with my regular expressions. Give me a week or so to finish some other work and i'll get back to this.

Incidentally, thanks for coming back to me with this problem.

Cheers Will.
CodeCogs\′s Photo
29 Jan 09, 8:33AM
Morris,

I might have solved your tw problem.

Can you flush out your cache and try again within tiddlywiki. Hopefully if you're linking to the right javascript files, then you should see
\sqrt[n][x]
produce this line for tw:
[img[http://latex.codecogs.com/gif.latex?\sqrt\[n\]{x}]]
Notice I've added a '\' infront of '[' and ']' where its used within the equation. This is to avoid a clash with the square brackets used by tw to identify the image etc.

I've not tested this from within tw, so I've no idea if this will work - but logically it should if tw was written well. If it doesn't then tw needs to be modified, which is a bigger task :)

Will. p.s. remember to link to editor on latex.codecogs.com; this is where this is setup.
msgray\′s Photo
29 Jan 09, 11:21AM
Hi Will,

I think TiddlyWiki is well written that's why the escape you used won't work since it is being used in a URL :-)

However you made the penny drop for me since it made me realize that what is needed is URL encoding. I was thinking it was an equation problem when in fact it is a URL problem

i.e. [=%5B and ]=%5D

Therefore what is needed is:

[img[http://latex.codecogs.com/gif.latex?\sqrt%5B3%5D{x+y}]]

This is a good fix as it is standard URL encoding and will work in any equation in any browser. It appears to render right when pasted into Equation Editor so...

See example at:http://twmath.tiddlyspot.com/#SquareBracketBug

What do you think?

Regards, Morris
CodeCogs\′s Photo
29 Jan 09, 1:05PM
Hi Morris,

Yes thats a perfect and easy solution, I should have thought of it also.

I'll implement this change as soon as I get back to my main computer.

Best wishes Will.
Currently you need to be logged in to leave a message.