]> git.lyx.org Git - features.git/commitdiff
Simplify output code
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 19 Dec 2022 10:08:41 +0000 (11:08 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 19 Dec 2022 10:09:50 +0000 (11:09 +0100)
lib/chkconfig.ltx
src/BufferParams.cpp

index 957ea22d0855a3cabc760f3d938acce2b9e72132..34f9aff13252d6880328815fc16e5975af84ebf0 100644 (file)
 %%% Crucial versions
 % This one introduces \textsubscript
 \TestLaTeXVersion{2005/12/01}
+% This one introduces \UseRawInputEncoding
+\TestLaTeXVersion{2018/04/01}
 % This one introduces path encoding changes
 \TestLaTeXVersion{2019/10/01}
 % This introduces all math and text spaces
index 01be1bf632cccb3e62d2b1a18a64bd8b4e363195..3c55756709860760ebf8b54c76f282b86dad1814 100644 (file)
@@ -3429,10 +3429,10 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
                case Encoding::CJK:
                case Encoding::japanese:
                        if (encoding().iconvName() != "UTF-8"
-                               && !features.runparams().isFullUnicode())
-                         // don't default to [utf8]{inputenc} with TeXLive >= 18
-                         os << "\\ifdefined\\UseRawInputEncoding\n"
-                                << "  \\UseRawInputEncoding\\fi\n";
+                           && !features.runparams().isFullUnicode()
+                           && features.isAvailable("LaTeX-2018/04/01"))
+                               // don't default to [utf8]{inputenc} with LaTeX >= 2018/04
+                               os << "\\UseRawInputEncoding\n";
                        break;
                case Encoding::inputenc:
                        // do not load inputenc if japanese is used
@@ -3456,11 +3456,10 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
                        break;
                }
        }
-       if (inputenc == "auto-legacy-plain" || features.isRequired("japanese")) {
-               // don't default to [utf8]{inputenc} with TeXLive >= 18
-               os << "\\ifdefined\\UseRawInputEncoding\n";
-               os << "  \\UseRawInputEncoding\\fi\n";
-       }
+       if ((inputenc == "auto-legacy-plain" || features.isRequired("japanese"))
+           && features.isAvailable("LaTeX-2018/04/01"))
+               // don't default to [utf8]{inputenc} with LaTeX >= 2018/04
+               os << "\\UseRawInputEncoding\n";
 }