

Example Screen Shot (Click to see the real thing)
The CodeCogs Equation editor is a free open source editor that produced equations using LaTeX. The editor can be easily extended and adapted for any particular need, allowing it to be embedded into a range of WYSIWYG editors and used in many different scientific disciplines.
Everything you need to install and configure the equation editor on your own website is provided on this page. Alternatively if you don't want to install anything (perhaps you want to create equations on a 3rd party forum or blog), then the editor can be used to construct HTML code (see the yellow box at the bottom of the editor) that generates the graphical equations using the CodeCogs servers. If you are familiar with LaTeX, then you can also write the equations out by hand, avoiding the need to use the editor at all.
For example, the following code:
<a href="http://www.codecogs.com"><img src="http://www.codecogs.com/eq.latex?1+sin(x)" border="0"/></a>will create:
For faster and more reliable service, you should install the CodeCogs Equation editor on your own server. This can be achieved in one of two ways:
Details and examples of installing the Equation Editor are given below:
If you want complete control over the equations generated on your server, then you need to install the following packages:
You will then have to make the following modification:
RewriteEngine On RewriteRule ^eq\.latex?(.*) /components/equationeditor/rawequation.php [L,NC]
define('LATEXRENDER','/latexrender/latex.php');define('EQUATIONENGINE','http://www.codecogs.com/eq.latex');
Note: the eq.latex, equates directly to the rewrite rule you set up in (1), so if you change one you must change both.img.src='http://www.codecogs.com/eq.latex?' + val;
document.getElementById('eqcoderaw').value='<img src="http://www.codecogs.com/eq.latex?' + val+'"/>';
so they refer to your servers url. As in (3), if you use a different rewrite rule in (1) then adjust as appropriate here also.cmhod 777 latexrender chmod 777 latexrender/tmp
magic_quotes_gpc = Off
If you want to test your installation then log into your server shell and type "latex", you should see something like "This is pdfeTeX, Version 3.141592-1.21a-2.2".
For the most part on Unix you should be able to install LaTeX using "yum", i.e. "yum install latex" and also "yum install latex2html" (Might be able to miss out the first step), then use "whereis latex" etc to find the location of "latex", "dvips" and "convert" and set the paths in the file "class.latexrender.php". For Windows installations check out MiKTeX described at LaTeX Render.
Please remember for all of this, you most certainly need to have 'root' access to your server. Check with your web server provider, if you're still unsure then you most probably don't have access and you should consider using the 'Light installation' below.
If having installed LaTeX successfully, then why not donate some of your spare computing power and allow others to use your server to create equations on their website. If you would like to do this, then please email us at: CodeCogs
The light installation can be installed onto any PHP enable website and merely required that you download and install the core equation editor files: Please register and login to download the equation editor code.
No modifications to the downloaded code are necessary as all the equations will be rendered using the CodeCogs servers, therefore you do not need to configure and install LaTeX and LatexRender. However we do politely ask that you display the following small banner on the main pages that use equation generated by our servers:
This logo is created using this code:
Please note: We reserve the right to disable the rendering of equations to any website at any time. CodeCogs (and Zyba Ltd) intend to run this free service for the forseable future (certainly for the next two years), however this service is intended for small websites with light usage, if you expect to be making heavy demands on our servers then warn us. We will suspend this service to anyone we feel is abusing our generosity and will certainly be less considerate to those who do not recognise our contribution to their website.
If you don't want to display our banner, then you should not install the equation editor in this way and you should set up your own LaTeX rendering engine (see Complete Installation above).
To avoid disruption or miss-understandings, we recommend that you also email us your contact details (or CodeCogs login) together with details of your website url to: CodeCogs Services.
Regardless of how you ultimately install the equation editor, the CodeCogs Equations editor can be launched in four main ways:
<a href="http://www.codecogs.com/components/equationeditor/equationeditor.php" target="_blank"> Launch CodeCogs Equation Editor</a>which creates: Launch CodeCogs Equation Editor
<a href="http://www.codecogs.com/components/equationeditor/equationeditor.php?target=testbox" target="_blank"> Launch CodeCogs Equation Editor</a> <textarea id="testbox" rows="3" cols="40">which creates:
</textarea>
<script type="text/javascript">
var popupwindows = new Array();
function popupnr( url, windowname, refocus, width, height )
{
if(typeof(popupwindows[windowname])!='undefined')
newwindow = popupwindows[windowname];
else newwindow=null;
if (newwindow==null || newwindow.closed || !newwindow.location)
{
newwindow=window.open(url,windowname,'width='+width+',height='+height+',status=1,scrollbars=no,resizable=1');
if (!newwindow.opener) newwindow.opener = self;
popupwindows[windowname]=newwindow;
}
if (window.focus) { newwindow.focus() }
return false;
}
</script>
Now, when you need to launch the equation editor you can use:
<a href="http://www.codecogs.com/components/equationeditor/equationeditor.php" onclick="return popupnr(this, 'equation', 1, 700, 450 )"> Launch CodeCogs Equation Editor</a>
<a href="http://www.codecogs.com/components/equationeditor/equationeditor.php?target=testbox2&html" onclick="return popupnr(this, 'equation', 1, 700, 450 )"> Launch CodeCogs Equation Editor</a> <textarea id="testbox2" rows="3" cols="40">which creates:
</textarea>
<a href="http://www.codecogs.com/components/equationeditor/equationeditor.php?target=testbox3&phpBB" onclick="return popupnr(this, 'equation', 1, 700, 450 )"> Launch CodeCogs Equation Editor</a> <textarea id="testbox3" rows="3" cols="40">which creates:
</textarea>
FCKConfig.Plugins.Add( 'equation', 'en' )
FCKConfig.ToolbarSets["Default"] = [
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Equation','Table','Rule'],
] ;
var editorpath='/components/equationeditor/';p.s. If anyone can find a way to make this pluging work by directly calling the equation editor installed on CodeCogs and returning the result back to the fckeditor on the clients machine (i.e. working across domains), then please send me the details.
$html= preg_replace('/\\f$(.*?)\\f$/','<img src="http://www.codecogs.com/eq.latex?\inline $1" />', $html);
$html= preg_replace('/\\f[(.*?)\\f]/','<img src="http://www.codecogs.com/eq.latex?\$1" />', $html);
The advantage of this approach, is that by maintaining the equations in text form within the HTML and making a quick adjustment only when we display them, then we are able to quickly edit any previous equations.This equation editor is designed to be flexible and allow the equation symbols to be expanded and adjusted as need be. In the directory '~/equationeditor/panels' you will find all of the existing panels. If you would like to create your own, we recommend copying one of these and then modifying it. The structure is fairly obvious:
<area shape="rect" alt="a_b" title="a_b" coords="0,26,25,50" href="javascript:insertText('{}_{}',1)" />
The important part here is the href=" " statement that runs insertText. In the first parameter you define the text to be inserted, i.e. "a_b"; while in the second parameter you give the new location of the cursor [This second term is optional].<div class="panel" id="panel8" onmouseover="this.style.overflow='visible'" onmouseout="this.style.overflow='hidden'">
<?php require 'panels/your_panel.tpl'; ?>
</div>
The CodeCogs equation editor is written by Will Bateman with advice and assistance from Steve Mayer. It also contains many neat Javascript enhancements by Thornahawk, which make the toolbar buttons more interactive.
If you are already using our equation editor, then please let us know so we can add you to above list and give users a range of alternatives.
You must login to leave a messge