}
-string MathHullInset::fileInsetLabel() const
-{
- return "Formula";
-}
-
-
/////////////////////////////////////////////////////////////////////
#include "formulamacro.h"
void MathHullInset::write(Buffer const &, std::ostream & os) const
{
WriteStream wi(os, false, false);
- os << fileInsetLabel() << ' ';
+ os << "Formula ";
write(wi);
}
}
-int MathHullInset::latex(Buffer const &, ostream & os,
- OutputParams const & runparams) const
-{
- WriteStream wi(os, runparams.moving_arg, true);
- write(wi);
- return wi.line();
-}
-
-
int MathHullInset::plaintext(Buffer const &, ostream & os,
OutputParams const &) const
{
///
bool idxLast(LCursor &) const;
- ///
- std::string fileInsetLabel() const;
///
void write(WriteStream & os) const;
///
///
void read(Buffer const &, LyXLex & lex);
///
- int latex(Buffer const &, std::ostream &,
- OutputParams const &) const;
- ///
int plaintext(Buffer const &, std::ostream &,
OutputParams const &) const;
///
at->write(wi);
return os;
}
-
-
-string MathInset::fileInsetLabel() const
-{
- return "Formula";
-}
virtual std::string const & getType() const;
/// change type
virtual void mutate(std::string const &) {}
- /// how is the inset called in the .lyx file?
- virtual std::string fileInsetLabel() const;
/// usually the latex name
virtual std::string name() const;
};
#include "bufferparams.h"
#include "debug.h"
#include "metricsinfo.h"
+#include "output_latex.h"
#include "paragraph.h"
+#include "texrow.h"
using std::auto_ptr;
using std::endl;
void MathMBoxInset::draw(PainterInfo & pi, int x, int y) const
{
- text_.draw(pi, x + 1, y);
+ text_.draw(pi, x + 1, y - text_.ascent());
drawMarkers(pi, x, y);
- setPosCache(pi, x, y);
}
}
+int MathMBoxInset::latex(Buffer const & buf, std::ostream & os,
+ OutputParams const & runparams) const
+{
+ os << "\\mbox{\n";
+ TexRow texrow;
+ latexParagraphs(buf, text_.paragraphs(), os, texrow, runparams);
+ os << "}";
+ return texrow.rows();
+}
+
+
void MathMBoxInset::priv_dispatch(LCursor & cur, FuncRequest & cmd)
{
text_.dispatch(cur, cmd);
void MathMBoxInset::getCursorPos(CursorSlice const & cur, int & x, int & y) const
{
x = text_.cursorX(cur);
- //y = text_.cursorY(cur);
- y = 100;
+ y = text_.cursorY(cur);
}
#include "math_diminset.h"
#include "lyxtext.h"
-class BufferView;
-
-// not yet a substitute for the real text inset...
+// almost a substitute for the real text inset...
class MathMBoxInset : public MathDimInset {
public:
///
void priv_dispatch(LCursor & cur, FuncRequest & cmd);
- ///
- void write(WriteStream & os) const;
///
bool inMathed() const { return false; }
+ ///
+ bool isActive() const { return true; }
+ ///
+ void write(WriteStream & os) const;
+ ///
+ int latex(Buffer const &, std::ostream & os,
+ OutputParams const & runparams) const;
///
LyXText * getText(int) const;
///
#include "BufferView.h"
#include "FuncStatus.h"
+#include "LColor.h"
#include "bufferview_funcs.h"
#include "cursor.h"
#include "debug.h"
#include "dispatchresult.h"
#include "funcrequest.h"
#include "gettext.h"
-#include "LColor.h"
+#include "outputparams.h"
#include "undo.h"
#include "support/std_sstream.h"
}
+int MathNestInset::latex(Buffer const &, std::ostream & os,
+ OutputParams const & runparams) const
+{
+ WriteStream wi(os, runparams.moving_arg, true);
+ write(wi);
+ return wi.line();
+}
+
+
void MathNestInset::notifyCursorLeaves(LCursor & cur)
{
/*
void write(WriteStream & os) const;
/// writes [, name(), and args in []
void normalize(NormalStream & os) const;
+ ///
+ int latex(Buffer const &, std::ostream & os,
+ OutputParams const & runparams) const;
protected:
///