lyxpreamble += oss.str();
}
- // Will be surrounded by \makeatletter and \makeatother when needed
+ // Will be surrounded by \makeatletter and \makeatother when not empty
docstring atlyxpreamble;
// Some macros LyX will need
+ tmppreamble + '\n';
/* the user-defined preamble */
- if (!preamble.empty())
+ if (!containsOnly(preamble, " \n\t"))
// FIXME UNICODE
atlyxpreamble += "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% "
"User specified LaTeX commands.\n"
if (!bullets_def.empty())
atlyxpreamble += bullets_def + "}\n\n";
- if (atlyxpreamble.find(from_ascii("@")) != docstring::npos)
+ if (!atlyxpreamble.empty())
lyxpreamble += "\n\\makeatletter\n"
+ atlyxpreamble + "\\makeatother\n\n";
- else
- lyxpreamble += '\n' + atlyxpreamble;
// We try to load babel late, in case it interferes with other packages.
// Jurabib and Hyperref have to be called after babel, though.