2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2001 The Lyx Team
9 * This file is Copyright 1996-2001
12 * ======================================================
23 #include <boost/utility.hpp>
33 Error () : error_in_line(0) {}
35 Error(int line, string const & desc, string const & text)
36 : error_in_line(line),
39 /// what line in the TeX file the error occured in
43 /// The line/cmd that caused the error.
48 typedef std::vector<Error> Errors;
50 Errors::const_iterator begin() const { return errors.begin(); }
52 Errors::const_iterator end() const { return errors.end(); }
54 void insertError(int line, string const & error_desc,
55 string const & error_text);
68 std::set<string> citations;
70 std::set<string> databases;
72 std::set<string> styles;
78 bool operator==(Aux_Info const & a, Aux_Info const & o)
80 return a.aux_file == o.aux_file &&
81 a.citations == o.citations &&
82 a.databases == o.databases &&
89 bool operator!=(Aux_Info const & a, Aux_Info const & o)
96 class LaTeX : boost::noncopyable {
98 /** Return values from scanLogFile() and run() (to come)
100 This enum should be enlarged a bit so that one could
101 get more feedback from the LaTeX run.
111 UNDEF_REF = 4, // Reference '...' on page ... undefined.
113 UNDEF_CIT = 8, // Citation '...' on page ... undefined.
115 RERUN = 16, // Label(s) may have changed. Rerun to get...
125 PACKAGE_WARNING = 512,
131 TOO_MANY_ERRORS = 4096,
135 ERRORS = TEX_ERROR + LATEX_ERROR,
137 WARNINGS = TEX_WARNING + LATEX_WARNING + PACKAGE_WARNING
142 cmd = the latex command, file = name of the (temporary) latex file,
143 path = name of the files original path.
145 LaTeX(string const & cmd, string const & file, string const & path);
150 /// runs LaTeX several times
151 int run(TeXErrors &, LyXFunc *);
154 int getNumErrors() { return num_errors;}
156 /// use this for running LaTeX once
160 int scanLogFile(TeXErrors &);
163 /// The dependency file.
167 void deplog(DepTable & head);
170 bool runMakeIndex(string const &);
173 std::vector<Aux_Info> const scanAuxFiles(string const &);
176 Aux_Info const scanAuxFile(string const &);
179 void scanAuxFile(string const &, Aux_Info &);
182 void updateBibtexDependencies(DepTable &,
183 std::vector<Aux_Info> const &);
186 bool runBibTeX(std::vector<Aux_Info> const &);
189 void deleteFilesOnError() const;
200 /// used by scanLogFile
203 /// The name of the final output file.