Files
ouc_latex_template/试卷归档目录/oucgddir.sty
T
laoyang 3906bb49a4 清理代码库中的开发过程内容
- 删除 WORKFLOW.md(开发流程文档,已移入记忆库)
- build.sh 去掉 WSL 相关说明
- 33 个源文件的注释:去掉踩坑记录、实测推导、原文件对比、工单号引用
- 保留技术参数、约束说明、命令含义

净删 399 行。全库 16/16 编译通过。
2026-11-01 09:29:00 +08:00

143 lines
4.9 KiB
TeX
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{oucgddir}[2026/10/27 v1.0 OUC exam archive checklist]
%======================================================================
% oucgddir.sty —— 试卷归档目录版式包
%
% 提供:gdtable 环境、\gdtitle、\gdhead、\gdno、\gditem、\gdnote
% 用法见同目录 README.md
%======================================================================
\RequirePackage{geometry}
\RequirePackage{fontspec}
\RequirePackage{xeCJK}
\RequirePackage{tabularray}
%======================================================================
% 一、页面
%
% 表格宽 150.8105mm,比常规版心(左右各 31.75mm)宽约 4.14mm,
% 故整表按纸张居中,左右各留 29.599mm。
%
% totalwidth 取 150.8105mm 而非 150.636mm:tabularray 把竖线画在
% 版心边界内侧,线宽计入盒宽,故需补 0.1745mm。
%======================================================================
\geometry{
paperwidth = 210mm,
paperheight = 297mm,
left = 29.599mm,
totalwidth = 150.8105mm,
top = 25.40mm,
bottom = 25.40mm,
headheight = 0pt,
headsep = 0pt,
footskip = 17.50mm,
}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
\pagestyle{empty}
\input{../fonts.tex}
\xeCJKsetup{PunctStyle=plain}
%======================================================================
% 二、字号
%
% 行距统一取字号的 1.2 倍。
% 字号用 bp 单位:pt 换算成 PDF 点会有 72/72.27 的偏差,
% 写 24pt 实际排出 23.91bp。
%======================================================================
\newcommand{\gdbasefont}{%
\linespread{1}\relax
\fontsize{12bp}{14.4bp}\selectfont}
\newcommand{\gdtitlefont}{\linespread{1}\relax\fontsize{24bp}{28.8bp}\selectfont}
\newcommand{\gdheadfont} {\linespread{1}\relax\fontsize{18bp}{21.6bp}\selectfont}
\newcommand{\gdnotefont} {\linespread{1}\relax\fontsize{10.45bp}{12.54bp}\selectfont}
\newcommand{\gdcellfont} {\linespread{1}\relax\fontsize{12bp}{14.4bp}\selectfont}
%======================================================================
% 三、表格尺寸
%
% tabularray 的 wd 是内容宽,不含内边距;实际列间距 =
% wd + 2×colsep + 线宽。下列取值已扣除内边距与线宽。
%======================================================================
\newcommand{\gdrule}{0.5pt} % 边框粗细
\newcommand{\gdcolsep}{1.905mm} % 单元格内边距
\newlength{\gdtblw}
\setlength{\gdtblw}{150.636mm} % 表宽(含 4 根竖线与 6 处内边距)
\newcommand{\gdwa}{19.0853mm} % 第 1 列内容宽
\newcommand{\gdwb}{73.3601mm} % 第 2 列内容宽
\newcommand{\gdwc}{46.2315mm} % 第 3 列内容宽
%======================================================================
% 四、表格环境
%
% 3 列:序号 / 内容 / 标注
% 第 1 行表头高 20.3729mm,正文行高 13.5819mm,末行 13.9876mm
%======================================================================
\newenvironment{gdtable}{%
\par\begingroup
\begin{tblr}[label=none]{
colspec={Q[c,m,wd=19.0853mm] Q[c,m,wd=73.3601mm] Q[c,m,wd=46.2315mm]},
colsep=1.905mm, rowsep=0pt, stretch=0,
hline{1-Z}={\gdrule}, vline{1-Z}={\gdrule},
row{1}={ht=20.3729mm},
row{2-Z}={ht=13.5819mm},
row{13}={ht=13.9876mm},
}%
}{%
\end{tblr}\par\endgroup}
%======================================================================
% 五、单元格命令
%======================================================================
\newcommand{\gdno}[1]{{\kaiti\bfseries\gdcellfont #1\normalfont}}
\newcommand{\gditem}[1]{{\kaiti\gdcellfont #1\normalfont}}
\newcommand{\gdheadraw}[1]{{\kaiti\bfseries\gdheadfont #1\normalfont}}
\newcommand{\gdhead}[1]{\gdheadraw{#1}\par\vspace*{1.58pt}}
\newcommand{\gdnote}[1]{{\kaiti\gdnotefont #1\normalfont}}
% 第三列表头:上行「标注」+ 下行说明
\newcommand{\gdheadIII}{%
\gdheadraw{标注}\par
\vspace{6.72pt}%
\gdnote{(确认存档后在此栏打√)}\par
\vspace*{-2.98pt}}%
%======================================================================
% 六、标题
%
% 标题「归档目录」四字之间用 \gdgap 插入固定空隙。
% xeCJK 会吞掉连续半角空格,故不能用空格排版。
%======================================================================
\newlength{\gdtitleindent}
\setlength{\gdtitleindent}{48.701mm}
\newlength{\gdtitlegap}
\setlength{\gdtitlegap}{24bp} % 字间空隙 = 1 个字宽
\newcommand{\gdgap}{\kern\gdtitlegap}
\newcommand{\gdtitle}[1]{%
\par\noindent
\hspace*{\gdtitleindent}%
{\kaiti\gdtitlefont #1\normalfont\par}}
%======================================================================
% 七、垂直间距
%======================================================================
\newlength{\gdheadskip}
\setlength{\gdheadskip}{9.943mm} % 标题下到表头
\newlength{\gdtopskip}
\setlength{\gdtopskip}{2.7255mm} % 页顶到标题
\AtBeginDocument{\gdbasefont}
\endinput