2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2000 The Lyx Team
9 * This file is Copyright 1996-1999
12 * ======================================================
27 #include <boost/utility.hpp>
37 Error () : error_in_line(0) {}
39 Error(int line, string const & desc, string const & text)
40 : error_in_line(line),
43 /// what line in the TeX file the error occured in
47 /// The line/cmd that caused the error.
52 typedef std::vector<Error> Errors;
54 Errors::const_iterator begin() const { return errors.begin(); }
56 Errors::const_iterator end() const { return errors.end(); }
58 void insertError(int line, string const & error_desc,
59 string const & error_text);
72 std::set<string> citations;
74 std::set<string> databases;
76 std::set<string> styles;
79 bool operator==(Aux_Info const & a, Aux_Info const & o);
85 bool operator==(Aux_Info const & a, Aux_Info const & o)
87 return a.aux_file == o.aux_file &&
88 a.citations == o.citations &&
89 a.databases == o.databases &&
95 class LaTeX : public noncopyable {
97 /** Return values from scanLogFile() and run() (to come)
99 This enum should be enlarged a bit so that one could
100 get more feedback from the LaTeX run.
110 UNDEF_REF = 4, // Reference '...' on page ... undefined.
112 UNDEF_CIT = 8, // Citation '...' on page ... undefined.
114 RERUN = 16, // Label(s) may have changed. Rerun to get...
124 PACKAGE_WARNING = 512,
130 TOO_MANY_ERRORS = 4096,
134 ERRORS = TEX_ERROR + LATEX_ERROR,
136 WARNINGS = TEX_WARNING + LATEX_WARNING + PACKAGE_WARNING
141 cmd = the latex command, file = name of the (temporary) latex file,
142 path = name of the files original path.
144 LaTeX(string const & cmd, string const & file, string const & path);
149 /// runs LaTeX several times
150 int run(TeXErrors &, MiniBuffer *);
153 int getNumErrors() { return num_errors;}
155 /// use this for running LaTeX once
159 int scanLogFile(TeXErrors &);
162 /// The dependency file.
166 void deplog(DepTable & head);
169 bool runMakeIndex(string const &);
172 std::vector<Aux_Info> const scanAuxFiles(string const &);
175 Aux_Info const scanAuxFile(string const &);
178 void scanAuxFile(string const &, Aux_Info &);
181 void updateBibtexDependencies(DepTable &,
182 std::vector<Aux_Info> const &);
185 bool runBibTeX(std::vector<Aux_Info> const &);
188 void deleteFilesOnError() const;
199 /// used by scanLogFile