diff -r -u TeXmacs-1.0.1.13-src.orig/src/Classes/Atomic/tree_label.cc TeXmacs-1.0.1.13-src/src/Classes/Atomic/tree_label.cc --- TeXmacs-1.0.1.13-src.orig/src/Classes/Atomic/tree_label.cc 2003-04-12 05:34:15.000000000 -0600 +++ TeXmacs-1.0.1.13-src/src/Classes/Atomic/tree_label.cc 2003-05-07 14:01:52.000000000 -0600 @@ -78,6 +78,8 @@ constructor (RIGHT_SUP, "rsup", 1, ACCESSIBLE); constructor (FRAC, "frac", 2, ACCESSIBLE); constructor (SQRT, "sqrt", -1, ACCESSIBLE); + constructor (OVERBRACE, "overbrace", 1, ACCESSIBLE); + constructor (UNDERBRACE, "underbrace", 1, ACCESSIBLE); constructor (WIDE, "wide", 1, ACCESSIBLE); constructor (WIDE_UNDER, "wide*", 1, ACCESSIBLE); constructor (NEG, "neg", 1, ACCESSIBLE); diff -r -u TeXmacs-1.0.1.13-src.orig/src/Classes/Atomic/tree_label.hh TeXmacs-1.0.1.13-src/src/Classes/Atomic/tree_label.hh --- TeXmacs-1.0.1.13-src.orig/src/Classes/Atomic/tree_label.hh 2003-04-12 11:48:01.000000000 -0600 +++ TeXmacs-1.0.1.13-src/src/Classes/Atomic/tree_label.hh 2003-05-07 14:01:52.000000000 -0600 @@ -28,8 +28,9 @@ GROUP, LEFT, MIDDLE, RIGHT, BIG, LEFT_PRIME, RIGHT_PRIME, BELOW, ABOVE, LEFT_SUB, LEFT_SUP, RIGHT_SUB, RIGHT_SUP, - FRAC, SQRT, WIDE, WIDE_UNDER, NEG, TREE, - OLD_MATRIX, OLD_TABLE, OLD_MOSAIC, OLD_MOSAIC_ITEM, // 23 + FRAC, SQRT, OVERBRACE, UNDERBRACE, WIDE, + WIDE_UNDER, NEG, TREE, OLD_MATRIX, OLD_TABLE, + OLD_MOSAIC, OLD_MOSAIC_ITEM, // 25 TABLE_FORMAT, TABLE_WITH, CELL_WITH, TABLE_MARKER, TABLE, ROW, CELL, SUB_TABLE, // 8 diff -r -u TeXmacs-1.0.1.13-src.orig/src/Edit/editor.hh TeXmacs-1.0.1.13-src/src/Edit/editor.hh --- TeXmacs-1.0.1.13-src.orig/src/Edit/editor.hh 2003-05-03 12:15:31.000000000 -0600 +++ TeXmacs-1.0.1.13-src/src/Edit/editor.hh 2003-05-07 14:01:52.000000000 -0600 @@ -258,6 +258,8 @@ virtual void make_var_sqrt () = 0; virtual void make_wide (string wide) = 0; virtual void make_wide_under (string wide) = 0; + virtual void make_overbrace (string brace) = 0; + virtual void make_underbrace (string brace) = 0; virtual void make_neg () = 0; virtual void make_tree () = 0; diff -r -u TeXmacs-1.0.1.13-src.orig/src/Edit/Modify/edit_delete.cc TeXmacs-1.0.1.13-src/src/Edit/Modify/edit_delete.cc --- TeXmacs-1.0.1.13-src.orig/src/Edit/Modify/edit_delete.cc 2003-03-02 11:19:10.000000000 -0700 +++ TeXmacs-1.0.1.13-src/src/Edit/Modify/edit_delete.cc 2003-05-07 14:01:52.000000000 -0600 @@ -157,6 +157,8 @@ return; case SQRT: case WIDE: + case UNDERBRACE: + case OVERBRACE: case WIDE_UNDER: case NEG: go_to (end (et, p * 0)); @@ -348,6 +350,8 @@ back_in_dynamic (u, p); return; case WIDE: + case UNDERBRACE: + case OVERBRACE: case WIDE_UNDER: back_in_math_accent (u, p); return; diff -r -u TeXmacs-1.0.1.13-src.orig/src/Edit/Modify/edit_math.cc TeXmacs-1.0.1.13-src/src/Edit/Modify/edit_math.cc --- TeXmacs-1.0.1.13-src.orig/src/Edit/Modify/edit_math.cc 2003-04-24 10:43:16.000000000 -0600 +++ TeXmacs-1.0.1.13-src/src/Edit/Modify/edit_math.cc 2003-05-07 14:01:52.000000000 -0600 @@ -157,6 +157,26 @@ } void +edit_math_rep::make_overbrace (string brace) { + if (selection_active_small ()) + insert_tree (tree (OVERBRACE, selection_get_cut (), brace)); + else { + insert_tree (tree (OVERBRACE, "", brace), path (0, 0)); + set_message ("move to the right when finished", "overbrace"); + } +} + +void +edit_math_rep::make_underbrace (string brace) { + if (selection_active_small ()) + insert_tree (tree (UNDERBRACE, selection_get_cut (), brace)); + else { + insert_tree (tree (UNDERBRACE, "", brace), path (0, 0)); + set_message ("move to the right when finished", "underbrace"); + } +} + +void edit_math_rep::make_neg () { if (selection_active_small ()) insert_tree (tree (NEG, selection_get_cut ())); diff -r -u TeXmacs-1.0.1.13-src.orig/src/Edit/Modify/edit_math.hh TeXmacs-1.0.1.13-src/src/Edit/Modify/edit_math.hh --- TeXmacs-1.0.1.13-src.orig/src/Edit/Modify/edit_math.hh 2003-04-24 10:43:24.000000000 -0600 +++ TeXmacs-1.0.1.13-src/src/Edit/Modify/edit_math.hh 2003-05-07 14:01:52.000000000 -0600 @@ -30,6 +30,8 @@ void make_var_sqrt (); void make_wide (string wide); void make_wide_under (string wide); + void make_overbrace (string brace); + void make_underbrace (string brace); void make_neg (); void make_tree (); void back_prime (tree t, path p); diff -r -u TeXmacs-1.0.1.13-src.orig/src/Guile/Glue/build-glue-editor.scm TeXmacs-1.0.1.13-src/src/Guile/Glue/build-glue-editor.scm --- TeXmacs-1.0.1.13-src.orig/src/Guile/Glue/build-glue-editor.scm 2003-05-03 12:11:52.000000000 -0600 +++ TeXmacs-1.0.1.13-src/src/Guile/Glue/build-glue-editor.scm 2003-05-07 14:01:52.000000000 -0600 @@ -123,6 +123,8 @@ (make-script make_script (void bool bool)) (make-fraction make_fraction (void)) (make-sqrt make_sqrt (void)) + (make-overbrace make_overbrace (void string)) + (make-underbrace make_underbrace (void string)) (make-wide make_wide (void string)) (make-wide-under make_wide_under (void string)) (make-var-sqrt make_var_sqrt (void)) diff -r -u TeXmacs-1.0.1.13-src.orig/src/Guile/Glue/glue_editor.cc TeXmacs-1.0.1.13-src/src/Guile/Glue/glue_editor.cc --- TeXmacs-1.0.1.13-src.orig/src/Guile/Glue/glue_editor.cc 2003-05-03 12:12:10.000000000 -0600 +++ TeXmacs-1.0.1.13-src/src/Guile/Glue/glue_editor.cc 2003-05-07 14:01:52.000000000 -0600 @@ -1154,6 +1154,32 @@ } SCM +tmg_make_overbrace (SCM arg1) { + SCM_ASSERT_STRING (arg1, SCM_ARG1, "make-overbrace"); + + string in1= scm_to_string (arg1); + + // SCM_DEFER_INTS; + get_server()->get_editor()->make_overbrace (in1); + // SCM_ALLOW_INTS; + + return SCM_UNSPECIFIED; +} + +SCM +tmg_make_underbrace (SCM arg1) { + SCM_ASSERT_STRING (arg1, SCM_ARG1, "make-underbrace"); + + string in1= scm_to_string (arg1); + + // SCM_DEFER_INTS; + get_server()->get_editor()->make_underbrace (in1); + // SCM_ALLOW_INTS; + + return SCM_UNSPECIFIED; +} + +SCM tmg_make_wide (SCM arg1) { SCM_ASSERT_STRING (arg1, SCM_ARG1, "make-wide"); @@ -2888,6 +2914,8 @@ gh_new_procedure ("make-script", (FN) tmg_make_script, 2, 0, 0); gh_new_procedure ("make-fraction", (FN) tmg_make_fraction, 0, 0, 0); gh_new_procedure ("make-sqrt", (FN) tmg_make_sqrt, 0, 0, 0); + gh_new_procedure ("make-overbrace", (FN) tmg_make_overbrace, 1, 0, 0); + gh_new_procedure ("make-underbrace", (FN) tmg_make_underbrace, 1, 0, 0); gh_new_procedure ("make-wide", (FN) tmg_make_wide, 1, 0, 0); gh_new_procedure ("make-wide-under", (FN) tmg_make_wide_under, 1, 0, 0); gh_new_procedure ("make-var-sqrt", (FN) tmg_make_var_sqrt, 0, 0, 0); diff -r -u TeXmacs-1.0.1.13-src.orig/src/System/tm_configure.hh TeXmacs-1.0.1.13-src/src/System/tm_configure.hh --- TeXmacs-1.0.1.13-src.orig/src/System/tm_configure.hh 2003-05-07 04:19:56.000000000 -0600 +++ TeXmacs-1.0.1.13-src/src/System/tm_configure.hh 2003-05-07 14:05:17.000000000 -0600 @@ -15,13 +15,13 @@ #define DYNAMIC_LINKING 1 #define USE_GET_TIME_OF_DAY 1 -#define DOTS_OK 1 -#define guile_str_size_t int + +#define guile_str_size_t size_t #define STD_SETENV #define OS_GNU_LINUX -#define GUILE_A +#define GUILE_B #define WORD_LENGTH 4 #define WORD_LENGTH_INC 3 #define WORD_MASK 0xfffffffc diff -r -u TeXmacs-1.0.1.13-src.orig/src/Typeset/Boxes/Basic/rubber_boxes.cc TeXmacs-1.0.1.13-src/src/Typeset/Boxes/Basic/rubber_boxes.cc --- TeXmacs-1.0.1.13-src.orig/src/Typeset/Boxes/Basic/rubber_boxes.cc 2003-01-26 05:28:54.000000000 -0700 +++ TeXmacs-1.0.1.13-src/src/Typeset/Boxes/Basic/rubber_boxes.cc 2003-05-07 18:25:13.000000000 -0600 @@ -179,6 +179,72 @@ } /*****************************************************************************/ +// Horizontal Brackets (underbrace/overbrace) +/*****************************************************************************/ + +struct hbrace_box_rep: public box_rep { + bool bUp; + color col; + SI penw; + + hbrace_box_rep (path ip, bool bu, SI penw, color c, SI x1b, SI x2b); + operator tree () { return "hbrace"; } + void display (ps_device dev); +}; + +SI +hbrace_height (SI width, SI penw) { + SI ref_size = penw/2; + double factor= sqrt (((double) width) / ((double) ref_size)); + if (factor<2) factor=2; + factor=factor*1.412; + return (2*penw) + ((SI) (((double) width)/factor)); +} + +hbrace_box_rep::hbrace_box_rep (path ip, bool bu, SI penw2, color c, + SI x1b, SI x2b): box_rep (ip) { + bUp= bu; + penw = penw2; + col = c; + y1 = y3 = 0; + y2 = y4 = hbrace_height (x2b- x1b, penw); + x1 = x3 = x1b; + x2 = x4 = x2b; +} + +void +draw_hbrace (ps_device dev, bool bUp, SI x, SI y, SI w, SI h, SI lw) { +// x+=lw; w-=2*lw; +// y+=lw; h-=2*lw; + SI d = h>>1; + SI ox= x+ (w>>1); + SI oy= y+ (h>>1); + SI xx= x+ w; + // SI yy= y+ h; + dev->line (x+d-PIXEL, oy, ox-d, oy); + dev->line (ox+d-PIXEL, oy, xx-d, oy); + if (bUp) { + dev->arc (ox, oy-h, ox+h, oy, 90<<6, 90<<6); + dev->arc (xx-h, oy, xx, oy+h, 270<<6, 90<<6); + dev->arc (ox-h, oy-h, ox, oy, 0, 90<<6); + dev->arc (x, oy, x+h, oy+h, 180<<6, 90<<6); + } + else { + dev->arc (xx-h, oy-h, xx, oy, 0, 90<<6); + dev->arc (ox, oy, ox+h, oy+h, 180<<6, 90<<6); + dev->arc (x, oy-h, x+h, oy, 90<<6, 90<<6); + dev->arc (ox-h, oy, ox, oy+h, 270<<6, 90<<6); + } +} + +void +hbrace_box_rep::display (ps_device dev) { + dev->set_line_style (penw); + dev->set_color (col); + draw_hbrace (dev, bUp, 0, y1, x2, y2-y1, penw); +} + +/*****************************************************************************/ // box construction routines /*****************************************************************************/ @@ -192,3 +258,7 @@ return new bracket_box_rep (ip, br_type, penw, col, y1, y2); } +box +hbrace_box (path ip, bool bUp, SI penw, color col, SI x1, SI x2) { + return new hbrace_box_rep (ip, bUp, penw, col, x1, x2); +} diff -r -u TeXmacs-1.0.1.13-src.orig/src/Typeset/Boxes/Basic/stretch_boxes.cc TeXmacs-1.0.1.13-src/src/Typeset/Boxes/Basic/stretch_boxes.cc --- TeXmacs-1.0.1.13-src.orig/src/Typeset/Boxes/Basic/stretch_boxes.cc 2003-01-26 05:28:54.000000000 -0700 +++ TeXmacs-1.0.1.13-src/src/Typeset/Boxes/Basic/stretch_boxes.cc 2003-05-07 18:18:04.000000000 -0600 @@ -17,6 +17,7 @@ #include "Boxes/construct.hh" #include +#include static void get_wide_parameters (SI x1, SI x2, SI penw, SI& width, SI& height) { @@ -103,4 +104,3 @@ get_wide_parameters (x1, x2, penw, width, height); return arc_box (ip, 0, 0, width, 2*height, 180<<6, 360<<6, penw, col); } - diff -r -u TeXmacs-1.0.1.13-src.orig/src/Typeset/Boxes/construct.hh TeXmacs-1.0.1.13-src/src/Typeset/Boxes/construct.hh --- TeXmacs-1.0.1.13-src.orig/src/Typeset/Boxes/construct.hh 2003-05-04 04:23:35.000000000 -0600 +++ TeXmacs-1.0.1.13-src/src/Typeset/Boxes/construct.hh 2003-05-07 18:18:19.000000000 -0600 @@ -16,6 +16,7 @@ #include "array.hh" #include "font.hh" #include "command.hh" +#include "env.hh" /****************************************************************************** * Construction routines for boxes @@ -32,6 +33,7 @@ box delimiter_box (path ip, string s, font fn, color col, SI y1, SI y2); box big_operator_box (path ip, string s, font fn, color col, int n); box bracket_box (path ip, int br_type, SI penw, color col, SI y1, SI y2); +box hbrace_box (path ip, bool bUp, SI penw, color col, SI x1, SI x2); box wide_hat_box (path ip, SI x1, SI x2, SI penw, color col); box wide_tilda_box (path ip, SI x1, SI x2, SI penw, color col); box wide_bar_box (path ip, SI x1, SI x2, SI penw, color col); diff -r -u TeXmacs-1.0.1.13-src.orig/src/Typeset/Concat/concater.cc TeXmacs-1.0.1.13-src/src/Typeset/Concat/concater.cc --- TeXmacs-1.0.1.13-src.orig/src/Typeset/Concat/concater.cc 2003-04-29 10:26:29.000000000 -0600 +++ TeXmacs-1.0.1.13-src/src/Typeset/Concat/concater.cc 2003-05-07 16:00:04.000000000 -0600 @@ -283,9 +283,15 @@ case WIDE: typeset_wide (t, ip, true); break; + case OVERBRACE: + typeset_hbrace (t, ip, true); + break; case WIDE_UNDER: typeset_wide (t, ip, false); break; + case UNDERBRACE: + typeset_hbrace (t, ip, false); + break; case NEG: typeset_neg (t, ip); break; Only in TeXmacs-1.0.1.13-src/src/Typeset/Concat: concater.cc.orig diff -r -u TeXmacs-1.0.1.13-src.orig/src/Typeset/Concat/concater.hh TeXmacs-1.0.1.13-src/src/Typeset/Concat/concater.hh --- TeXmacs-1.0.1.13-src.orig/src/Typeset/Concat/concater.hh 2003-03-02 11:17:44.000000000 -0700 +++ TeXmacs-1.0.1.13-src/src/Typeset/Concat/concater.hh 2003-05-07 16:00:20.000000000 -0600 @@ -69,6 +69,7 @@ void typeset_frac (tree t, path ip); void typeset_sqrt (tree t, path ip); void typeset_wide (tree t, path ip, bool above); + void typeset_hbrace (tree t, path ip, bool above); void typeset_neg (tree t, path ip); void typeset_tree (tree t, path ip); void typeset_table (tree t, path ip); diff -r -u TeXmacs-1.0.1.13-src.orig/src/Typeset/Concat/concat_math.cc TeXmacs-1.0.1.13-src/src/Typeset/Concat/concat_math.cc --- TeXmacs-1.0.1.13-src.orig/src/Typeset/Concat/concat_math.cc 2003-01-26 05:28:54.000000000 -0700 +++ TeXmacs-1.0.1.13-src/src/Typeset/Concat/concat_math.cc 2003-05-07 18:23:39.000000000 -0600 @@ -210,6 +210,9 @@ bool wide; box b= typeset_as_concat (env, t[0], descend (ip, 0)); string s= as_string (t[1]); + + fprintf (stderr, "Entering typeset_wide...\n") ; + if (starts (s, "fn->wline* 3; + box wideb ; + + if (((s == "}") && above) || (s == "{" && !above)) + wideb= hbrace_box (decorate_middle (ip), true, w, env->col, b->x1, b->x2) ; + else if (((s == "{") && above) || (s == "}" && !above)) + wideb= hbrace_box (decorate_middle (ip), false, w, env->col, b->x1, b->x2) ; + if (!nil (wideb)) { + print (STD_ITEM, wide_box (ip, b, wideb, env->fn, env->fn->sep, above)); + return; + } +} + +void concater_rep::typeset_neg (tree t, path ip) { box b= typeset_as_concat (env, t[0], descend (ip, 0)); print (STD_ITEM, neg_box (ip, b, env->fn, env->col)); diff -r -u TeXmacs-1.0.1.13-src.orig/TeXmacs-1.0.1.13/fonts/enc/rubber-cmex.enc TeXmacs-1.0.1.13-src/TeXmacs-1.0.1.13/fonts/enc/rubber-cmex.enc --- TeXmacs-1.0.1.13-src.orig/TeXmacs-1.0.1.13/fonts/enc/rubber-cmex.enc 2003-01-26 05:28:58.000000000 -0700 +++ TeXmacs-1.0.1.13-src/TeXmacs-1.0.1.13/fonts/enc/rubber-cmex.enc 2003-05-07 14:02:24.000000000 -0600 @@ -16,3 +16,4 @@ 98 "wide-hat" 101 "wide-tilde" 112 "large-sqrt" +122 "braceld" "bracerd" "bracelu" "braceru" diff -r -u TeXmacs-1.0.1.13-src.orig/TeXmacs-1.0.1.13/progs/keyboard/kbd-latex.scm TeXmacs-1.0.1.13-src/TeXmacs-1.0.1.13/progs/keyboard/kbd-latex.scm --- TeXmacs-1.0.1.13-src.orig/TeXmacs-1.0.1.13/progs/keyboard/kbd-latex.scm 2003-04-24 10:07:56.000000000 -0600 +++ TeXmacs-1.0.1.13-src/TeXmacs-1.0.1.13/progs/keyboard/kbd-latex.scm 2003-05-07 14:02:41.000000000 -0600 @@ -142,6 +142,9 @@ ("bigotimes" "Insert big tensor product" (make-big-operator "otimes")) ("bigoplus" "Insert big direct sum" (make-big-operator "oplus")) ("biguplus" "Insert big union sum" (make-big-operator "uplus")) + + ("underbrace" "Insert underbrace" (make-underbrace "{")) + ("overbrace" "Insert overbrace" (make-overbrace "{")) ("left(" "Insert large (" (make-bracket-open "(" ")" #t)) ("left)" "Insert large left )" (make-bracket-open ")" "(" #t)) diff -r -u TeXmacs-1.0.1.13-src.orig/TeXmacs-1.0.1.13/progs/menus/menu-mathematics.scm TeXmacs-1.0.1.13-src/TeXmacs-1.0.1.13/progs/menus/menu-mathematics.scm --- TeXmacs-1.0.1.13-src.orig/TeXmacs-1.0.1.13/progs/menus/menu-mathematics.scm 2003-04-19 15:55:25.000000000 -0600 +++ TeXmacs-1.0.1.13-src/TeXmacs-1.0.1.13/progs/menus/menu-mathematics.scm 2003-05-07 14:03:00.000000000 -0600 @@ -60,6 +60,9 @@ ("Two dots" (make-wide-under "")) ("Circle" (make-wide-under "")) ("Wide bar" (make-wide-under ""))) + (-> "Brace" + ("Underbrace" (make-underbrace "}")) + ("Overbrace" (make-overbrace "{"))) (-> "Symbol" (link symbol-menu)) (if (or (table-inside? "eqnarray") (table-inside? "eqnarray*")) ---