From: Uwe Stöhr Date: Sat, 17 Jul 2010 15:51:11 +0000 (+0000) Subject: support for formal math script X-Git-Tag: 2.0.0~2957 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=72292b98a64c152c3b8862456c49067f74449cef;p=features.git support for formal math script - fileformat change - fixes #2340 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34941 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/development/FORMAT b/development/FORMAT index 0b0f3e1c88..2843ddf61b 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -7,6 +7,10 @@ The good example would be 2010-01-10 entry. ----------------------- +2010-07-17 Uwe Stöhr + * Format incremented to 398: support \mathscr; + no new parameter but the mathrsfs package will be loaded + 2010-07-16 Richard Heck * Format incremented to 397 (r34920) Remove Nameref support diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index 0a3852c624..df5122947d 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -276,6 +276,7 @@ \TestPackage[lithuanian.ldf]{lithuanian} \TestPackage{longtable} \TestPackage{mathdots} +\TestPackage{mathrsfs} \TestPackage{mhchem} \TestPackage[mongolian.ldf]{mongolian} \TestPackage{natbib} diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx index b49e054577..68831c696f 100644 --- a/lib/doc/LaTeXConfig.lyx +++ b/lib/doc/LaTeXConfig.lyx @@ -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 diff --git a/lib/lyx2lyx/lyx_2_0.py b/lib/lyx2lyx/lyx_2_0.py index 6dc3058427..f9d6344449 100644 --- a/lib/lyx2lyx/lyx_2_0.py +++ b/lib/lyx2lyx/lyx_2_0.py @@ -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]], diff --git a/lib/symbols b/lib/symbols index f8ca3c5701..cee45b9314 100644 --- a/lib/symbols +++ b/lib/symbols @@ -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 diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc index 3edb98bd38..b448745cf8 100644 --- a/lib/ui/stdmenus.inc +++ b/lib/ui/stdmenus.inc @@ -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" diff --git a/lib/ui/stdtoolbars.inc b/lib/ui/stdtoolbars.inc index b3f0bf1463..2bb064867e 100644 --- a/lib/ui/stdtoolbars.inc +++ b/lib/ui/stdtoolbars.inc @@ -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 diff --git a/src/Buffer.cpp b/src/Buffer.cpp index b399f64831..78ca6dd038 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -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 DepClean; typedef map > RefCache; diff --git a/src/Font.cpp b/src/Font.cpp index e84b66b0c8..bd9541f0d1 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -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] = diff --git a/src/FontEnums.h b/src/FontEnums.h index 717cc399d5..5b98604c9d 100644 --- a/src/FontEnums.h +++ b/src/FontEnums.h @@ -47,6 +47,8 @@ enum FontFamily { /// EUFRAK_FAMILY, /// + RSFS_FAMILY, + /// WASY_FAMILY, /// ESINT_FAMILY, diff --git a/src/FontInfo.cpp b/src/FontInfo.cpp index 7efe2c7611..27b6a51ba3 100644 --- a/src/FontInfo.cpp +++ b/src/FontInfo.cpp @@ -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: diff --git a/src/frontends/qt4/GuiFontLoader.cpp b/src/frontends/qt4/GuiFontLoader.cpp index 046f7df7d1..9cd51c25f7 100644 --- a/src/frontends/qt4/GuiFontLoader.cpp +++ b/src/frontends/qt4/GuiFontLoader.cpp @@ -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-*-*-*-*-*-*-*-*-*-*-*" } }; diff --git a/src/mathed/InsetMathFont.cpp b/src/mathed/InsetMathFont.cpp index 93a2665537..6b3f2e0f2f 100644 --- a/src/mathed/InsetMathFont.cpp +++ b/src/mathed/InsetMathFont.cpp @@ -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") diff --git a/src/mathed/MathFactory.cpp b/src/mathed/MathFactory.cpp index 6750fa414f..6a5112925c 100644 --- a/src/mathed/MathFactory.cpp +++ b/src/mathed/MathFactory.cpp @@ -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 diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp index 6dde57a6c8..59b236333f 100644 --- a/src/mathed/MathSupport.cpp +++ b/src/mathed/MathSupport.cpp @@ -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,