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 * ======================================================
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;
82 bool operator==(Aux_Info const & a, Aux_Info const & o)
84 return a.aux_file == o.aux_file &&
85 a.citations == o.citations &&
86 a.databases == o.databases &&
93 bool operator!=(Aux_Info const & a, Aux_Info const & o)
100 class LaTeX : boost::noncopyable {
102 /** Return values from scanLogFile() and run() (to come)
104 This enum should be enlarged a bit so that one could
105 get more feedback from the LaTeX run.
115 UNDEF_REF = 4, // Reference '...' on page ... undefined.
117 UNDEF_CIT = 8, // Citation '...' on page ... undefined.
119 RERUN = 16, // Label(s) may have changed. Rerun to get...
129 PACKAGE_WARNING = 512,
135 TOO_MANY_ERRORS = 4096,
139 ERRORS = TEX_ERROR + LATEX_ERROR,
141 WARNINGS = TEX_WARNING + LATEX_WARNING + PACKAGE_WARNING
146 cmd = the latex command, file = name of the (temporary) latex file,
147 path = name of the files original path.
149 LaTeX(string const & cmd, string const & file, string const & path);
154 /// runs LaTeX several times
155 int run(TeXErrors &, LyXFunc *);
158 int getNumErrors() { return num_errors;}
160 /// use this for running LaTeX once
164 int scanLogFile(TeXErrors &);
167 /// The dependency file.
171 void deplog(DepTable & head);
174 bool runMakeIndex(string const &);
177 std::vector<Aux_Info> const scanAuxFiles(string const &);
180 Aux_Info const scanAuxFile(string const &);
183 void scanAuxFile(string const &, Aux_Info &);
186 void updateBibtexDependencies(DepTable &,
187 std::vector<Aux_Info> const &);
190 bool runBibTeX(std::vector<Aux_Info> const &);
193 void deleteFilesOnError() const;
204 /// used by scanLogFile
207 /// The name of the final output file.