using std::endl;
using std::set;
-LaTeXFeatures::LaTeXFeatures(BufferParams const & p, LyXTextClass::size_type n)
+using lyx::layout_type;
+using lyx::textclass_type;
+
+LaTeXFeatures::LaTeXFeatures(BufferParams const & p, layout_type n)
: layout(n, false), params(p)
-{
-
-}
+{}
void LaTeXFeatures::require(string const & name)
features.push_back("graphics");
} else
features.push_back(name);
-
}
+
void LaTeXFeatures::useLayout(std::vector<bool>::size_type const & idx)
{
layout[idx] = true;
}
+
bool LaTeXFeatures::isRequired(string const & name) const
{
FeaturesList::const_iterator i = std::find(features.begin(),
features.end(),
name);
- return i!= features.end();
+ return i != features.end();
}
+
void LaTeXFeatures::addExternalPreamble(string const & pream)
{
externalPreambles += pream;
}
+
void LaTeXFeatures::useFloat(string const & name)
{
usedFloats.insert(name);
}
+
void LaTeXFeatures::useLanguage(Language const * lang)
{
UsedLanguages.insert(lang);
}
+
void LaTeXFeatures::includeFile(string const & key, string const & name)
{
IncludedFiles[key] = name;
}
+
bool LaTeXFeatures::hasLanguages()
{
return !UsedLanguages.empty();
}
+
string LaTeXFeatures::getLanguages() const
{
-
ostringstream languages;
for (LanguageList::const_iterator cit =
return languages.str().c_str();
}
+
set<string> LaTeXFeatures::getEncodingSet(string const & doc_encoding)
{
set<string> encodings;
return encodings;
}
+
string const LaTeXFeatures::getPackages() const
{
ostringstream packages;
* packages which we just \usepackage{package}
**/
-// array-package
+ // array-package
if (isRequired("array"))
packages << "\\usepackage{array}\n";
packages << externalPreambles;
return packages.str().c_str();
-
}
if (isRequired("lyxline"))
macros << lyxline_def << '\n';
- if (isRequired("noun")) {
+ if (isRequired("noun"))
macros << noun_def << '\n';
- }
- if (isRequired("lyxarrow")) {
+ if (isRequired("lyxarrow"))
macros << lyxarrow_def << '\n';
- }
// quotes.
if (isRequired("quotesinglbase"))
macros << binom_def << '\n';
// other
- if (isRequired("NeedLyXMinipageIndent"))
+ if (isRequired("NeedLyXMinipageIndent"))
macros << minipageindent_def;
- if (isRequired("ParagraphIndent"))
+ if (isRequired("ParagraphIndent"))
macros << paragraphindent_def;
- if (isRequired("NeedLyXFootnoteCode"))
+ if (isRequired("NeedLyXFootnoteCode"))
macros << floatingfootnote_def;
// floats
string const LaTeXFeatures::getTClassPreamble() const
{
// the text class specific preamble
- LyXTextClass const & tclass =
- textclasslist.TextClass(params.textclass);
+ LyXTextClass const & tclass = textclasslist.TextClass(params.textclass);
ostringstream tcpreamble;
tcpreamble << tclass.preamble();
- for (LyXTextClass::size_type i = 0; i < tclass.numLayouts(); ++i) {
+ for (layout_type i = 0; i < tclass.numLayouts(); ++i) {
if (layout[i]) {
tcpreamble << tclass[i].preamble();
}
ostringstream entities;
if (isRequired("lyxarrow")) {
- entities << "<!ENTITY lyxarrow \"->\">"
- << '\n';
+ entities << "<!ENTITY lyxarrow \"->\">" << '\n';
}
return entities.str().c_str();