New XHTML math options. Format change.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34250 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-04-21 15:18:25 +00:00
parent 0cdf8ec74a
commit 5678dc566f
5 changed files with 48 additions and 9 deletions

View File

@ -7,6 +7,11 @@ The good example would be 2010-01-10 entry.
----------------------- -----------------------
2010-04-21 Richard heck <rgheck@comcast.net>
* Format incremented to 387: New options for XHTML math output.
New BufferParams: html_math_img_scale, html_latex_start,
html_latex_end.
2010-04-17 Richard heck <rgheck@comcast.net> 2010-04-17 Richard heck <rgheck@comcast.net>
* Format incremented to 386: LyX version for InsetInfo: * Format incremented to 386: LyX version for InsetInfo:
new parameters: type "lyxinfo", arg "version". new parameters: type "lyxinfo", arg "version".

View File

@ -1512,6 +1512,20 @@ def revert_lyx_version(document):
i = i+1 i = i+1
def revert_math_scale(document):
" Remove math scaling and LaTeX options "
i = find_token(document.header, '\\html_math_img_scale', 0)
if i != -1:
del document.header[i]
i = find_token(document.header, '\\html_latex_start', 0)
if i != -1:
del document.header[i]
i = find_token(document.header, '\\html_latex_end', 0)
if i != -1:
del document.header[i]
## ##
# Conversion hub # Conversion hub
# #
@ -1557,10 +1571,12 @@ convert = [[346, []],
[383, []], [383, []],
[384, []], [384, []],
[385, []], [385, []],
[386, []] [386, []],
] [387, []],
]
revert = [[385, [revert_lyx_version]], revert = [[386, [revert_math_scale]],
[385, [revert_lyx_version]],
[384, [revert_shadedboxcolor]], [384, [revert_shadedboxcolor]],
[383, [revert_fontcolor]], [383, [revert_fontcolor]],
[382, [revert_turkmen]], [382, [revert_turkmen]],

View File

@ -126,7 +126,7 @@ namespace {
// Do not remove the comment below, so we get merge conflict in // Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own. // independent branches. Instead add your own.
int const LYX_FORMAT = 386; // rgh: LyX version for InsetInfo int const LYX_FORMAT = 387; // rgh: XHTML math options
typedef map<string, bool> DepClean; typedef map<string, bool> DepClean;
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache; typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;

View File

@ -383,8 +383,11 @@ BufferParams::BufferParams()
} }
// default index // default index
indiceslist().addDefault(B_("Index")); indiceslist().addDefault(B_("Index"));
html_be_strict = true; html_be_strict = false;
html_math_output = MathML; html_math_output = MathML;
html_math_img_scale = 1.0;
html_latex_start = "<span class='latex'>";
html_latex_end = "</span>";
} }
@ -807,6 +810,12 @@ string BufferParams::readToken(Lexer & lex, string const & token,
html_math_output = static_cast<MathOutput>(temp); html_math_output = static_cast<MathOutput>(temp);
} else if (token == "\\html_be_strict") { } else if (token == "\\html_be_strict") {
lex >> html_be_strict; lex >> html_be_strict;
} else if (token == "\\html_math_img_scale") {
lex >> html_math_img_scale;
} else if (token == "\\html_latex_start") {
lex >> html_latex_start;
} else if (token == "\\html_latex_end") {
lex >> html_latex_end;
} else { } else {
lyxerr << "BufferParams::readToken(): Unknown token: " << lyxerr << "BufferParams::readToken(): Unknown token: " <<
token << endl; token << endl;
@ -1024,10 +1033,13 @@ void BufferParams::writeFile(ostream & os) const
} }
} }
os << "\\tracking_changes " << convert<string>(trackChanges) << "\n" os << "\\tracking_changes " << convert<string>(trackChanges) << '\n'
<< "\\output_changes " << convert<string>(outputChanges) << "\n" << "\\output_changes " << convert<string>(outputChanges) << '\n'
<< "\\html_math_output " << html_math_output << "\n" << "\\html_math_output " << html_math_output << '\n'
<< "\\html_be_strict " << convert<string>(html_be_strict) << "\n"; << "\\html_be_strict " << convert<string>(html_be_strict) << '\n'
<< "\\html_math_img_scale " << convert<string>(html_math_img_scale) << '\n'
<< "\\html_latex_start \"" << html_latex_start << "\"\n"
<< "\\html_latex_end \"" << html_latex_end << "\"\n";
os << pimpl_->authorlist; os << pimpl_->authorlist;
} }

View File

@ -393,6 +393,12 @@ public:
/// whether to attempt to be XHTML 1.1 compliant or instead be /// whether to attempt to be XHTML 1.1 compliant or instead be
/// a little more mellow /// a little more mellow
bool html_be_strict; bool html_be_strict;
///
double html_math_img_scale;
///
std::string html_latex_start;
///
std::string html_latex_end;
private: private:
/// ///