commit e694199837172dd4927eb64112e00f85a426eb8e
Author: Richard Heck <[email protected]>
Date: Fri Apr 6 22:29:04 2018 -0400
Fix bug 9798.
Nameref support for math references.
(cherry picked from commit 5f6332bf46d4a0b65dd352b3e12ec35f58b6dece)
---
src/frontends/qt4/GuiRef.cpp | 2 +-
src/mathed/InsetMathRef.cpp | 3 +++
src/mathed/MathParser.cpp | 3 ++-
status.23x | 4 ++++
4 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp
index c07ce5c..fac8be9 100644
--- a/src/frontends/qt4/GuiRef.cpp
+++ b/src/frontends/qt4/GuiRef.cpp
@@ -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");
diff --git a/src/mathed/InsetMathRef.cpp b/src/mathed/InsetMathRef.cpp
index 4215120..97591dc 100644
--- a/src/mathed/InsetMathRef.cpp
+++ b/src/mathed/InsetMathRef.cpp
@@ -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("") }
};
diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp
index d7af40c..fbd08c3 100644
--- a/src/mathed/MathParser.cpp
+++ b/src/mathed/MathParser.cpp
@@ -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();
diff --git a/status.23x b/status.23x
index 19a5d54..348128f 100644
--- a/status.23x
+++ b/status.23x
@@ -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