Rev 5514 | Rev 5822 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5514 | Rev 5516 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | char texmathbuf[MAX_LINELEN+1]; |
32 | char texmathbuf[MAX_LINELEN+1]; |
33 | char *find_term_end(char *p); |
33 | char *find_term_end(char *p); |
34 | void t_onestring(char *p); |
34 | void t_onestring(char *p); |
35 | void t_oneterm(char *p, int num); |
35 | void t_oneterm(char *p, int num); |
36 | void t_onefactor(struct afactor *p, int num); |
36 | void t_onefactor(struct afactor *p, int num); |
- | 37 | /* never used or defined ?? */ |
|
37 | void n_onestring(char *p); |
38 | void n_onestring(char *p); |
38 | void n_oneterm(char *p, int num); |
39 | void n_oneterm(char *p, int num); |
39 | void n_onefactor(struct afactor *p, int num); |
40 | void n_onefactor(struct afactor *p, int num); |
- | 41 | /* */ |
|
40 | void texmath(char *p); |
42 | void texmath(char *p); |
41 | 43 | ||
42 | /* print to texmathbuf */ |
44 | /* print to texmathbuf */ |
43 | void tprint(char *s,...) |
45 | void tprint(char *s,...) |
44 | { |
46 | { |
Line 461... | Line 463... | ||
461 | if(dencnt>0) qsort(denominator,dencnt,sizeof(denominator[0]),fsort); |
463 | if(dencnt>0) qsort(denominator,dencnt,sizeof(denominator[0]),fsort); |
462 | if(numcnt>0) qsort(numerator,numcnt,sizeof(numerator[0]),fsort); |
464 | if(numcnt>0) qsort(numerator,numcnt,sizeof(numerator[0]),fsort); |
463 | if(neucnt>0) qsort(neutral,neucnt,sizeof(neutral[0]),fsort); |
465 | if(neucnt>0) qsort(neutral,neucnt,sizeof(neutral[0]),fsort); |
464 | if(sign>0 && num>0 && rel==0) tprint(" +"); |
466 | if(sign>0 && num>0 && rel==0) tprint(" +"); |
465 | if(sign<0) tprint(" -"); |
467 | if(sign<0) tprint(" -"); |
466 | if(fcnt<1) tprint("1 "); |
468 | if(fcnt<1) tprint("1 "); // no factors why 1 - don't remove the 1 if [1,2;3,4], the 1 is useful? |
467 | if(dencnt>0) { |
469 | if(dencnt>0) { |
468 | tprint(" {"); |
470 | tprint(" {"); |
469 | if(numcnt==0) tprint(" 1"); // no numerator ? will write {1 over denominator} |
471 | if(numcnt==0) tprint(" 1"); // no numerator ? will write {1 over denominator} |
470 | else {/* numerator */ |
472 | else {/* numerator */ |
471 | if(numcnt==1 && *numerator[0]->beg=='(' && |
473 | if(numcnt==1 && *numerator[0]->beg=='(' && |
Line 677... | Line 679... | ||
677 | } |
679 | } |
678 | /* remove spaces */ |
680 | /* remove spaces */ |
679 | for(pp=p; *pp; pp++) { |
681 | for(pp=p; *pp; pp++) { |
680 | if(isspace(*pp)) {ovlstrcpy(pp,pp+1); pp--;} |
682 | if(isspace(*pp)) {ovlstrcpy(pp,pp+1); pp--;} |
681 | } |
683 | } |
682 | /* replace ** by ^ */ |
684 | /* replace ** by ^ see __replace_badchar(p,"**", "^");*/ |
683 | for(pp=strstr(p,"**"); pp!=NULL; pp=strstr(pp,"**")) { |
685 | for(pp=strstr(p,"**"); pp!=NULL; pp=strstr(pp,"**")) { |
684 | *pp='^'; ovlstrcpy(pp+1,pp+2); |
686 | *pp='^'; ovlstrcpy(pp+1,pp+2); |
685 | } |
687 | } |
686 | if(check_parentheses(p,1)!=0) module_error("unmatched_parentheses"); |
688 | if(check_parentheses(p,1)!=0) module_error("unmatched_parentheses"); |
687 | texmathbuf[0]=0; t_onestring(p); |
689 | texmathbuf[0]=0; t_onestring(p); |