]> git.lyx.org Git - lyx.git/commitdiff
Allow to disable inputenc loading via 'Provides inputenc 1'
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 15 Mar 2015 09:29:07 +0000 (10:29 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 15 Mar 2015 09:29:07 +0000 (10:29 +0100)
src/BufferParams.cpp

index 47c65cea2666a091684304b9cd31486f87de3ce0..403da2fe6be5161da632e0845dcb9ce663547bb3 100644 (file)
@@ -2825,7 +2825,8 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
                // inputenc must be omitted.
                // see http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg129680.html
                if ((!encodings.empty() || package == Encoding::inputenc)
-                   && !features.isRequired("japanese")) {
+                   && !features.isRequired("japanese")
+                   && !features.isProvided("inputenc")) {
                        os << "\\usepackage[";
                        set<string>::const_iterator it = encodings.begin();
                        set<string>::const_iterator const end = encodings.end();
@@ -2856,7 +2857,9 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
                        break;
                case Encoding::inputenc:
                        // do not load inputenc if japanese is used
-                       if (features.isRequired("japanese"))
+                       // or if the class provides inputenc
+                       if (features.isRequired("japanese")
+                           && features.isProvided("inputenc"))
                                break;
                        os << "\\usepackage[" << from_ascii(encoding().latexName())
                           << "]{inputenc}\n";