Files

143 lines
4.9 KiB
TeX
Raw Permalink Normal View History

2026-10-27 07:51:10 +08:00
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{oucgddir}[2026/10/27 v1.0 OUC exam archive checklist]
2026-11-01 09:29:00 +08:00
%======================================================================
% oucgddir.sty —— 试卷归档目录版式包
%
% 提供:gdtable 环境、\gdtitle、\gdhead、\gdno、\gditem、\gdnote
% 用法见同目录 README.md
%======================================================================
2026-10-27 07:51:10 +08:00
\RequirePackage{geometry}
\RequirePackage{fontspec}
\RequirePackage{xeCJK}
\RequirePackage{tabularray}
%======================================================================
2026-11-01 09:29:00 +08:00
% 一、页面
2026-10-27 07:51:10 +08:00
%
2026-11-01 09:29:00 +08:00
% 表格宽 150.8105mm,比常规版心(左右各 31.75mm)宽约 4.14mm,
% 故整表按纸张居中,左右各留 29.599mm。
2026-10-27 07:51:10 +08:00
%
2026-11-01 09:29:00 +08:00
% totalwidth 取 150.8105mm 而非 150.636mm:tabularray 把竖线画在
% 版心边界内侧,线宽计入盒宽,故需补 0.1745mm。
2026-10-27 07:51:10 +08:00
%======================================================================
\geometry{
paperwidth = 210mm,
paperheight = 297mm,
2026-11-01 09:29:00 +08:00
left = 29.599mm,
totalwidth = 150.8105mm,
2026-10-27 07:51:10 +08:00
top = 25.40mm,
bottom = 25.40mm,
headheight = 0pt,
headsep = 0pt,
footskip = 17.50mm,
}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
2026-11-01 09:29:00 +08:00
\pagestyle{empty}
2026-10-27 07:51:10 +08:00
\input{../fonts.tex}
\xeCJKsetup{PunctStyle=plain}
2026-11-01 09:29:00 +08:00
%======================================================================
% 二、字号
2026-10-27 07:51:10 +08:00
%
2026-11-01 09:29:00 +08:00
% 行距统一取字号的 1.2 倍。
% 字号用 bp 单位:pt 换算成 PDF 点会有 72/72.27 的偏差,
% 写 24pt 实际排出 23.91bp。
%======================================================================
2026-10-27 07:51:10 +08:00
\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}
%======================================================================
2026-11-01 09:29:00 +08:00
% 三、表格尺寸
2026-10-27 07:51:10 +08:00
%
2026-11-01 09:29:00 +08:00
% tabularray 的 wd 是内容宽,不含内边距;实际列间距 =
% wd + 2×colsep + 线宽。下列取值已扣除内边距与线宽。
2026-10-27 07:51:10 +08:00
%======================================================================
2026-11-01 09:29:00 +08:00
\newcommand{\gdrule}{0.5pt} % 边框粗细
\newcommand{\gdcolsep}{1.905mm} % 单元格内边距
2026-10-27 07:51:10 +08:00
\newlength{\gdtblw}
\setlength{\gdtblw}{150.636mm} % 表宽(含 4 根竖线与 6 处内边距)
2026-11-01 09:29:00 +08:00
\newcommand{\gdwa}{19.0853mm} % 第 1 列内容宽
\newcommand{\gdwb}{73.3601mm} % 第 2 列内容宽
\newcommand{\gdwc}{46.2315mm} % 第 3 列内容宽
2026-10-27 07:51:10 +08:00
%======================================================================
2026-11-01 09:29:00 +08:00
% 四、表格环境
2026-10-27 07:51:10 +08:00
%
2026-11-01 09:29:00 +08:00
% 3 列:序号 / 内容 / 标注
% 第 1 行表头高 20.3729mm,正文行高 13.5819mm,末行 13.9876mm
2026-10-27 07:51:10 +08:00
%======================================================================
\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}
%======================================================================
2026-11-01 09:29:00 +08:00
% 五、单元格命令
2026-10-27 07:51:10 +08:00
%======================================================================
\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}}
2026-11-01 09:29:00 +08:00
% 第三列表头:上行「标注」+ 下行说明
2026-10-27 07:51:10 +08:00
\newcommand{\gdheadIII}{%
\gdheadraw{标注}\par
\vspace{6.72pt}%
\gdnote{(确认存档后在此栏打√)}\par
\vspace*{-2.98pt}}%
%======================================================================
2026-11-01 09:29:00 +08:00
% 六、标题
2026-10-27 07:51:10 +08:00
%
2026-11-01 09:29:00 +08:00
% 标题「归档目录」四字之间用 \gdgap 插入固定空隙。
% xeCJK 会吞掉连续半角空格,故不能用空格排版。
2026-10-27 07:51:10 +08:00
%======================================================================
\newlength{\gdtitleindent}
\setlength{\gdtitleindent}{48.701mm}
\newlength{\gdtitlegap}
2026-11-01 09:29:00 +08:00
\setlength{\gdtitlegap}{24bp} % 字间空隙 = 1 个字宽
2026-10-27 07:51:10 +08:00
\newcommand{\gdgap}{\kern\gdtitlegap}
\newcommand{\gdtitle}[1]{%
\par\noindent
\hspace*{\gdtitleindent}%
{\kaiti\gdtitlefont #1\normalfont\par}}
%======================================================================
2026-11-01 09:29:00 +08:00
% 七、垂直间距
2026-10-27 07:51:10 +08:00
%======================================================================
\newlength{\gdheadskip}
2026-11-01 09:29:00 +08:00
\setlength{\gdheadskip}{9.943mm} % 标题下到表头
2026-10-27 07:51:10 +08:00
\newlength{\gdtopskip}
2026-11-01 09:29:00 +08:00
\setlength{\gdtopskip}{2.7255mm} % 页顶到标题
2026-10-27 07:51:10 +08:00
\AtBeginDocument{\gdbasefont}
\endinput