Skip to content

Commit

Permalink
[latex] Problem Slides at contest level: warn for each problem missin…
Browse files Browse the repository at this point in the history
…g problem-slide.en.tex
  • Loading branch information
mpsijm committed Dec 21, 2024
1 parent a0ef9c3 commit 4a325a3
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions bin/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,18 +483,22 @@ def build_contest_pdf(
for problem in problems:
if build_type == PdfType.PROBLEM:
prepare_problem(problem, language)

if solutions:
solutiontex = problem.path / 'problem_statement' / 'solution.tex'
solutionlangtex = problem.path / 'problem_statement' / f'solution.{language}.tex'
if solutionlangtex.is_file():
else: # i.e. for SOLUTION and PROBLEM_SLIDE
tex_no_lang = problem.path / 'problem_statement' / f'{build_type.value}.tex'
tex_with_lang = (
problem.path / 'problem_statement' / f'{build_type.value}.{language}.tex'
)
if tex_with_lang.is_file():
# All is good
pass
elif solutiontex.is_file():
bar.warn(f'Rename solution.tex to solution.{language}.tex', problem.name)
elif tex_no_lang.is_file():
bar.warn(
f'Rename {build_type.value}.tex to {build_type.value}.{language}.tex',
problem.name,
)
continue
else:
bar.warn(f'solution.{language}.tex not found', problem.name)
bar.warn(f'{build_type.value}.{language}.tex not found', problem.name)
continue

problems_data += substitute(
Expand Down

0 comments on commit 4a325a3

Please sign in to comment.