The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Latex temporary solution!

View previous topic View next topic Go down

Latex temporary solution!

Post by xx3004 on February 28th 2011, 2:56 am

Okay I've found out a very interesting way to type latex while the forum doesn't support it yet. But I don't know where to post it, so I see the category "Support forum" and post it here. Please move it to proper place (I am not granted permission to post in "Tips and Tricks").

Go to Admin CP > Module > Forum Widgets Management > Create a widget > [Use table type: No | Copy the code below to HTML box]
OR
Go to Admin CP > Display > Template > General > overall_header > [Paste the code below to anywhere you want]

Code:

<script language='javascript'>
font_for_latex="PUT YOUR FONT HERE BETWEEN 2 QUOTES - LOOK AT THE NOTE BELOW";
background_for_latex="PUT YOUR BACKGROUND COLOR HERE BETWEEN 2 QUOTES - LOOK AT THE NOTE BELOW";
latex_use=".latex";
(function(jQuery){jQuery.fn.xxLatex=function(lfSize, lbgColor){return this.each(function(){var latexImgUrl=encodeURI(jQuery(this).html())if(lfSize=="tiny"||lfSize=="small"||lfSize=="large"||lfSize=="LARGE"||lfSize=="huge"){lfSize="%5C"+lfSize;}else{lfSize="";}if(lbgColor=="white"||lbgColor=="black"||lbgColor=="red"||lbgColor=="green"||lbgColor=="blue"){lbgColor="%20%5Cbg_"+lbgColor;}else{lbgColor="";}jQuery(this).html("<img src='http://latex.codecogs.com/png.latex?"+lfSize+lbgColor+"%20%5Cfn_cs%20"+latexImgUrl+"' border=0>");});}jQuery(document).ready(function(){jQuery(latex_use).xxLatex(font_for_latex,background_for_latex);});</script>

Where by:
  • font_for_latex could be tiny or small or large or LARGE or huge or <blank> case sensitive
  • background_for_latex could be white or black or red or green or blue or <blank for transparent> case sensitive
  • latex_use could be "latex" (Not safe) or ".latex" (Safe). If latex_use = ".latex", whenever you type in <span class="latex">LATEX CONTENT HERE</span> it will turn into a latex equation image. If latex_use="latex", whenever you type it <latex>LATEX CONTENT HERE</latex> it will turn into a latex equation image.


Here is a screenshot for you to see how it looks like (taken from my forum):

I hope this help, enjoy Smile

[Credits by xx3004]

xx3004
New Member

Male Posts : 13
Reputation : 0
Language : English, Vietnamese

http://xx3004.forumotion.com

Back to top Go down

Re: Latex temporary solution!

Post by I-Angel-Q on February 28th 2011, 10:05 am

Oh! that sweet but iّm doّnt need in my forum .
thanks

I-Angel-Q
Forumember

Male Posts : 54
Reputation : 1
Language : Arabic and English

Back to top Go down

Re: Latex temporary solution!

Post by Sanket on February 28th 2011, 6:04 pm

Thread is being Locked, since this is not the place to post tutorials.
You can PM tutorials related to a forum to a staff member.

Sanket
ForumGuru

Male Posts : 48766
Reputation : 2819
Language : English
Location : Mumbai

http://webartzforum.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum