#include "TextClass.h"
#include "LayoutFile.h"
+#include "CiteEnginesList.h"
#include "Color.h"
#include "Counters.h"
#include "Floating.h"
// You should also run the development/tools/updatelayouts.py script,
// to update the format of all of our layout files.
//
-int const LAYOUT_FORMAT = 60; //lasgouttes LongTableNoNumber => Unnumbered
+int const LAYOUT_FORMAT = 62; //spitz PassThru for arguments.
// Layout format for the current lyx file format. Controls which format is
return "input file";
case TextClass::MODULE:
return "module file";
+ case TextClass::CITE_ENGINE:
+ return "cite engine";
case TextClass::VALIDATION:
return "validation";
}
break;
case TC_PREAMBLE:
- preamble_ = from_utf8(lexrc.getLongString("EndPreamble"));
+ preamble_ = lexrc.getLongString(from_ascii("EndPreamble"));
break;
case TC_HTMLPREAMBLE:
- htmlpreamble_ = from_utf8(lexrc.getLongString("EndPreamble"));
+ htmlpreamble_ = lexrc.getLongString(from_ascii("EndPreamble"));
break;
case TC_HTMLSTYLES:
- htmlstyles_ = from_utf8(lexrc.getLongString("EndStyles"));
+ htmlstyles_ = lexrc.getLongString(from_ascii("EndStyles"));
break;
case TC_HTMLTOCSECTION:
break;
case TC_ADDTOPREAMBLE:
- preamble_ += from_utf8(lexrc.getLongString("EndPreamble"));
+ preamble_ += lexrc.getLongString(from_ascii("EndPreamble"));
break;
case TC_ADDTOHTMLPREAMBLE:
- htmlpreamble_ += from_utf8(lexrc.getLongString("EndPreamble"));
+ htmlpreamble_ += lexrc.getLongString(from_ascii("EndPreamble"));
break;
case TC_ADDTOHTMLSTYLES:
- htmlstyles_ += from_utf8(lexrc.getLongString("EndStyles"));
+ htmlstyles_ += lexrc.getLongString(from_ascii("EndStyles"));
break;
case TC_PROVIDES: {
break;
case TC_DEFAULTBIBLIO:
- if (lexrc.next())
- cite_default_biblio_style_ = rtrim(lexrc.getString());
+ if (lexrc.next()) {
+ vector<string> const dbs =
+ getVectorFromString(rtrim(lexrc.getString()), "|");
+ vector<string>::const_iterator it = dbs.begin();
+ vector<string>::const_iterator end = dbs.end();
+ for (; it != end; ++it) {
+ if (!contains(*it, ':'))
+ cite_default_biblio_style_[opt_enginetype_] = *it;
+ else {
+ string eng;
+ string const db = split(*it, eng, ':');
+ cite_default_biblio_style_[eng] = db;
+ }
+ }
+ }
break;
case TC_FULLAUTHORLIST:
string ext;
string htmlattr;
- string htmlstyle;
+ docstring htmlstyle;
string htmltag;
string listname;
string listcommand;
break;
case FT_HTMLSTYLE:
lexrc.next();
- htmlstyle = lexrc.getLongString("EndHTMLStyle");
+ htmlstyle = lexrc.getLongString(from_ascii("EndHTMLStyle"));
break;
case FT_HTMLTAG:
lexrc.next();
DocumentClassPtr getDocumentClass(
LayoutFile const & baseClass, LayoutModuleList const & modlist,
+ LayoutModuleList const & celist,
bool const clone)
{
DocumentClassPtr doc_class =
frontend::Alert::warning(_("Read Error"), msg);
}
}
+
+ LayoutModuleList::const_iterator cit = celist.begin();
+ LayoutModuleList::const_iterator cen = celist.end();
+ for (; cit != cen; ++cit) {
+ string const ceName = *cit;
+ LyXCiteEngine * ce = theCiteEnginesList[ceName];
+ if (!ce) {
+ docstring const msg =
+ bformat(_("The cite engine %1$s has been requested by\n"
+ "this document but has not been found in the list of\n"
+ "available engines. If you recently installed it, you\n"
+ "probably need to reconfigure LyX.\n"), from_utf8(ceName));
+ if (!clone)
+ frontend::Alert::warning(_("Cite Engine not available"), msg);
+ continue;
+ }
+ if (!ce->isAvailable() && !clone) {
+ docstring const prereqs = from_utf8(getStringFromVector(ce->prerequisites(), "\n\t"));
+ docstring const msg =
+ bformat(_("The cite engine %1$s requires a package that is not\n"
+ "available in your LaTeX installation, or a converter that\n"
+ "you have not installed. LaTeX output may not be possible.\n"
+ "Missing prerequisites:\n"
+ "\t%2$s\n"
+ "See section 3.1.2.3 (Modules) of the User's Guide for more information."),
+ from_utf8(ceName), prereqs);
+ frontend::Alert::warning(_("Package not available"), msg, true);
+ }
+ FileName layout_file = libFileSearch("citeengines", ce->getFilename());
+ if (!doc_class->read(layout_file, TextClass::CITE_ENGINE)) {
+ docstring const msg =
+ bformat(_("Error reading cite engine %1$s\n"), from_utf8(ceName));
+ frontend::Alert::warning(_("Read Error"), msg);
+ }
+ }
+
return doc_class;
}