rc_entry = [ r'\jbibtex_command "automatic"' ],
alt_rc_entry = [ r'\jbibtex_alternatives "%%"' ])
checkProgAlternatives('available index processors',
- ['texindy $$x', 'makeindex -c -q', 'xindy $$x'],
+ ['texindy $$x -t $$b.ilg', 'makeindex -c -q', 'xindy $$x -t $$b.ilg'],
rc_entry = [ r'\index_command "%%"' ],
alt_rc_entry = [ r'\index_alternatives "%%"' ])
checkProg('an index processor appropriate to Japanese',
{
int scanres = NO_ERRORS;
int bscanres = NO_ERRORS;
+ int iscanres = NO_ERRORS;
unsigned int count = 0; // number of times run
num_errors = 0; // just to make sure.
unsigned int const MAX_RUN = 6;
runMakeIndex(onlyFileName(idxfile.absFileName()), runparams);
if (ret == Systemcall::KILLED)
return Systemcall::KILLED;
+ FileName const ilgfile(changeExtension(file.absFileName(), ".ilg"));
+ if (ilgfile.exists())
+ iscanres = scanIlgFile(terr);
rerun = true;
}
file.absFileName(), ".idx")), runparams);
if (ret == Systemcall::KILLED)
return Systemcall::KILLED;
- rerun = true;
+ FileName const ilgfile(changeExtension(file.absFileName(), ".ilg"));
+ if (ilgfile.exists())
+ iscanres = scanIlgFile(terr);
+ rerun = true;
}
// MSVC complains that bool |= int is unsafe. Not sure why.
if (bscanres & ERRORS)
return bscanres; // return on error
+ if (iscanres & ERRORS)
+ return iscanres; // return on error
+
return scanres;
}
tmp = subst(tmp, "$$x", xdyopts);
}
+ if (contains(tmp, "$$b")) {
+ // advise xindy to write a log file
+ tmp = subst(tmp, "$$b", removeExtension(f));
+ }
+
LYXERR(Debug::LATEX,
"idx file has been made, running index processor ("
<< tmp << ") on file " << f);
}
+int LaTeX::scanIlgFile(TeXErrors & terr)
+{
+ FileName const ilg_file(changeExtension(file.absFileName(), "ilg"));
+ LYXERR(Debug::LATEX, "Scanning ilg file: " << ilg_file);
+
+ ifstream ifs(ilg_file.toFilesystemEncoding().c_str());
+ string token;
+ int retval = NO_ERRORS;
+
+ string prevtoken;
+ while (getline(ifs, token)) {
+ token = rtrim(token, "\r");
+ smatch sub;
+ if (prefixIs(token, "!! "))
+ prevtoken = token;
+ else if (!prevtoken.empty()) {
+ retval |= INDEX_ERROR;
+ string errstr = N_("Makeindex error: ") + prevtoken;
+ string msg = prevtoken + '\n';
+ msg += token;
+ terr.insertError(0,
+ from_local8bit(errstr),
+ from_local8bit(msg));
+ prevtoken.clear();
+ } else if (prefixIs(token, "ERROR: ")) {
+ retval |= BIBTEX_ERROR;
+ string errstr = N_("Xindy error: ") + token.substr(6);
+ string msg = token;
+ terr.insertError(0,
+ from_local8bit(errstr),
+ from_local8bit(msg));
+ }
+ }
+ return retval;
+}
+
+
+
} // namespace lyx
///
NONZERO_ERROR = 32768, // the command exited with nonzero status
///
- ERRORS = TEX_ERROR + LATEX_ERROR + NONZERO_ERROR + BIBTEX_ERROR,
+ INDEX_ERROR = 65536,
+ ///
+ ERRORS = TEX_ERROR + LATEX_ERROR + NONZERO_ERROR + BIBTEX_ERROR + INDEX_ERROR,
///
WARNINGS = TEX_WARNING + LATEX_WARNING + PACKAGE_WARNING
};
///
int scanBlgFile(DepTable & head, TeXErrors & terr);
+ ///
+ int scanIlgFile(TeXErrors & terr);
+
///
bool runBibTeX(std::vector<AuxInfo> const &,
OutputParams const &, int & exit_code);