virtual InsetLayout const & getLayout() const;
///
virtual bool isPassThru() const { return getLayout().isPassThru(); }
+ /// Is this inset embedded in a title?
+ virtual bool isInTitle() const { return false; }
/// Is this inset's layout defined in the document's textclass?
bool undefined() const;
/// should this inset be handled like a normal character?
/////////////////////////////////////////////////////////////////////
InsetText::InsetText(Buffer * buf, UsePlain type)
- : Inset(buf), drawFrame_(false), frame_color_(Color_insetframe),
- text_(this, type == DefaultLayout)
+ : Inset(buf), drawFrame_(false), intitle_context_(false),
+ frame_color_(Color_insetframe), text_(this, type == DefaultLayout)
{
}
InsetText::InsetText(InsetText const & in)
- : Inset(in), text_(this, in.text_)
+ : Inset(in), intitle_context_(false), text_(this, in.text_)
{
drawFrame_ = in.drawFrame_;
frame_color_ = in.frame_color_;
cnt.restoreLastLayout();
// FIXME cnt.restoreLastCounter()?
}
+ // Record in this inset is embedded in a title layout
+ // This is needed to decide when \maketitle is output.
+ intitle_context_ = it.paragraph().layout().intitle;
} else {
DocumentClass const & tclass = buffer().masterBuffer()->params().documentClass();
// Note that we do not need to call:
///
virtual bool allowMultiPar() const { return getLayout().isMultiPar(); }
///
+ bool isInTitle() const { return intitle_context_; }
+ ///
/// should paragraphs be forced to use the empty layout?
virtual bool forcePlainLayout(idx_type = 0) const
{ return getLayout().forcePlainLayout(); }
///
bool drawFrame_;
///
+ bool intitle_context_;
+ ///
ColorCode frame_color_;
///
Text text_;
<< "}\n";
}
}
- } else if (runparams.need_maketitle && !runparams.have_maketitle && !layout.inpreamble) {
+ } else if (runparams.need_maketitle && !runparams.have_maketitle
+ && !layout.inpreamble && !text.inset().isInTitle()) {
if (tclass.titletype() == TITLE_ENVIRONMENT) {
os << "\\end{" << from_ascii(tclass.titlename())
<< "}\n";