groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff-commit] groff/src/preproc/eqn script.cpp


From: Eric S. Raymond
Subject: [Groff-commit] groff/src/preproc/eqn script.cpp
Date: Sat, 03 Feb 2007 05:32:59 +0000

CVSROOT:        /sources/groff
Module name:    groff
Changes by:     Eric S. Raymond <esr>   07/02/03 05:32:59

Modified files:
        src/preproc/eqn: script.cpp 

Log message:
        The -TMathML option for eqn.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/src/preproc/eqn/script.cpp?cvsroot=groff&r1=1.3&r2=1.4

Patches:
Index: script.cpp
===================================================================
RCS file: /sources/groff/groff/src/preproc/eqn/script.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- script.cpp  26 May 2005 21:02:00 -0000      1.3
+++ script.cpp  3 Feb 2007 05:32:59 -0000       1.4
@@ -168,6 +168,7 @@
 
 void script_box::output()
 {
+  if (output_format == troff) {
   p->output();
   if (sup != 0) {
     printf("\\Z" DELIMITER_CHAR);
@@ -188,6 +189,26 @@
   }
   printf("\\h'\\n[" WIDTH_FORMAT "]u-\\n[" WIDTH_FORMAT "]u'",
         uid, p->uid);
+  } else if (output_format == mathml) {
+    if (sup != 0 and sub != 0) {
+      printf("<msubsup>");
+      p->output();
+      sub->output();
+      sup->output();
+      printf("</msubsup>");
+    } else if (sup != 0) {
+      printf("<msup>");
+      p->output();
+      sup->output();
+      printf("</msup>");
+  } else if (sub != 0) {
+      printf("<msub>");
+      p->output();
+      sub->output();
+      printf("</msub>");
+    }
+
+  }
 }
 
 void script_box::hint(unsigned flags)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]