Skip to content

Commit

Permalink
Close #4513 Allow PDF refresh on change during build if -f and nonsto…
Browse files Browse the repository at this point in the history
…pmode
  • Loading branch information
James-Yu committed Jan 26, 2025
1 parent 220454f commit f7d2d84
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/compile/recipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ export async function build(rootFile: string, langId: string, buildLoop: () => P
const timestamp = Date.now()
tools.forEach(tool => queue.add(tool, rootFile, recipeName || 'Build', timestamp))

lw.compile.compiledPDFPath = lw.file.getPdfPath(rootFile)
// #4513 If the recipe contains a forced latexmk compilation, don't set the
// compiledPDFPath so that PDF refresh is handled by file watcher.
if (!tools.some(tool => tool.command === 'latexmk' &&
tool.args?.includes('-interaction=nonstopmode') &&
tool.args?.includes('-f'))) {
lw.compile.compiledPDFPath = lw.file.getPdfPath(rootFile)
}
// Execute the build loop
await buildLoop()
}
Expand Down

0 comments on commit f7d2d84

Please sign in to comment.