Skip to content

Commit

Permalink
Fix jobname parsing
Browse files Browse the repository at this point in the history
Merge changes from PR aclements#47
  • Loading branch information
lazdmx committed Jun 18, 2020
1 parent 38ff6ec commit caabe2b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions latexrun
Original file line number Diff line number Diff line change
Expand Up @@ -861,15 +861,16 @@ class LaTeX(Task):
pages of output.
"""
jobname = outname = None
for m in re.finditer(r'^Transcript written on "?(.*)\.log"?\.$', stdout,
for m in re.finditer(r'Transcript written on "?(.*?)\.log"?\.', stdout,
re.MULTILINE | re.DOTALL):
jobname = m.group(1).replace('\n', '')
if jobname is None:
print(stdout, file=sys.stderr)
raise TaskError('failed to extract job name from latex log')
for m in re.finditer(r'^Output written on "?(.*\.[^ ."]+)"? \([0-9]+ page',
for m in re.finditer(r'Output written on "?(.*?\.[^ ."]+)"?\s+\([0-9]+ (page)?',
stdout, re.MULTILINE | re.DOTALL):
outname = m.group(1).replace('\n', '')
if m.group(2) == "page":
outname = m.group(1).replace('\n', '')
if outname is None and not \
re.search(r'^No pages of output\.$|^! Emergency stop\.$'
r'|^! ==> Fatal error occurred, no output PDF file produced!$',
Expand Down

0 comments on commit caabe2b

Please sign in to comment.