On Sun, Nov 22, 2009 at 04:16:16AM +0100, Uwe Stöhr wrote:

> Pavel Sanda schrieb:
> 
> >> I've done this now, please test if the Math manual is now compilable.
> > 
> > now i still see 
> > ! LaTeX Error: File `mhchem.sty' not found.
> 
> OK. I see now that it is impossible to compile the file without having
> mhchem installed:

That is not true (see below).

> Whenever you use \ce in a formula, LyX loads mhchem
> in the preamble. My solution fails, because it only suppresses mhchem
> in the formulas, but cannot suppress it when it was loaded by LyX to
> the preamble.

Then don't try to load mhchem if it is not available (see attached patch).

-- 
Enrico
Index: src/LaTeXFeatures.cpp
===================================================================
--- src/LaTeXFeatures.cpp	(revisione 32152)
+++ src/LaTeXFeatures.cpp	(copia locale)
@@ -693,7 +693,7 @@ string const LaTeXFeatures::getPackages(
 		packages << "\\PassOptionsToPackage{normalem}{ulem}\n"
 			    "\\usepackage{ulem}\n";
 
-	if (mustProvide("mhchem"))
+	if (mustProvide("mhchem") && isAvailable("mhchem"))
 		packages << "\\PassOptionsToPackage{version=3}{mhchem}\n"
 			    "\\usepackage{mhchem}\n";
 

Reply via email to