Rev 8185 | Rev 8894 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8185 | Rev 8490 | ||
---|---|---|---|
Line 14... | Line 14... | ||
14 | * You should have received a copy of the GNU General Public License |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write to the Free Software |
15 | * along with this program; if not, write to the Free Software |
16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | */ |
17 | */ |
18 | #include "wims.h" |
18 | #include "wims.h" |
19 | - | ||
- | 19 | int disable_mathml; |
|
20 | int mathml(char *p, int option ){ |
20 | int mathml(char *p, int option ){ |
21 | if (strlen(p)==0) return 1 ; |
21 | if (strlen(p)==0) return 1 ; |
22 | if( mathalign_base <= 1){ |
22 | if( mathalign_base <= 1){ |
23 | internal_error(" why is wims trying mathml()?\n"); |
23 | internal_error(" why is wims trying mathml()?\n"); |
24 | return 0; // go to insmath with gifs |
24 | return 0; // go to insmath with gifs |
25 | } |
25 | } |
- | 26 | if( disable_mathml==1 || atoi(getvar("disable_mathml"))==1) return 0; |
|
26 | if(strlen(p) > MAX_LINELEN ){ // too big ? probably too big for gifs as well ; but error signalling is better in gif-methods |
27 | if(strlen(p) > MAX_LINELEN ){ // too big ? probably too big for gifs as well ; but error signalling is better in gif-methods |
27 | mathalign_base = 1;// 0 or 1 position of tex_gifs |
28 | mathalign_base = 1;// 0 or 1 position of tex_gifs |
28 | return 0; // go to insmath with gifs |
29 | return 0; // go to insmath with gifs |
29 | } |
30 | } |
30 | //singlespace(p); // needed for check unbalanced \left\right in wims_mathml.cc --> insmath.c |
31 | //singlespace(p); // needed for check unbalanced \left\right in wims_mathml.cc --> insmath.c |
Line 39... | Line 40... | ||
39 | else |
40 | else |
40 | { |
41 | { |
41 | pid = fork(); |
42 | pid = fork(); |
42 | if (pid == (pid_t) 0){ |
43 | if (pid == (pid_t) 0){ |
43 | // this buffer should probably be set to 0.5 * MAX_LINELEN : mathml is very big ! |
44 | // this buffer should probably be set to 0.5 * MAX_LINELEN : mathml is very big ! |
44 | // if output mathml string larger ;ERROR will be signaled by |
45 | // if output mathml string larger ;ERROR will be signaled by wims_mathml. |
45 | char mml_buffer[MAX_LINELEN+1]; |
46 | char mml_buffer[MAX_LINELEN+1]; |
46 | sprintf(mml_buffer, "%d", MAX_LINELEN);// int --> char |
47 | sprintf(mml_buffer, "%d", MAX_LINELEN);// int --> char |
47 | // setting --tex-size argument to wims_mathml.cc |
48 | // setting --tex-size argument to wims_mathml.cc |
48 | char mathml_tex_size[64];//this should be a string like "250%" |
49 | char mathml_tex_size[64];//this should be a string like "250%" |
49 | int texsize_list[]={20,30,50,70,90,100,120,130,150,180,220,300}; |
50 | int texsize_list[]={20,30,50,70,90,100,120,130,150,180,220,300}; |