Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: jaccione on October 12, 2010, 12:51:46 AM

Title: Subs-editor.php help
Post by: jaccione on October 12, 2010, 12:51:46 AM
Hi, I am trying to add an extra bbc button function for a LaTex/mimetex mod in the forum.

the mod array looks like this and works just fine:
array(
'image' => 'tex',
'code' => 'tex',
'before' => '[tex]',
'after' => '[/tex]',
'description' => $txt['latex']
),


what i would like to do is add another button with a further defined option  for colour font formatting so that the 'before' text reads as '[tex]\color{blue}' and the after would remain the same '[/tex]'

I think the forward slash is crashing subs-editor though??

array(
'image' => 'tex',
'code' => 'tex',
'before' => '[tex]\color{blue}',
'after' => '[/tex]',
'description' => $txt['latex']
),


I am not sure how to escape it, or if that is even the problem. Any ideas appreciated.  I am running 2.0RC3 with the mimetex mod
thanks
Title: Re: Subs-editor.php help
Post by: Oya on October 12, 2010, 03:09:40 AM
try that line as

'before' => '[tex]\\color{blue}',
Title: Re: Subs-editor.php help
Post by: jaccione on October 12, 2010, 03:50:07 AM
Thanks so much, that worked a charm

I knew it had to be simple!!