#include "output_latex.h"
#include "output_xhtml.h"
#include "sgml.h"
+#include "texstream.h"
#include "TextClass.h"
#include "TocBackend.h"
}
// get contents of InsetText as LaTeX and plaintext
- TexRow texrow;
odocstringstream ourlatex;
- otexstream ots(ourlatex, texrow);
+ // FIXME: do Tex/Row correspondence (I don't currently understand what is
+ // being generated from latexstr below)
+ otexstream ots(ourlatex);
InsetText::latex(ots, runparams);
odocstringstream ourplain;
InsetText::plaintext(ourplain, runparams);
void InsetIndex::addToToc(DocIterator const & cpit, bool output_active,
- UpdateType utype) const
+ UpdateType utype, TocBackend & backend) const
{
DocIterator pit = cpit;
pit.push_back(CursorSlice(const_cast<InsetIndex &>(*this)));
type += ":" + to_utf8(params_.index);
// this is unlikely to be terribly long
text().forOutliner(str, INT_MAX);
- buffer().tocBackend().toc(type)->push_back(TocItem(pit, 0, str, output_active));
+ TocBuilder & b = backend.builder(type);
+ b.pushItem(pit, str, output_active);
// Proceed with the rest of the inset.
- InsetCollapsable::addToToc(cpit, output_active, utype);
+ InsetCollapsable::addToToc(cpit, output_active, utype, backend);
+ b.pop();
}
static ParamInfo param_info_;
if (param_info_.empty()) {
param_info_.add("type", ParamInfo::LATEX_OPTIONAL,
- ParamInfo::HANDLING_ESCAPE);
- param_info_.add("name", ParamInfo::LATEX_REQUIRED);
+ ParamInfo::HANDLING_ESCAPE);
+ param_info_.add("name", ParamInfo::LATEX_OPTIONAL,
+ ParamInfo::HANDLING_LATEXIFY);
+ param_info_.add("literal", ParamInfo::LYX_INTERNAL);
}
return param_info_;
}
}
+void InsetPrintIndex::updateBuffer(ParIterator const &, UpdateType)
+{
+ Index const * index =
+ buffer().masterParams().indiceslist().findShortcut(getParam("type"));
+ if (index)
+ setParam("name", index->index());
+}
+
+
void InsetPrintIndex::latex(otexstream & os, OutputParams const & runparams_in) const
{
if (!buffer().masterBuffer()->params().use_indices) {
if (getParam("type") == from_ascii("idx"))
- os << "\\printindex{}";
+ os << "\\printindex" << termcmd;
return;
}
OutputParams runparams = runparams_in;
features.require("makeidx");
if (buffer().masterBuffer()->params().use_indices)
features.require("splitidx");
+ InsetCommand::validate(features);
}