X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2Fpreamble.C;h=acb066814aeda319778ae5ee5000b572f1158ad8;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=a68d279d571988353173f88901d890e8c5411ac5;hpb=6a4f2b40db61684c8f9885120e5eb194d4e68133;p=lyx.git diff --git a/src/tex2lyx/preamble.C b/src/tex2lyx/preamble.C index a68d279d57..acb066814a 100644 --- a/src/tex2lyx/preamble.C +++ b/src/tex2lyx/preamble.C @@ -18,6 +18,7 @@ #include "lyxtextclass.h" #include "lyxlex.h" #include "support/filetools.h" +#include "support/lstrings.h" #include #include @@ -26,6 +27,9 @@ #include #include + +namespace lyx { + using std::istringstream; using std::ostream; using std::ostringstream; @@ -34,7 +38,8 @@ using std::vector; using std::cerr; using std::endl; -using lyx::support::libFileSearch; +using support::FileName; +using support::libFileSearch; // special columntypes extern std::map special_columns; @@ -483,10 +488,11 @@ LyXTextClass const parse_preamble(Parser & p, ostream & os, string const & force p.skip_spaces(); // Force textclass if the user wanted it - if (!forceclass.empty()) { + if (!forceclass.empty()) h_textclass = forceclass; - } - string layoutfilename = libFileSearch("layouts", h_textclass, "layout"); + if (noweb_mode && !lyx::support::prefixIs(h_textclass, "literate-")) + h_textclass.insert(0, "literate-"); + FileName layoutfilename = libFileSearch("layouts", h_textclass, "layout"); if (layoutfilename.empty()) { cerr << "Error: Could not find layout file for textclass \"" << h_textclass << "\"." << endl; exit(1); @@ -503,3 +509,6 @@ LyXTextClass const parse_preamble(Parser & p, ostream & os, string const & force } // }]) + + +} // namespace lyx