As already mentioned, I propose to use ulem instead of soul for the output of 
struck out text (i.e., change tracking with pdflatex).

It turned out that soul is way too fragile. Ulem does the same job (striking 
out with line break support), and it is significantly more robust.

The attached patch does the switch and fixes at least these bugs that cannot 
be fixed if we stick with soul, AFAICS:

http://bugzilla.lyx.org/show_bug.cgi?id=5480
http://bugzilla.lyx.org/show_bug.cgi?id=5647
http://bugzilla.lyx.org/show_bug.cgi?id=5091 (remainders)

I'd like to commit this to branch and trunk.

Objections?

Jürgen
Index: lib/chkconfig.ltx
===================================================================
--- lib/chkconfig.ltx	(Revision 28056)
+++ lib/chkconfig.ltx	(Arbeitskopie)
@@ -267,6 +267,7 @@
 \TestPackage{soul}
 \TestPackage{subfig}
 \TestPackage{textcomp}
+\TestPackage{ulem}
 \TestPackage{units}
 \TestPackage{url}
 \TestPackage{varioref}
Index: lib/doc/LaTeXConfig.lyx
===================================================================
--- lib/doc/LaTeXConfig.lyx	(Revision 28056)
+++ lib/doc/LaTeXConfig.lyx	(Arbeitskopie)
@@ -1,4 +1,4 @@
-#LyX 1.6.0 created this file. For more info see http://www.lyx.org/
+#LyX 1.6.2svn created this file. For more info see http://www.lyx.org/
 \lyxformat 345
 \begin_document
 \begin_header
@@ -14,6 +14,7 @@
 \font_osf false
 \font_sf_scale 100
 \font_tt_scale 100
+
 \graphics default
 \paperfontsize default
 \spacing single
@@ -35,8 +36,8 @@
 \paperpagestyle plain
 \tracking_changes false
 \output_changes false
-\author ""
-\author ""
+\author "" 
+\author "" 
 \end_header
 
 \begin_body
@@ -4569,14 +4570,14 @@
 \end_layout
 
 \begin_layout Subsection
-soul
+ulem
 \end_layout
 
 \begin_layout Description
 Found: 
 \begin_inset Info
 type  "package"
-arg   "soul"
+arg   "ulem"
 \end_inset
 
 
@@ -4585,17 +4586,18 @@
 \begin_layout Description
 CTAN: 
 \family typewriter
-macros/latex/contrib/soul
+macros/latex/contrib/misc/
 \end_layout
 
 \begin_layout Description
 Notes: The package 
 \family sans
-soul
+ulem
 \family default
- provides hyphenatable letterspacing (spacing out), underlining, striking
- out, and some derivatives.
- It is needed by LyX to output struck out text in change tracked documents.
+ provides various types of underlining, striking through and emphasizing
+ that can stretch between words and be broken across lines.
+ It is needed by LyX to output struck out text in change tracked documents
+ to PDF.
 \end_layout
 
 \begin_layout Subsection
Index: src/BufferView.cpp
===================================================================
--- src/BufferView.cpp	(Revision 28056)
+++ src/BufferView.cpp	(Arbeitskopie)
@@ -1138,19 +1138,19 @@
 		buffer_.params().outputChanges = !buffer_.params().outputChanges;
 		if (buffer_.params().outputChanges) {
 			bool dvipost    = LaTeXFeatures::isAvailable("dvipost");
-			bool xcolorsoul = LaTeXFeatures::isAvailable("soul") &&
+			bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
 					  LaTeXFeatures::isAvailable("xcolor");
 
-			if (!dvipost && !xcolorsoul) {
+			if (!dvipost && !xcolorulem) {
 				Alert::warning(_("Changes not shown in LaTeX output"),
 					       _("Changes will not be highlighted in LaTeX output, "
-						 "because neither dvipost nor xcolor/soul are installed.\n"
+						 "because neither dvipost nor xcolor/ulem are installed.\n"
 						 "Please install these packages or redefine "
 						 "\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
-			} else if (!xcolorsoul) {
+			} else if (!xcolorulem) {
 				Alert::warning(_("Changes not shown in LaTeX output"),
 					       _("Changes will not be highlighted in LaTeX output "
-						 "when using pdflatex, because xcolor and soul are not installed.\n"
+						 "when using pdflatex, because xcolor and ulem are not installed.\n"
 						 "Please install both packages or redefine "
 						 "\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
 			}
Index: src/LaTeXFeatures.cpp
===================================================================
--- src/LaTeXFeatures.cpp	(Revision 28056)
+++ src/LaTeXFeatures.cpp	(Arbeitskopie)
@@ -171,15 +171,15 @@
 	"\\newcommand{\\lyxdeleted}[3]{%\n"
 	"\\changestart\\overstrikeon#3\\overstrikeoff\\changeend}\n";
 
-static string const changetracking_xcolor_soul_def =
-	"%% Change tracking with soul\n"
+static string const changetracking_xcolor_ulem_def =
+	"%% Change tracking with ulem\n"
 	"\\newcommand{\\lyxadded}[3]{{\\color{lyxadded}#3}}\n"
-	"\\newcommand{\\lyxdeleted}[3]{{\\color{lyxdeleted}\\st{#3}}}\n";
+	"\\newcommand{\\lyxdeleted}[3]{{\\color{lyxdeleted}\\sout{#3}}}\n";
 
-static string const changetracking_xcolor_soul_hyperref_def =
-	"%% Change tracking with soul\n"
+static string const changetracking_xcolor_ulem_hyperref_def =
+	"%% Change tracking with ulem\n"
 	"\\newcommand{\\lyxadded}[3]{{\\texorpdfstring{\\color{lyxadded}}{}#3}}\n"
-	"\\newcommand{\\lyxdeleted}[3]{{\\texorpdfstring{\\color{lyxdeleted}\\st{#3}}{}}}\n";
+	"\\newcommand{\\lyxdeleted}[3]{{\\texorpdfstring{\\color{lyxdeleted}\\sout{#3}}{}}}\n";
 
 static string const changetracking_none_def =
 	"\\newcommand{\\lyxadded}[3]{#3}\n"
@@ -684,6 +684,10 @@
 	if (mustProvide("xy"))
 		packages << "\\usepackage[all]{xy}\n";
 
+	if (mustProvide("ulem"))
+		packages << "\\PassOptionsToPackage{normalem}{ulem}\n"
+			    "\\usepackage{ulem}\n";
+
 	if (mustProvide("nomencl")) {
 		// Make it work with the new and old version of the package,
 		// but don't use the compatibility option since it is
@@ -811,7 +815,7 @@
 	if (mustProvide("ct-dvipost"))
 		macros << changetracking_dvipost_def;
 
-	if (mustProvide("ct-xcolor-soul")) {
+	if (mustProvide("ct-xcolor-ulem")) {
 		int const prec = macros.precision(2);
 	
 		RGBColor cadd = rgbFromHexName(lcolor.getX11Name(Color_addedtext));
@@ -825,9 +829,9 @@
 		macros.precision(prec);
 		
 		if (isRequired("hyperref"))
-			macros << changetracking_xcolor_soul_hyperref_def;
+			macros << changetracking_xcolor_ulem_hyperref_def;
 		else
-			macros << changetracking_xcolor_soul_def;
+			macros << changetracking_xcolor_ulem_def;
 	}
 
 	if (mustProvide("ct-none"))
Index: src/Buffer.cpp
===================================================================
--- src/Buffer.cpp	(Revision 28056)
+++ src/Buffer.cpp	(Arbeitskopie)
@@ -557,19 +557,19 @@
 
 	if (params().outputChanges) {
 		bool dvipost    = LaTeXFeatures::isAvailable("dvipost");
-		bool xcolorsoul = LaTeXFeatures::isAvailable("soul") &&
+		bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
 				  LaTeXFeatures::isAvailable("xcolor");
 
-		if (!dvipost && !xcolorsoul) {
+		if (!dvipost && !xcolorulem) {
 			Alert::warning(_("Changes not shown in LaTeX output"),
 				       _("Changes will not be highlighted in LaTeX output, "
-					 "because neither dvipost nor xcolor/soul are installed.\n"
+					 "because neither dvipost nor xcolor/ulem are installed.\n"
 					 "Please install these packages or redefine "
 					 "\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
-		} else if (!xcolorsoul) {
+		} else if (!xcolorulem) {
 			Alert::warning(_("Changes not shown in LaTeX output"),
 				       _("Changes will not be highlighted in LaTeX output "
-					 "when using pdflatex, because xcolor and soul are not installed.\n"
+					 "when using pdflatex, because xcolor and ulem are not installed.\n"
 					 "Please install both packages or redefine "
 					 "\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
 		}
Index: src/BufferParams.cpp
===================================================================
--- src/BufferParams.cpp	(Revision 28056)
+++ src/BufferParams.cpp	(Arbeitskopie)
@@ -858,7 +858,7 @@
 
 	if (outputChanges) {
 		bool dvipost    = LaTeXFeatures::isAvailable("dvipost");
-		bool xcolorsoul = LaTeXFeatures::isAvailable("soul") &&
+		bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
 				  LaTeXFeatures::isAvailable("xcolor");
 
 		switch (features.runparams().flavor) {
@@ -866,18 +866,18 @@
 			if (dvipost) {
 				features.require("ct-dvipost");
 				features.require("dvipost");
-			} else if (xcolorsoul) {
-				features.require("ct-xcolor-soul");
-				features.require("soul");
+			} else if (xcolorulem) {
+				features.require("ct-xcolor-ulem");
+				features.require("ulem");
 				features.require("xcolor");
 			} else {
 				features.require("ct-none");
 			}
 			break;
 		case OutputParams::PDFLATEX:
-			if (xcolorsoul) {
-				features.require("ct-xcolor-soul");
-				features.require("soul");
+			if (xcolorulem) {
+				features.require("ct-xcolor-ulem");
+				features.require("ulem");
 				features.require("xcolor");
 				// improves color handling in PDF output
 				features.require("pdfcolmk"); 

Reply via email to