Simplify output code

This commit is contained in:
Juergen Spitzmueller 2022-12-19 11:08:41 +01:00
parent 38e3538b77
commit 41146030b6
2 changed files with 10 additions and 9 deletions

View File

@ -237,6 +237,8 @@
%%% Crucial versions %%% Crucial versions
% This one introduces \textsubscript % This one introduces \textsubscript
\TestLaTeXVersion{2005/12/01} \TestLaTeXVersion{2005/12/01}
% This one introduces \UseRawInputEncoding
\TestLaTeXVersion{2018/04/01}
% This one introduces path encoding changes % This one introduces path encoding changes
\TestLaTeXVersion{2019/10/01} \TestLaTeXVersion{2019/10/01}
% This introduces all math and text spaces % This introduces all math and text spaces

View File

@ -3429,10 +3429,10 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
case Encoding::CJK: case Encoding::CJK:
case Encoding::japanese: case Encoding::japanese:
if (encoding().iconvName() != "UTF-8" if (encoding().iconvName() != "UTF-8"
&& !features.runparams().isFullUnicode()) && !features.runparams().isFullUnicode()
// don't default to [utf8]{inputenc} with TeXLive >= 18 && features.isAvailable("LaTeX-2018/04/01"))
os << "\\ifdefined\\UseRawInputEncoding\n" // don't default to [utf8]{inputenc} with LaTeX >= 2018/04
<< " \\UseRawInputEncoding\\fi\n"; os << "\\UseRawInputEncoding\n";
break; break;
case Encoding::inputenc: case Encoding::inputenc:
// do not load inputenc if japanese is used // do not load inputenc if japanese is used
@ -3456,11 +3456,10 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
break; break;
} }
} }
if (inputenc == "auto-legacy-plain" || features.isRequired("japanese")) { if ((inputenc == "auto-legacy-plain" || features.isRequired("japanese"))
// don't default to [utf8]{inputenc} with TeXLive >= 18 && features.isAvailable("LaTeX-2018/04/01"))
os << "\\ifdefined\\UseRawInputEncoding\n"; // don't default to [utf8]{inputenc} with LaTeX >= 2018/04
os << " \\UseRawInputEncoding\\fi\n"; os << "\\UseRawInputEncoding\n";
}
} }