It can be made to work with the basic text formatter, but then that breaks the html and markdown compatibility!
The problem is that it stores the mathematics inside <latex> tags which need to be allowed through any other formatter. What happens is that the html and markdown formatters work directly with tags but the text formatter converts the brackets to html escape codes. The vLaTeX plugin needs to be told what to look inside to find its mathematics and, due to the above, it is different for different other formatters. I suppose that if there was some way to know which text formatter was being used then the plugin could select the appropriate pattern (another solution would be that the text formatter didn't escape latex tags).
It's easy to globally shift it. Look in the function parseLaTeX. There's a commented-out line. If you uncomment that and comment-out the next line then it becomes compatible with the text formatter. (Lines 146 and 147).
Sorry for the lengthy delay in replying. For some reason your comment didn't get picked up by my RSS reader. Must be following the wrong thread ... grrr.
I'm new to Vanilla (just installed it today!). I stumbled on this plugin and was hoping to install it since much of the discussion on my forum will involve mathematics. However, whenever I try to post some latex code to my forum, such as $$x^2 +y^2$$, the post shows <latex>x^2+y^2</latex>. I noticed that the plugin was meant to be used with an earlier version, so I was wondering if anyone else has had better luck getting this to work with the current version of Vanilla?
The fact that you see the <latex>x^2 + y^2</latex> suggests that at least part of the plugin is working fine.
What text filter are you using? If you aren't sure, then you're probably using the default text formatter in which case you need to make the alterations I mentioned in my previous comment. This plugin tries to work alongside whatever other text filters you have but different filters have different behaviours so some minor alteration is needed to get them to "play nicely" together.
1. installed Vanilla 1.1.9 2. put vLaTeX 0.1 into extensions folder 3. activated vLaTeX in admin panel 4. changed lines 146 and 147 in default.php according the astacey's comment above
I haven't tested it on 1.1.9 so I'll have to do that to be sure that there's not an incompatibility there.
When you say "2^2 gets parsed to $$2^2$$", are there some missing tags there? Depending on how much of vLaTeX is working I would expect you to see one of three things:
$$2^2$$ stays as it is
$$2^2$$ becomes 2^2
$$2^2$$ becomes a picture of what it ought to be
From what you say, it seems as though the first one is happening, am I right? In which case it shouldn't be an issue with the text formatter but looks as though vLaTeX isn't even getting called. I'm sure this isn't the case, but you did select the right tags in the configuration panel, didn't you? And did you do the steps to create the cache?
I'll try it on 1.1.9 and report back, but in the meantime please try the other tag options and see if they work, and please tell me which text formatter(s) you are using.
In testing, though, I discovered one or two things that maybe weren't so clear from the documentation.
The simplest way to get it working is to use the standard formatter and make the change indicated above. I should probably change these around so that it works out-of-the-box with the standard formatter and the change needs to be made for other formatters. Next time that something more serious needs updating then I'll do that.
If you want to use it with another formatter, then you need to do a little configuring. I tend to use the Markdown filter. On a live forum where I have this working, then I've disabled Markdown's HTML sanitiser, choosing to use KSES instead. The problem is that the vanilla Markdown addon cleans out ALL tags (if you look at markdown.php you'll see that the wordpress implementation is a little more sophisticated: it has a whitelist to which one could add vlatex if one wanted). The Markdown change in the readme merely tells Markdown to ignore the contents of the vlatex tags, which is necessary but is a second step.
Perhaps I should have chosen something else as the internal tags than fake HTML tags. However, it made a sort of sense: you don't want markdown (or any other filter) looking inside the latex code and it's usually fairly easy to tell a filter to ignore text inside certain HTML tags as they generally have a system already for that. Also, you don't want the user putting in the internal tags without meaning to, and someone typing any HTML tags, real or fake, is going to be fully aware what they are doing. But it does mean that the sanitisers have to be a little more clever than simply removing all tags.
That said, it doesn't answer kaikajus's problem. I can't see anything wrong in what you said you did, but you didn't list all the necessary steps to get this addon to work so I can't tell if maybe you just missed one out or just didn't say that you did it. Specifically, you didn't mention setting up the cache. And you didn't mention changing the tags from the default \[\] to double dollars $$ $$.
I forgot. The other thing that I had to do was fix the permissions on the directory. For some reason, the extension directory got permissions 700 and the files in it got 000 (!). However, if you get to the settings page then clearly this isn't a problem.
I am having a hard time getting the vlatex extension to work with vanilla 1.1.10 but i think it is because of the cache not working correctly. The first time I installed it I just clicked on the "create cache" and it worked but then for some dumb reason I removed the address and i can't get it to create it correctly now. What is the proper format to put in the address to have the extension create the cache?
Comments
2. put vLaTeX 0.1 into extensions folder
3. activated vLaTeX in admin panel
4. changed lines 146 and 147 in default.php according the astacey's comment above
result: 2^2 gets parsed to $$2^2$$
Am I missing something?
When you say "2^2 gets parsed to $$2^2$$", are there some missing tags there? Depending on how much of vLaTeX is working I would expect you to see one of three things:
$$2^2$$ stays as it is
$$2^2$$ becomes 2^2
$$2^2$$ becomes a picture of what it ought to be
From what you say, it seems as though the first one is happening, am I right? In which case it shouldn't be an issue with the text formatter but looks as though vLaTeX isn't even getting called. I'm sure this isn't the case, but you did select the right tags in the configuration panel, didn't you? And did you do the steps to create the cache?
I'll try it on 1.1.9 and report back, but in the meantime please try the other tag options and see if they work, and please tell me which text formatter(s) you are using.
Thanks
$$2^2$$ becomes >vlatex<2^2>/vlatex<
In testing, though, I discovered one or two things that maybe weren't so clear from the documentation.
The simplest way to get it working is to use the standard formatter and make the change indicated above. I should probably change these around so that it works out-of-the-box with the standard formatter and the change needs to be made for other formatters. Next time that something more serious needs updating then I'll do that.
If you want to use it with another formatter, then you need to do a little configuring. I tend to use the Markdown filter. On a live forum where I have this working, then I've disabled Markdown's HTML sanitiser, choosing to use KSES instead. The problem is that the vanilla Markdown addon cleans out ALL tags (if you look at markdown.php you'll see that the wordpress implementation is a little more sophisticated: it has a whitelist to which one could add vlatex if one wanted). The Markdown change in the readme merely tells Markdown to ignore the contents of the vlatex tags, which is necessary but is a second step.
Perhaps I should have chosen something else as the internal tags than fake HTML tags. However, it made a sort of sense: you don't want markdown (or any other filter) looking inside the latex code and it's usually fairly easy to tell a filter to ignore text inside certain HTML tags as they generally have a system already for that. Also, you don't want the user putting in the internal tags without meaning to, and someone typing any HTML tags, real or fake, is going to be fully aware what they are doing. But it does mean that the sanitisers have to be a little more clever than simply removing all tags.
That said, it doesn't answer kaikajus's problem. I can't see anything wrong in what you said you did, but you didn't list all the necessary steps to get this addon to work so I can't tell if maybe you just missed one out or just didn't say that you did it. Specifically, you didn't mention setting up the cache. And you didn't mention changing the tags from the default \[\] to double dollars $$ $$.
If your installation isn't an unusual one, the URL for the cache should be:
http://hostname/path/to/vanilla/extensions/vLaTeX/cache
The key bit is the last three components: "extensions/vLaTeX/cache"