mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Fix bug 9798.
Nameref support for math references.
This commit is contained in:
parent
2553b0073f
commit
5f6332bf46
@ -328,9 +328,9 @@ void GuiRef::updateContents()
|
||||
typeCO->addItem(qt_("<page>"), "pageref");
|
||||
typeCO->addItem(qt_("on page <page>"), "vpageref");
|
||||
typeCO->addItem(qt_("<reference> on page <page>"), "vref");
|
||||
typeCO->addItem(qt_("Textual reference"), "nameref");
|
||||
if (bufferview()->cursor().inTexted()) {
|
||||
typeCO->addItem(qt_("Formatted reference"), "formatted");
|
||||
typeCO->addItem(qt_("Textual reference"), "nameref");
|
||||
typeCO->addItem(qt_("Label only"), "labelonly");
|
||||
} else
|
||||
typeCO->addItem(qt_("Formatted reference"), "prettyref");
|
||||
|
@ -168,6 +168,8 @@ void InsetMathRef::validate(LaTeXFeatures & features) const
|
||||
features.require("prettyref");
|
||||
else if (commandname() == "eqref")
|
||||
features.require("amsmath");
|
||||
else if (commandname() == "nameref")
|
||||
features.require("nameref");
|
||||
}
|
||||
|
||||
|
||||
@ -243,6 +245,7 @@ InsetMathRef::ref_type_info InsetMathRef::types[] = {
|
||||
{ from_ascii("vpageref"), from_ascii(N_("Textual Page Number")), from_ascii(N_("TextPage: "))},
|
||||
{ from_ascii("vref"), from_ascii(N_("Standard+Textual Page")), from_ascii(N_("Ref+Text: "))},
|
||||
{ from_ascii("prettyref"), from_ascii(N_("PrettyRef")), from_ascii(N_("FormatRef: "))},
|
||||
{ from_ascii("nameref"), from_ascii(N_("Reference to Name")), from_ascii(N_("NameRef: "))},
|
||||
{ from_ascii(""), from_ascii(""), from_ascii("") }
|
||||
};
|
||||
|
||||
|
@ -1552,7 +1552,8 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
|
||||
}
|
||||
|
||||
else if (t.cs() == "ref" || t.cs() == "eqref" || t.cs() == "prettyref"
|
||||
|| t.cs() == "pageref" || t.cs() == "vpageref" || t.cs() == "vref") {
|
||||
|| t.cs() == "nameref" || t.cs() == "pageref"
|
||||
|| t.cs() == "vpageref" || t.cs() == "vref") {
|
||||
cell->push_back(MathAtom(new InsetMathRef(buf, t.cs())));
|
||||
docstring const opt = parse_verbatim_option();
|
||||
docstring const ref = parse_verbatim_item();
|
||||
|
Loading…
Reference in New Issue
Block a user