string const command = "sh " + LibScriptSearch(cs.str().c_str());
// Initiate the conversion from LaTeX to bitmap images files.
- Forkedcall::SignalTypePtr convert_ptr;
- convert_ptr.reset(new Forkedcall::SignalType);
-
+ Forkedcall::SignalTypePtr convert_ptr(new Forkedcall::SignalType);
convert_ptr->connect(
boost::bind(&Impl::finishedGenerating, this, _1, _2, _3));
+2002-10-17 Angus Leeming <leeming@lyx.org>
+
+ * formula.C (latexString): change "\[ ... \]" to "$ \displaystyle ... $"
+ for nicer previews.
+
2002-10-17 Dekel Tsur <dekelts@tau.ac.il>
* math_kerninset.C (metrics): Use LyXLength::inPixels.
ostringstream ls;
WriteStream wi(ls, false, false);
parent().par_->write(wi);
- return ls.str().c_str();
+ string str = ls.str().c_str();
+
+ // If we are in displaymode, the preview will include the margins
+ // on either side of the previewed equation.
+ // We can create an image with a tight bounding box by replacing the
+ // "\[ ... \]" delimiters with "$ \displaystyle ... $".
+ // Note that we have to get rid of any trailing '\n's for the fix
+ // to work.
+ if (prefixIs(str, "\\[")) {
+ std::cerr << "before\n" << str << std::endl;
+ str = rtrim(rtrim(ltrim(str, "\\["), "\n"), "\\]");
+ str = "$ \\displaystyle " + str + " $";
+ std::cerr << "after\n" << str << std::endl;
+ }
+
+ return str;
}