mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
GuiDocument: support also the class option reqno
as discussed our support for the formula numbering side should be complete. There are document classes that uses left numbering as default and with the class option "reqno" this can be changed to right numbering. reqno requires the loading of amsamth.
This commit is contained in:
parent
dadb041575
commit
19cc4a1fcb
@ -385,7 +385,7 @@ BufferParams::BufferParams()
|
||||
makeDocumentClass();
|
||||
paragraph_separation = ParagraphIndentSeparation;
|
||||
is_math_indent = false;
|
||||
math_number_before = false;
|
||||
math_number_before = "default";
|
||||
quotes_style = InsetQuotesParams::EnglishQuotes;
|
||||
dynamic_quotes = false;
|
||||
fontsize = "default";
|
||||
@ -1640,8 +1640,12 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
|
||||
if (is_math_indent)
|
||||
clsoptions << "fleqn,";
|
||||
|
||||
if (math_number_before)
|
||||
if (math_number_before == "true")
|
||||
clsoptions << "leqno,";
|
||||
else if (math_number_before == "false") {
|
||||
clsoptions << "reqno,";
|
||||
features.require("amsmath");
|
||||
}
|
||||
|
||||
// language should be a parameter to \documentclass
|
||||
if (language->babel() == "hebrew"
|
||||
|
@ -110,8 +110,8 @@ public:
|
||||
bool is_math_indent;
|
||||
|
||||
|
||||
/// number formulas before them
|
||||
bool math_number_before;
|
||||
/// number formulas before or not
|
||||
std::string math_number_before;
|
||||
|
||||
/** Whether paragraphs are separated by using a indent like in
|
||||
* articles or by using a little skip like in letters.
|
||||
|
@ -1283,7 +1283,8 @@ GuiDocument::GuiDocument(GuiView & lv)
|
||||
bc().addCheckedLineEdit(mathsModule->MathIndentLE);
|
||||
mathsModule->MathNumberingPosCO->addItem(qt_("Left"));
|
||||
mathsModule->MathNumberingPosCO->addItem(qt_("Default"));
|
||||
mathsModule->MathNumberingPosCO->setCurrentIndex(2);
|
||||
mathsModule->MathNumberingPosCO->addItem(qt_("Right"));
|
||||
mathsModule->MathNumberingPosCO->setCurrentIndex(1);
|
||||
|
||||
|
||||
// latex class
|
||||
@ -2942,14 +2943,17 @@ void GuiDocument::applyView()
|
||||
}
|
||||
switch (mathsModule->MathNumberingPosCO->currentIndex()) {
|
||||
case 0:
|
||||
bp_.math_number_before = true;
|
||||
bp_.math_number_before = "true";
|
||||
break;
|
||||
case 1:
|
||||
bp_.math_number_before = false;
|
||||
bp_.math_number_before = "default";
|
||||
break;
|
||||
case 2:
|
||||
bp_.math_number_before = "false";
|
||||
break;
|
||||
default:
|
||||
// this should never happen
|
||||
bp_.math_number_before = false;
|
||||
bp_.math_number_before = "default";
|
||||
break;
|
||||
}
|
||||
|
||||
@ -3415,10 +3419,12 @@ void GuiDocument::paramsToDialog()
|
||||
mathsModule->MathIndentCO->setCurrentIndex(indent);
|
||||
enableMathIndent(indent);
|
||||
}
|
||||
if (bp_.math_number_before)
|
||||
if (bp_.math_number_before == "true")
|
||||
mathsModule->MathNumberingPosCO->setCurrentIndex(0);
|
||||
else
|
||||
else if (bp_.math_number_before == "default")
|
||||
mathsModule->MathNumberingPosCO->setCurrentIndex(1);
|
||||
else if (bp_.math_number_before == "false")
|
||||
mathsModule->MathNumberingPosCO->setCurrentIndex(2);
|
||||
|
||||
map<string, string> const & packages = BufferParams::auto_packages();
|
||||
for (map<string, string>::const_iterator it = packages.begin();
|
||||
|
@ -494,7 +494,7 @@ Preamble::Preamble() : one_language(true), explicit_babel(false),
|
||||
h_font_tt_scale[1] = "100";
|
||||
//h_font_cjk
|
||||
h_is_mathindent = "0";
|
||||
h_math_number_before = "0";
|
||||
h_math_number_before = "default";
|
||||
h_graphics = "default";
|
||||
h_default_output_format = "default";
|
||||
h_html_be_strict = "false";
|
||||
@ -1692,7 +1692,12 @@ void Preamble::parse(Parser & p, string const & forceclass,
|
||||
// formula numbering side
|
||||
if ((it = find(opts.begin(), opts.end(), "leqno"))
|
||||
!= opts.end()) {
|
||||
h_math_number_before = "1";
|
||||
h_math_number_before = "true";
|
||||
opts.erase(it);
|
||||
}
|
||||
else if ((it = find(opts.begin(), opts.end(), "reqno"))
|
||||
!= opts.end()) {
|
||||
h_math_number_before = "false";
|
||||
opts.erase(it);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user