]> git.lyx.org Git - features.git/commitdiff
Re-fix #2005
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 14 Aug 2019 12:49:38 +0000 (14:49 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:43 +0000 (15:48 +0200)
Loading keyval does not work any longer. Fix it properly by de-activating
the equal character locally if graphics options use it.

lib/languages
src/insets/InsetGraphics.cpp

index 9cadbe7b45f5ffe0c3317c3a17107788525d474c..ca08344f80d5635fddac19321b56aa30f4c8c628 100644 (file)
@@ -1007,6 +1007,7 @@ Language latin
        GuiName          "Latin"
        BabelName        latin
        PolyglossiaName  latin
+       ActiveChars      ^=
        Encoding         iso8859-15
        FontEncoding     T1|OT1
        LangCode         la_LA
@@ -1471,13 +1472,11 @@ Language turkish
        BabelName        turkish
        PolyglossiaName  turkish
        QuoteStyle       english
+       ActiveChars      =
        Encoding         iso8859-9
        FontEncoding     T1|OT1
        LangCode         tr_TR
        DateFormats      "d MMMM yyyy|dd.MMM.yyyy|dd.MM.yyyy"
-       PostBabelPreamble
-       \usepackage{xkeyval}
-       EndPostBabelPreamble
 End
 
 # turkmen must be loaded locally with babel options,
index c05075583b01416edd530ee3541140a1d522ea39..04edf265a87ecf7e8bef12754baf30becde15a1f 100644 (file)
@@ -841,18 +841,25 @@ void InsetGraphics::latex(otexstream & os,
        string before;
        string after;
 
-       if (runparams.moving_arg)
-               before += "\\protect";
-
-       // We never use the starred form, we use the "clip" option instead.
-       before += "\\includegraphics";
-
        // Write the options if there are any.
        bool const ps = runparams.flavor == OutputParams::LATEX
                || runparams.flavor == OutputParams::DVILUATEX;
        string const opts = createLatexOptions(ps);
        LYXERR(Debug::GRAPHICS, "\tOpts = " << opts);
 
+       if (contains(opts, '=') && contains(runparams.active_chars, '=')) {
+               // We have a language that makes = active. Deactivate locally
+               // for keyval option parsing (#2005).
+               before = "\\begingroup\\catcode`\\=12";
+               after = "\\endgroup";
+       }
+
+       if (runparams.moving_arg)
+               before += "\\protect";
+
+       // We never use the starred form, we use the "clip" option instead.
+       before += "\\includegraphics";
+
        if (!opts.empty() && !message.empty())
                before += ('[' + opts + ',' + message + ']');
        else if (!opts.empty() || !message.empty())