X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2FPreamble.cpp;h=622c7df1435a61a5a6963ca5f6e7085173a2ee27;hb=02b2cd50ed925323ad0a1ae6905c424e36da6b6d;hp=d9c823f81dbc1e3153dbf4ed42cd9409270a20c3;hpb=98fc5e518f0c692a0e45f56e71448a459b6488f4;p=lyx.git diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index d9c823f81d..622c7df143 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -136,8 +136,8 @@ const char * const known_sans_fonts[] = { "avant", "berasans", "biolinum-type1", "kurierc", "kurierl", "kurierlc", "lmss", "tgadventor", "tgheros", 0}; const char * const known_typewriter_fonts[] = { "beramono", "cmtl", "cmtt", -"courier", "lmtt", "luximono", "fourier", "lmodern", "mathpazo", "mathptmx", -"newcent", "tgcursor", "txtt", 0}; +"courier", "lmtt", "luximono", "fourier", "libertineMono-type1", "lmodern", +"mathpazo", "mathptmx", "newcent", "tgcursor", "txtt", 0}; const char * const known_math_fonts[] = { "eulervm", "newtxmath", 0}; @@ -424,7 +424,8 @@ bool scale_as_percentage(string const & scale, string & percentage) if (pos != string::npos) { string value = scale.substr(pos + 1); if (isStrDbl(value)) { - percentage = convert(100 * convert(value)); + percentage = convert( + static_cast(100 * convert(value))); return true; } } @@ -726,14 +727,19 @@ void Preamble::handle_package(Parser &p, string const & name, // sansserif fonts if (is_known(name, known_sans_fonts)) { h_font_sans = name; - if (options.size() == 1) { + if (options.size() >= 1) { if (scale_as_percentage(opts, h_font_sf_scale)) options.clear(); } } - if (name == "biolinum-type1") + if (name == "biolinum-type1") { h_font_sans = "biolinum"; + // biolinum can have several options, e.g. [osf,scaled=0.97] + string::size_type pos = opts.find("osf"); + if (pos != string::npos) + h_font_osf = "true"; + } // typewriter fonts if (is_known(name, known_typewriter_fonts)) { @@ -741,13 +747,17 @@ void Preamble::handle_package(Parser &p, string const & name, // fourier as typewriter is handled in handling of \ttdefault if (name != "fourier") { h_font_typewriter = name; - if (options.size() == 1) { + if (options.size() >= 1) { if (scale_as_percentage(opts, h_font_tt_scale)) options.clear(); } } } + if (name == "libertineMono-type1") { + h_font_typewriter = "libertine-mono"; + } + // font uses old-style figure if (name == "eco") h_font_osf = "true"; @@ -767,6 +777,14 @@ void Preamble::handle_package(Parser &p, string const & name, h_font_math = "minion-ntxm"; } + if (name == "iwona") + if (opts == "math") + h_font_math = "iwona-math"; + + if (name == "kurier") + if (opts == "math") + h_font_math = "kurier-math"; + // after the detection and handling of special cases, we can remove the // fonts, otherwise they would appear in the preamble, see bug #7856 if (is_known(name, known_roman_fonts) || is_known(name, known_sans_fonts) @@ -957,6 +975,9 @@ void Preamble::handle_package(Parser &p, string const & name, h_cite_engine_type = "authoryear"; } + else if (name == "bibtopic") + h_use_bibtopic = "true"; + else if (name == "hyperref") handle_hyperref(options);