Math - LATEX

Modifications for phpBB3.
Try the Mods here and share Your own Mods
Forum rules
You dont have to use ModX or make your mod AutoMod compatible. A simple textfile is fine
But if you post Mods here You also have to give support
No Avatar
Chico Gois Offline
BBCoder II
BBCoder II
Posts: 10
Joined: 08 Mar 2010, 15:00
Local time: Saturday 17:28
Last active: -

Math - LATEX

Post by Chico Gois »

For those who need to post mathematical formulas, I found this tip and resource that can be read in full at this address http://www.codecogs.com/pages/forums/pa ... hp?id=1682

Basically this is the changes:

Prosilver:
Open: overall_header.html

Find:

Code: Select all

<script type="text/javascript" src="{T_TEMPLATE_PATH}/forum_fn.js"></script>
After, add:

Code: Select all

<script type="text/javascript" src="http://latex.codecogs.com/editor.js"></script>
Open: posting_buttons.html

Find:

Code: Select all

<input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{custom_tags.BBCODE_HELPLINE}" />
<!-- END custom_tags -->
After, add

Code: Select all

<input type="button" class="button2" onclick="javascript:OpenLatexEditor('message','phpBB','')" value="Equation Editor"/>
Subsilver2:
Open: posting_buttons.html

Find:

Code: Select all

<script type="text/javascript" src="{T_TEMPLATE_PATH}/editor.js"></script>
After, Add

Code: Select all

<script type="text/javascript" src="http://latex.codecogs.com/editor.js"></script>
Find:

Code: Select all

<input type="button" class="btnbbcode" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})"<!-- IF custom_tags.BBCODE_HELPLINE !== '' --> onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')" onmouseout="helpline('tip')"<!-- ENDIF --> />
<!-- END custom_tags -->
After, Add

Code: Select all

<input type="button" class="btnbbcode" onclick="javascript:OpenLatexEditor('message','phpBB','')" value="Equation Editor"/>
Find:

Code: Select all

<textarea name="message" rows="15" cols="76" tabindex="3" onselect="storeCaret(this);" onclick="storeCaret(this);"
onkeyup="storeCaret(this);" style="width: 98%;">{MESSAGE}</textarea>
Replace:

Code: Select all

<textarea id="message" name="message" rows="15" cols="76" tabindex="3" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" style="width: 98%;">{MESSAGE}</textarea>
Below are the instruction on how to install the BBCode, therefore it is similar for both styles:

BBCode:

Code: Select all

[tex]{TEXT}[/tex]
HTML:

Code: Select all

<img style="vertical-align: middle" src="http://latex.codecogs.com/png.latex?{TEXT}"/>
Help Line:

Code: Select all

[tex]Your equation[/tex]
Demo:
bi.gif
Or my board:

http://www.mundophpbb.com.br/forum/view ... p?f=14&t=8
You do not have the required permissions to view the files attached to this post.
User avatar
Stoker Offline
Site Admin
Site Admin
Posts: 4,294
Joined: 12 May 2008, 21:26
Local time: Saturday 22:28
Last active: -
Favourite EXT: Forum Goal
Location: Denmark

Math - LATEX

Post by Stoker »

Looks great :thumb:
~ The greatest achievement in life is to inspire ~
Regards Stoker
No Avatar
Jessica Offline
BBCoder II
BBCoder II
Posts: 66
Joined: 25 Apr 2010, 23:26
Local time: Saturday 16:28
Last active: -
Favourite BBCode: spoilvtitle
Favourite EXT: AJAX Quick Edit
Location: Pennsylvania

Math - LATEX

Post by Jessica »

this is PERFECT. use it on my forum, really useful you can type it in the pop up