Skip to content

Commit

Permalink
latex - don't fail on hyphenation installation
Browse files Browse the repository at this point in the history
  • Loading branch information
cderv committed Aug 30, 2024
1 parent b42af94 commit c543de6
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/command/render/latexmk/pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,21 @@ async function initialCompileLatex(
const logText = Deno.readTextFileSync(response.log);
const missingHyphenationFile = findMissingHyphenationFiles(logText);
if (missingHyphenationFile) {
if (await pkgMgr.installPackages([missingHyphenationFile])) {
// We installed hyphenation files, retry
continue;
} else {
writeError("missing hyphenation file", "", response.log);
return Promise.reject();
// try to install it, unless auto install is opted out
if (pkgMgr.autoInstall) {
logProgress("Installing missing hyphenation file...");
if (await pkgMgr.installPackages([missingHyphenationFile])) {
// We installed hyphenation files, retry
continue;
} else {
logProgress("Installing missing hyphenation file failed.");
}
}
// Let's just through a warning, but it may not be fatal for the compilation
// and we can end normally
warning(
`Possibly missing hyphenation file: '${missingHyphenationFile}'. See more in logfile (by setting 'latex-clean: false').\n`,
);
}
} else if (pkgMgr.autoInstall) {
// try autoinstalling
Expand Down

0 comments on commit c543de6

Please sign in to comment.