#include "tex2lyx.h"
+#include "LayoutFile.h"
#include "Layout.h"
#include "Lexer.h"
#include "TextClass.h"
+
#include "support/convert.h"
+#include "support/FileName.h"
#include "support/filetools.h"
#include "support/lstrings.h"
} // anonymous namespace
-TextClass const parse_preamble(Parser & p, ostream & os, string const & forceclass)
+void parse_preamble(Parser & p, ostream & os,
+ string const & forceclass, TeX2LyXDocClass & tc)
{
// initialize fixed types
special_columns['D'] = 3;
p.setCatCode('@', catOther);
}
- else if (t.cs() == "newcommand" || t.cs() == "renewcommand"
- || t.cs() == "providecommand") {
+ else if (t.cs() == "newcommand"
+ || t.cs() == "renewcommand"
+ || t.cs() == "providecommand"
+ || t.cs() == "newlyxcommand") {
bool star = false;
if (p.next_token().character() == '*') {
p.get_token();
cerr << "Error: Could not find layout file for textclass \"" << h_textclass << "\"." << endl;
exit(1);
}
- TextClass textclass;
- textclass.read(layoutfilename);
+ tc.read(layoutfilename);
if (h_papersides.empty()) {
ostringstream ss;
- ss << textclass.sides();
+ ss << tc.sides();
h_papersides = ss.str();
}
- end_preamble(os, textclass);
- return textclass;
+ end_preamble(os, tc);
}
// }])