From 57c04644d2516738bd821a7d310758e1b2fdf4b4 Mon Sep 17 00:00:00 2001 From: xiaopeng <1509442308@qq.com> Date: Fri, 29 May 2026 12:25:04 +0800 Subject: [PATCH] =?UTF-8?q?chore(latex):=20=E6=B8=85=E7=90=86=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E6=96=87=E4=BB=B6=EF=BC=8Cfigures=20=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=20gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除 content_raw.tex、_test_ch04.tex、_check_jumps.py、_check_nums.py 将 officefile/latex/figures/ 加入 .gitignore Co-Authored-By: Claude Opus 4.7 --- .gitignore | 1 + officefile/latex/_check_jumps.py | 28 ---------------------------- officefile/latex/_check_nums.py | 23 ----------------------- 3 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 officefile/latex/_check_jumps.py delete mode 100644 officefile/latex/_check_nums.py diff --git a/.gitignore b/.gitignore index c0e00e6..509bf81 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ output/ *.blg *.synctex.gz *.pdf +officefile/latex/figures/ diff --git a/officefile/latex/_check_jumps.py b/officefile/latex/_check_jumps.py deleted file mode 100644 index 7aa73d2..0000000 --- a/officefile/latex/_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/officefile/latex/_check_nums.py b/officefile/latex/_check_nums.py deleted file mode 100644 index 7a2c739..0000000 --- a/officefile/latex/_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}')