Fix bug 9798.

Nameref support for math references.

(cherry picked from commit 5f6332bf46)
This commit is contained in:
Richard Heck 2018-04-06 22:29:04 -04:00 committed by Richard Kimberly Heck
parent 26d4b5bb47
commit e694199837
4 changed files with 10 additions and 2 deletions

View File

@ -309,9 +309,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");

View File

@ -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("") }
};

View File

@ -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();

View File

@ -27,6 +27,10 @@ What's new
* USER INTERFACE
- Allow external editing of preamble and ERT (bugs 991, 7404).
- Allow nameref in math references (bug 9798).
* DOCUMENTATION AND LOCALIZATION