Difference between revisions of "TeX notation filter"

Jump to: navigation, search

Note: You are currently viewing documentation for Moodle 2.2. Up-to-date documentation for the latest stable version is available here: TeX notation filter.

(Settings Page)
Line 1: Line 1:
The [[TeX Filter]] converts TeX code into GIF images. It uses a binary program(s) on the server to render the images (either the full LaTeX implementation or the [[MimeTeX]] binary that ships with Moodle for various platforms). Versions of MimeTex for Linux (glib2.3), Windows and Mac OS X are included in the Moodle distribution.  
+
The [[TeX Filter]] converts TeX code into GIF images. It uses a binary program(s) on the server to render the images (either the full LaTeX implementation, in Moodle 1.6 or later, or the [[MimeTeX]] binary that ships with Moodle for various platforms). Versions of MimeTex for Linux (glib2.3), Windows and Mac OS X are included in the Moodle distribution.  
  
 
No additional software or plugins are required on the client computers to display the images.
 
No additional software or plugins are required on the client computers to display the images.
Line 11: Line 11:
 
=== Using MimeTeX ===
 
=== Using MimeTeX ===
  
MimeTeX is a number of pre-built binaries that are included in the Moodle standard distribution and are located in the filters/tex directory. There are a number of different versions for different operating systems. The TeX filter picks the appropriate binary for the detected host operating system. Note that your web server needs to be set up with appropriate permissions for running binaries in that location. This appears to be particularly problematic on the Windows platform. See the [http://moodle.org/mod/forum/view.php?id=752 Mathematical Tools Forum] for more information.
+
MimeTeX is a number of pre-built binaries that are included in the Moodle standard distribution and are located in the filters/tex directory. There are a number of different versions for different operating systems. The TeX filter picks the appropriate binary for the detected host operating system (you will need to hack the script if your system is not included, for example for FreeBSD). Note that your web server needs to be set up with appropriate permissions for running binaries in that location. This appears to be particularly problematic on the Windows platform. See the [http://moodle.org/mod/forum/view.php?id=752 Mathematical Tools Forum] for more information.
  
 
If you use TeX in a GIFT question import file you must escape  { } and = (even # and ~) with a \ before each symbol.
 
If you use TeX in a GIFT question import file you must escape  { } and = (even # and ~) with a \ before each symbol.
Line 19: Line 19:
 
{{Moodle 1.6}}
 
{{Moodle 1.6}}
  
Moodle 1.6 adds the ability to use the full TeX formatting facilities (MimeTex only provides a subset). Three external binaries are used to render the images which may need setting up for your system. The filter will first check for a LaTeX renderer (Ghostscript is also required for this method) and failing that will use the simpler [[MimeTeX]] binary included in the Moodle distribution. LaTex permits the whole range of syntax, whereas [[MimeTeX]] only supports a mathematical subset.
+
Moodle 1.6 adds the ability to use the full TeX formatting facilities (MimeTex only provides a subset). Three external binaries are used to render the images which may need setting up for your system. The filter will first check for a LaTeX renderer (Ghostscript is also required for this method, ImageMagick in the case of Linux) and failing that will use the simpler [[MimeTeX]] binary included in the Moodle distribution. LaTex permits the whole range of syntax, whereas [[MimeTeX]] only supports a mathematical subset.
  
 
=== Settings Page ===
 
=== Settings Page ===
Line 47: Line 47:
 
==== Path of ''convert'' binary ====
 
==== Path of ''convert'' binary ====
  
Path to standard convert binary. This is distributed as part of the Ghostscript system.
+
Path to standard convert binary. This is distributed as part of the Ghostscript system, or ImageMagick in Linux.
  
 
== See also ==
 
== See also ==

Revision as of 06:25, 3 June 2007

The TeX Filter converts TeX code into GIF images. It uses a binary program(s) on the server to render the images (either the full LaTeX implementation, in Moodle 1.6 or later, or the MimeTeX binary that ships with Moodle for various platforms). Versions of MimeTex for Linux (glib2.3), Windows and Mac OS X are included in the Moodle distribution.

No additional software or plugins are required on the client computers to display the images.

Usage

To use the filter the resource should include a TeX expression delimited by double-dollar signs. Example:

   $$ sqrt( x + y ) $$

Using MimeTeX

MimeTeX is a number of pre-built binaries that are included in the Moodle standard distribution and are located in the filters/tex directory. There are a number of different versions for different operating systems. The TeX filter picks the appropriate binary for the detected host operating system (you will need to hack the script if your system is not included, for example for FreeBSD). Note that your web server needs to be set up with appropriate permissions for running binaries in that location. This appears to be particularly problematic on the Windows platform. See the Mathematical Tools Forum for more information.

If you use TeX in a GIFT question import file you must escape { } and = (even # and ~) with a \ before each symbol.

Improvements in 1.6

Template:Moodle 1.6

Moodle 1.6 adds the ability to use the full TeX formatting facilities (MimeTex only provides a subset). Three external binaries are used to render the images which may need setting up for your system. The filter will first check for a LaTeX renderer (Ghostscript is also required for this method, ImageMagick in the case of Linux) and failing that will use the simpler MimeTeX binary included in the Moodle distribution. LaTex permits the whole range of syntax, whereas MimeTeX only supports a mathematical subset.

Settings Page

The TeX filter settings page are primarily intended to adjust the operation of the LaTeX renderer. The defaults for the three path settings are selected according to the detection of the operating system on which Moodle is running. These are simply suggested common values - Moodle does not check that the binaries actually exist at these locations. The settings have no effect on the operation of the MimeTex binary (used if any of these binaries are not found).

LaTeX preamble

Enables the LaTeX preamble to be specified. The default should work for most users, but you may need to change it to support non-latin character sets etc. Please see the LaTeX documentation for further details.

Transparent colour

This should be set to your normal text background colour. The default setting is #FFFFFF (i.e., white).

Density

This setting effects the size of the resulting image.

Path of latex binary

Path to standard latex binary.

Path of dvips binary

Path to standard dvips binary - generally distributed as part of a LaTeX system.

Path of convert binary

Path to standard convert binary. This is distributed as part of the Ghostscript system, or ImageMagick in Linux.

See also