adding some strings
[moodle-linuxchix.git] / filter / tex / defaultsettings.php
blob277fa717b4cbf96e4ea71f5051cf75776fbb6ac6
1 <?php
2 // defaultsettings.php
3 // deafault settings are done here, saves doing all this twice in
4 // both the rendering routine and the config screen
6 function tex_defaultsettings( $force=false ) {
8 global $CFG;
10 if (!isset($CFG->filter_tex_latexpreamble) or $force) {
11 set_config( 'filter_tex_latexpreamble', " \\usepackage[latin1]{inputenc}\n \\usepackage{amsmath}\n \\usepackage{amsfonts}\n \\RequirePackage{amsmath,amssymb,latexsym}\n");
14 if (!isset($CFG->filter_tex_latexbackground) or $force) {
15 set_config( 'filter_tex_latexbackground', '#FFFFFF' );
18 if (!isset($CFG->filter_tex_density) or $force) {
19 set_config( 'filter_tex_density', '120' );
22 // defaults for paths - if one not set assume all not set
23 if (!isset($CFG->filter_tex_pathlatex) or $force) {
24 // load the paths for the appropriate OS
25 // it would be nice to expand this
26 if (PHP_OS=='Linux') {
27 $binpath = '/usr/bin/';
28 set_config( 'filter_tex_pathlatex',"{$binpath}latex" );
29 set_config( 'filter_tex_pathdvips',"{$binpath}dvips" );
30 set_config( 'filter_tex_pathconvert',"{$binpath}convert" );
32 elseif (PHP_OS=='Darwin') {
33 $binpath = '/sw/bin/'; // most likely needs a fink install (fink.sf.net)
34 set_config( 'filter_tex_pathlatex',"{$binpath}latex" );
35 set_config( 'filter_tex_pathdvips',"{$binpath}dvips" );
36 set_config( 'filter_tex_pathconvert',"{$binpath}convert" );
38 elseif (PHP_OS=='WINNT' or PHP_OS=='WIN32' or PHP_OS=='Windows') {
39 // note: you need Ghostscript installed (standard), miktex (standard)
40 // and ImageMagick (install at c:\ImageMagick)
41 set_config( 'filter_tex_pathlatex',"\"c:\\texmf\\miktex\\bin\\latex.exe\" " );
42 set_config( 'filter_tex_pathdvips',"\"c:\\texmf\\miktex\\bin\\dvips.exe\" " );
43 set_config( 'filter_tex_pathconvert',"\"c:\\imagemagick\\convert.exe\" " );
45 else {
46 set_config( 'filter_tex_pathlatex','' );
47 set_config( 'filter_tex_pathdvips','' );
48 set_config( 'filter_tex_pathconvert','' );