#include "support/lstrings.h"
#include "debug.h"
+using std::ostream;
+using std::endl;
ostream & operator<<(ostream & o, MathedTextCodes mtc)
{
}
-void MathMacro::Write(ostream & os)
+void MathMacro::Write(ostream & os, bool fragile)
{
if (tmplate->flags & MMF_Exp) {
lyxerr[Debug::MATHED] << "Expand " << tmplate->flags
<< ' ' << MMF_Exp << endl;
tmplate->update(this);
- tmplate->Write(os);
+ tmplate->Write(os, fragile);
} else {
if (tmplate->flags & MMF_Env) {
os << "\\begin{"
for (int i = 0; i < nargs; ++i) {
array = args[i].array;
- MathParInset::Write(os);
+ MathParInset::Write(os, fragile);
if (i < nargs - 1)
os << "}{";
}
MathParInset::draw(pain, x, baseline);
} else {
#ifdef HAVE_SSTREAM
- ostringstream ost;
+ std::ostringstream ost;
ost << '#' << number;
drawStr(pain, LM_TC_TEX, size, x, baseline,
reinterpret_cast<byte const *>(ost.str().c_str()), 2);
MathParInset::Metrics();
} else {
#ifdef HAVE_SSTREAM
- ostringstream ost;
+ std::ostringstream ost;
ost << '#' << number;
width = mathed_string_width(LM_TC_TEX, size,
reinterpret_cast<byte const *>(ost.str().c_str()), 2);
}
-void MathMacroArgument::Write(ostream & os)
+void MathMacroArgument::Write(ostream & os, bool fragile)
{
if (expnd_mode) {
- MathParInset::Write(os);
+ MathParInset::Write(os, fragile);
} else {
os << '#' << number << ' ';
}
}
-void MathMacroTemplate::WriteDef(ostream & os)
+void MathMacroTemplate::WriteDef(ostream & os, bool fragile)
{
os << "\n\\newcommand{\\" << name << "}";
for (int i = 0; i < nargs; ++i) {
args[i].setExpand(false);
}
- Write(os);
+ Write(os, fragile);
os << "}\n";
}