\begin_layout Plain Layout
Primary
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\end_inset
Primary
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\begin_layout Plain Layout
Primary
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\end_inset
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\begin_layout Plain Layout
Primary
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\begin_layout Plain Layout
Primary
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\end_inset
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\begin_layout Plain Layout
A
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\begin_layout Plain Layout
A
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\end_inset
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\begin_layout Plain Layout
A
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\begin_layout Plain Layout
E
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\begin_layout Plain Layout
A
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\begin_layout Plain Layout
A
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\end_inset
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\begin_layout Plain Layout
A
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
\begin_layout Plain Layout
E
-\begin_inset IndexMacro subindex
+\begin_inset IndexMacro subentry
status open
\begin_layout Plain Layout
2022-10-29 Jürgen Spitzmüller <spitz@lyx.org>
* Format incremented to 610: InsetIndexMacros and new IndexInset params:
- - \begin_inset IndexMacro [see|seealso|subindex|sortkey], relating to
+ - \begin_inset IndexMacro [see|seealso|subentry|sortkey], relating to
\index{...|see{content}} -- see
\index{...|seealso{content}} -- seealso
- \index{...!subindex} -- subindex
+ \index{...!subentry} -- subentry
\index{sortkey@...} -- sortkey
see and see also are mutually exclusive
- \begin_inset Index
LabelString "Sort as"
End
-InsetLayout IndexMacro:subindex
+InsetLayout IndexMacro:subentry
CopyStyle IndexMacro:see
- LabelString "Subindex"
+ LabelString "Subentry"
End
InsetLayout Box
if j == -1:
document.warning("Malformed LyX document: Can't find end of index inset at line %d" % i)
continue
- # We search for all possible subindexes in turn, store their
+ # We search for all possible subentries in turn, store their
# content and delete them
see = []
seealso = []
- subindex = []
- subindex2 = []
+ subentry = []
+ subentry2 = []
sortkey = []
- # Two subindexes are allowed, thus the duplication
- imacros = ["seealso", "see", "subindex", "subindex", "sortkey"]
+ # Two subentries are allowed, thus the duplication
+ imacros = ["seealso", "see", "subentry", "subentry", "sortkey"]
for imacro in imacros:
iim = find_token(document.body, "\\begin_inset IndexMacro %s" % imacro, i, j)
if iim == -1:
seealso = icont[1:]
elif imacro == "see":
see = icont[1:]
- elif imacro == "subindex":
- # subindexes might hace their own sortkey!
+ elif imacro == "subentry":
+ # subentries might hace their own sortkey!
xiim = find_token(document.body, "\\begin_inset IndexMacro sortkey", iimpl, iimple)
if xiim != -1:
xiime = find_end_of_inset(document.body, xiim)
xicont = document.body[xiimpl:xiimple]
xxicont = document.body[iimpl:xiimpl] + document.body[xiimple+1:iimple]
icont = xicont + put_cmd_in_ert("@") + xxicont[1:]
- if len(subindex) > 0:
- subindex2 = icont[1:]
+ if len(subentry) > 0:
+ subentry2 = icont[1:]
else:
- subindex = icont[1:]
+ subentry = icont[1:]
elif imacro == "sortkey":
sortkey = icont
# Everything stored. Delete subinset.
document.body[ple:ple] = put_cmd_in_ert("|" + pagerange + "seealso{") + seealso + put_cmd_in_ert("}")
elif pageformat != "default":
document.body[ple:ple] = put_cmd_in_ert("|" + pagerange + pageformat)
- if len(subindex2) > 0:
- document.body[ple:ple] = put_cmd_in_ert("!") + subindex2
- if len(subindex) > 0:
- document.body[ple:ple] = put_cmd_in_ert("!") + subindex
+ if len(subentry2) > 0:
+ document.body[ple:ple] = put_cmd_in_ert("!") + subentry2
+ if len(subentry) > 0:
+ document.body[ple:ple] = put_cmd_in_ert("!") + subentry
if len(sortkey) > 0:
document.body[pl:pl+1] = document.body[pl:pl] + sortkey + put_cmd_in_ert("@")
End
Menu "context-edit-index"
- OptItem "Insert Subentry|b" "indexmacro-insert subindex"
+ OptItem "Insert Subentry|b" "indexmacro-insert subentry"
OptItem "Insert Sortkey|k" "indexmacro-insert sortkey"
OptItem "Insert See Reference|e" "indexmacro-insert see"
OptItem "Insert See also Reference|a" "indexmacro-insert seealso"
End
Menu "index_properties"
- OptItem "Subentry|b" "indexmacro-insert subindex"
+ OptItem "Subentry|b" "indexmacro-insert subentry"
OptItem "Sortkey|k" "indexmacro-insert sortkey"
OptItem "See|e" "indexmacro-insert see"
OptItem "See also|a" "indexmacro-insert seealso"
* \var lyx::FuncCode lyx::LFUN_INDEXMACRO_INSERT
* \li Action: Inserts special Index macros into the document.
* \li Syntax: indexmacro-insert <type>
- * \li Params: <type>: see, seealso, subindex, sortkey.
+ * \li Params: <type>: see, seealso, subentry, sortkey.
* \li Origin: spitz, 20 Feb 2022
* \endvar
*/
case LFUN_INDEXMACRO_INSERT: {
string const arg = cmd.getArg(0);
if (arg != "see" && arg != "seealso"
- && arg != "subindex" && arg != "sortkey") {
- LYXERR0("LFUN_IPAMACRO_INSERT: wrong argument");
+ && arg != "subentry" && arg != "sortkey") {
+ LYXERR0("LFUN_INDEXMACRO_INSERT: wrong argument");
return nullptr;
}
return new InsetIndexMacro(buf, arg);
case LFUN_PARAGRAPH_BREAK: {
// Since this inset in single-par anyway, let's use
- // return to enter subindexes
- FuncRequest fr(LFUN_INDEXMACRO_INSERT, "subindex");
+ // return to enter subentryes
+ FuncRequest fr(LFUN_INDEXMACRO_INSERT, "subentry");
lyx::dispatch(fr);
break;
}
}
case LFUN_PARAGRAPH_BREAK:
- return macrosPossible("subindex");
+ return macrosPossible("subentry");
case LFUN_INDEXMACRO_INSERT:
return macrosPossible(cmd.getArg(0));
if (inset.lyxCode() == INDEXMACRO_CODE) {
InsetIndexMacro const & iim =
static_cast<InsetIndexMacro const &>(inset);
- if (iim.params().type == InsetIndexMacroParams::Subindex) {
+ if (iim.params().type == InsetIndexMacroParams::Subentry) {
++i;
if (i > 2)
return;
if (inset.lyxCode() == INDEXMACRO_CODE) {
InsetIndexMacro const & iim =
static_cast<InsetIndexMacro const &>(inset);
- if (iim.params().type == InsetIndexMacroParams::Subindex) {
+ if (iim.params().type == InsetIndexMacroParams::Subentry) {
++i;
if (i > 2)
break;
bool InsetIndex::hasSubentries() const
{
- return hasInsetWithCode(this, INDEXMACRO_CODE, {InsetIndexMacroParams::Subindex});
+ return hasInsetWithCode(this, INDEXMACRO_CODE, {InsetIndexMacroParams::Subentry});
}
bool InsetIndex::macrosPossible(string const type) const
{
if (type != "see" && type != "seealso"
- && type != "sortkey" && type != "subindex")
+ && type != "sortkey" && type != "subentry")
return false;
Paragraph const & par = paragraphs().front();
&& (iim.params().type == InsetIndexMacroParams::See
|| iim.params().type == InsetIndexMacroParams::Seealso))
return false;
- if (type == "subindex"
- && iim.params().type == InsetIndexMacroParams::Subindex) {
+ if (type == "subentry"
+ && iim.params().type == InsetIndexMacroParams::Subentry) {
++subidxs;
if (subidxs > 1)
return false;
{
InsetIndexMacroTranslator translator("see", InsetIndexMacroParams::See);
translator.addPair("seealso", InsetIndexMacroParams::Seealso);
- translator.addPair("subindex", InsetIndexMacroParams::Subindex);
+ translator.addPair("subentry", InsetIndexMacroParams::Subentry);
translator.addPair("sortkey", InsetIndexMacroParams::Sortkey);
return translator;
}
{
InsetIndexMacroTranslatorLoc translator(_("See"), InsetIndexMacroParams::See);
translator.addPair(_("See also"), InsetIndexMacroParams::Seealso);
- translator.addPair(_("Subindex"), InsetIndexMacroParams::Subindex);
+ translator.addPair(_("Subentry"), InsetIndexMacroParams::Subentry);
translator.addPair(_("Sort as"), InsetIndexMacroParams::Sortkey);
return translator;
}
void InsetIndexMacro::getLatex(otexstream & os, OutputParams const & runparams) const
{
- if (params_.type == InsetIndexMacroParams::Subindex) {
+ if (params_.type == InsetIndexMacroParams::Subentry) {
if (hasSortKey()) {
getSortkey(os, runparams);
os << "@";
case INDEX_CODE:
return false;
case INDEXMACRO_SORTKEY_CODE:
- return (params_.type == InsetIndexMacroParams::Subindex
+ return (params_.type == InsetIndexMacroParams::Subentry
&& !hasSortKey());
default:
return InsetCollapsible::insetAllowed(code);
enum Type {
See,
Seealso,
- Subindex,
+ Subentry,
Sortkey
};
///
p.get_token();
os << "\\begin_layout Plain Layout\n";
} else {
- begin_inset(os, "IndexMacro subindex");
+ begin_inset(os, "IndexMacro subentry");
os << "\nstatus collapsed\n";
}
// Check for (level-specific) sortkey
main = false;
}
if (!main) {
- begin_inset(os, "IndexMacro subindex");
+ begin_inset(os, "IndexMacro subentry");
os << "\nstatus collapsed\n";
}
// Final level
os << "\n\\end_layout\n";
} else {
if (post.empty() && !startrange && !endrange) {
- parse_text_in_inset(p, os, FLAG_BRACE_LAST, false, context, "IndexMacro subindex");
+ parse_text_in_inset(p, os, FLAG_BRACE_LAST, false, context, "IndexMacro subentry");
p.dropPosition();
} else {
// Handle post-argument