void MathMacro::Write(ostream & os)
{
+#ifdef USE_OSTREAM_ONLY
+ if (tmplate->flags & MMF_Exp) {
+ lyxerr[Debug::MATHED] << "Expand " << tmplate->flags
+ << ' ' << MMF_Exp << endl;
+ tmplate->update(this);
+ tmplate->Write(os);
+ } else {
+ if (tmplate->flags & MMF_Env) {
+ os << "\\begin{"
+ << name
+ << "} ";
+ } else {
+ os << '\\' << name;
+ }
+// if (options) {
+// file += '[';
+// file += options;
+// file += ']';
+// }
+
+ if (!(tmplate->flags & MMF_Env) && nargs > 0)
+ os << '{';
+
+ for (int i = 0; i < nargs; ++i) {
+ array = args[i].array;
+ MathParInset::Write(os);
+ if (i < nargs - 1)
+ os << "}{";
+ }
+ if (tmplate->flags & MMF_Env) {
+ os << "\\end{"
+ << name
+ << '}';
+ } else {
+ if (nargs > 0)
+ os << '}';
+ else
+ os << ' ';
+ }
+ }
+#else
string output;
MathMacro::Write(output);
os << output;
+#endif
}
+#ifndef USE_OSTREAM_ONLY
void MathMacro::Write(string &file)
{
if (tmplate->flags & MMF_Exp) {
}
}
}
-
+#endif
/*--------------- Macro argument -----------------------------------*/
void MathMacroArgument::Write(ostream & os)
{
+#ifdef USE_OSTREAM_ONLY
+ if (expnd_mode) {
+ MathParInset::Write(os);
+ } else {
+ os << '#' << number << ' ';
+ }
+#else
string output;
MathMacroArgument::Write(output);
os << output;
+#endif
}
+#ifndef USE_OSTREAM_ONLY
void MathMacroArgument::Write(string & file)
{
if (expnd_mode) {
file += ' ';
}
}
+#endif
/* --------------------- MathMacroTemplate ---------------------------*/
}
+#ifndef USE_OSTREAM_ONLY
void MathMacroTemplate::WriteDef(string & file)
{
file += "\n\\newcommand{\\";
Write(file);
file += "}\n";
}
+#endif
void MathMacroTemplate::setArgument(LyxArrayBase * a, int i)
/* -------------------------- MathMacroTable -----------------------*/
-MathMacroTable::MathMacroTable(int n): max_macros(n)
+MathMacroTable::MathMacroTable(int n) : max_macros(n)
{
macro_table = new MathMacroTemplateP[max_macros];
num_macros = 0;