3 require_once($CFG->dirroot
.'/filter/tex/lib.php');
6 $items[] = new admin_setting_heading('filter_tex_latexheading', get_string('latexsettings', 'admin'), '');
7 $items[] = new admin_setting_configtextarea('filter_tex_latexpreamble', get_string('latexpreamble','admin'),
8 '', " \\usepackage[latin1]{inputenc}\n \\usepackage{amsmath}\n \\usepackage{amsfonts}\n \\RequirePackage{amsmath,amssymb,latexsym}\n");
9 $items[] = new admin_setting_configtext('filter_tex_latexbackground', get_string('backgroundcolour', 'admin'), '', '#FFFFFF');
10 $items[] = new admin_setting_configtext('filter_tex_density', get_string('density', 'admin'), '', '120', PARAM_INT
);
11 $items[] = new admin_setting_configtext('filter_tex_density', get_string('density', 'admin'), '', '120', PARAM_INT
);
13 if (PHP_OS
=='Linux') {
14 $default_filter_tex_pathlatex = "/usr/bin/latex";
15 $default_filter_tex_pathdvips = "/usr/bin/dvips";
16 $default_filter_tex_pathconvert = "/usr/bin/convert";
18 } else if (PHP_OS
=='Darwin') {
19 // most likely needs a fink install (fink.sf.net)
20 $default_filter_tex_pathlatex = "/sw/bin/latex";
21 $default_filter_tex_pathdvips = "/sw/bin/dvips";
22 $default_filter_tex_pathconvert = "/sw/bin/convert";
24 } else if (PHP_OS
=='WINNT' or PHP_OS
=='WIN32' or PHP_OS
=='Windows') {
25 // note: you need Ghostscript installed (standard), miktex (standard)
26 // and ImageMagick (install at c:\ImageMagick)
27 $default_filter_tex_pathlatex = "\"c:\\texmf\\miktex\\bin\\latex.exe\" ";
28 $default_filter_tex_pathdvips = "\"c:\\texmf\\miktex\\bin\\dvips.exe\" ";
29 $default_filter_tex_pathconvert = "\"c:\\imagemagick\\convert.exe\" ";
32 $default_filter_tex_pathlatex = '';
33 $default_filter_tex_pathdvips = '';
34 $default_filter_tex_pathconvert = '';
37 $items[] = new admin_setting_configexecutable('filter_tex_pathlatex', get_string('pathlatex', 'admin'), '', $default_filter_tex_pathlatex);
38 $items[] = new admin_setting_configexecutable('filter_tex_pathdvips', get_string('pathdvips', 'admin'), '', $default_filter_tex_pathdvips);
39 $items[] = new admin_setting_configexecutable('filter_tex_pathconvert', get_string('pathconvert', 'admin'), '', $default_filter_tex_pathconvert);
41 foreach ($items as $item) {
42 $item->set_updatedcallback('filter_tex_updatedcallback');
43 $settings->add($item);