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 "outputparams.h"
19 #include "support/docstring.h"
21 #include <boost/utility.hpp>
22 #include <boost/signal.hpp>
36 Error () : error_in_line(0) {}
38 Error(int line, std::string const & desc, std::string const & text)
39 : error_in_line(line),
42 /// what line in the TeX file the error occured in
45 std::string error_desc;
46 /// The line/cmd that caused the error.
47 std::string error_text;
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, std::string const & error_desc,
58 std::string const & error_text);
72 std::set<std::string> citations;
74 std::set<std::string> databases;
76 std::set<std::string> styles;
81 bool operator==(Aux_Info const &, Aux_Info const &);
82 bool operator!=(Aux_Info const &, Aux_Info const &);
86 class LaTeX : boost::noncopyable {
88 /** Return values from scanLogFile() and run() (to come)
90 This enum should be enlarged a bit so that one could
91 get more feedback from the LaTeX run.
101 UNDEF_REF = 4, // Reference '...' on page ... undefined.
103 UNDEF_CIT = 8, // Citation '...' on page ... undefined.
105 RERUN = 16, // Label(s) may have changed. Rerun to get...
115 PACKAGE_WARNING = 512,
121 TOO_MANY_ERRORS = 4096,
125 ERRORS = TEX_ERROR + LATEX_ERROR,
127 WARNINGS = TEX_WARNING + LATEX_WARNING + PACKAGE_WARNING
130 /// This signal emits an informative message
131 boost::signal<void(lyx::docstring)> message;
135 cmd = the latex command, file = name of the (temporary) latex file,
136 path = name of the files original path.
138 LaTeX(std::string const & cmd, OutputParams const &,
139 std::string const & file, std::string const & path);
141 /// runs LaTeX several times
142 int run(TeXErrors &);
145 int getNumErrors() { return num_errors;}
148 int scanLogFile(TeXErrors &);
151 /// use this for running LaTeX once
154 /// The dependency file.
158 void deplog(DepTable & head);
161 bool runMakeIndex(std::string const &, OutputParams const &);
164 std::vector<Aux_Info> const scanAuxFiles(std::string const &);
167 Aux_Info const scanAuxFile(std::string const &);
170 void scanAuxFile(std::string const &, Aux_Info &);
173 void updateBibtexDependencies(DepTable &,
174 std::vector<Aux_Info> const &);
177 bool runBibTeX(std::vector<Aux_Info> const &);
180 void deleteFilesOnError() const;
191 /// used by scanLogFile
194 /// The name of the final output file.
195 std::string output_file;
198 OutputParams runparams;