Using mathrsfs script fonts in MediaWiki

In howto on Jan 28, 2011 by theoryl Tagged: , , , , , , , ,

This is in Ubuntu Lucid Lynx 10.04:

The RSFS fonts give you very nice script fonts:

The top row shows the fonts from the command \mathscr while the bottom from \mathcal, which \LaTeX users should be more familiar with.

In order to use the RSFS fonts in \LaTeX, you would add the preamble \usepackage{mathrsfs} in the .tex file. But what if you want to use the RSFS fonts in MediaWiki (the software that powers the Wikipedia), which by default does not include the preamble?

It turns out that you have to compile texvc (the \LaTeX interpreter incorporated into MediaWiki) with some slight modifications to (located in the source directory mediawiki/math). Basically, you want to add the preamble into that file. Below is what I did:

  • First, make sure you have installed mathrsfs.sty in the \LaTeX environment. If not, you can download it from In Ubuntu 10.04, it should be located at /usr/share/texmf-texlive/tex/latex/jknapltx/mathrsfs.sty.
  • Get the MediaWiki source from repo: sudo apt-get source mediawiki. Install all the dependencies as well.
  • Get its compiler: sudo apt-get install ocaml-nox gcc.
  • Now cd to the math directory: cd /var/lib/mediawiki/mediawiki-1.15.1/math
  • Edit the file Find the line beginning with: (if !modules_ams then "\\usepackage{amsmath}\n
  • Now, add: "\\usepackage(mathrsfs)\n" among the preambles.
  • Add another line close to the end of the file: | "\\mathscr" -> (tex_use_ams (); FUN_AR1 "\\mathscr ").
  • Compile: sudo make
  • After it is compiled successfully, copy the executable: sudo cp texvc /usr/bin

Make sure TeX is enabled in MediaWiki config file LocalSettings.php. If not, append the line to the file: $wgUseTeX = true ;.

That’s it. You should be able to use the command \mathscr in your MediaWiki!



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: