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
26 /** The packages and commands that a buffer needs. This class
27 contains a list<string>. Each of the LaTeX packages that a buffer needs
28 should be added with void require(string const & name).
30 i.e require("amssymb")
32 To add support you should only need to require() the package name as
33 packages which don't have special requirements are handled automatically.
34 If your new package does need special consideration you'll need to alter
35 string const getPackages() const;
36 Remember to update the validate function in buffer.C and paragraph.C
42 LaTeXFeatures(Buffer const &, BufferParams const &, bool);
43 /// The packages needed by the document
44 std::string const getPackages() const;
45 /// The macros definitions needed by the document
46 std::string const getMacros() const;
48 std::string const getBabelOptions() const;
49 /// The definitions needed by the document's textclass
50 std::string const getTClassPreamble() const;
51 /// The sgml definitions needed by the document (dobook/linuxdoc)
52 std::string const getLyXSGMLEntities() const;
53 /// The SGML Required to include the files added with includeFile();
54 std::string const getIncludedFiles(std::string const & fname) const;
55 /// Include a file for use with the SGML entities
56 void includeFile(std::string const & key, std::string const & name);
57 /// The float definitions.
58 void getFloatDefinitions(std::ostream & os) const;
59 /// Print requirements to lyxerr
60 void showStruct() const;
62 void addExternalPreamble(std::string const &);
63 /// Provide a string name-space to the requirements
64 void require(std::string const & name);
65 /// Is the package required?
66 bool isRequired(std::string const & name) const;
68 void useFloat(std::string const & name);
70 void useLanguage(Language const *);
72 bool hasLanguages() const;
74 std::string getLanguages() const;
76 std::set<std::string> getEncodingSet(std::string const & doc_encoding) const;
78 void useLayout(std::string const & lyt);
80 Buffer const & buffer() const;
82 void setBuffer(Buffer const &);
84 BufferParams const & bufferParams() const;
85 /// the return value is dependent upon both LyXRC and LaTeXFeatures.
86 bool useBabel() const;
88 bool nice() const { return nice_; };
91 std::list<std::string> usedLayouts_;
93 /// Static preamble bits from the external material insets
94 typedef std::list<std::string> FeaturesList;
96 FeaturesList features_;
98 FeaturesList preamble_snippets_;
100 typedef std::set<Language const *> LanguageList;
102 LanguageList UsedLanguages_;
104 typedef std::set<std::string> UsedFloats;
106 UsedFloats usedFloats_;
108 typedef std::map<std::string , std::string> FileMap;
110 FileMap IncludedFiles_;
111 /** Buffer of the file being processed.
112 * This may be a child buffer of the to-be-exported file and
113 * therefore may not be the buffer that belongs to params_.
114 * Only needed by InsetInclude::validate().
116 Buffer const * buffer_;
118 BufferParams const & params_;
119 /** If we are writing a nice LaTeX file or not.
120 * Only needed by InsetInclude::validate().