Inset * MathMacroTemplate::clone() const
{
- return new MathMacroTemplate(*this);
+ MathMacroTemplate * inset = new MathMacroTemplate(*this);
+ // the parent pointers of the proxy insets above will point to
+ // to the old template. Hence, the look must be updated.
+ inset->updateLook();
+ return inset;
}
}
-void MathMacroTemplate::write(WriteStream & os, bool /*overwriteRedefinition*/) const
+void MathMacroTemplate::write(WriteStream & os, bool overwriteRedefinition) const
{
// newcommand or renewcommand
if (os.latex() && optionals_ > 1)
os << "\\newlyxcommand";
else {
- if (redefinition_)
+ if (redefinition_ && !overwriteRedefinition)
os << "\\renewcommand";
else
os << "\\newcommand";