Subversion Repositories wimsdev

Rev

Rev 5611 | Rev 6525 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5611 Rev 5617
Line 61... Line 61...
61
}
61
}
62
 
62
 
63
char tnames[]="sqrt int integrate sum prod product \
63
char tnames[]="sqrt int integrate sum prod product \
64
Int Sum Prod conj abs";
64
Int Sum Prod conj abs";
65
 
65
 
66
int __gototex (char *buf,char *f, int ts)
66
int __gototex (char *p, char *f, int ts)
67
{
67
{
68
      char alignbak[2048];
68
      char alignbak[2048];
-
 
69
      char *pp, buf[MAX_LINELEN+1];
69
      char *pp;
70
      ovlstrcpy(buf,p);
70
      instex_style="$$";
71
      instex_style="$$";
71
      if(!ts) texmath(buf);
72
      if(!ts) texmath(buf);
72
         /* ts=0 but there is some computer matrix to transform
73
         /* ts=0 but there is some computer matrix to transform
73
          * done by texmath, but it does much more as replacing strings in tmathfn
74
          * done by texmath, but it does much more as replacing strings in tmathfn
74
          * OK if buf contains " math computer-syntax" ; if not, the result may be bad
75
          * OK if buf contains " math computer-syntax" ; if not, the result may be bad
Line 80... Line 81...
80
        if(*p1=='\\') {
81
        if(*p1=='\\') {
81
          int i;
82
          int i;
82
          char *pt;
83
          char *pt;
83
          for(i=1;isalnum(p1[i]);i++); /* find an alphanumeric string beginning by \\ */
84
          for(i=1;isalnum(p1[i]);i++); /* find an alphanumeric string beginning by \\ */
84
          if(p1[i]==0 && (pt=mathfont(p1))!=NULL) {
85
          if(p1[i]==0 && (pt=mathfont(p1))!=NULL) {
85
            _output_(pt); *buf=0; return 1;
86
            _output_(pt); *p=0; return 1;
86
          }
87
          }
87
        }
88
        }
88
      // }
89
      // }
89
      }
90
      }
90
      /* send to mathml */
91
      /* send to mathml */
91
      if (mathalign_base == 2 && mathml(buf,0)) { *buf=0 ;return 1; }
92
      if (mathalign_base == 2 && mathml(buf,0)) { *p=0 ;return 1; }
92
/* end if mathml option in case ts=1 or "computer matrix" */
93
/* end if mathml option in case ts=1 or "computer matrix" */
93
 
94
 
94
/* creating images*/
95
/* creating images*/
95
      pp=getvar("ins_align");
96
      pp=getvar("ins_align");
96
      if(pp!=NULL) mystrncpy(alignbak,pp,sizeof(alignbak));
97
      if(pp!=NULL) mystrncpy(alignbak,pp,sizeof(alignbak));
Line 102... Line 103...
102
      else {
103
      else {
103
        instex_usedynamic=1; exec_instex(buf); instex_usedynamic=0;
104
        instex_usedynamic=1; exec_instex(buf); instex_usedynamic=0;
104
      }
105
      }
105
      instex_style="";
106
      instex_style="";
106
      if(alignbak[0]) setvar("ins_align",alignbak);
107
      if(alignbak[0]) setvar("ins_align",alignbak);
107
      *buf=0; return 0;
108
      *p=0; return 0;
108
}
109
}
109
 
110
 
110
    /* Intelligent insertion of math formulas, kernel */
111
    /* Intelligent insertion of math formulas, kernel */
111
void __insmath(char *p)
112
void __insmath(char *p)
112
{
113
{