mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
whitespace
This commit is contained in:
parent
89c7d0eea3
commit
bd79001387
@ -587,13 +587,13 @@ void InsetMathHull::addPreview(DocIterator const & inset_pos,
|
|||||||
|
|
||||||
|
|
||||||
void InsetMathHull::preparePreview(DocIterator const & pos,
|
void InsetMathHull::preparePreview(DocIterator const & pos,
|
||||||
bool forexport) const
|
bool forexport) const
|
||||||
{
|
{
|
||||||
// there is no need to do all the macro stuff if we're not
|
// there is no need to do all the macro stuff if we're not
|
||||||
// actually going to generate the preview.
|
// actually going to generate the preview.
|
||||||
if (RenderPreview::status() != LyXRC::PREVIEW_ON && !forexport)
|
if (RenderPreview::status() != LyXRC::PREVIEW_ON && !forexport)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Buffer const * buffer = pos.buffer();
|
Buffer const * buffer = pos.buffer();
|
||||||
|
|
||||||
// collect macros at this position
|
// collect macros at this position
|
||||||
@ -752,7 +752,7 @@ void InsetMathHull::validate(LaTeXFeatures & features) const
|
|||||||
if (features.runparams().isLaTeX()) {
|
if (features.runparams().isLaTeX()) {
|
||||||
if (ams())
|
if (ams())
|
||||||
features.require("amsmath");
|
features.require("amsmath");
|
||||||
|
|
||||||
if (type_ == hullRegexp) {
|
if (type_ == hullRegexp) {
|
||||||
features.require("color");
|
features.require("color");
|
||||||
string frcol = lcolor.getLaTeXName(Color_regexpframe);
|
string frcol = lcolor.getLaTeXName(Color_regexpframe);
|
||||||
@ -764,12 +764,12 @@ void InsetMathHull::validate(LaTeXFeatures & features) const
|
|||||||
features.addPreambleSnippet(
|
features.addPreambleSnippet(
|
||||||
string("\\newcommand{\\endregexp}{}"));
|
string("\\newcommand{\\endregexp}{}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validation is necessary only if not using AMS math.
|
// Validation is necessary only if not using AMS math.
|
||||||
// To be safe, we will always run mathedvalidate.
|
// To be safe, we will always run mathedvalidate.
|
||||||
//if (features.amsstyle)
|
//if (features.amsstyle)
|
||||||
// return;
|
// return;
|
||||||
|
|
||||||
//features.binom = true;
|
//features.binom = true;
|
||||||
} else if (features.runparams().math_flavor == OutputParams::MathAsHTML) {
|
} else if (features.runparams().math_flavor == OutputParams::MathAsHTML) {
|
||||||
// it would be better to do this elsewhere, but we can't validate in
|
// it would be better to do this elsewhere, but we can't validate in
|
||||||
@ -1642,7 +1642,7 @@ bool InsetMathHull::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
// if there is an argument, find the corresponding label, else
|
// if there is an argument, find the corresponding label, else
|
||||||
// check whether there is at least one label.
|
// check whether there is at least one label.
|
||||||
for (row_type row = 0; row != nrows(); ++row) {
|
for (row_type row = 0; row != nrows(); ++row) {
|
||||||
if (numbered_[row] && label_[row] &&
|
if (numbered_[row] && label_[row] &&
|
||||||
(cmd.argument().empty() || label(row) == cmd.argument())) {
|
(cmd.argument().empty() || label(row) == cmd.argument())) {
|
||||||
enabled = true;
|
enabled = true;
|
||||||
break;
|
break;
|
||||||
@ -2122,7 +2122,7 @@ void InsetMathHull::mathAsLatex(WriteStream & os) const
|
|||||||
|
|
||||||
docstring InsetMathHull::xhtml(XHTMLStream & xs, OutputParams const & op) const
|
docstring InsetMathHull::xhtml(XHTMLStream & xs, OutputParams const & op) const
|
||||||
{
|
{
|
||||||
BufferParams::MathOutput const mathtype =
|
BufferParams::MathOutput const mathtype =
|
||||||
buffer().masterBuffer()->params().html_math_output;
|
buffer().masterBuffer()->params().html_math_output;
|
||||||
|
|
||||||
bool success = false;
|
bool success = false;
|
||||||
@ -2146,10 +2146,10 @@ docstring InsetMathHull::xhtml(XHTMLStream & xs, OutputParams const & op) const
|
|||||||
} catch (MathExportException const &) {}
|
} catch (MathExportException const &) {}
|
||||||
if (success) {
|
if (success) {
|
||||||
if (getType() == hullSimple)
|
if (getType() == hullSimple)
|
||||||
xs << html::StartTag("math",
|
xs << html::StartTag("math",
|
||||||
"xmlns=\"http://www.w3.org/1998/Math/MathML\"", true);
|
"xmlns=\"http://www.w3.org/1998/Math/MathML\"", true);
|
||||||
else
|
else
|
||||||
xs << html::StartTag("math",
|
xs << html::StartTag("math",
|
||||||
"display=\"block\" xmlns=\"http://www.w3.org/1998/Math/MathML\"", true);
|
"display=\"block\" xmlns=\"http://www.w3.org/1998/Math/MathML\"", true);
|
||||||
xs << XHTMLStream::ESCAPE_NONE
|
xs << XHTMLStream::ESCAPE_NONE
|
||||||
<< os.str()
|
<< os.str()
|
||||||
@ -2170,14 +2170,14 @@ docstring InsetMathHull::xhtml(XHTMLStream & xs, OutputParams const & op) const
|
|||||||
<< html::EndTag(tag);
|
<< html::EndTag(tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// what we actually want is this:
|
// what we actually want is this:
|
||||||
// if (
|
// if (
|
||||||
// ((mathtype == BufferParams::MathML || mathtype == BufferParams::HTML)
|
// ((mathtype == BufferParams::MathML || mathtype == BufferParams::HTML)
|
||||||
// && !success)
|
// && !success)
|
||||||
// || mathtype == BufferParams::Images
|
// || mathtype == BufferParams::Images
|
||||||
// )
|
// )
|
||||||
// but what follows is equivalent, since we'll enter only if either (a) we
|
// but what follows is equivalent, since we'll enter only if either (a) we
|
||||||
// tried and failed with MathML or HTML or (b) didn't try yet at all but
|
// tried and failed with MathML or HTML or (b) didn't try yet at all but
|
||||||
// aren't doing LaTeX, in which case we are doing Images.
|
// aren't doing LaTeX, in which case we are doing Images.
|
||||||
if (!success && mathtype != BufferParams::LaTeX) {
|
if (!success && mathtype != BufferParams::LaTeX) {
|
||||||
@ -2213,7 +2213,7 @@ docstring InsetMathHull::xhtml(XHTMLStream & xs, OutputParams const & op) const
|
|||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// so we'll pass this test if we've failed everything else, or
|
// so we'll pass this test if we've failed everything else, or
|
||||||
// if mathtype was LaTeX, since we won't have entered any of the
|
// if mathtype was LaTeX, since we won't have entered any of the
|
||||||
// earlier branches
|
// earlier branches
|
||||||
@ -2225,14 +2225,14 @@ docstring InsetMathHull::xhtml(XHTMLStream & xs, OutputParams const & op) const
|
|||||||
ModeSpecifier specifier(wi, MATH_MODE);
|
ModeSpecifier specifier(wi, MATH_MODE);
|
||||||
mathAsLatex(wi);
|
mathAsLatex(wi);
|
||||||
docstring const latex = ls.str();
|
docstring const latex = ls.str();
|
||||||
|
|
||||||
// class='math' allows for use of jsMath
|
// class='math' allows for use of jsMath
|
||||||
// http://www.math.union.edu/~dpvc/jsMath/
|
// http://www.math.union.edu/~dpvc/jsMath/
|
||||||
// FIXME XHTML
|
// FIXME XHTML
|
||||||
// probably should allow for some kind of customization here
|
// probably should allow for some kind of customization here
|
||||||
string const tag = (getType() == hullSimple) ? "span" : "div";
|
string const tag = (getType() == hullSimple) ? "span" : "div";
|
||||||
xs << html::StartTag(tag, "class='math'")
|
xs << html::StartTag(tag, "class='math'")
|
||||||
<< latex
|
<< latex
|
||||||
<< html::EndTag(tag)
|
<< html::EndTag(tag)
|
||||||
<< html::CR();
|
<< html::CR();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user