From 4a325a355ae0edf8ef5c0c2d94b12e43c64d6818 Mon Sep 17 00:00:00 2001 From: Maarten Sijm <9739541+mpsijm@users.noreply.github.com> Date: Sat, 21 Dec 2024 15:49:23 +0100 Subject: [PATCH] [latex] Problem Slides at contest level: warn for each problem missing problem-slide.en.tex --- bin/latex.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/bin/latex.py b/bin/latex.py index 266a3e36..2e1e3d59 100644 --- a/bin/latex.py +++ b/bin/latex.py @@ -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(