Am Sonntag, dem 14.08.2022 um 14:33 +0200 schrieb Kornel Benko:
> Maybe because of update of package 'ucs' in TL22 today.

Better with this patch (issuing Tools > Reconfigure might be needed)?

-- 
Jürgen
diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx
index d2613e9c49..3f5427c440 100644
--- a/lib/chkconfig.ltx
+++ b/lib/chkconfig.ltx
@@ -591,6 +591,9 @@
 % With this version, hyperref option unicode is true
 % by default
 \TestPackageVersion{hyperref}{2021/02/04}
+% As of this version, the ucs package must be explicitly
+% loaded to get utf8x (rather than utf8) encoding tables
+\TestPackageVersion{ucs}{2022/08/07}
 
 %%% Document classes
 % The list of layout files has been put in this file here by the
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index 3bb9445adb..4a4b21aac6 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -3440,8 +3440,15 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
 			if (features.isRequired("japanese")
 			    || features.isProvided("inputenc"))
 				break;
-			os << "\\usepackage[" << from_ascii(encoding().latexName());
-		   	if (features.runparams().flavor == Flavor::LuaTeX
+			string const doc_encoding = encoding().latexName();
+			// ucs 2022 release defaults to utf8 if the ucs package
+			// is not loaded before inputenc utf8x is called
+			if (doc_encoding == "utf8x"
+			    && features.isAvailable("ucs-2022/08/07")
+			    && !features.isProvided("ucs"))
+				os << "\\usepackage{ucs}\n";
+			os << "\\usepackage[" << from_ascii(doc_encoding);
+			if (features.runparams().flavor == Flavor::LuaTeX
 			    || features.runparams().flavor == Flavor::DviLuaTeX)
 				os << "]{luainputenc}\n";
 			else

Attachment: signature.asc
Description: This is a digitally signed message part

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to