X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2Fpreamble.C;h=acb066814aeda319778ae5ee5000b572f1158ad8;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=c8d3af3ff7e141a2c8ba548a8e61e96600f4d7dd;hpb=cf4293824f406c03e940bed6bf7274b57629a857;p=lyx.git diff --git a/src/tex2lyx/preamble.C b/src/tex2lyx/preamble.C index c8d3af3ff7..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; @@ -406,7 +411,8 @@ LyXTextClass const parse_preamble(Parser & p, ostream & os, string const & force ss << '{' << p.verbatim_item() << '}'; ss << '{' << p.verbatim_item() << '}'; if (name != "lyxcode" && name != "lyxlist" && - name != "lyxrightadress" && name != "lyxaddress") + name != "lyxrightadress" && + name != "lyxaddress" && name != "lyxgreyedout") h_preamble << ss.str(); } @@ -482,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); @@ -502,3 +509,6 @@ LyXTextClass const parse_preamble(Parser & p, ostream & os, string const & force } // }]) + + +} // namespace lyx