The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Latex temporary solution!

3 posters

Go down

Latex temporary solution! Empty Latex temporary solution!

Post by xx3004 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):
Latex temporary solution! Prove_10

I hope this help, enjoy Smile

[Credits by xx3004]
xx3004
xx3004
New Member

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

http://xx3004.forumotion.com

Back to top Go down

Latex temporary solution! Empty Re: Latex temporary solution!

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

Oh! that sweet but iّm doّnt need in my forum .
thanks
Latex temporary solution! 951938
I-Angel-Q
I-Angel-Q
Forumember

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

Back to top Go down

Latex temporary solution! Empty Re: Latex temporary solution!

Post by Sanket 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
Sanket
ForumGuru

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

Back to top Go down

Back to top


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