/itexToMML

To download this project, use:
bzr branch http://golem.ph.utexas.edu/~distler/code/itexToMML/

« back to all changes in this revision

Viewing changes to itex-src/itex2MML.y

  • Committer: Jacques Distler
  • Date: 2014-01-05 18:28:41 UTC
  • Revision ID: distler@golem.ph.utexas.edu-20140105182841-n0xy2tiap8yuo6q7
Tags: 1.5.1
itex2MML 1.5.1

New commands:
  \negmedspace
  \negthickspace
  \mathsf{}
  \mathtt{}
  \begintoggle{expr1}{expr2}...{exprN}\endtoggle

Bugs fixed:
   \pmod{} MathML output corrected
    | = \vert
      and         emit the "correct" unicode characters now. 
   \| = \Vert
   Cleaned up empty elements

Show diffs side-by-side

added added

removed removed

504
504
  itex2MML_free_string($3);
505
505
}
506
506
| SUB closedTerm {
507
 
  $$ = itex2MML_copy3("<msub><mo></mo>", $2, "</msub>");
 
507
  $$ = itex2MML_copy3("<msub><mo/>", $2, "</msub>");
508
508
  itex2MML_free_string($2);
509
509
}
510
510
| SUP closedTerm {
511
 
  $$ = itex2MML_copy3("<msup><mo></mo>", $2, "</msup>");
 
511
  $$ = itex2MML_copy3("<msup><mo/>", $2, "</msup>");
512
512
  itex2MML_free_string($2);
513
513
}
514
514
| closedTerm {
1136
1136
 
1137
1137
multi: MULTI MROWOPEN subsupList MROWCLOSE closedTerm MROWOPEN subsupList MROWCLOSE {
1138
1138
  char * s1 = itex2MML_copy3("<mmultiscripts>", $5, $7);
1139
 
  char * s2 = itex2MML_copy3("<mprescripts></mprescripts>", $3, "</mmultiscripts>");
 
1139
  char * s2 = itex2MML_copy3("<mprescripts/>", $3, "</mmultiscripts>");
1140
1140
  $$ = itex2MML_copy2(s1, s2);
1141
1141
  itex2MML_free_string(s1);
1142
1142
  itex2MML_free_string(s2);
1146
1146
}
1147
1147
| MULTI MROWOPEN subsupList MROWCLOSE closedTerm EMPTYMROW {
1148
1148
  char * s1 = itex2MML_copy2("<mmultiscripts>", $5);
1149
 
  char * s2 = itex2MML_copy3("<mprescripts></mprescripts>", $3, "</mmultiscripts>");
 
1149
  char * s2 = itex2MML_copy3("<mprescripts/>", $3, "</mmultiscripts>");
1150
1150
  $$ = itex2MML_copy2(s1, s2);
1151
1151
  itex2MML_free_string(s1);
1152
1152
  itex2MML_free_string(s2);
1177
1177
  itex2MML_free_string($4);
1178
1178
}
1179
1179
| SUB closedTerm {
1180
 
  $$ = itex2MML_copy2($2, " <none></none>");
 
1180
  $$ = itex2MML_copy2($2, " <none/>");
1181
1181
  itex2MML_free_string($2);
1182
1182
}
1183
1183
| SUP closedTerm {
1184
 
  $$ = itex2MML_copy2("<none></none> ", $2);
 
1184
  $$ = itex2MML_copy2("<none/> ", $2);
1185
1185
  itex2MML_free_string($2);
1186
1186
}
1187
1187
| SUB SUP closedTerm {
1188
 
  $$ = itex2MML_copy2("<none></none> ", $3);
 
1188
  $$ = itex2MML_copy2("<none/> ", $3);
1189
1189
  itex2MML_free_string($3);
1190
1190
};
1191
1191
 
1483
1483
};
1484
1484
 
1485
1485
emptymrow: EMPTYMROW {
1486
 
  $$ = itex2MML_copy_string("<mrow></mrow>");
 
1486
  $$ = itex2MML_copy_string("<mrow/>");
1487
1487
};
1488
1488
 
1489
1489
mathenv: BEGINENV MATRIX tableRowList ENDENV MATRIX {
1738
1738
};
1739
1739
 
1740
1740
tableCell:   {
1741
 
  $$ = itex2MML_copy_string("<mtd></mtd>");
 
1741
  $$ = itex2MML_copy_string("<mtd/>");
1742
1742
}
1743
1743
| compoundTermList {
1744
1744
  $$ = itex2MML_copy3("<mtd>", $1, "</mtd>");