3 * \file LaTeXFeatures.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jean-Marc Lasgouttes
10 * Full author contact details are available in file CREDITS.
13 #ifndef LATEXFEATURES_H
14 #define LATEXFEATURES_H
16 #include "support/types.h"
27 /** The packages and commands that a buffer needs. This class
28 contains a list<string>. Each of the LaTeX packages that a buffer needs
29 should be added with void require(string const & name).
31 i.e require("amssymb")
33 To add support you should only need to require() the package name as
34 packages which don't have special requirements are handled automatically.
35 If your new package does need special consideration you'll need to alter
36 string const getPackages() const;
37 Remember to update the validate function in buffer.C and paragraph.C
43 LaTeXFeatures(BufferParams const &);
44 /// The packages needed by the document
45 string const getPackages() const;
46 /// The macros definitions needed by the document
47 string const getMacros() const;
49 string const getBabelOptions() const;
50 /// The definitions needed by the document's textclass
51 string const getTClassPreamble() const;
52 /// The sgml definitions needed by the document (dobook/linuxdoc)
53 string const getLyXSGMLEntities() const;
54 /// The SGML Required to include the files added with includeFile();
55 string const getIncludedFiles(string const & fname) const;
56 /// Include a file for use with the SGML entities
57 void includeFile(string const & key, string const & name);
58 /// The float definitions.
59 void getFloatDefinitions(std::ostream & os) const;
60 /// Print requirements to lyxerr
61 void showStruct() const;
63 void addExternalPreamble(string const &);
64 /// Provide a string name-space to the requirements
65 void require(string const & name);
66 /// Is the package required?
67 bool isRequired(string const & name) const;
69 void useFloat(string const & name);
71 void useLanguage(Language const *);
73 bool hasLanguages() const;
75 string getLanguages() const;
77 std::set<string> getEncodingSet(string const & doc_encoding) const;
79 void useLayout(string const & lyt);
81 BufferParams const & bufferParams() const;
82 /// the return value is dependent upon both LyXRC and LaTeXFeatures.
83 bool useBabel() const;
86 string externalPreambles;
88 std::list<string> usedLayouts;
90 /// Static preamble bits from the external material insets
93 typedef std::list<string> FeaturesList;
95 FeaturesList features;
97 typedef std::set<Language const *> LanguageList;
99 LanguageList UsedLanguages;
101 typedef std::set<string> UsedFloats;
103 UsedFloats usedFloats;
105 typedef std::map<string , string> FileMap;
107 FileMap IncludedFiles;
110 BufferParams const & params;