Allow to disable inputenc loading via 'Provides inputenc 1'

This commit is contained in:
Juergen Spitzmueller 2015-03-15 10:29:07 +01:00
parent 048b5fcb67
commit d15388ba98

View File

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