groff-commit
[Top][All Lists]
Advanced

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

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


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

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

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

Log message:
        The -TMathML option for eqn.

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

Patches:
Index: over.cpp
===================================================================
RCS file: /sources/groff/groff/src/preproc/eqn/over.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- over.cpp    26 May 2005 21:02:00 -0000      1.2
+++ over.cpp    3 Feb 2007 05:32:57 -0000       1.3
@@ -118,11 +118,12 @@
 
 void over_box::output()
 {
+  if (output_format == troff) {
   if (reduce_size)
     printf("\\s[\\n[" SMALL_SIZE_FORMAT "]u]", uid);
-#ifdef USE_Z
+  #ifdef USE_Z
   printf("\\Z" DELIMITER_CHAR);
-#endif
+  #endif
   // move up to the numerator baseline
   printf("\\v'-\\n[" SUP_RAISE_FORMAT "]u'", uid);
   // move across so that it's centered
@@ -132,19 +133,19 @@
   // print the numerator
   num->output();
 
-#ifdef USE_Z
+  #ifdef USE_Z
   printf(DELIMITER_CHAR);
-#else
+  #else
   // back again
   printf("\\h'-\\n[" WIDTH_FORMAT "]u'", num->uid);
   printf("\\h'-(\\n[" WIDTH_FORMAT "]u-\\n[" WIDTH_FORMAT "]u/2u)'",
         uid, num->uid);
   // down again
   printf("\\v'\\n[" SUP_RAISE_FORMAT "]u'", uid);
-#endif
-#ifdef USE_Z
+  #endif
+  #ifdef USE_Z
   printf("\\Z" DELIMITER_CHAR);
-#endif
+  #endif
   // move down to the denominator baseline
   printf("\\v'\\n[" SUB_LOWER_FORMAT "]u'", uid);
 
@@ -155,16 +156,16 @@
   // print the the denominator
   den->output();
 
-#ifdef USE_Z
+  #ifdef USE_Z
   printf(DELIMITER_CHAR);
-#else
+  #else
   // back again
   printf("\\h'-\\n[" WIDTH_FORMAT "]u'", den->uid);
   printf("\\h'-(\\n[" WIDTH_FORMAT "]u-\\n[" WIDTH_FORMAT "]u/2u)'",
         uid, den->uid);
   // up again
   printf("\\v'-\\n[" SUB_LOWER_FORMAT "]u'", uid);
-#endif
+  #endif
   if (reduce_size)
     printf("\\s[\\n[" SIZE_FORMAT "]u]", uid);
   // draw the line
@@ -176,6 +177,13 @@
   fputs(draw_flag ? " 0'" : "\\&\\(ru'", stdout);
   printf("\\v'%dM'", axis_height);
   printf("\\h'%dM'", null_delimiter_space);
+  } else if (output_format == mathml) {
+    // FIXME: passing a displaystyle attribute doesn't validate.
+    printf("<mfrac>");
+    num->output();
+    den->output();
+    printf("</mfrac>");
+  }
 }
 
 void over_box::debug_print()




reply via email to

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