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 » CK Editor »

Latest version and some errors

danielmerino\′s Photo
25 May 11, 6:41AM
(9 replies)
Latest version and some errors
Hi. I have downloaded the latest version (2.3) of your FCKEditor plugin. Or at least that is said in the download page (http://www.codecogs.com/latex/integration/fckeditor/install.php).

However, I can see in the editor's example page (http://www.codecogs.com/latex/eqneditor.php) that the latest version seems to be 3.02 and it's translated to spanish. Also, my installed editor shows 3.02 in the bottom, but it doesn't seem to be translated to spanish.

Also, we're having issues when editing the saved images with FCKEditor (in Sakai LMS). The edition launches the Equation window but the latex code isn't loaded inside it. A second double-click on the image loads the code in the Editor textarea, but in several functions (for example, frac) the backslashes of the latex code dissapear and only the text is shown, so it's quite annoying to add all the backslashes again.

Have you found these issues before? Thanks in advance.
CodeCogs\′s Photo
25 May 11, 7:30AM

The FCKEditor plugin automatically uses the latest version of the editor, so you shouldn't have to worry about that.

The translation to Spanish is an option you have to specify in the file equation_html/fckplugin.js:
  • Look for line 7
    var language=FCKConfig.DefaultLanguage;
  • Replace with your desired language, i.e.
    var language='es-es';
  • Then delete/refresh your browser cache and reload.

We don't currently allow end users of the embedded equation editor the ability to customise the language and design - though if there is sufficient interest we might enable this feature in the future.

Let me know if that works.
danielmerino\′s Photo
26 May 11, 5:19AM
Hi again.

I have been debugging the errors as far as I have been able.

First at all, the language variable is working as you said, so thanks a lot for that trick!

In fckplugin.js (the "equation" one) when it comes into this line:

script.innerHTML = 'EqEditor.load(''+(latex)+'');';

latex value is "\sum \bigcup", that is the equation I have done double-click on.

However, in the editor's text area is shown the text

sum igcup

It seems that the load method is not parsing well the backslashes, but I can't debug that method, can I?

If you want to try it yourself, I can give access in our Sakai test server, just tell me an email.

Many thanks in advance.
danielmerino\′s Photo
26 May 11, 5:34AM
Hi, again.

I have managed to solve the issue adding this line:

latex = latex.replace(/\\/g,'\\\\');

before this one:

script.innerHTML = 'EqEditor.load(\''+(latex)+'\');';

Now it works OK. What do you think? Could it break other thing?

CodeCogs\′s Photo
26 May 11, 1:21PM
Sounds like your fix it exactly right. But I'll investigate this tomorrow and revert.

CodeCogs\′s Photo
26 May 11, 1:34PM
I have to confess I am bemused by the error you have, since I can't replicate it. Everything works perfectly on our servers, with FireFox and Safari. I'll test again IE later.

Whats odd. Is that in our code we already have
latex = latex.replace(/\\/g,'\\\\');

as in:
	  latex = latex.replace(/\\/g,'\\\\');
          latex = latex.replace(/'/g,'\\'');
          latex = latex.replace(/"/g,'\\"');
          latex = latex.replace(/0/g,'\\0');
	  eval("var old = popupEqnwin.document.getElementById('JSONload')");
	  if (old != null) {
	    delete old;

var head = popupEqnwin.document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.type = "text/javascript"; script.id = '
JSONload'; script.innerHTML = 'EqEditor.load(''+(latex)+'');'; head.appendChild(script); }

So why isn't this working for you. Why do you have to do it twice?

Do you know if this is specific to a particular browser?
danielmerino\′s Photo
27 May 11, 2:21AM
I have taken a look and your code is OK in fckplugin.js inside the folder equation_html, but is different in the same file inside the folder equation:

else if (window.focus) 
	eq = eq.replace(/\\/g,'\\\\');
      eq = eq.replace(/'/g,'\\'');
      eq = eq.replace(/"/g,'\\"');
      eq = eq.replace(/0/g,'\\0');
	eval("var old = popupEqnwin.document.getElementById('JSONload')");
	if (old != null) {
		delete old;

I have downloaded both files from your page ( http://www.codecogs.com/pages/functions/download.php?dir=/latex/integration/fckeditor~8a00af5ae3&file=fckplug

Configuring the editor with equation_html works fine. Thanks a lot.

CodeCogs\′s Photo
27 May 11, 4:43AM
Thanks for noticing that. However although the code in equation is slightly different to equation_html, it still fundamentally does the same thing.

I'll run some more test later. Though this does beg the question. Do we need to retain the original, verion 1, of this code (i.e. the 'equation' code). How many people genuinely need or use it. Even for advanced uses you can back out all the latex from output of equation_html.

As such I wonder if it might be simple to remove version 1 all together?

As a recent user - what is your own perspective? Have others a view?
danielmerino\′s Photo
27 May 11, 6:32AM
I can't figure out what advantages or disadvantages could each version have respect to the other. It seems that, in terms of performance, version 2 (equation_html) is better, so I'm going to put only that one into production.

However, I'm waiting the feedback of a LaTeX expert, so maybe I could change my opinion. I'll tell you if that happens.

Thanks and best regards.

PD: I don't know how difficult can it be, but I think that including into the Equation Editor the Google plugin which changes from SVG to flash ( http://code.google.com/p/svgweb/ ) would be a huge improvement, at least while Internet Explorer 9 is not still widely being used.
CodeCogs\′s Photo
27 May 11, 7:56AM
Given your answer then you should definitely be using equation_html

The difference is really in terms of what is return from the editor.

With version 1 (equation), you get back pure latex, i.e.

with version 2 (equation_html), you get back html for the equation, i.e.
<img src="http://latex.codecogs.com/gif.latex?\frac{1-\sin(x^2)}{x}" alt="\frac{1-\sin(x^2)}{x}" />

As such with version 1, we run a 2nd step afterwards to convert the latex to html on the fly. If your creating a lot of equations and often like to write them without using the editor, then version 1 can be easier to use. In almost all other circumstances you're better off with version 2.

Hope this helps explain the difference.
Currently you need to be logged in to leave a message.