2016-03-09 19:55 GMT+01:00 Scott Kostyshak <skost...@lyx.org>:

> More out of curiosity than practical concern, are the following two
> statements correct?
>
> 1. This patch could cause some documents that compile on 2.1.x to not
> compile with 2.2.0, if they have a certain block of ERT or preamble
> code. I guess this is always true whenever we change any .tex code that
> LyX exports because there is probably some contrived way of conditioning
> on it. So the question is whether we think such ERT/preamble code is
> common?
>

It can happen in theory. But I don't think we can do anything about that.


>
> 2. Even if we wanted to complicate things, we could not address the
> above concern with lyx2lyx because it is possible that the user has a
> customized beamer.layout file in their user directory, so we cannot even
> assume that they're using the one we ship?
>

Yes.


>
> The more practical question is:
> Do you recommend the attached patch for 2.2.0?
>

Yes, and branch, for that matter.


>
> We do not also want to inherit color from beamer.layout?
>

Probably. Beamer-article does not load color (as opposed to xcolor), but we
do not want to load color if we load xcolor. I think LaTeXFeatures should
care about that, but I think the logic is flawed.

This code in LaTeXFeatures:

    // [x]color.sty
    if (mustProvide("color") || mustProvide("xcolor")) {
        string const package =
            (mustProvide("xcolor") ? "xcolor" : "color");
        if (params_.graphics_driver == "default"
            || params_.graphics_driver == "none")
            colors << "\\usepackage{" << package << "}\n";
        else
            colors << "\\usepackage["
                 << params_.graphics_driver
                 << "]{" << package << "}\n";
    }


loads color if xcolor and color are both requested and xcolor is provided.
It should probably read:

    // [x]color.sty
    if ((mustProvide("color") && !isProvided("xcolor")) ||
mustProvide("xcolor")) {
        string const package =
            (mustProvide("xcolor") ? "xcolor" : "color");
        if (params_.graphics_driver == "default"
            || params_.graphics_driver == "none")
            colors << "\\usepackage{" << package << "}\n";
        else
            colors << "\\usepackage["
                 << params_.graphics_driver
                 << "]{" << package << "}\n";
    }


Jürgen


>
> Scott
>

Reply via email to