}
-docstring InsetIndex::getSeeAsText(OutputParams const & runparams) const
+docstring InsetIndex::getSeeAsText(OutputParams const & runparams,
+ bool const asLabel) const
{
Paragraph const & par = paragraphs().front();
InsetList::const_iterator it = par.insetList().begin();
InsetIndexMacro const & iim =
static_cast<InsetIndexMacro const &>(inset);
if (iim.params().type == InsetIndexMacroParams::See) {
- otexstringstream os;
- iim.getLatex(os, runparams);
- return os.str();
+ if (asLabel) {
+ docstring const l;
+ return iim.getNewLabel(l);
+ } else {
+ otexstringstream os;
+ iim.getLatex(os, runparams);
+ return os.str();
+ }
}
}
}
}
-std::vector<docstring> InsetIndex::getSeeAlsoesAsText(OutputParams const & runparams) const
+std::vector<docstring> InsetIndex::getSeeAlsoesAsText(OutputParams const & runparams,
+ bool const asLabel) const
{
std::vector<docstring> seeAlsoes;
InsetIndexMacro const & iim =
static_cast<InsetIndexMacro const &>(inset);
if (iim.params().type == InsetIndexMacroParams::Seealso) {
- otexstringstream os;
- iim.getLatex(os, runparams);
- seeAlsoes.emplace_back(os.str());
+ if (asLabel) {
+ docstring const l;
+ seeAlsoes.emplace_back(iim.getNewLabel(l));
+ } else {
+ otexstringstream os;
+ iim.getLatex(os, runparams);
+ seeAlsoes.emplace_back(os.str());
+ }
}
}
}
res += " " + docstring(1, char_type(0x2023));// TRIANGULAR BULLET
res += " " + sublbl;
}
+ docstring see = getSeeAsText(rp, true);
+ if (see.empty() && !getSeeAlsoesAsText(rp, true).empty())
+ see = getSeeAlsoesAsText(rp, true).front();
+ if (!see.empty()) {
+ res += " " + docstring(1, char_type(0x261e));// WHITE RIGHT POINTING INDEX
+ res += " " + see;
+ }
}
if (!insetindexpagerangetranslator_latex().find(params_.range).empty())
res += " " + from_ascii(insetindexpagerangetranslator_latex().find(params_.range));
str += " " + docstring(1, char_type(0x2023));// TRIANGULAR BULLET
str += " " + sublbl;
}
+ docstring see = getSeeAsText(rp, true);
+ if (see.empty() && !getSeeAlsoesAsText(rp, true).empty())
+ see = getSeeAlsoesAsText(rp, true).front();
+ if (!see.empty()) {
+ str += " " + docstring(1, char_type(0x261e));// WHITE RIGHT POINTING INDEX
+ str += " " + see;
+ }
}
string type = "index";
if (buffer().masterBuffer()->params().use_indices)
///
void getSeeRefs(otexstream &, OutputParams const &) const;
///
- docstring getSeeAsText(OutputParams const & runparams) const;
+ docstring getSeeAsText(OutputParams const & runparams,
+ bool const asLabel = false) const;
///
- std::vector<docstring> getSeeAlsoesAsText(OutputParams const & runparams) const;
+ std::vector<docstring> getSeeAlsoesAsText(OutputParams const & runparams,
+ bool const asLabel = false) const;
///
bool hasSubentries() const;
///