void getArgInsets(otexstream & os, OutputParams const & runparams, Layout::LaTeXArgMap const & latexargs,
- map<int, lyx::InsetArgument const *> ilist, vector<string> required, bool item)
+ map<int, lyx::InsetArgument const *> ilist, vector<string> required, string const & prefix)
{
unsigned int const argnr = latexargs.size();
if (argnr == 0)
Layout::LaTeXArgMap::const_iterator lait = latexargs.begin();
Layout::LaTeXArgMap::const_iterator const laend = latexargs.end();
for (; lait != laend; ++lait) {
- string const name = item ? "item:" + convert<string>(i) : convert<string>(i);
+ string const name = prefix + convert<string>(i);
if ((*lait).first == name) {
Layout::latexarg arg = (*lait).second;
if (arg.mandatory) {
void latexArgInsets(Paragraph const & par, otexstream & os,
- OutputParams const & runparams, Layout::LaTeXArgMap const & latexargs, bool item)
+ OutputParams const & runparams, Layout::LaTeXArgMap const & latexargs, string const & prefix)
{
map<int, InsetArgument const *> ilist;
vector<string> required;
if (ins->name().empty())
LYXERR0("Error: Unnamed argument inset!");
else {
- string const name = item ? split(ins->name(), ':') : ins->name();
+ string const name = prefix.empty() ? ins->name() : split(ins->name(), ':');
unsigned int const nr = convert<unsigned int>(name);
ilist[nr] = ins;
Layout::LaTeXArgMap::const_iterator const lit =
}
}
}
- getArgInsets(os, runparams, latexargs, ilist, required, item);
+ getArgInsets(os, runparams, latexargs, ilist, required, prefix);
}
void latexArgInsets(ParagraphList const & pars, ParagraphList::const_iterator pit,
- otexstream & os, OutputParams const & runparams, Layout::LaTeXArgMap const & latexargs)
+ otexstream & os, OutputParams const & runparams, Layout::LaTeXArgMap const & latexargs,
+ string const & prefix)
{
map<int, InsetArgument const *> ilist;
vector<string> required;
if (ins->name().empty())
LYXERR0("Error: Unnamed argument inset!");
else {
- string const name = ins->name();
+ string const name = prefix.empty() ? ins->name() : split(ins->name(), ':');
unsigned int const nr = convert<unsigned int>(name);
if (ilist.find(nr) == ilist.end())
ilist[nr] = ins;
}
}
}
- getArgInsets(os, runparams, latexargs, ilist, required, false);
+ getArgInsets(os, runparams, latexargs, ilist, required, prefix);
}
namespace {
os << "\\" + style.itemcommand();
// Item arguments
if (!style.itemargs().empty())
- latexArgInsets(par, os, runparams, style.itemargs(), true);
+ latexArgInsets(par, os, runparams, style.itemargs(), "item:");
os << " ";
break;
case LATEX_BIB_ENVIRONMENT:
os << "\\" << from_ascii(font.latexSize()) << " \\par}";
} else if (is_command) {
os << '}';
+ if (!style.postcommandargs().empty())
+ latexArgInsets(par, os, runparams, style.postcommandargs(), "post:");
if (runparams.encoding != prev_encoding) {
runparams.encoding = prev_encoding;
if (!runparams.isFullUnicode())