Bug 1776 is not a bug of LyX in the strict sense (latex2html cannot cope
with

\includegraphics[%
  width=0.36\paperwidth]{immagini/tc1}

). But this attempt of pretty-printing does not improve the output IMO, and
since it confuses latex2html I propose to make no attempt to pretty-print
includegraphics at all.

Is this OK?


Georg
Index: src/insets/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/ChangeLog,v
retrieving revision 1.1105
diff -u -p -r1.1105 ChangeLog
--- src/insets/ChangeLog	3 Feb 2005 17:24:39 -0000	1.1105
+++ src/insets/ChangeLog	7 Feb 2005 09:10:03 -0000
@@ -1,3 +1,8 @@
+2005-02-07  Georg Baum  <[EMAIL PROTECTED]>
+
+	* insetgraphics.C (latex): Remove line continuation '%\n' (bug xxx,
+	workaround for broken HTML converter)
+
 2005-02-03  Georg Baum  <[EMAIL PROTECTED]>
 
 	* insetert.C (latex, linuxdoc, docbook): remove newline handling
Index: src/insets/insetgraphics.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v
retrieving revision 1.272
diff -u -p -r1.272 insetgraphics.C
--- src/insets/insetgraphics.C	27 Jan 2005 21:05:42 -0000	1.272
+++ src/insets/insetgraphics.C	7 Feb 2005 09:10:04 -0000
@@ -294,48 +294,47 @@ string const InsetGraphics::createLatexO
 	// before writing it to the output stream.
 	ostringstream options;
 	if (!params().bb.empty())
-	    options << " bb=" << rtrim(params().bb) << ",\n";
+	    options << "bb=" << rtrim(params().bb) << ',';
 	if (params().draft)
-	    options << " draft,\n";
+	    options << "draft,";
 	if (params().clip)
-	    options << " clip,\n";
+	    options << "clip,";
 	double const scl = convert<double>(params().scale);
 	if (!params().scale.empty() && !float_equal(scl, 0.0, 0.05)) {
 		if (!float_equal(scl, 100.0, 0.05))
-			options << " scale=" << scl / 100.0
-				<< ",\n";
+			options << "scale=" << scl / 100.0 << ',';
 	} else {
 		if (!params().width.zero())
-			options << " width=" << params().width.asLatexString() << ",\n";
+			options << "width=" << params().width.asLatexString() << ',';
 		if (!params().height.zero())
-			options << " height=" << params().height.asLatexString() << ",\n";
+			options << "height=" << params().height.asLatexString() << ',';
 		if (params().keepAspectRatio)
-			options << " keepaspectratio,\n";
+			options << "keepaspectratio,";
 	}
 
 	// Make sure rotation angle is not very close to zero;
 	// a float can be effectively zero but not exactly zero.
 	if (!params().rotateAngle.empty()
 		&& !float_equal(convert<double>(params().rotateAngle), 0.0, 0.001)) {
-	    options << "  angle=" << params().rotateAngle << ",\n";
+	    options << "angle=" << params().rotateAngle << ',';
 	    if (!params().rotateOrigin.empty()) {
-		options << "  origin=" << params().rotateOrigin[0];
+		options << "origin=" << params().rotateOrigin[0];
 		if (contains(params().rotateOrigin,"Top"))
 		    options << 't';
 		else if (contains(params().rotateOrigin,"Bottom"))
 		    options << 'b';
 		else if (contains(params().rotateOrigin,"Baseline"))
 		    options << 'B';
-		options << ",\n";
+		options << ',';
 	    }
 	}
 
 	if (!params().special.empty())
-	    options << params().special << ",\n";
+	    options << params().special << ',';
 
 	string opts = options.str();
-	// delete last ",\n"
-	return opts.substr(0, opts.size() - 2);
+	// delete last ','
+	return opts.substr(0, opts.size() - 1);
 }
 
 
@@ -722,9 +720,9 @@ int InsetGraphics::latex(Buffer const & 
 	lyxerr[Debug::GRAPHICS] << "\tOpts = " << opts << endl;
 
 	if (!opts.empty() && !message.empty())
-		before += ("[%\n" + opts + ',' + message + ']');
+		before += ('[' + opts + ',' + message + ']');
 	else if (!opts.empty() || !message.empty())
-		before += ("[%\n" + opts + message + ']');
+		before += ('[' + opts + message + ']');
 
 	lyxerr[Debug::GRAPHICS]
 		<< "\tBefore = " << before

Reply via email to