added math templates
[lambda.git] / jsMath / easy / load.js
1 /**********************************************************************
2  *
3  *   Customize the values given below to suit your needs.
4  *   You can make additional copies of this file with
5  *   different customizated settings if you need to load
6  *   jsMath with different parameters.
7  *   
8  *   Load this page via:
9  *   
10  *   <SCRIPT SRC="path-to-jsMath/easy/load.js"></SCRIPT>
11  *   
12  *   (If you are including this file into your page via Server-Side
13  *   Includes, you should remove line above.)
14  *   
15  *   You can make copies of this file with different settings
16  *   if you need to have several different configurations.
17  *   
18  **********************************************************************/
19
20 if (!window.jsMath) {window.jsMath = {}}
21
22 jsMath.Easy = {
23   //
24   //  The URL of the root jsMath directory on your server
25   //  (it must be in the same domain as the HTML page).
26   //  It should include "http://yoursite.com/", or should
27   //  be relative to the root of your server.  It is possible
28   //  to be a relative URL, but it will be relative to the
29   //  HTML page loading this file.
30   //  
31   //  If you leave this blank, jsMath will try to look it up from
32   //  the URL where it loaded this file, but that may not work.
33   //
34   root: "",
35   
36   //
37   //  The default scaling factor for mathematics compared to the
38   //  surrounding text.
39   //
40   scale: 120,
41   
42   //
43   //  1 means use the autoload plug-in to decide if jsMath should be loaded
44   //  0 means always load jsMath
45   //
46   autoload: 1,
47
48   //
49   //  Setting any of these will cause the tex2math plugin to be used
50   //  to add the <DIV> and <SPAN> tags that jsMath needs.  See the
51   //  documentation for the tex2math plugin for more information.
52   //
53   processSlashParens: 1,       // process \(...\) in text?
54   processSlashBrackets: 1,     // process \[...\] in text?
55   processDoubleDollars: 1,     // process $$...$$ in text?
56   processSingleDollars: 0,     // process $...$ in text?
57   processLaTeXenvironments: 0, // process \begin{xxx}...\end{xxx} outside math mode?
58   fixEscapedDollars: 0,        // convert \$ to $ outside of math mode?
59   doubleDollarsAreInLine: 0,   // make $$...$$ be in-line math?
60   allowDisableTag: 1,          // allow ID="tex2math_off" to disable tex2math?
61   //
62   //  If you want to use your own custom delimiters for math instead
63   //  of the usual ones, then uncomment the following four lines and
64   //  insert your own delimiters within the quotes.  You may want to
65   //  turn off processing of the dollars and other delimiters above
66   //  as well, though you can use them in combination with the
67   //  custom delimiters if you wish.  See the tex2math documentation
68   //  for more details.
69   //  
70   //customDelimiters: [
71   //  '[math]','[/math]',        // to begin and end in-line math
72   //  '[display]','[/display]'   // to begin and end display math
73   //],
74
75   //
76   //  Disallow the use of the @(...) mechanism for including raw HTML
77   //  in the contents of \hbox{}?  (If used in a content-management system
78   //  where users are allowed to enter mathematics, setting this to 0
79   //  would allow them to enter arbitrary HTML code within their
80   //  math formulas, and that poses a security risk.)
81   //
82   safeHBoxes: 1,
83
84   //
85   //  Show TeX source when mathematics is double-clicked?
86   //
87   allowDoubleClicks: 1,
88   
89   //
90   //  Show jsMath font warning messages?  (Disabling this prevents yours
91   //  users from finding out that they can have a better experience on your
92   //  site by installing some fonts, so don't disable this).
93   //
94   showFontWarnings: 1,
95   
96   //
97   //  Use "Process" or "ProcessBeforeShowing".  See the jsMath
98   //  author's documentation for the difference between these
99   //  two routines.
100   //
101   method: "Process",
102
103   //
104   //  List of plug-ins and extensions that you want to be
105   //  loaded automatically.  E.g.
106   //      ["plugins/mimeTeX.js","extensions/AMSsymbols.js"]
107   //  
108   loadFiles: [],
109   
110   //
111   //  List of fonts to load automatically.  E.g.
112   //      ["cmmib10"]
113   //
114   loadFonts: [],
115   
116   //
117   //  List of macros to define.  These are of the form
118   //      name: value
119   //  where 'value' is the replacement text for the macro \name.
120   //  The 'value' can also be [value,n] where 'value' is the replacement
121   //  text and 'n' is the number of parameters for the macro.
122   //  Note that backslashes must be doubled in the replacement string.
123   //  E.g.,
124   //      {
125   //        RR: '{\\bf R}',
126   //        bold: ['{\\bf #1}', 1]
127   //      }
128   //
129   macros: {},
130   
131   //
132   //  Allow jsMath to enter global mode?
133   //  (Uses frames, so may not always work with complex web sites)
134   //
135   allowGlobal: 1,
136   
137   //
138   //  Disable image fonts?  (In case you don't load them on your server.)
139   //
140   noImageFonts: 0
141   
142 };
143
144 /****************************************************************/
145 /****************************************************************/
146 //
147 //            DO NOT MAKE CHANGES BELOW THIS
148 //
149 /****************************************************************/
150 /****************************************************************/
151
152 if (jsMath.Easy.root == "") {
153   jsMath.Easy.root = document.getElementsByTagName("script");
154   jsMath.Easy.root = jsMath.Easy.root[jsMath.Easy.root.length-1].src
155   if (jsMath.Easy.root.match(/\/easy\/[^\/]*$/)) {
156     jsMath.Easy.root = jsMath.Easy.root.replace(/\/easy\/[^\/]*$/,"");
157   } else {
158     jsMath.Easy.root = jsMath.Easy.root.replace(/\/(jsMath\/(easy\/)?)?[^\/]*$/,"/jsMath");
159   }
160 }
161 jsMath.Easy.root = jsMath.Easy.root.replace(/\/$/,""); // trim trailing "/" if any
162
163 document.write('<script src="'+jsMath.Easy.root+'/jsMath-easy-load.js"><'+'/script>');
164