+ /// remove #n with from<=n<=to
+ void removeArguments(Cursor & cur, DocIterator const & inset_pos,
+ int from, int to);
+ /// shift every #n with from<=n, i.e. #n -> #(n-by)
+ void shiftArguments(size_t from, int by);
+ ///
+ void insertParameter(Cursor & cur, DocIterator const & inset_pos,
+ int pos, bool greedy = false, bool addarg = true);
+ ///
+ void removeParameter(Cursor & cur, DocIterator const & inset_pos,
+ int pos, bool greedy = false);
+ ///
+ void makeOptional(Cursor & cur, DocIterator const & inset_pos);
+ ///
+ void makeNonOptional(Cursor & cur, DocIterator const & inset_pos);
+ ///
+ idx_type defIdx() const { return optionals_ + 1; }
+ /// index of default value cell of optional parameter (#1 -> n=0)
+ idx_type optIdx(idx_type n) const { return n + 1; }
+ ///
+ idx_type displayIdx() const { return optionals_ + 2; }
+ ///
+ void updateLook() const;
+ /// look through the macro for #n arguments
+ int maxArgumentInDefinition() const;
+ /// add missing #n arguments up to \c maxArg
+ void insertMissingArguments(int maxArg);
+ /// change the arity
+ void changeArity(Cursor & cur, DocIterator const & inset_pos,
+ int newNumArg);
+ /// find arguments in definition and adapt the arity accordingly
+ void commitEditChanges(Cursor & cur, DocIterator const & inset_pos);
+ /// The representation of the macro template, with some holes to edit
+ mutable MathData look_;
+ ///
+ mutable int numargs_;
+ ///
+ mutable int argsInLook_;
+ ///
+ int optionals_;
+ /// keeps the old optional default value when an
+ /// optional argument is disabled
+ std::vector<MathData> optionalValues_;
+
+ /// (re)newcommand or def
+ mutable MacroType type_;
+ /// defined before already?
+ bool redefinition_;
+ ///
+ void createLook(int args) const;
+ ///
+ mutable bool lookOutdated_;
+ /// true if in pre-calculations of metrics to get height of boxes
+ mutable bool premetrics_;
+ ///
+ mutable int labelBoxAscent_;
+ ///
+ mutable int labelBoxDescent_;
+ ///
+ bool premetrics() const { return premetrics_; }