-----------------------
+2010-07-16 Richard Heck <rgheck@comcast.net>
+ * Format incremented to 397 (r34884)
+ Remove Nameref support
+
2010-07-13 Richard Heck <rgheck@comcast.net>
* Format incremented to 396 (r34884)
nameref support
add_to_preamble(document, "\usepackage{nameref}")
+def remove_Nameref(document):
+ " Convert Nameref commands to nameref commands "
+ i = 0
+ while 1:
+ # It seems better to look for this, as most of the reference
+ # insets won't be ones we care about.
+ i = find_token(document.body, "LatexCommand Nameref" , i)
+ if i == -1:
+ break
+ cmdloc = i
+ i += 1
+
+ # Make sure it is actually in an inset!
+ # We could just check document.lines[i-1], but that relies
+ # upon something that might easily change.
+ # We'll look back a few lines.
+ stins = cmdloc - 10
+ if stins < 0:
+ stins = 0
+ stins = find_token(document.body, "\\begin_inset CommandInset ref", stins)
+ if stins == -1 or stins > cmdloc:
+ continue
+ endins = find_end_of_inset(document.body, stins)
+ if endins == -1:
+ document.warning("Can't find end of inset at line " + stins + "!!")
+ continue
+ if endins < cmdloc:
+ continue
+ document.body[cmdloc] = "LatexCommand nameref"
##
[393, [convert_optarg]],
[394, []],
[395, []],
- [396, []]
+ [396, []],
+ [397, [remove_Nameref]]
]
-revert = [[395, [revert_nameref]],
+revert = [[396, []],
+ [395, [revert_nameref]],
[394, [revert_DIN_C_pagesizes]],
[393, [revert_makebox]],
[392, [revert_argument]],
Item "<Reference> on Page <Page>|f" "inset-modify changetype vref"
Item "Formatted Reference|t" "inset-modify changetype prettyref"
Item "Textual Reference|x" "inset-modify changetype nameref"
- Item "Textual Reference plus <page>|l" "inset-modify changetype Nameref"
Separator
Item "Settings...|S" "inset-settings"
End
// Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own.
-int const LYX_FORMAT = 396; // rgh: nameref
+int const LYX_FORMAT = 397; // rgh: remove Nameref support
typedef map<string, bool> DepClean;
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
|| s == "vpageref"
|| s == "prettyref"
|| s == "eqref"
- || s == "nameref"
- || s == "Nameref";
+ || s == "nameref";
}
else if (cmd == "prettyref"
// we don't really have the ability to handle these
// properly in XHTML output
- || cmd == "nameref" || cmd == "Nameref")
+ || cmd == "nameref")
display_string = il->prettyCounter();
} else
display_string = ref;
features.require("prettyref");
else if (cmd == "eqref")
features.require("amsmath");
- else if (cmd == "nameref" || cmd == "Nameref")
+ else if (cmd == "nameref")
features.require("nameref");
}
{ "vref", N_("Standard+Textual Page"), N_("Ref+Text: ")},
{ "prettyref", N_("PrettyRef"), N_("FrmtRef: ")},
{ "nameref", N_("Reference to Name"), N_("NameRef:")},
- { "Nameref", N_("Name+Textual Page"), N_("NamePgRef:")},
{ "", "", "" }
};