Rev 13590 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 13590 | Rev 17974 | ||
|---|---|---|---|
| Line 122... | Line 122... | ||
| 122 | else { |
122 | else { |
| 123 | fprintf(outf,"question=%s\n",executed_str); |
123 | fprintf(outf,"question=%s\n",executed_str); |
| 124 | ex_statement=1; |
124 | ex_statement=1; |
| 125 | } |
125 | } |
| 126 | } |
126 | } |
| - | 127 | void p_latex(char *p[MAX_PARM]) |
|
| 127 | 128 | { |
|
| - | 129 | if(ex_latex<0) return; |
|
| - | 130 | if(ex_latex>0 || p==NULL) { |
|
| - | 131 | out_exec(vbuf_latex,"latex"); |
|
| - | 132 | ex_latex=-1; return; |
|
| - | 133 | } |
|
| - | 134 | snprintf(vbuf_latex,sizeof(vbuf_latex),"%s",p[0]); |
|
| - | 135 | subst(vbuf_latex); |
|
| - | 136 | singlespace(vbuf_latex); |
|
| - | 137 | fprintf(outf,"latex=!nosubst %s\n\n", vbuf_latex); |
|
| - | 138 | } |
|
| 128 | void p_gen(int *ex_gen, char vbuf_gen[], char *name_gen, char *p[MAX_PARM]) |
139 | void p_gen(int *ex_gen, char vbuf_gen[], char *name_gen, char *p[MAX_PARM]) |
| 129 | { |
140 | { |
| 130 | if(*ex_gen<0) return; |
141 | if(*ex_gen<0) return; |
| 131 | if(*ex_gen>0 || p==NULL) { |
142 | if(*ex_gen>0 || p==NULL) { |
| 132 | out_exec(vbuf_gen, name_gen); |
143 | out_exec(vbuf_gen, name_gen); |
| 133 | *ex_gen=-1; return; |
144 | *ex_gen=-1; return; |
| 134 | } |
145 | } |
| 135 | snprintf(vbuf_gen,MAX_LINELEN,"%s",p[0]); subst(vbuf_gen); |
146 | snprintf(vbuf_gen,MAX_LINELEN,"%s",p[0]); subst(vbuf_gen); |
| 136 | if(strchr(vbuf_gen,'\\')!=NULL) { |
147 | if(strchr(vbuf_gen,'\\')!=NULL) { |
| 137 | fprintf(outf,"%s=%s\n", name_gen, executed_str); |
148 | fprintf(outf,"%s=%s\n", name_gen, executed_str); |
| 138 | *ex_gen=1; |
149 | *ex_gen=1; |
| 139 | } |
150 | } |
| 140 | else { |
151 | else { |
| 141 | singlespace(vbuf_gen); |
152 | singlespace(vbuf_gen); |
| 142 | fprintf(outf,"%s=!nosubst %s\n\n", name_gen, vbuf_gen); |
153 | fprintf(outf,"%s=!nosubst %s\n\n", name_gen, vbuf_gen); |
| 143 | } |
154 | } |
| 144 | } |
155 | } |
| 145 | 156 | ||
| 146 | void p_hint(char *p[MAX_PARM]) {p_gen(&ex_hint, vbuf_hint, "hint", p);} |
157 | void p_hint(char *p[MAX_PARM]) {p_gen(&ex_hint, vbuf_hint, "hint", p);} |
| 147 | void p_help(char *p[MAX_PARM]) {p_gen(&ex_help, vbuf_help, "help", p);} |
158 | void p_help(char *p[MAX_PARM]) {p_gen(&ex_help, vbuf_help, "help", p);} |
| 148 | void p_solution(char *p[MAX_PARM]) {p_gen(&ex_solution, vbuf_solution, "solution", p);} |
159 | void p_solution(char *p[MAX_PARM]) {p_gen(&ex_solution, vbuf_solution, "solution", p);} |
| 149 | - | ||
| 150 | void p_latex(char *p[MAX_PARM]) |
- | |
| 151 | { |
- | |
| 152 | if(ex_latex<0) return; |
- | |
| 153 | if(ex_latex>0 || p==NULL) { |
- | |
| 154 | out_exec(vbuf_latex,"latex"); |
- | |
| 155 | ex_latex=-1; return; |
- | |
| 156 | } |
- | |
| 157 | snprintf(vbuf_latex,sizeof(vbuf_latex),"%s",p[0]); |
- | |
| 158 | subst(vbuf_latex); |
- | |
| 159 | singlespace(vbuf_latex); |
- | |
| 160 | fprintf(outf,"latex=!nosubst %s\n\n", vbuf_latex); |
- | |
| 161 | } |
- | |
| 162 | 160 | ||
| 163 | enum {typ_default, typ_num, typ_func, typ_units, typ_text, |
161 | enum {typ_default, typ_num, typ_func, typ_units, typ_text, |
| 164 | typ_formal,typ_matrix,typ_vector,typ_set,typ_equation, |
162 | typ_formal,typ_matrix,typ_vector,typ_set,typ_equation, |
| 165 | typ_case, typ_nocase, typ_atext, typ_wlist, typ_comp, |
163 | typ_case, typ_nocase, typ_atext, typ_wlist, typ_comp, |
| 166 | typ_algexp, typ_litexp, typ_menu, typ_coord, typ_fill, |
164 | typ_algexp, typ_litexp, typ_menu, typ_coord, typ_fill, |