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 * ======================================================
26 #include "support/utility.hpp"
36 Error () : error_in_line(0) {}
38 Error(int line, string const & desc, string const & text)
39 : error_in_line(line),
42 /// what line in the TeX file the error occured in
46 /// The line/cmd that caused the error.
51 typedef std::vector<Error> Errors;
53 Errors::const_iterator begin() const { return errors.begin(); }
55 Errors::const_iterator end() const { return errors.end(); }
57 void insertError(int line, string const & error_desc,
58 string const & error_text);
66 class LaTeX : public noncopyable {
68 /** Return values from scanLogFile() and run() (to come)
70 This enum should be enlarged a bit so that one could
71 get more feedback from the LaTeX run.
81 UNDEF_REF = 4, // Reference '...' on page ... undefined.
83 UNDEF_CIT = 8, // Citation '...' on page ... undefined.
85 RERUN = 16, // Label(s) may have changed. Rerun to get...
95 PACKAGE_WARNING = 512,
101 TOO_MANY_ERRORS = 4096,
103 ERRORS = TEX_ERROR + LATEX_ERROR,
105 WARNINGS = TEX_WARNING + LATEX_WARNING + PACKAGE_WARNING
110 cmd = the latex command, file = name of the (temporary) latex file,
111 path = name of the files original path.
113 LaTeX(string const & cmd, string const & file, string const & path);
115 /// runs LaTeX several times
116 int run(TeXErrors &, MiniBuffer *);
119 int getNumErrors() { return num_errors;}
121 /// use this for running LaTeX once
124 /// The dependency file.
128 void deplog(DepTable & head);
131 int scanLogFile(TeXErrors &);
134 bool runMakeIndex(string const &);
137 bool scanAux(DepTable &);
140 bool runBibTeX(string const &, DepTable &);
143 void deleteFilesOnError() const;
154 /// used by scanLogFile