#define MATH_MATHMLSTREAM_H
#include "InsetMath.h"
+
+#include "TexRow.h"
#include "texstream.h"
#include "support/Changer.h"
class InsetMath;
class MathAtom;
class MathData;
-struct RowEntry;
//
// LaTeX/LyX
wsPreview
};
///
+ enum UlemCmdType {
+ NONE,
+ UNDERLINE,
+ STRIKEOUT
+ };
+ ///
explicit WriteStream(otexrowstream & os, bool fragile = false,
bool latex = false, OutputType output = wsDefault,
Encoding const * encoding = 0);
void canBreakLine(bool breakline) { canbreakline_ = breakline; }
/// tell whether we can write an immediately following newline char
bool canBreakLine() const { return canbreakline_; }
+ /// record whether we have to take care for striking out display math
+ void strikeoutMath(bool mathsout) { mathsout_ = mathsout; }
+ /// tell whether we have to take care for striking out display math
+ bool strikeoutMath() const { return mathsout_; }
+ /// record which ulem command type we are inside
+ void ulemCmd(UlemCmdType ulemcmd) { ulemcmd_ = ulemcmd; }
+ /// tell which ulem command type we are inside
+ UlemCmdType ulemCmd() const { return ulemcmd_; }
+ /// record whether we are in the optional argument of a math macro
+ void insideMacroOpt(bool inopt) { insidemacro_opt_ = inopt; }
+ /// tell whether we are in the optional argument of a math macro
+ bool insideMacroOpt() const { return insidemacro_opt_; }
/// writes space if next thing is isalpha()
void pendingSpace(bool how);
/// writes space if next thing is isalpha()
Encoding const * encoding() const { return encoding_; }
/// Temporarily change the TexRow information about the outer row entry.
- Changer changeRowEntry(RowEntry entry);
+ Changer changeRowEntry(TexRow::RowEntry entry);
/// TexRow::starts the innermost outer math inset
/// returns true if the outer row entry will appear at this line
bool startOuterRow();
int latex_;
/// output type (default, source preview, instant preview)?
OutputType output_;
+ /// are we in the optional argument of a math macro?
+ bool insidemacro_opt_;
/// do we have a space pending?
bool pendingspace_;
/// do we have a brace pending?
bool ascii_;
/// are we allowed to output an immediately following newline?
bool canbreakline_;
+ /// should we take care for striking out display math?
+ bool mathsout_;
+ /// what ulem command are we inside (none, underline, strikeout)?
+ UlemCmdType ulemcmd_;
///
int line_;
///
Encoding const * encoding_;
/// Row entry we are in
- /// (it is a pointer to allow forward-declaration)
- unique_ptr<RowEntry> row_entry_;
+ TexRow::RowEntry row_entry_;
};
///
*
* A local variable of this type can be used to either ensure math mode
* or delay the writing of a pending brace when outputting LaTeX.
- * A LyX MathMacro is always assumed needing a math mode environment, while
+ * A LyX InsetMathMacro is always assumed needing a math mode environment, while
* no assumption is made for macros defined through \newcommand or \def.
*
* Example 1:
* to be specified. Only the following 3 different cases are handled.
*
* When the needs_mathmode parameter is true the behavior is as in Example 1.
- * This is the case for a LyX MathMacro or a macro not tagged as textmode.
+ * This is the case for a LyX InsetMathMacro or a macro not tagged as textmode.
*
* When the needs_mathmode and textmode_macro parameters are both false the
* macro is left in the same (text or math mode) environment it was entered.
class MTag {
public:
///
- MTag(char const * const tag, std::string attr = "")
+ MTag(char const * const tag, std::string attr = "")
: tag_(tag), attr_(attr) {}
///
char const * const tag_;