Uwe Stöhr wrote:

> Hello LyXers,
> 
> I encountered two LyX 1.3.6CVS-bugs:
> 
> I can't compile my Mathed documentation anymore:
> 
> http://wiki.lyx.org/uploads/LyX/LyXMathebefehle/LyXMathebefehle.lyx
> 
> The problem is that LyX 1.3.6CVS adds the line
> 
> \usepackage{wasysym}
> 
> automatically to the preamble. This causes errors when using AMS symbols
> that are redefined by wasysym. In my case I use the symbols \iint and
> \iiint and choose to use AMS-Math in the menu Layout->Document->Packages.

I too have been bitten by this recently.

> The solution would be a new checkbox if the package wasysym should be
> used or not in the menu Layout->Document->Packages.

I propose a different solution: Prefer amsmath over wasysym if both packages
are requested, since many wasysym symbols are also available in amsmath. An
additional checkbox is bad because it is a file format change (cannot be
done in 1.3), and because the conflict was created by LyX and should not be
solved by the user (How does an inexperienced user know what to check?)

Of course an invalid .tex file is generated if a wasysym only symbol is
requested. In this case the user has to uncheck the AMS button and stop
using AMS constructs.

The attached tested and working patch is for 1.4. Is it OK to apply it (and
the 1.3 equivalent?


Georg
Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2196
diff -u -p -r1.2196 ChangeLog
--- src/ChangeLog	7 Jun 2005 16:50:00 -0000	1.2196
+++ src/ChangeLog	7 Jun 2005 17:26:20 -0000
@@ -1,3 +1,7 @@
+2005-06-09  Georg Baum  <[EMAIL PROTECTED]>
+
+	* LaTeXFeatures.C (getPackages): ignore wasysym if amsmath is used
+
 2005-06-07  Georg Baum  <[EMAIL PROTECTED]>
 
 	* lyx_main.C (parse_execute): Fix last fix: is_gui = false
Index: src/LaTeXFeatures.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LaTeXFeatures.C,v
retrieving revision 1.118
diff -u -p -r1.118 LaTeXFeatures.C
--- src/LaTeXFeatures.C	26 Apr 2005 11:12:09 -0000	1.118
+++ src/LaTeXFeatures.C	7 Jun 2005 17:26:22 -0000
@@ -233,6 +233,7 @@ char const * simplefeatures[] = {
 	"varioref",
 	"prettyref",
 	"float",
-	"wasysym",
 	"dvipost",
 	"fancybox",
 	"calc",
@@ -273,6 +285,12 @@ string const LaTeXFeatures::getPackages(
 	    && !tclass.provides(LyXTextClass::amsmath)
 	    && params_.use_amsmath != BufferParams::AMS_OFF) {
 		packages << "\\usepackage{amsmath}\n";
+		if (isRequired("wasysym"))
+			lyxerr << "Warning: Conflicting packages amsmath and "
+			          "wasysym are requested, ignoring wasysym."
+			       << endl;
+	} else if (isRequired("wasysym")) {
+		packages << "\\usepackage{wasysym}\n";
 	}
 
 	// color.sty

Reply via email to