mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Add support for the doublestroke package
This commit adds the mathed command \mathds that selects a font more appropriate than \mathbb for typesetting the mathematical symbols for the natural (N), whole numbers (Z), rational numbers (Q), real numbers (R), complex numbers (C), and some others. As in the \mathbb case, only capital letters are supported, but in addition one can also typeset a symbol often used for representing the indicator function (\mathds{1}) and the letters a, h, k. Fixes bug #11887.
This commit is contained in:
parent
3af543455b
commit
5a80f7bb6a
2355
lib/fonts/dsrom10.sfd
Normal file
2355
lib/fonts/dsrom10.sfd
Normal file
File diff suppressed because it is too large
Load Diff
BIN
lib/fonts/dsrom10.ttf
Executable file
BIN
lib/fonts/dsrom10.ttf
Executable file
Binary file not shown.
BIN
lib/images/math/mathds.svgz
Normal file
BIN
lib/images/math/mathds.svgz
Normal file
Binary file not shown.
@ -118,6 +118,7 @@ Bigggr big none hiddensymbol
|
|||||||
mathnormal font mathmode inherit medium up math
|
mathnormal font mathmode inherit medium up math
|
||||||
frak font mathmode
|
frak font mathmode
|
||||||
mathbb font mathmode
|
mathbb font mathmode
|
||||||
|
mathds font mathmode
|
||||||
mathbf font mathmode
|
mathbf font mathmode
|
||||||
mathcal font mathmode
|
mathcal font mathmode
|
||||||
mathfrak font mathmode
|
mathfrak font mathmode
|
||||||
|
@ -423,6 +423,7 @@ ToolbarSet
|
|||||||
Item "Italic \\mathit" "math-insert \mathit"
|
Item "Italic \\mathit" "math-insert \mathit"
|
||||||
Item "Typewriter \\mathtt" "math-insert \mathtt"
|
Item "Typewriter \\mathtt" "math-insert \mathtt"
|
||||||
Item "Blackboard \\mathbb" "math-insert \mathbb"
|
Item "Blackboard \\mathbb" "math-insert \mathbb"
|
||||||
|
Item "Double stroke \\mathds" "math-insert \mathds"
|
||||||
Item "Fraktur \\mathfrak" "math-insert \mathfrak"
|
Item "Fraktur \\mathfrak" "math-insert \mathfrak"
|
||||||
Item "Calligraphic \\mathcal" "math-insert \mathcal"
|
Item "Calligraphic \\mathcal" "math-insert \mathcal"
|
||||||
Item "Formal Script \\mathscr" "math-insert \mathscr"
|
Item "Formal Script \\mathscr" "math-insert \mathscr"
|
||||||
|
@ -45,6 +45,8 @@ enum FontFamily {
|
|||||||
///
|
///
|
||||||
MSB_FAMILY,
|
MSB_FAMILY,
|
||||||
///
|
///
|
||||||
|
DS_FAMILY,
|
||||||
|
///
|
||||||
EUFRAK_FAMILY,
|
EUFRAK_FAMILY,
|
||||||
///
|
///
|
||||||
RSFS_FAMILY,
|
RSFS_FAMILY,
|
||||||
|
@ -493,6 +493,7 @@ string getFamilyCSS(FontFamily const & f)
|
|||||||
case CMEX_FAMILY:
|
case CMEX_FAMILY:
|
||||||
case MSA_FAMILY:
|
case MSA_FAMILY:
|
||||||
case MSB_FAMILY:
|
case MSB_FAMILY:
|
||||||
|
case DS_FAMILY:
|
||||||
case EUFRAK_FAMILY:
|
case EUFRAK_FAMILY:
|
||||||
case RSFS_FAMILY:
|
case RSFS_FAMILY:
|
||||||
case STMARY_FAMILY:
|
case STMARY_FAMILY:
|
||||||
|
@ -1158,7 +1158,8 @@ char const * simplefeatures[] = {
|
|||||||
"xskak",
|
"xskak",
|
||||||
"pict2e",
|
"pict2e",
|
||||||
"drs",
|
"drs",
|
||||||
"environ"
|
"environ",
|
||||||
|
"dsfont"
|
||||||
};
|
};
|
||||||
|
|
||||||
char const * bibliofeatures[] = {
|
char const * bibliofeatures[] = {
|
||||||
|
@ -36,8 +36,8 @@ using namespace std;
|
|||||||
using namespace lyx::support;
|
using namespace lyx::support;
|
||||||
|
|
||||||
QString const math_fonts[] = {"cmex10", "cmmi10", "cmr10", "cmsy10",
|
QString const math_fonts[] = {"cmex10", "cmmi10", "cmr10", "cmsy10",
|
||||||
"esint10", "eufm10", "msam10", "msbm10", "rsfs10", "stmary10",
|
"dsrom10", "esint10", "eufm10", "msam10", "msbm10", "rsfs10",
|
||||||
"wasy10"};
|
"stmary10", "wasy10"};
|
||||||
int const num_math_fonts = sizeof(math_fonts) / sizeof(*math_fonts);
|
int const num_math_fonts = sizeof(math_fonts) / sizeof(*math_fonts);
|
||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
@ -78,6 +78,7 @@ SymbolFont symbol_fonts[] = {
|
|||||||
{ CMEX_FAMILY, "cmex10", "-*-cmex10-*-*-*-*-*-*-*-*-*-*-*-*" },
|
{ CMEX_FAMILY, "cmex10", "-*-cmex10-*-*-*-*-*-*-*-*-*-*-*-*" },
|
||||||
{ MSA_FAMILY, "msam10", "-*-msam10-*-*-*-*-*-*-*-*-*-*-*-*" },
|
{ MSA_FAMILY, "msam10", "-*-msam10-*-*-*-*-*-*-*-*-*-*-*-*" },
|
||||||
{ MSB_FAMILY, "msbm10", "-*-msbm10-*-*-*-*-*-*-*-*-*-*-*-*" },
|
{ MSB_FAMILY, "msbm10", "-*-msbm10-*-*-*-*-*-*-*-*-*-*-*-*" },
|
||||||
|
{ DS_FAMILY, "dsrom10", "-*-dsrom10-*-*-*-*-*-*-*-*-*-*-*-*" },
|
||||||
{ EUFRAK_FAMILY,"eufm10", "-*-eufm10-medium-*-*-*-*-*-*-*-*-*-*-*" },
|
{ EUFRAK_FAMILY,"eufm10", "-*-eufm10-medium-*-*-*-*-*-*-*-*-*-*-*" },
|
||||||
{ RSFS_FAMILY, "rsfs10", "-*-rsfs10-medium-*-*-*-*-*-*-*-*-*-*-*" },
|
{ RSFS_FAMILY, "rsfs10", "-*-rsfs10-medium-*-*-*-*-*-*-*-*-*-*-*" },
|
||||||
{ STMARY_FAMILY,"stmary10","-*-stmary10-medium-*-*-*-*-*-*-*-*-*-*-*" },
|
{ STMARY_FAMILY,"stmary10","-*-stmary10-medium-*-*-*-*-*-*-*-*-*-*-*" },
|
||||||
@ -91,6 +92,7 @@ SymbolFont symbol_fonts[] = {
|
|||||||
{ CMEX_FAMILY, "cmex10"},
|
{ CMEX_FAMILY, "cmex10"},
|
||||||
{ MSA_FAMILY, "msam10"},
|
{ MSA_FAMILY, "msam10"},
|
||||||
{ MSB_FAMILY, "msbm10"},
|
{ MSB_FAMILY, "msbm10"},
|
||||||
|
{ DS_FAMILY, "dsrom10"},
|
||||||
{ EUFRAK_FAMILY,"eufm10"},
|
{ EUFRAK_FAMILY,"eufm10"},
|
||||||
{ RSFS_FAMILY, "rsfs10"},
|
{ RSFS_FAMILY, "rsfs10"},
|
||||||
{ STMARY_FAMILY,"stmary10"},
|
{ STMARY_FAMILY,"stmary10"},
|
||||||
|
@ -134,6 +134,8 @@ void InsetMathFont::validate(LaTeXFeatures & features) const
|
|||||||
features.require("tipa");
|
features.require("tipa");
|
||||||
if (fontname == "ce" || fontname == "cf")
|
if (fontname == "ce" || fontname == "cf")
|
||||||
features.require("mhchem");
|
features.require("mhchem");
|
||||||
|
if (fontname == "mathds")
|
||||||
|
features.require("dsfont");
|
||||||
} else if (features.runparams().math_flavor == OutputParams::MathAsHTML) {
|
} else if (features.runparams().math_flavor == OutputParams::MathAsHTML) {
|
||||||
features.addCSSSnippet(
|
features.addCSSSnippet(
|
||||||
"span.normal{font: normal normal normal inherit serif;}\n"
|
"span.normal{font: normal normal normal inherit serif;}\n"
|
||||||
@ -163,9 +165,11 @@ void InsetMathFont::htmlize(HtmlStream & os) const
|
|||||||
variant = "normal";
|
variant = "normal";
|
||||||
else if (tag == "frak" || tag == "mathfrak")
|
else if (tag == "frak" || tag == "mathfrak")
|
||||||
variant = "fraktur";
|
variant = "fraktur";
|
||||||
else if (tag == "mathbb" || tag == "mathbf"
|
else if (tag == "mathbf" || tag == "textbf")
|
||||||
|| tag == "textbf")
|
|
||||||
variant = "bold";
|
variant = "bold";
|
||||||
|
else if (tag == "mathbb" || tag == "mathbbm"
|
||||||
|
|| tag == "mathds")
|
||||||
|
variant = "double-struck";
|
||||||
else if (tag == "mathcal")
|
else if (tag == "mathcal")
|
||||||
variant = "script";
|
variant = "script";
|
||||||
else if (tag == "mathit" || tag == "textsl"
|
else if (tag == "mathit" || tag == "textsl"
|
||||||
@ -220,7 +224,7 @@ void InsetMathFont::mathmlize(MathStream & os) const
|
|||||||
// no support at present for textipa, textsc, noun
|
// no support at present for textipa, textsc, noun
|
||||||
|
|
||||||
if (!variant.empty()) {
|
if (!variant.empty()) {
|
||||||
if (tag == "mathbb") {
|
if (tag == "mathbb" || tag == "mathds") {
|
||||||
os << MTag("mstyle", "class='mathbb' mathvariant='" + variant + "'")
|
os << MTag("mstyle", "class='mathbb' mathvariant='" + variant + "'")
|
||||||
<< cell(0)
|
<< cell(0)
|
||||||
<< ETag("mstyle");
|
<< ETag("mstyle");
|
||||||
|
@ -272,6 +272,8 @@ void initSymbols()
|
|||||||
tmp.required = "wasysym";
|
tmp.required = "wasysym";
|
||||||
else if (tmp.inset == "mathscr")
|
else if (tmp.inset == "mathscr")
|
||||||
tmp.required = "mathrsfs";
|
tmp.required = "mathrsfs";
|
||||||
|
else if (tmp.inset == "mathds")
|
||||||
|
tmp.required = "dsfont";
|
||||||
}
|
}
|
||||||
|
|
||||||
// symbol font is not available sometimes
|
// symbol font is not available sometimes
|
||||||
|
@ -775,6 +775,8 @@ fontinfo fontinfos[] = {
|
|||||||
inh_shape, Color_math},
|
inh_shape, Color_math},
|
||||||
{"mathbb", MSB_FAMILY, inh_series,
|
{"mathbb", MSB_FAMILY, inh_series,
|
||||||
inh_shape, Color_math},
|
inh_shape, Color_math},
|
||||||
|
{"mathds", DS_FAMILY, inh_series,
|
||||||
|
inh_shape, Color_math},
|
||||||
{"mathtt", TYPEWRITER_FAMILY, inh_series,
|
{"mathtt", TYPEWRITER_FAMILY, inh_series,
|
||||||
inh_shape, Color_math},
|
inh_shape, Color_math},
|
||||||
{"mathit", inh_family, inh_series,
|
{"mathit", inh_family, inh_series,
|
||||||
|
Loading…
Reference in New Issue
Block a user