4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Angus Leeming
11 * Full author contact details are available in file CREDITS.
17 #include "latexrunparams.h"
18 #include "support/std_string.h"
22 #include <boost/utility.hpp>
23 #include <boost/signals/signal1.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
127 /// This signal emits an informative message
128 boost::signal1<void, string> message;
132 cmd = the latex command, file = name of the (temporary) latex file,
133 path = name of the files original path.
135 LaTeX(string const & cmd, LatexRunParams const &,
136 string const & file, string const & path);
138 /// runs LaTeX several times
139 int run(TeXErrors &);
142 int getNumErrors() { return num_errors;}
145 int scanLogFile(TeXErrors &);
148 /// use this for running LaTeX once
151 /// The dependency file.
155 void deplog(DepTable & head);
158 bool runMakeIndex(string const &);
161 std::vector<Aux_Info> const scanAuxFiles(string const &);
164 Aux_Info const scanAuxFile(string const &);
167 void scanAuxFile(string const &, Aux_Info &);
170 void updateBibtexDependencies(DepTable &,
171 std::vector<Aux_Info> const &);
174 bool runBibTeX(std::vector<Aux_Info> const &);
177 void deleteFilesOnError() const;
188 /// used by scanLogFile
191 /// The name of the final output file.
195 LatexRunParams runparams;