X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fbuffer.C;h=3e6a4e3a2b11cf6e0d61de0627490985655117af;hb=342932ad32b6eb9afc0845717d2e3f25433bb5f1;hp=acda02ef18a14878a951d80f4d3d94d71655e851;hpb=35dc964fe7deb9ea39503d5524a15ff4eea9ce5c;p=lyx.git diff --git a/src/buffer.C b/src/buffer.C index acda02ef18..3e6a4e3a2b 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -45,6 +45,7 @@ #include "BufferView.h" #include "ParagraphParameters.h" #include "iterators.h" +#include "lyxtextclasslist.h" #include "mathed/formulamacro.h" #include "mathed/formula.h" @@ -92,6 +93,7 @@ #include "support/lyxlib.h" #include "support/FileInfo.h" #include "support/lyxmanip.h" +#include "support/lyxalgo.h" // for lyx::count #include #include @@ -147,21 +149,26 @@ extern int tex_code_break_column; Buffer::Buffer(string const & file, bool ronly) + : paragraph(0), lyx_clean(true), bak_clean(true), + unnamed(false), dep_clean(0), read_only(ronly), + filename_(file), users(0) { lyxerr[Debug::INFO] << "Buffer::Buffer()" << endl; - filename = file; - filepath = OnlyPath(file); - paragraph = 0; - lyx_clean = true; - bak_clean = true; - dep_clean = 0; - read_only = ronly; - unnamed = false; - users = 0; +// filename = file; + filepath_ = OnlyPath(file); +// paragraph = 0; +// lyx_clean = true; +// bak_clean = true; +// dep_clean = 0; +// read_only = ronly; +// unnamed = false; +// users = 0; lyxvc.buffer(this); - if (read_only || (lyxrc.use_tempdir)) { + if (read_only || lyxrc.use_tempdir) { tmppath = CreateBufferTmpDir(); - } else tmppath.erase(); + } else { + tmppath.erase(); + } } @@ -193,7 +200,7 @@ Buffer::~Buffer() string const Buffer::getLatexName(bool no_path) const { - string const name = ChangeExtension(MakeLatexName(filename), ".tex"); + string const name = ChangeExtension(MakeLatexName(fileName()), ".tex"); if (no_path) return OnlyFilename(name); else @@ -266,9 +273,9 @@ void Buffer::resetAutosaveTimers() const void Buffer::setFileName(string const & newfile) { - filename = MakeAbsPath(newfile); - filepath = OnlyPath(filename); - setReadonly(IsFileWriteable(filename) == 0); + filename_ = MakeAbsPath(newfile); + filepath_ = OnlyPath(filename_); + setReadonly(IsFileWriteable(filename_) == 0); updateTitles(); } @@ -286,6 +293,7 @@ struct ErtComp string contents; bool active; bool in_tabular; + LyXFont font; }; std::stack ert_stack; @@ -330,7 +338,7 @@ bool Buffer::readLyXformat2(LyXLex & lex, Paragraph * par) } else { // We are inserting into an existing document users->text->breakParagraph(users); - first_par = users->text->firstParagraph(); + first_par = users->text->ownerParagraph(); pos = 0; markDirty(); // We don't want to adopt the parameters from the @@ -394,16 +402,13 @@ bool Buffer::readLyXformat2(LyXLex & lex, Paragraph * par) #ifndef NO_COMPABILITY -void Buffer::insertErtContents(Paragraph * par, int & pos, - LyXFont const & f, bool set_inactive) +void Buffer::insertErtContents(Paragraph * par, int & pos, bool set_inactive) { if (!ert_comp.contents.empty()) { lyxerr[Debug::INSETS] << "ERT contents:\n'" << ert_comp.contents << "'" << endl; Inset * inset = new InsetERT(ert_comp.contents, true); - LyXFont font; - font.setLanguage(f.language()); - par->insertInset(pos++, inset, font); + par->insertInset(pos++, inset, ert_comp.font); ert_comp.contents.erase(); } if (set_inactive) { @@ -456,16 +461,22 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, #ifndef NO_COMPABILITY ert_comp.in_tabular = false; // Do the insetert. - insertErtContents(par, pos, font); + insertErtContents(par, pos); #endif lex.eatLine(); string const layoutname = lex.getString(); + //lyxerr << "Looking for layout '" + // << layoutname << "'!" << endl; + pair pp = textclasslist.NumberOfLayout(params.textclass, layoutname); + //lyxerr << "Result: " << pp.first << "/" << pp.second << endl; + #ifndef NO_COMPABILITY if (compare_no_case(layoutname, "latex") == 0) { ert_comp.active = true; + ert_comp.font = font; } #endif #ifdef USE_CAPTION @@ -536,6 +547,9 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, } else { // layout not found // use default layout "Standard" (0) + //lyxerr << "Layout '" << layoutname + // << "' was not found!" << endl; + par->layout = 0; ++unknown_layouts; string const s = _("Layout had to be changed from\n") @@ -566,8 +580,8 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, #ifndef NO_COMPABILITY } else if (token == "\\begin_float") { - insertErtContents(par, pos, font); - //insertErtContents(par, pos, font, false); + insertErtContents(par, pos); + //insertErtContents(par, pos, false); //ert_stack.push(ert_comp); //ert_comp = ErtComp(); @@ -657,7 +671,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, inset->read(this, nylex); par->insertInset(pos, inset, font); ++pos; - insertErtContents(par, pos, font); + insertErtContents(par, pos); #endif } else if (token == "\\begin_deeper") { ++depth; @@ -728,21 +742,25 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, par->params().startOfAppendix(true); } else if (token == "\\paragraph_separation") { int tmpret = lex.findToken(string_paragraph_separation); - if (tmpret == -1) ++tmpret; + if (tmpret == -1) + ++tmpret; if (tmpret != LYX_LAYOUT_DEFAULT) params.paragraph_separation = static_cast(tmpret); } else if (token == "\\defskip") { lex.nextToken(); params.defskip = VSpace(lex.getString()); +#ifndef NO_COMPABILITY } else if (token == "\\epsfig") { // obsolete // Indeed it is obsolete, but we HAVE to be backwards // compatible until 0.14, because otherwise all figures // in existing documents are irretrivably lost. (Asger) params.readGraphicsDriver(lex); +#endif } else if (token == "\\quotes_language") { int tmpret = lex.findToken(string_quotes_language); - if (tmpret == -1) ++tmpret; + if (tmpret == -1) + ++tmpret; if (tmpret != LYX_LAYOUT_DEFAULT) { InsetQuotes::quote_language tmpl = InsetQuotes::EnglishQ; @@ -805,7 +823,8 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, params.use_numerical_citations = lex.getInteger(); } else if (token == "\\paperorientation") { int tmpret = lex.findToken(string_orientation); - if (tmpret == -1) ++tmpret; + if (tmpret == -1) + ++tmpret; if (tmpret != LYX_LAYOUT_DEFAULT) params.orientation = static_cast(tmpret); } else if (token == "\\paperwidth") { @@ -877,6 +896,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, //how can I put it back? } } else if (token == "\\bulletLaTeX") { + // The bullet class should be able to read this. lex.nextToken(); int const index = lex.getInteger(); lex.next(); @@ -893,6 +913,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, lex.next(); temp_str = lex.getString(); } + params.user_defined_bullets[index].setText(sum_str); params.temp_bullets[index].setText(sum_str); } else if (token == "\\secnumdepth") { @@ -963,12 +984,13 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, string const tok = lex.getString(); if (tok == "no_latex") { // Do the insetert. - insertErtContents(par, pos, font); + insertErtContents(par, pos); } else if (tok == "latex") { ert_comp.active = true; + ert_comp.font = font; } else if (tok == "default") { // Do the insetert. - insertErtContents(par, pos, font); + insertErtContents(par, pos); } else { lex.printError("Unknown LaTeX font flag " "`$$Token'"); @@ -1059,7 +1081,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, // the inset isn't it? Lgb. } else if (token == "\\begin_inset") { #ifndef NO_COMPABILITY - insertErtContents(par, pos, font, false); + insertErtContents(par, pos, false); ert_stack.push(ert_comp); ert_comp = ErtComp(); #endif @@ -1067,7 +1089,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, #ifndef NO_COMPABILITY ert_comp = ert_stack.top(); ert_stack.pop(); - insertErtContents(par, pos, font); + insertErtContents(par, pos); #endif } else if (token == "\\SpecialChar") { LyXLayout const & layout = @@ -1105,7 +1127,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, // Since we cannot know it this is only a regular // newline or a tabular cell delimter we have to // handle the ERT here. - insertErtContents(par, pos, font, false); + insertErtContents(par, pos, false); par->insertChar(pos, Paragraph::META_NEWLINE, font); ++pos; @@ -1161,7 +1183,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, #ifndef NO_COMPABILITY // If we still have some ert active here we have to insert // it so we don't loose it. (Lgb) - insertErtContents(par, pos, font); + insertErtContents(par, pos); #endif the_end_read = true; #ifndef NO_COMPABILITY @@ -1256,10 +1278,10 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, } InsetMinipage * mini = new InsetMinipage; mini->pos(static_cast(par->params().pextraAlignment())); - mini->width(par->params().pextraWidth()); + mini->pageWidth(LyXLength(par->params().pextraWidth())); if (!par->params().pextraWidthp().empty()) { - lyxerr << "WP:" << mini->width() << endl; - mini->width(tostr(par->params().pextraWidthp())+"%"); + lyxerr << "WP:" << mini->pageWidth().asString() << endl; + mini->pageWidth(LyXLength((par->params().pextraWidthp())+"%")); } Paragraph * op = mini->firstParagraph(); mini->inset.paragraph(par); @@ -1337,10 +1359,10 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, InsetMinipage * mini = new InsetMinipage; mini->pos(static_cast(minipar->params().pextraAlignment())); - mini->width(minipar->params().pextraWidth()); + mini->pageWidth(LyXLength(minipar->params().pextraWidth())); if (!par->params().pextraWidthp().empty()) { - lyxerr << "WP:" << mini->width() << endl; - mini->width(tostr(par->params().pextraWidthp())+"%"); + lyxerr << "WP:" << mini->pageWidth().asString() << endl; + mini->pageWidth(LyXLength((par->params().pextraWidthp())+"%")); } mini->inset.paragraph(minipar); @@ -1491,8 +1513,8 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par, } else if (tmptok == "Formula") { inset = new InsetFormula; } else if (tmptok == "Figure") { // Backward compatibility - inset = new InsetFig(100, 100, *this); - //inset = new InsetGraphics; +// inset = new InsetFig(100, 100, *this); + inset = new InsetGraphics; } else if (tmptok == "Graphics") { inset = new InsetGraphics; } else if (tmptok == "Info") {// backwards compatibility @@ -1680,7 +1702,7 @@ bool Buffer::writeFile(string const & fname, bool flag) const // warnings, only cerr. // Needed for autosave in background or panic save (Matthias 120496) - if (read_only && (fname == filename)) { + if (read_only && (fname == fileName())) { // Here we should come with a question if we should // perform the write anyway. if (flag) @@ -1768,178 +1790,219 @@ bool Buffer::writeFile(string const & fname, bool flag) const string const Buffer::asciiParagraph(Paragraph const * par, - unsigned int linelen) const + unsigned int linelen, + bool noparbreak) const { ostringstream buffer; + ostringstream word; Paragraph::depth_type depth = 0; int ltype = 0; Paragraph::depth_type ltype_depth = 0; string::size_type currlinelen = 0; bool ref_printed = false; - - int noparbreak = 0; - int islatex = 0; - if (!par->previous()) { - // begins or ends a deeper area ? - if (depth != par->params().depth()) { - if (par->params().depth() > depth) { - while (par->params().depth() > depth) { - ++depth; - } - } else { - while (par->params().depth() < depth) { - --depth; - } +// if (!par->previous()) { +#if 0 + // begins or ends a deeper area ? + if (depth != par->params().depth()) { + if (par->params().depth() > depth) { + while (par->params().depth() > depth) { + ++depth; } - } - - // First write the layout - string const tmp = textclasslist.NameOfLayout(params.textclass, par->layout); - if (tmp == "Itemize") { - ltype = 1; - ltype_depth = depth + 1; - } else if (tmp == "Enumerate") { - ltype = 2; - ltype_depth = depth + 1; - } else if (contains(tmp, "ection")) { - ltype = 3; - ltype_depth = depth + 1; - } else if (contains(tmp, "aragraph")) { - ltype = 4; - ltype_depth = depth + 1; - } else if (tmp == "Description") { - ltype = 5; - ltype_depth = depth + 1; - } else if (tmp == "Abstract") { - ltype = 6; - ltype_depth = 0; - } else if (tmp == "Bibliography") { - ltype = 7; - ltype_depth = 0; } else { - ltype = 0; - ltype_depth = 0; + while (par->params().depth() < depth) { + --depth; + } } + } +#else + depth = par->params().depth(); +#endif - /* maybe some vertical spaces */ + // First write the layout + string const tmp = textclasslist.NameOfLayout(params.textclass, par->layout); + if (tmp == "Itemize") { + ltype = 1; + ltype_depth = depth + 1; + } else if (tmp == "Enumerate") { + ltype = 2; + ltype_depth = depth + 1; + } else if (contains(tmp, "ection")) { + ltype = 3; + ltype_depth = depth + 1; + } else if (contains(tmp, "aragraph")) { + ltype = 4; + ltype_depth = depth + 1; + } else if (tmp == "Description") { + ltype = 5; + ltype_depth = depth + 1; + } else if (tmp == "Abstract") { + ltype = 6; + ltype_depth = 0; + } else if (tmp == "Bibliography") { + ltype = 7; + ltype_depth = 0; + } else { + ltype = 0; + ltype_depth = 0; + } - /* the labelwidthstring used in lists */ + /* maybe some vertical spaces */ - /* some lines? */ + /* the labelwidthstring used in lists */ - /* some pagebreaks? */ + /* some lines? */ - /* noindent ? */ + /* some pagebreaks? */ - /* what about the alignment */ - } else { - lyxerr << "Should this ever happen?" << endl; - } - - for (pos_type i = 0; i < par->size(); ++i) { - if (!i && !noparbreak) { + /* noindent ? */ + + /* what about the alignment */ +// } else { +// lyxerr << "Should this ever happen?" << endl; +// } + + // linelen <= 0 is special and means we don't have pargraph breaks + if (!noparbreak) { + if (linelen > 0) + buffer << "\n\n"; + for (Paragraph::depth_type j = 0; j < depth; ++j) + buffer << " "; + currlinelen = depth * 2; + //-- + // we should probably change to the paragraph language in the + // gettext here (if possible) so that strings are outputted in + // the correct language! (20012712 Jug) + //-- + switch (ltype) { + case 0: // Standard + case 4: // (Sub)Paragraph + case 5: // Description + break; + case 6: // Abstract if (linelen > 0) - buffer << "\n\n"; - for (Paragraph::depth_type j = 0; j < depth; ++j) - buffer << " "; - currlinelen = depth * 2; - switch (ltype) { - case 0: // Standard - case 4: // (Sub)Paragraph - case 5: // Description - break; - case 6: // Abstract + buffer << _("Abstract") << "\n\n"; + else + buffer << _("Abstract: "); + break; + case 7: // Bibliography + if (!ref_printed) { if (linelen > 0) - buffer << "Abstract\n\n"; + buffer << _("References") << "\n\n"; else - buffer << "Abstract: "; - break; - case 7: // Bibliography - if (!ref_printed) { - if (linelen > 0) - buffer << "References\n\n"; - else - buffer << "References: "; - ref_printed = true; - } - break; - default: - buffer << par->params().labelString() << " "; - break; + buffer << _("References: "); + ref_printed = true; } - if (ltype_depth > depth) { - for (Paragraph::depth_type j = ltype_depth - 1; - j > depth; --j) - buffer << " "; - currlinelen += (ltype_depth-depth)*2; + break; + default: + buffer << par->params().labelString() << " "; + break; + } + } + string s = buffer.str(); + if (s.rfind('\n') != string::npos) { + string dummy; + s = rsplit(buffer.str().c_str(), dummy, '\n'); + } + currlinelen = s.length(); + if (!currlinelen) { + for (Paragraph::depth_type j = 0; j < depth; ++j) + buffer << " "; + currlinelen = depth * 2; + if (ltype_depth > depth) { + for (Paragraph::depth_type j = ltype_depth; + j > depth; --j) + { + buffer << " "; } + currlinelen += (ltype_depth-depth)*2; } - + } + // this is to change the linebreak to do it by word a bit more intelligent + // hopefully! (only in the case where we have a max linelenght!) (Jug) + for (pos_type i = 0; i < par->size(); ++i) { char c = par->getUChar(params, i); - if (islatex) - continue; switch (c) { case Paragraph::META_INSET: { Inset const * inset = par->getInset(i); if (inset) { - if (!inset->ascii(this, buffer)) { + if (linelen > 0) { + buffer << word.str(); + word.str(""); + } + if (inset->ascii(this, buffer, linelen)) { + // to be sure it breaks paragraph + currlinelen += linelen; + } +#if 0 + else { string dummy; string const s = rsplit(buffer.str().c_str(), dummy, '\n'); - currlinelen += s.length(); - } else { - // to be sure it breaks paragraph - currlinelen += linelen; + currlinelen = s.length(); } +#endif } } break; case Paragraph::META_NEWLINE: if (linelen > 0) { - buffer << "\n"; + buffer << word.str() << "\n"; + word.str(""); for (Paragraph::depth_type j = 0; j < depth; ++j) buffer << " "; - } - currlinelen = depth * 2; - if (ltype_depth > depth) { - for (Paragraph::depth_type j = ltype_depth; - j > depth; --j) - buffer << " "; - currlinelen += (ltype_depth - depth) * 2; + currlinelen = depth * 2; + if (ltype_depth > depth) { + for (Paragraph::depth_type j = ltype_depth; + j > depth; --j) + buffer << " "; + currlinelen += (ltype_depth - depth) * 2; + } } break; - case Paragraph::META_HFILL: - buffer << "\t"; + case Paragraph::META_HFILL: + buffer << word.str() << "\t"; + currlinelen += word.str().length() + 1; + word.str(""); break; default: - if ((linelen > 0) && (currlinelen > (linelen - 10)) && - (c == ' ') && ((i + 2) < par->size())) - { - buffer << "\n"; - for (Paragraph::depth_type j = 0; - j < depth; ++j) - buffer << " "; - currlinelen = depth * 2; - if (ltype_depth > depth) { - for (Paragraph::depth_type j = ltype_depth; - j > depth; --j) + if (c == ' ') { + buffer << word.str() << ' '; + currlinelen += word.str().length() + 1; + word.str(""); + } else { + if (c != '\0') { + word << c; + } else { + lyxerr[Debug::INFO] << + "writeAsciiFile: NULL char in structure." << endl; + } + if ((linelen > 0) && + (currlinelen+word.str().length()) > linelen) + { + buffer << "\n"; + for (Paragraph::depth_type j = 0; j < depth; ++j) buffer << " "; - currlinelen += (ltype_depth-depth)*2; + currlinelen = depth * 2; + if (ltype_depth > depth) { + for (Paragraph::depth_type j = ltype_depth; + j > depth; --j) + { + buffer << " "; + } + currlinelen += (ltype_depth-depth)*2; + } } - } else if (c != '\0') { - buffer << c; - ++currlinelen; - } else - lyxerr[Debug::INFO] << "writeAsciiFile: NULL char in structure." << endl; + } break; } } + buffer << word.str(); return buffer.str().c_str(); } @@ -1959,14 +2022,16 @@ void Buffer::writeFileAscii(ostream & ofs, int linelen) { Paragraph * par = paragraph; while (par) { - ofs << asciiParagraph(par, linelen); + ofs << asciiParagraph(par, linelen, par->previous() == 0); par = par->next(); } ofs << "\n"; } + bool use_babel; + void Buffer::makeLaTeXFile(string const & fname, string const & original_path, bool nice, bool only_body) @@ -2267,12 +2332,6 @@ void Buffer::makeLaTeXFile(string const & fname, texrow.newline(); } - if (features.isRequired("amsstyle") - && !tclass.provides(LyXTextClass::amsmath)) { - ofs << "\\usepackage{amsmath}\n"; - texrow.newline(); - } - if (tokenPos(tclass.opt_pagestyle(), '|', params.pagestyle) >= 0) { if (params.pagestyle == "fancy") { @@ -2391,7 +2450,9 @@ void Buffer::makeLaTeXFile(string const & fname, if (!bullets_def.empty()) preamble += bullets_def + "}\n\n"; - for (int j = countChar(preamble, '\n'); j-- ;) { + int const nlines = + int(lyx::count(preamble.begin(), preamble.end(), '\n')); + for (int j = 0; j != nlines; ++j) { texrow.newline(); } @@ -2469,33 +2530,41 @@ void Buffer::makeLaTeXFile(string const & fname, // LaTeX all paragraphs from par to endpar, if endpar == 0 then to the end // void Buffer::latexParagraphs(ostream & ofs, Paragraph * par, - Paragraph * endpar, TexRow & texrow) const + Paragraph * endpar, TexRow & texrow) const { bool was_title = false; bool already_title = false; // if only_body while (par != endpar) { - LyXLayout const & layout = - textclasslist.Style(params.textclass, - par->layout); - - if (layout.intitle) { - if (already_title) { - lyxerr <<"Error in latexParagraphs: You" - " should not mix title layouts" - " with normal ones." << endl; - } else - was_title = true; - } else if (was_title && !already_title) { - ofs << "\\maketitle\n"; - texrow.newline(); - already_title = true; - was_title = false; - } - - if (layout.isEnvironment()) { - par = par->TeXEnvironment(this, params, ofs, texrow); + Inset * in = par->inInset(); + // well we have to check if we are in an inset with unlimited + // lenght (all in one row) if that is true then we don't allow + // any special options in the paragraph and also we don't allow + // any environment other then "Standard" to be valid! + if ((in == 0) || !in->forceDefaultParagraphs(in)) { + LyXLayout const & layout = + textclasslist.Style(params.textclass, par->layout); + + if (layout.intitle) { + if (already_title) { + lyxerr <<"Error in latexParagraphs: You" + " should not mix title layouts" + " with normal ones." << endl; + } else + was_title = true; + } else if (was_title && !already_title) { + ofs << "\\maketitle\n"; + texrow.newline(); + already_title = true; + was_title = false; + } + + if (layout.isEnvironment()) { + par = par->TeXEnvironment(this, params, ofs, texrow); + } else { + par = par->TeXOnePar(this, params, ofs, texrow, false); + } } else { par = par->TeXOnePar(this, params, ofs, texrow, false); } @@ -3380,7 +3449,7 @@ int Buffer::runChktex() // get LaTeX-Filename string const name = getLatexName(); - string path = OnlyPath(filename); + string path = filePath(); string const org_path = path; if (lyxrc.use_tempdir || !IsDirWriteable(path)) { @@ -3397,7 +3466,7 @@ int Buffer::runChktex() makeLaTeXFile(name, org_path, false); TeXErrors terr; - Chktex chktex(lyxrc.chktex_command, name, filepath); + Chktex chktex(lyxrc.chktex_command, name, filePath()); int res = chktex.run(terr); // run chktex if (res == -1) { @@ -3428,7 +3497,7 @@ void Buffer::validate(LaTeXFeatures & features) const // AMS Style is at document level if (params.use_amsmath || tclass.provides(LyXTextClass::amsmath)) - features.require("amsstyle"); + features.require("amsmath"); while (par) { // We don't use "lyxerr.debug" because of speed. (Asger)