Hello,

in analogy to the character/text styles for normal text, I would like to shift math text styles to the "edit=>math" submenu.

In order to do so, LFUN_MATH_INSERT must be disabled in regular text mode (otherwise, the math submenu is shown all the time).

Could you please have a look at the patch below, and tell me whether this patch is OK? Unfortunately, I can no longer test 1.5.0svn because LyX stops right after the start.

Michael


Index: lib/ui/stdmenus.ui
===================================================================
--- lib/ui/stdmenus.ui    (revision 14990)
+++ lib/ui/stdmenus.ui    (working copy)
@@ -180,6 +180,8 @@
        Separator
        Submenu "Change Formula Type|F" "edit_math_mutate"
        Separator
+        Submenu "Text Style|T" "edit_math_textstyles"
+        Separator
        Submenu "Use Computer Algebra System|S" "edit_math_extern"
        Separator
        Item "Split Cell|C" "cell-split"
@@ -201,6 +203,31 @@
         Item "Inline|I"  "math-limits nolimits"
    End

+    Menu "edit_math_textstyles"
+        Item "Math Normal Font" "math-insert \mathnormal"
+        Separator
+        Item "Math Calligraphic Family" "math-insert \mathcal"
+        Item "Math Fraktur Family" "math-insert \mathfrak"
+        Item "Math Roman Family" "math-insert \mathrm"
+        Item "Math Sans Serif Family" "math-insert \mathsf"
+        Separator
+        Item "Math Bold Series" "math-insert \mathbf"
+        Separator
+        Item "Text Normal Font" "math-insert \textnormal"
+        Separator
+        Item "Text Roman Family" "math-insert \textrm"
+        Item "Text Sans Serif Family" "math-insert \textsf"
+        Item "Text Typewriter Family" "math-insert \texttt"
+        Separator
+        Item "Text Bold Series" "math-insert \textbf"
+        Item "Text Medium Series" "math-insert \textmd"
+        Separator
+        Item "Text Italic Shape" "math-insert \textit"
+        Item "Text Small Caps Shape" "math-insert \textsc"
+        Item "Text Slanted Shape" "math-insert \textsl"
+        Item "Text Upright Shape" "math-insert \textup"
+    End
+
    Menu "edit_math_extern"
        Item "Octave" "math-extern octave"
        Item "Maxima" "math-extern maxima"
@@ -315,41 +342,15 @@
Item "AMS multline Environment|m" "command-sequence math-mode on; math-mutate multline;"
        Separator
        Item "Array Environment|y" "math-matrix 2 2"
-        Item "Cases Environment|C" "math-insert \cases"
- Item "Aligned Environment" "command-sequence math-insert \aligned; tabular-feature append-column" - Item "AlignedAt Environment" "command-sequence math-insert \alignedat; tabular-feature append-column"
-        Item "Gathered Environment" "math-insert \gathered"
- Item "Split Environment|S" "command-sequence math-insert \split; tabular-feature append-column" + Item "Cases Environment|C" "command-sequence math-mode on; math-insert \cases" + Item "Aligned Environment" "command-sequence math-mode on; math-insert \aligned; tabular-feature append-column" + Item "AlignedAt Environment" "command-sequence math-mode on; math-insert \alignedat; tabular-feature append-column" + Item "Gathered Environment" "command-sequence math-mode on; math-insert \gathered" + Item "Split Environment|S" "command-sequence math-mode on; math-insert \split; tabular-feature append-column"
        Separator
-        Submenu "Font Change|o" "insert_math_font"
        Item "Math Panel|P" "dialog-show mathpanel"
    End

-    Menu "insert_math_font"
-        Item "Math Normal Font" "math-insert \mathnormal"
-        Separator
-        Item "Math Calligraphic Family" "math-insert \mathcal"
-        Item "Math Fraktur Family" "math-insert \mathfrak"
-        Item "Math Roman Family" "math-insert \mathrm"
-        Item "Math Sans Serif Family" "math-insert \mathsf"
-        Separator
-        Item "Math Bold Series" "math-insert \mathbf"
-        Separator
-        Item "Text Normal Font" "math-insert \textnormal"
-        Separator
-        Item "Text Roman Family" "math-insert \textrm"
-        Item "Text Sans Serif Family" "math-insert \textsf"
-        Item "Text Typewriter Family" "math-insert \texttt"
-        Separator
-        Item "Text Bold Series" "math-insert \textbf"
-        Item "Text Medium Series" "math-insert \textmd"
-        Separator
-        Item "Text Italic Shape" "math-insert \textit"
-        Item "Text Small Caps Shape" "math-insert \textsc"
-        Item "Text Slanted Shape" "math-insert \textsl"
-        Item "Text Upright Shape" "math-insert \textup"
-            End
-
    Menu "insert_float"
        FloatInsert
# This has got to be better than "Wrap", anyway
Index: src/text3.C
===================================================================
--- src/text3.C    (revision 14990)
+++ src/text3.C    (working copy)
@@ -1761,7 +1761,6 @@
    case LFUN_MATH_IMPORT_SELECTION:
    case LFUN_MATH_MODE:
    case LFUN_MATH_MACRO:
-    case LFUN_MATH_INSERT:
    case LFUN_MATH_MATRIX:
    case LFUN_MATH_DELIM:
    case LFUN_MATH_BIGDELIM:
@@ -1804,6 +1803,9 @@
        // these are handled in our dispatch()
        enable = true;
        break;
+    case LFUN_MATH_INSERT:
+        enable = false;
+        break;

    default:
        return false;

Reply via email to