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;
78 operator==(Aux_Info const & o) const {
79 return aux_file == o.aux_file &&
80 citations == o.citations &&
81 databases == o.databases &&
87 class LaTeX : public noncopyable {
89 /** Return values from scanLogFile() and run() (to come)
91 This enum should be enlarged a bit so that one could
92 get more feedback from the LaTeX run.
102 UNDEF_REF = 4, // Reference '...' on page ... undefined.
104 UNDEF_CIT = 8, // Citation '...' on page ... undefined.
106 RERUN = 16, // Label(s) may have changed. Rerun to get...
116 PACKAGE_WARNING = 512,
122 TOO_MANY_ERRORS = 4096,
126 ERRORS = TEX_ERROR + LATEX_ERROR,
128 WARNINGS = TEX_WARNING + LATEX_WARNING + PACKAGE_WARNING
133 cmd = the latex command, file = name of the (temporary) latex file,
134 path = name of the files original path.
136 LaTeX(string const & cmd, string const & file, string const & path);
141 /// runs LaTeX several times
142 int run(TeXErrors &, MiniBuffer *);
145 int getNumErrors() { return num_errors;}
147 /// use this for running LaTeX once
151 int scanLogFile(TeXErrors &);
154 /// The dependency file.
158 void deplog(DepTable & head);
161 bool runMakeIndex(string const &);
164 std::vector<Aux_Info> const scanAuxFiles(string const &);
167 Aux_Info const scanAuxFile(string const &);
170 void scanAuxFile(string const &, Aux_Info &);
173 void updateBibtexDependencies(DepTable &, vector<Aux_Info> const &);
176 bool runBibTeX(vector<Aux_Info> const &);
179 void deleteFilesOnError() const;
190 /// used by scanLogFile