Subversion Repositories wimsdev

Rev

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

Rev 8155 Rev 8185
Line 13... Line 13...
13
 *  You should have received a copy of the GNU General Public License
13
 *  You should have received a copy of the GNU General Public License
14
 *  along with this program; if not, write to the Free Software
14
 *  along with this program; if not, write to the Free Software
15
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16
 */
16
 */
17
/* subroutines for texmath */
17
/* subroutines for texmath */
-
 
18
#include "wims.h"
18
 
19
 
19
        /* Careful! increasing this number risks stack overflow. */
20
/* Careful! increasing this number risks stack overflow. */
20
#define MAX_FACTORS 256
21
#define MAX_FACTORS 256
21
 
22
 
22
enum {
23
enum {
23
    type_integer, type_numeric, type_var,
24
    type_integer, type_numeric, type_var,
24
      type_poly, type_transcend
25
      type_poly, type_transcend
Line 91... Line 92...
91
/* integration, sum and product */
92
/* integration, sum and product */
92
void tex_int(char *p) {  _tex_sums(p,"int",1); }
93
void tex_int(char *p) {  _tex_sums(p,"int",1); }
93
void tex_sum(char *p) {  _tex_sums(p,"sum",0); }
94
void tex_sum(char *p) {  _tex_sums(p,"sum",0); }
94
void tex_prod(char *p) { _tex_sums(p,"prod",0);}
95
void tex_prod(char *p) { _tex_sums(p,"prod",0);}
95
 
96
 
96
struct {
-
 
97
    char *name;
-
 
98
    int expind;
-
 
99
    char *left, *right;
-
 
100
    void (*routine) (char *p);
-
 
101
} tmathfn[]={
97
struct tmathfn tmathfn[]={
102
      {"Arg",      1,  "\\rm{Arg}",      "\\right)"},
98
      {"Arg",      1,  "\\rm{Arg}",      "\\right)"},
103
      {"Int",      2,  "","",        tex_int},
99
      {"Int",      2,  "","",        tex_int},
104
      {"Prod",     2,  "","",        tex_prod},
100
      {"Prod",     2,  "","",        tex_prod},
105
      {"Sum",      2,  "","",        tex_sum},
101
      {"Sum",      2,  "","",        tex_sum},
106
      {"abs",      0,  "\\left|",      "\\right|"},
102
      {"abs",      0,  "\\left|",      "\\right|"},
Line 144... Line 140...
144
      {"tanh",     1,  "\\rm{th}",      "\\right)"},
140
      {"tanh",     1,  "\\rm{th}",      "\\right)"},
145
      {"tg",       1,  "\\rm{tg}",      "\\right)"},
141
      {"tg",       1,  "\\rm{tg}",      "\\right)"},
146
      {"th",       1,  "\\rm{th}",      "\\right)"}
142
      {"th",       1,  "\\rm{th}",      "\\right)"}
147
};
143
};
148
 
144
 
149
#define tmathfn_no (sizeof(tmathfn)/sizeof(tmathfn[0]))
145
int tmathfn_no=(sizeof(tmathfn)/sizeof(tmathfn[0]));
150
 
146
 
151
struct {
-
 
152
    char *name, *tex;
-
 
153
} tmathvar[]={
147
struct tmathvar tmathvar[]={
154
      {"CC",      "\\mathbb{C}"},
148
      {"CC",      "\\mathbb{C}"},
155
      {"Delta",   "\\Delta"},
149
      {"Delta",   "\\Delta"},
156
      {"Gamma",   "\\Gamma"},
150
      {"Gamma",   "\\Gamma"},
157
      {"Inf",     "\\infty"},
151
      {"Inf",     "\\infty"},
158
      {"Lambda",  "\\Lambda"},
152
      {"Lambda",  "\\Lambda"},
Line 196... Line 190...
196
      {"theta",  "\\theta"},
190
      {"theta",  "\\theta"},
197
      {"xi",     "\\xi"},
191
      {"xi",     "\\xi"},
198
      {"zeta",   "\\zeta"}
192
      {"zeta",   "\\zeta"}
199
};
193
};
200
 
194
 
201
#define tmathvar_no (sizeof(tmathvar)/sizeof(tmathvar[0]))
195
int tmathvar_no=(sizeof(tmathvar)/sizeof(tmathvar[0]));
202
 
196
 
203
 
197
 
204
/* find the end of an additive term. */
198
/* find the end of an additive term. */
205
char *find_term_end(char *p)
199
char *find_term_end(char *p)
206
{
200
{