mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-06 00:10:59 +00:00
Nicer previews.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5434 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b265e8fb05
commit
160b147186
@ -479,9 +479,7 @@ void PreviewLoader::Impl::startLoading()
|
|||||||
string const command = "sh " + LibScriptSearch(cs.str().c_str());
|
string const command = "sh " + LibScriptSearch(cs.str().c_str());
|
||||||
|
|
||||||
// Initiate the conversion from LaTeX to bitmap images files.
|
// Initiate the conversion from LaTeX to bitmap images files.
|
||||||
Forkedcall::SignalTypePtr convert_ptr;
|
Forkedcall::SignalTypePtr convert_ptr(new Forkedcall::SignalType);
|
||||||
convert_ptr.reset(new Forkedcall::SignalType);
|
|
||||||
|
|
||||||
convert_ptr->connect(
|
convert_ptr->connect(
|
||||||
boost::bind(&Impl::finishedGenerating, this, _1, _2, _3));
|
boost::bind(&Impl::finishedGenerating, this, _1, _2, _3));
|
||||||
|
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
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>
|
2002-10-17 Dekel Tsur <dekelts@tau.ac.il>
|
||||||
|
|
||||||
* math_kerninset.C (metrics): Use LyXLength::inPixels.
|
* math_kerninset.C (metrics): Use LyXLength::inPixels.
|
||||||
|
@ -330,5 +330,20 @@ string const InsetFormula::PreviewImpl::latexString() const
|
|||||||
ostringstream ls;
|
ostringstream ls;
|
||||||
WriteStream wi(ls, false, false);
|
WriteStream wi(ls, false, false);
|
||||||
parent().par_->write(wi);
|
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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user