]> git.lyx.org Git - features.git/commitdiff
support for formal math script
authorUwe Stöhr <uwestoehr@web.de>
Sat, 17 Jul 2010 15:51:11 +0000 (15:51 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Sat, 17 Jul 2010 15:51:11 +0000 (15:51 +0000)
- fileformat change
- fixes #2340

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34941 a592a061-630c-0410-9148-cb99ea01b6c8

15 files changed:
development/FORMAT
lib/chkconfig.ltx
lib/doc/LaTeXConfig.lyx
lib/lyx2lyx/lyx_2_0.py
lib/symbols
lib/ui/stdmenus.inc
lib/ui/stdtoolbars.inc
src/Buffer.cpp
src/Font.cpp
src/FontEnums.h
src/FontInfo.cpp
src/frontends/qt4/GuiFontLoader.cpp
src/mathed/InsetMathFont.cpp
src/mathed/MathFactory.cpp
src/mathed/MathSupport.cpp

index 0b0f3e1c88808f3cdcf7c22f9db98653ed1c8ed7..2843ddf61be324d53de4f2df5292d6ad07723e89 100644 (file)
@@ -7,6 +7,10 @@ The good example would be 2010-01-10 entry.
 
 -----------------------
 
+2010-07-17 Uwe Stöhr <uwestoehr@web.de>
+       * Format incremented to 398: support \mathscr;
+         no new parameter but the mathrsfs package will be loaded
+
 2010-07-16 Richard Heck <rgheck@comcast.net>
        * Format incremented to 397 (r34920)
          Remove Nameref support
index 0a3852c6245b5f713713d4214316ddd41d16d819..df5122947dd54e982f12fac4ec8fc3ee8d3ba061 100644 (file)
 \TestPackage[lithuanian.ldf]{lithuanian}
 \TestPackage{longtable}
 \TestPackage{mathdots}
+\TestPackage{mathrsfs}
 \TestPackage{mhchem}
 \TestPackage[mongolian.ldf]{mongolian}
 \TestPackage{natbib}
index b49e0545777e37e63866edb25b6446471c208f6a..68831c696f657720bdce799eeb80de4071dea1d0 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
-\lyxformat 397
+\lyxformat 398
 \begin_document
 \begin_header
 \textclass article
@@ -4672,6 +4672,42 @@ listings
  etc.
 \end_layout
 
+\begin_layout Subsection
+mathrsfs
+\end_layout
+
+\begin_layout Description
+Found: 
+\begin_inset Info
+type  "package"
+arg   "mathrsfs"
+\end_inset
+
+
+\end_layout
+
+\begin_layout Description
+CTAN: 
+\family typewriter
+macros/latex/contrib/jknappen/
+\end_layout
+
+\begin_layout Description
+Notes: The package 
+\family sans
+mathrsfs
+\family default
+ is used by LyX to output the math font style 
+\begin_inset Quotes eld
+\end_inset
+
+formal script
+\begin_inset Quotes erd
+\end_inset
+
+.
+\end_layout
+
 \begin_layout Subsection
 mhchem
 \end_layout
index 6dc3058427301a0bfcb5f55762de08a672c0c819..f9d634444914882dc6e2b0e2e281dc729c5d53a6 100644 (file)
@@ -2026,6 +2026,21 @@ def remove_Nameref(document):
     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
 #
@@ -2082,10 +2097,12 @@ convert = [[346, []],
            [394, []],
            [395, []],
            [396, []],
-           [397, [remove_Nameref]]
+           [397, [remove_Nameref]],
+           [398, []]
           ]
 
-revert =  [[396, []],
+revert =  [[397, [revert_mathrsfs]],
+           [396, []],
            [395, [revert_nameref]],
            [394, [revert_DIN_C_pagesizes]],
            [393, [revert_makebox]],
index f8ca3c570105f106ee2e5cee58f3b7a2815433fb..cee45b93144a3c17fb7d9ed34a672982ade200e0 100644 (file)
@@ -89,6 +89,7 @@ mathcal           font        mathmode
 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 3edb98bd38e013fee54a871e2c7d3ee3297e6daf..b448745cf88549bc8597d5f1c778064dc4149c13 100644 (file)
@@ -259,6 +259,7 @@ Menuset
                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 b3f0bf14635c0bd28201144f5dcf1d5d008404df..2bb064867e28383945f2e935943f7e0288b6129f 100644 (file)
@@ -375,6 +375,7 @@ ToolbarSet
                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 b399f6483117539f03861d0271d942d4d2425324..78ca6dd038f19756dcd71727657517eb5bcf7d10 100644 (file)
@@ -126,7 +126,7 @@ namespace {
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-int const LYX_FORMAT = 397; // rgh: remove Nameref support
+int const LYX_FORMAT = 398; // uwestoehr: support for \mathscr
 
 typedef map<string, bool> DepClean;
 typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
index e84b66b0c89b41fdfe5fb445151a47d090378d1e..bd9541f0d1f874c055e406a924530ac7220c2d07 100644 (file)
@@ -57,7 +57,7 @@ namespace {
 
 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 717cc399d5feff2752aa72564bd48d3dded56b82..5b98604c9dd0b1a37210ef424f8282437da2dad9 100644 (file)
@@ -47,6 +47,8 @@ enum FontFamily {
        ///
        EUFRAK_FAMILY,
        ///
+       RSFS_FAMILY,
+       ///
        WASY_FAMILY,
        ///
        ESINT_FAMILY,
index 7efe2c76112d1c76d04df8444a8157950b58d7e6..27b6a51ba37a03c28c3fc375d22125a0fe06acdc 100644 (file)
@@ -32,8 +32,8 @@ namespace lyx {
 //
 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 @@ namespace {
                case MSA_FAMILY:
                case MSB_FAMILY:
                case EUFRAK_FAMILY:
+               case RSFS_FAMILY:
                case WASY_FAMILY:
                case ESINT_FAMILY:
                case INHERIT_FAMILY:
index 046f7df7d122686ae835b78d83ac0c0fcbda0aab..9cd51c25f78e8d026a27a0cb7a2923c3fdec1208 100644 (file)
@@ -77,6 +77,7 @@ SymbolFont symbol_fonts[] = {
        { 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 93a266553759d0b4530d893993e7028dacf761d0..6b3f2e0f2f51f0559e53fcd997a663d0a3ef04d5 100644 (file)
@@ -100,6 +100,8 @@ void InsetMathFont::validate(LaTeXFeatures & features) const
                if (key_->name == "text" || key_->name == "textnormal"
                                || (key_->name.length() == 6 && key_->name.substr(0, 4) == "text"))
                        features.require("amstext");
+               if (key_->name == "mathscr")
+                       features.require("mathrsfs"); 
                if (key_->name == "textipa")
                        features.require("tipa");
                if (key_->name == "ce" || key_->name == "cf")
index 6750fa414fe421424b6959e9bdbc2f40d756e280..6a5112925c690ed7938c67a281646dfa742ab2cc 100644 (file)
@@ -179,6 +179,8 @@ void initSymbols()
                                        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 6dde57a6c899e8e416fa190538ac6241dcbcfc7b..59b236333fd6be6fdc4a66d6fbfd944e0e6b44da 100644 (file)
@@ -546,6 +546,8 @@ fontinfo fontinfos[] = {
                          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,