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);
69 std::set<string> citations;
71 std::set<string> databases;
73 std::set<string> styles;
78 bool operator==(Aux_Info const &, Aux_Info const &);
79 bool operator!=(Aux_Info const &, Aux_Info const &);
83 class LaTeX : boost::noncopyable {
85 /** Return values from scanLogFile() and run() (to come)
87 This enum should be enlarged a bit so that one could
88 get more feedback from the LaTeX run.
98 UNDEF_REF = 4, // Reference '...' on page ... undefined.
100 UNDEF_CIT = 8, // Citation '...' on page ... undefined.
102 RERUN = 16, // Label(s) may have changed. Rerun to get...
112 PACKAGE_WARNING = 512,
118 TOO_MANY_ERRORS = 4096,
122 ERRORS = TEX_ERROR + LATEX_ERROR,
124 WARNINGS = TEX_WARNING + LATEX_WARNING + PACKAGE_WARNING
129 cmd = the latex command, file = name of the (temporary) latex file,
130 path = name of the files original path.
132 LaTeX(string const & cmd, string const & file, string const & path);
134 /// runs LaTeX several times
135 int run(TeXErrors &, LyXFunc *);
138 int getNumErrors() { return num_errors;}
141 int scanLogFile(TeXErrors &);
144 /// use this for running LaTeX once
147 /// The dependency file.
151 void deplog(DepTable & head);
154 bool runMakeIndex(string const &);
157 std::vector<Aux_Info> const scanAuxFiles(string const &);
160 Aux_Info const scanAuxFile(string const &);
163 void scanAuxFile(string const &, Aux_Info &);
166 void updateBibtexDependencies(DepTable &,
167 std::vector<Aux_Info> const &);
170 bool runBibTeX(std::vector<Aux_Info> const &);
173 void deleteFilesOnError() const;
184 /// used by scanLogFile
187 /// The name of the final output file.