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 * ======================================================
18 #include "latexrunparams.h"
24 #include <boost/utility.hpp>
34 Error () : error_in_line(0) {}
36 Error(int line, string const & desc, string const & text)
37 : error_in_line(line),
40 /// what line in the TeX file the error occured in
44 /// The line/cmd that caused the error.
49 typedef std::vector<Error> Errors;
51 Errors::const_iterator begin() const { return errors.begin(); }
53 Errors::const_iterator end() const { return errors.end(); }
55 void insertError(int line, string const & error_desc,
56 string const & error_text);
70 std::set<string> citations;
72 std::set<string> databases;
74 std::set<string> styles;
79 bool operator==(Aux_Info const &, Aux_Info const &);
80 bool operator!=(Aux_Info const &, Aux_Info const &);
84 class LaTeX : boost::noncopyable {
86 /** Return values from scanLogFile() and run() (to come)
88 This enum should be enlarged a bit so that one could
89 get more feedback from the LaTeX run.
99 UNDEF_REF = 4, // Reference '...' on page ... undefined.
101 UNDEF_CIT = 8, // Citation '...' on page ... undefined.
103 RERUN = 16, // Label(s) may have changed. Rerun to get...
113 PACKAGE_WARNING = 512,
119 TOO_MANY_ERRORS = 4096,
123 ERRORS = TEX_ERROR + LATEX_ERROR,
125 WARNINGS = TEX_WARNING + LATEX_WARNING + PACKAGE_WARNING
130 cmd = the latex command, file = name of the (temporary) latex file,
131 path = name of the files original path.
133 LaTeX(string const & cmd, LatexRunParams const &,
134 string const & file, string const & path);
136 /// runs LaTeX several times
137 int run(TeXErrors &, LyXFunc *);
140 int getNumErrors() { return num_errors;}
143 int scanLogFile(TeXErrors &);
146 /// use this for running LaTeX once
149 /// The dependency file.
153 void deplog(DepTable & head);
156 bool runMakeIndex(string const &);
159 std::vector<Aux_Info> const scanAuxFiles(string const &);
162 Aux_Info const scanAuxFile(string const &);
165 void scanAuxFile(string const &, Aux_Info &);
168 void updateBibtexDependencies(DepTable &,
169 std::vector<Aux_Info> const &);
172 bool runBibTeX(std::vector<Aux_Info> const &);
175 void deleteFilesOnError() const;
186 /// used by scanLogFile
189 /// The name of the final output file.
193 LatexRunParams runparams;