Showing posts with label edit toolbar. Show all posts
Showing posts with label edit toolbar. Show all posts

Wednesday, September 17, 2008

Change the Math button

Change the Math button in editor (standard Edit Toolbar) to produce <tex> and </tex> tags, instead of <math> and </math>

<math> tag support is like small hack, so I prefer to give users <tex> tag and save <math> tag for compatibility with Wikipedia standards.

Find into WIKI_HOME/includes/EditPage.php
array(
'image' => $wgLang->getImageFile('button-math'),
'id' => 'mw-editbutton-math',
'open' => "<math>",
'close' => "</math>",
'sample' => wfMsg('math_sample'),
'tip' => wfMsg('math_tip'),
'key' => 'C'
),


and replace it with
array(
'image' => $wgLang->getImageFile('button-math'),
'id' => 'mw-editbutton-math',
'open' => "<tex<",
'close' => "</tex>",
'sample' => wfMsg('math_sample'),
'tip' => wfMsg('math_tip'),
'key' => 'C'
),


See also http://www.mediawiki.org/wiki/Mimetex_alternative

It's possible to change MediaWiki system messges like math_sample or math_tip. List of messages is here http://WIKI_HOST/index.php5/Special:AllMessages
To change messages see files in WIKI_HOME/languages/messages (find files for your language).