diff --git a/_check_jumps.py b/_check_jumps.py deleted file mode 100644 index 7aa73d2..0000000 --- a/_check_jumps.py +++ /dev/null @@ -1,28 +0,0 @@ -import os - -outdir = os.path.join(os.path.dirname(__file__), 'chapters') -for fname in sorted(os.listdir(outdir)): - if not fname.endswith('.tex'): - continue - fpath = os.path.join(outdir, fname) - with open(fpath, 'r', encoding='utf-8') as fh: - content = fh.read() - lines = content.split('\n') - prev_cmd = '' - prev_title = '' - for i, line in enumerate(lines): - s = line.strip() - matched = None - for cmd in ['\\chapter{', '\\section{', '\\subsection{', '\\subsubsection{']: - if s.startswith(cmd): - matched = cmd - break - if matched: - # Check for level jumps (skip of 1 or more intermediate levels) - levels = {'\\chapter{': 0, '\\section{': 1, '\\subsection{': 2, '\\subsubsection{': 3} - if prev_cmd and matched in levels and prev_cmd in levels: - jump = levels[matched] - levels[prev_cmd] - if jump > 1: - title = s[len(matched):-1] - print(f'{fname}:{i+1}: {prev_cmd.replace("{","")} -> {matched.replace("{","")} ({jump} levels): {title[:60]}') - prev_cmd = matched diff --git a/_check_nums.py b/_check_nums.py deleted file mode 100644 index 7a2c739..0000000 --- a/_check_nums.py +++ /dev/null @@ -1,23 +0,0 @@ -import re, os - -outdir = r'e:/Project/SI/2026_DesignAI/officefile/latex/chapters' -total = 0 - -for fname in sorted(os.listdir(outdir)): - if fname == 'ch13-conclusion.tex' or not fname.endswith('.tex'): - continue - fpath = os.path.join(outdir, fname) - with open(fpath, 'r', encoding='utf-8') as f: - content = f.read() - - for cmd in ['section', 'subsection', 'subsubsection']: - pattern = re.compile(r'\\' + cmd + r'\{(\d+\.[^}]+)\}') - matches = pattern.findall(content) - for m in matches[:3]: - head = m[:60] - print(f' \\{cmd}{{{head}}}') - if len(matches) > 3: - print(f' ... and {len(matches)-3} more \\{cmd} with numbers') - total += len(matches) - -print(f'\nTotal headings with numeric prefix: {total}')