The attached patch is an updated version of Georg Baum's patch for #2340. It provides support for formal math script (LaTeX command \mathrsfs).

This would be a fileformat change.

The only missing thing is the file "rsfs10.ttf" to display the script within LyX on Windows. Can somebody do me the favor and convert the file
http://mirror.ctan.org/fonts/rsfs/rsfs10.mf
or
http://mirror.ctan.org/fonts/rsfs/type1/rsfs10.pfb
or
http://mirror.ctan.org/fonts/rsfs/type1/afm/rsfs10.afm
or
http://mirror.ctan.org/fonts/rsfs/type1/pfm/rsfs10.pfm
to TrueType?

thanks and regards
Uwe
Index: lib/chkconfig.ltx
===================================================================
--- lib/chkconfig.ltx	(revision 34932)
+++ lib/chkconfig.ltx	(working copy)
@@ -276,6 +276,7 @@
 \TestPackage[lithuanian.ldf]{lithuanian}
 \TestPackage{longtable}
 \TestPackage{mathdots}
+\TestPackage{mathrsfs}
 \TestPackage{mhchem}
 \TestPackage[mongolian.ldf]{mongolian}
 \TestPackage{natbib}
Index: lib/lyx2lyx/lyx_2_0.py
===================================================================
--- lib/lyx2lyx/lyx_2_0.py	(revision 34932)
+++ lib/lyx2lyx/lyx_2_0.py	(working copy)
@@ -2032,6 +2032,21 @@
     document.body[cmdloc] = "LatexCommand nameref"
 
 
+def revert_mathrsfs(document):
+    " Load mathrsfs if \mathrsfs us use in the document "
+    i = 0
+    end = len(document.body) - 1
+    while True:
+      j = document.body[i].find("\\mathscr{")
+      if j != -1:
+        add_to_preamble(document, ["% this command was inserted by lyx2lyx"])
+        add_to_preamble(document, ["\\usepackage{mathrsfs}"])
+        break
+      if i == end:
+        break
+      i += 1
+
+
 ##
 # Conversion hub
 #
@@ -2091,7 +2106,7 @@
            [397, [remove_Nameref]]
           ]
 
-revert =  [[396, []],
+revert =  [[396, [revert_mathrsfs]],
            [395, [revert_nameref]],
            [394, [revert_DIN_C_pagesizes]],
            [393, [revert_makebox]],
Index: lib/symbols
===================================================================
--- lib/symbols	(revision 34932)
+++ lib/symbols	(working copy)
@@ -89,6 +89,7 @@
 mathfrak          font        mathmode
 mathit            font        mathmode
 mathrm            font        mathmode
+mathscr           font        mathmode 
 mathsf            font        mathmode
 mathtt            font        mathmode
 textnormal        font        textmode  inherit  medium   up  math
Index: lib/ui/stdmenus.inc
===================================================================
--- lib/ui/stdmenus.inc	(revision 34932)
+++ lib/ui/stdmenus.inc	(working copy)
@@ -259,6 +259,7 @@
 		Item "Math Normal Font|N" "math-font-style mathnormal"
 		Separator
 		Item "Math Calligraphic Family|C" "math-font-style mathcal"
+		Item "Math Formal Script Family|o" "math-font-style mathscr"
 		Item "Math Fraktur Family|F" "math-font-style mathfrak"
 		Item "Math Roman Family|R" "math-font-style mathrm"
 		Item "Math Sans Serif Family|S" "math-font-style mathsf"
Index: lib/ui/stdtoolbars.inc
===================================================================
--- lib/ui/stdtoolbars.inc	(revision 34932)
+++ lib/ui/stdtoolbars.inc	(working copy)
@@ -375,6 +375,7 @@
 		Item "Blackboard	\\mathbb" "math-insert \mathbb"
 		Item "Fraktur	\\mathfrak" "math-insert \mathfrak"
 		Item "Calligraphic	\\mathcal" "math-insert \mathcal"
+		Item "Formal Script	\\mathscr" "math-insert \mathscr"
 		Item "Normal text mode	\\textrm" "math-insert \textrm"
 	End
 
Index: src/Font.cpp
===================================================================
--- src/Font.cpp	(revision 34932)
+++ src/Font.cpp	(working copy)
@@ -57,7 +57,7 @@
 
 char const * GUIFamilyNames[NUM_FAMILIES + 2 /* default & error */] =
 { N_("Roman"), N_("Sans Serif"), N_("Typewriter"), N_("Symbol"),
-  "cmr", "cmsy", "cmm", "cmex", "msa", "msb", "eufrak", "wasy", "esint",
+  "cmr", "cmsy", "cmm", "cmex", "msa", "msb", "eufrak", "rsfs", "wasy", "esint",
   N_("Inherit"), N_("Ignore") };
 
 char const * GUISeriesNames[4] =
Index: src/FontEnums.h
===================================================================
--- src/FontEnums.h	(revision 34932)
+++ src/FontEnums.h	(working copy)
@@ -47,6 +47,8 @@
 	///
 	EUFRAK_FAMILY,
 	///
+	RSFS_FAMILY,
+	///
 	WASY_FAMILY,
 	///
 	ESINT_FAMILY,
Index: src/FontInfo.cpp
===================================================================
--- src/FontInfo.cpp	(revision 34932)
+++ src/FontInfo.cpp	(working copy)
@@ -32,8 +32,8 @@
 //
 char const * LyXFamilyNames[NUM_FAMILIES + 2 /* default & error */] =
 { "roman", "sans", "typewriter", "symbol",
-  "cmr", "cmsy", "cmm", "cmex", "msa", "msb", "eufrak", "wasy", "esint",
-  "default", "error" };
+  "cmr", "cmsy", "cmm", "cmex", "msa", "msb", "eufrak", "rsfs", "wasy",
+  "esint", "default", "error" };
 
 char const * LyXSeriesNames[4] =
 { "medium", "bold", "default", "error" };
@@ -377,6 +377,7 @@
 		case MSA_FAMILY:
 		case MSB_FAMILY:
 		case EUFRAK_FAMILY:
+		case RSFS_FAMILY:
 		case WASY_FAMILY:
 		case ESINT_FAMILY:
 		case INHERIT_FAMILY:
Index: src/frontends/qt4/GuiFontLoader.cpp
===================================================================
--- src/frontends/qt4/GuiFontLoader.cpp	(revision 34932)
+++ src/frontends/qt4/GuiFontLoader.cpp	(working copy)
@@ -77,6 +77,7 @@
 	{ MSA_FAMILY,   "msam10", "-*-msam10-*-*-*-*-*-*-*-*-*-*-*-*" },
 	{ MSB_FAMILY,   "msbm10", "-*-msbm10-*-*-*-*-*-*-*-*-*-*-*-*" },
 	{ EUFRAK_FAMILY,"eufm10", "-*-eufm10-medium-*-*-*-*-*-*-*-*-*-*-*" },
+	{ RSFS_FAMILY,  "rsfs10", "-*-rsfs10-medium-*-*-*-*-*-*-*-*-*-*-*" },
 	{ WASY_FAMILY,  "wasy10", "-*-wasy10-medium-*-*-*-*-*-*-*-*-*-*-*" },
 	{ ESINT_FAMILY, "esint10","-*-esint10-medium-*-*-*-*-*-*-*-*-*-*-*" }
 };
Index: src/mathed/InsetMathFont.cpp
===================================================================
--- src/mathed/InsetMathFont.cpp	(revision 34932)
+++ src/mathed/InsetMathFont.cpp	(working copy)
@@ -100,6 +100,8 @@
 		if (key_->name == "text" || key_->name == "textnormal"
 				|| (key_->name.length() == 6 && key_->name.substr(0, 4) == "text"))
 			features.require("amstext");
+		else if (key_->name == "mathscr")
+			features.require("mathrsfs"); 
 		if (key_->name == "textipa")
 			features.require("tipa");
 		if (key_->name == "ce" || key_->name == "cf")
Index: src/mathed/MathFactory.cpp
===================================================================
--- src/mathed/MathFactory.cpp	(revision 34932)
+++ src/mathed/MathFactory.cpp	(working copy)
@@ -179,6 +179,8 @@
 					tmp.requires = from_ascii("amssymb");
 				else if (tmp.inset == "wasy")
 					tmp.requires = from_ascii("wasysym");
+				else if (tmp.inset == "mathscr")
+					tmp.requires = from_ascii("mathrsfs");
 			}
 
 			// symbol font is not available sometimes
Index: src/mathed/MathSupport.cpp
===================================================================
--- src/mathed/MathSupport.cpp	(revision 34932)
+++ src/mathed/MathSupport.cpp	(working copy)
@@ -546,6 +546,8 @@
 			  inh_shape, Color_math},
 	{"mathit",        inh_family, inh_series,
 			  ITALIC_SHAPE, Color_math},
+	{"mathscr",       RSFS_FAMILY, inh_series,
+	          inh_shape, Color_math}, 
 	{"cmex",          CMEX_FAMILY, inh_series,
 			  inh_shape, Color_math},
 	{"cmm",           CMM_FAMILY, inh_series,

Reply via email to