使用 LaTeX 制作三张 A4 的全国卷答题卡 [复制链接]

管理员组

选自:https://zhuanlan.zhihu.com/p/2057104225402885805

考生号填涂版

使用说明

20261025011706240.jpg
20261025011706295.jpg
20261025011706137.jpg
20261025011706358.jpg
20261025011706173.jpg
20261025011706111.jpg
20261025011712864.jpg
20261025011713601.jpg

LaTeX 代码

\documentclass[UTF8, 11pt, a4paper, oneside]{ctexart}
\usepackage{amsmath, amsthm, amssymb, graphicx}
\usepackage[bookmarks=true, colorlinks, citecolor=blue, linkcolor=black]{hyperref}
\usepackage{geometry}
\usepackage{diagbox}
\usepackage{[tikz](https://zhida.zhihu.com/search?content_id=278353680&content_type=Article&match_order=1&q=tikz&zhida_source=entity)}
\geometry{left=0.6cm, right=0.6cm, top=0.6cm, bottom=0.6cm}
\linespread{1.625}
\setcounter{page}{1}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\usepackage{upgreek} % 加载 upgreek 宏包
\usepackage{fancyhdr}
\usepackage{[makecell](https://zhida.zhihu.com/search?content_id=278353680&content_type=Article&match_order=1&q=makecell&zhida_source=entity)}
\usepackage{caption}
\usepackage{[float](https://zhida.zhihu.com/search?content_id=278353680&content_type=Article&match_order=1&q=float&zhida_source=entity)}
\usetikzlibrary{intersections}
\usetikzlibrary{calc}
\pagestyle{fancy}


\fancyhf{}

\usepackage{eso-pic}  % 用于在每页添加内容
\definecolor{mycolor}{RGB}{255,50,165}%主颜色,考试答题卡常用颜色有{255,0,0}、{255,25,25}、{255,0,255}、{255,50,165},为了环保,平时校内黑白印刷的时候想印得清楚一点也可以选黑色{0,0,0}
\AddToShipoutPictureFG{%
    \begin{tikzpicture}[remember picture, overlay]
        \fill[black] ([xshift=0.6cm, yshift=0.6cm] current page.south west) rectangle ++(10mm, 6mm);
        \fill[black] ([xshift=-0.6cm, yshift=0.6cm] current page.south east) rectangle ++(-10mm, 6mm);
        \fill[black] ([xshift=-0.6cm, yshift=-0.6cm] current page.north east) rectangle ++(-10mm, -6mm);
        \fill[black] ([xshift=0.6cm, yshift=-0.6cm] current page.north west) rectangle ++(10mm, -6mm);
        % 在页面底部放置页脚
        \node at (current page.south) 
            [anchor=south, yshift=0.6cm] 
            {\color{mycolor}\textbf{数学答题卡第\thepage 页(共6页)}};
            % {数学答题卡第\thepage 页(共6页)};
    \end{tikzpicture}%
}
\begin{document}
%----------------------第一页-------------------------------
\centering
\begin{tikzpicture}
    \useasboundingbox (0,0) rectangle (19.7,28.25);
    \node[font=\fontsize{16pt}{16pt}\selectfont] 
        at (9.85,27.3)
        {\color{mycolor}\textbf{2025年[普通高等学校招生全国统一考试](https://zhida.zhihu.com/search?content_id=278353680&content_type=Article&match_order=1&q=%E6%99%AE%E9%80%9A%E9%AB%98%E7%AD%89%E5%AD%A6%E6%A0%A1%E6%8B%9B%E7%94%9F%E5%85%A8%E5%9B%BD%E7%BB%9F%E4%B8%80%E8%80%83%E8%AF%95&zhida_source=entity)}};
        % {2025年普通高等学校招生全国统一考试};
    \node[font=\fontsize{22pt}{22pt}\selectfont] at (9.85,26.3){\textbf{数学答题卡}};
    \node at (9.85,25) {试室号:\textcolor{mycolor}{\underline{\hspace{2cm}}} \hspace{0.6em}座位号:\textcolor{mycolor}{\underline{\hspace{2cm}}}\hspace{0.6em}姓名:\textcolor{mycolor}{\underline{\hspace{3.2cm}}} \hspace{0.6em} 班级:\textcolor{mycolor}{\underline{\hspace{3.2cm}}}};
   
    % 绘制考生号表格
    \def\rows{10}%行数(通常为10行,分别是数字0-9)
    \def\cols{10}%列数(准考证号的位数)
    \def\cellw{0.9}%每列的宽
    \def\cellh{0.5}%每行的高
    \def\beginx{9.5}%准考证号表格左上角横坐标
    \def\beginy0{24.2}%准考证号左上角纵坐标
    \def\fontHeight{0.6}%“准考证号”一行的行高
    \def\smallHeight{0.2}%填涂码区的上下外边距
    \def\selectw{0.5}%选项码的长
    \def\selecth{0.25}%选项码的宽
    \foreach \col [evaluate=\col as \x using \beginx+\col*\cellw] in {0,...,\cols} {
        \draw[mycolor] (\x, \beginy0-\fontHeight) -- (\x,\beginy0-\fontHeight-\cellw-\cellh*\rows-2*\smallHeight);
    }
    \draw[mycolor] (\beginx,\beginy0-\fontHeight) -- (\beginx+\cellw*\cols,\beginy0-\fontHeight);
    \draw[mycolor] (\beginx,\beginy0) -- (\beginx+\cellw*\cols,\beginy0);
    \draw[mycolor] (\beginx,\beginy0) -- (\beginx,\beginy0-\fontHeight);
    \draw[mycolor] (\beginx+\cellw*\cols,\beginy0) -- (\beginx+\cellw*\cols,\beginy0-\fontHeight);
    \draw[mycolor] (\beginx,\beginy0-\fontHeight-\cellw) -- (\beginx+\cellw*\cols,\beginy0-\fontHeight-\cellw);
    \draw[mycolor] (\beginx,\beginy0-\fontHeight-\cellw-\smallHeight*2-\cellh*\rows) -- (\beginx+\cellw*\cols,\beginy0-\fontHeight-\cellw-\smallHeight*2-\cellh*\rows);
    \node at (\beginx+0.5*\cols*\cellw,\beginy0-0.5*\fontHeight) {\small\textbf{考\hspace{1em}生\hspace{1em}号}};
    \foreach \row in {1,...,\rows} {
        \foreach \col in {1,...,\cols} {
            \node at (\beginx+\col*\cellw-0.5*\cellw,\beginy0-\fontHeight-\cellw-\smallHeight-\row*\cellh+0.5*\cellh) {\footnotesize\textcolor{mycolor}{\the\numexpr \row - 1 \relax}};
            %方案一:矩形码
            % \draw[mycolor] (\beginx+\col*\cellw-0.5*\cellw-0.5*\selectw,\beginy0-\fontHeight-\cellw-\smallHeight-\row*\cellh+0.5*\cellh+0.5*\selecth) rectangle ++(\selectw, -\selecth);
            %方案二:中括号码
            \draw[mycolor] (\beginx+\col*\cellw-0.5*\cellw-0.5*\selectw+0.25*\selectw,\beginy0-\fontHeight-\cellw-\smallHeight-\row*\cellh+0.5*\cellh+0.5*\selecth) -- ++(-0.25*\selectw,0) -- ++(0,-\selecth) -- ++(0.25*\selectw,0);
            \draw[mycolor] (\beginx+\col*\cellw-0.5*\cellw-0.5*\selectw+0.75*\selectw,\beginy0-\fontHeight-\cellw-\smallHeight-\row*\cellh+0.5*\cellh+0.5*\selecth) -- ++(0.25*\selectw,0) -- ++(0,-\selecth) -- ++(-0.25*\selectw,0);
        }
    } 

    %黑色矩形定位标记
    \foreach \row in {1,...,\rows} {
        \fill[black] (18.9,\beginy0-\fontHeight-\cellw-\smallHeight-\row*\cellh+0.5*\cellh+0.5*\selecth) rectangle ++(\selectw,-\selecth);
    }
    \foreach \col in{1,2,...,\cols} {
        \fill[black] (\beginx+\col*\cellw-0.5*\cellw-0.5*\selectw,28.1) rectangle ++(\selectw,-\selecth);
    }

    %注意事项框
    \def\startx{1.2}%框的左上角横坐标
    \def\starty{24.2}%框的左上角纵坐标
    \def\squarew{7.7}%框的宽
    \def\squareh{4.8}%框的高
    \def\fontmarginx{0.1}%文字左右边距
    \def\fontmarginy{0.1}%文字上下边距
    \draw[mycolor] (\startx,\starty) rectangle ++(\squarew,-\squareh);
    \node[text width=7.3cm,align=left,anchor=north west] at (\startx+\fontmarginx,\starty-\fontmarginy)
        {\fontsize{8pt}{8pt}\selectfont\textbf{注意事项}:\\
            \hangindent=1.5em1.答题前,考生务必用黑色字迹的钢笔或签字笔将试室号、座位号、姓名和考生号填写在答题卡上,并用\hspace{0.1em}2B\hspace{0.1em}铅笔将考生号对应的数字涂黑。\\
            \hangindent=1.5em2.回答选择题时,选出每小题答案以后,用\hspace{0.1em}2B\hspace{0.1em}铅笔把答题卡上对应题目的答案标号涂黑。如需改动,用橡皮擦擦干净后,再选其它答案标号涂黑。回答非选择题时,将答案写在答题卡上指定区域内,超出答题区域的答案无效。\\
            \hangindent=1.5em3.正确填涂试卷类型,否则答案无效。\\
            \hangindent=1.5em4.答题卡保持卡面整洁,不要折叠和弄破。\\
        };
    
    %试卷类型
    \def\boxx{1.2}
    \def\boxy{19.1}
    \def\boxw{2.5}
    \def\boxh{1.8}
    \draw[mycolor] (\boxx,\boxy) rectangle ++(\boxw,-\boxh);
    \node[anchor=north west, align=left, font=\fontsize{9pt}{9pt}\selectfont] at (\boxx+0.1, \boxy-0.1) 
        {\textbf{试卷类型}:\\
            试卷A\\
            试卷B\\
        };
    %黑色矩形定位
    \draw[mycolor] (\boxx+1.5,\boxy-0.8) rectangle ++(\selectw,-\selecth);
    \draw[mycolor] (\boxx+1.5,\boxy-1.3) rectangle ++(\selectw,-\selecth);
    \fill[black] (0.25,\boxy-0.8) rectangle ++(\selectw,-\selecth);
    \fill[black] (0.25,\boxy-1.3) rectangle ++(\selectw,-\selecth);
    \fill[black] (\boxx+1.5,28.1) rectangle ++(\selectw,-\selecth);

    %填涂样例
    \def\samplex{3.9}
    \def\sampley{19.1}
    \def\samplew{3.1}
    \def\sampleh{1.8}
    \draw[mycolor] (\samplex,\sampley) rectangle ++(\samplew,-\sampleh);
    \node[anchor=north west, align=left, font=\fontsize{9pt}{9pt}\selectfont] at (\samplex+0.1, \sampley-0.1) 
        {\textbf{填涂样例}:\\
            正确填涂:\\
            错误填涂:\\
        };
    \fill[black] (\samplex+1.7,\sampley-0.8) rectangle ++(\selectw,-\selecth);
    \draw[mycolor] (\samplex+1.7,\sampley-1.3) rectangle ++(\selectw,-\selecth);
    \draw[mycolor] (\samplex+2.4,\sampley-1.3) rectangle ++(\selectw,-\selecth);
    \fill[black] (\samplex+1.73,\sampley-1.4) -- (\samplex+1.45+\selectw,\sampley-1.3-\selecth)--(\samplex+1.65+\selectw,\sampley-1.05-\selecth)--(\samplex+1.6+\selectw,\sampley-1-\selecth)--(\samplex+1.43+\selectw,\sampley-1.2-\selecth)--(\samplex+1.27+\selectw,\sampley-1.1-\selecth) --cycle;
    \fill[black] (\samplex+2.35,\sampley-1.35) rectangle ++(0.6,-0.1);

    %缺考标记
    \def\lessx{7.2}
    \def\lessy{19.1}
    \def\lessw{1.7}
    \def\lessh{1.8}
    \draw[mycolor] (\lessx,\lessy) rectangle ++(\lessw,-\lessh);
    \node[anchor=north west, align=left, font=\fontsize{9pt}{9pt}\selectfont] at (\lessx+0.1, \lessy-0.1) 
        {\textbf{缺考标记}\\
        };
    \draw[mycolor] (\lessx+0.5*\lessw-0.5*\selectw,\lessy-1) rectangle ++(\selectw,-\selecth);
    %标记矩形
    \fill[black] (\lessx+0.5*\lessw-0.5*\selectw,28.1) rectangle ++(\selectw,-\selecth);

    %第一页大框
    \def\bigx{1.2}
    \def\bigy{16.9}
    \def\bigw{17.3}
    \def\bigh{16.3}
    \draw[rounded corners=10pt,mycolor] (\bigx,\bigy) rectangle ++(\bigw,-\bigh);

    %选择题框
    \def\chosex{1.4}%框左上角横坐标
    \def\chosey{16.2}%框左上角纵坐标
    \def\chosew{16.9}%框的宽度
    \def\choseh{2.7}%框的高度
    \draw[black] (\chosex,\chosey) rectangle ++(\chosew,-\choseh);
    \node[anchor=north west, align=left, font=\fontsize{10pt}{9pt}\selectfont] at (\chosex+0.1, \chosey+0.6) 
        {\textbf{一、选择题}\\
        };
    %选择题选项
    \def\chosenumx{1.9}%第一个题号左上角横坐标
    \def\chosenumy{15.67}%第一个题号左上角纵坐标
    \def\chosedistancey{0.55}%两个上下字母中心的垂直距离
    \def\numenglishd{0.8}%题号与其右侧选项字母中心的水平距离
    \def\chosedistancex{0.75}%两个左右相邻选项字母中心的水平距离
    \def\distance{2}%每一列D选项字母中心与右侧下一组题号水平留下的间隙
    \def\quantity{11}%选项的数量
    \pgfmathsetmacro{\d}{\numenglishd+3*\chosedistancex+\distance}
    \foreach \row in {0,...,\numexpr\quantity-1\relax} {
        \pgfmathtruncatemacro{\nx}{floor(\row/4)}
        \node at (\chosenumx+\nx*\d,\chosenumy-\row*\chosedistancey+\nx*4*\chosedistancey) {\the\numexpr \row + 1 \relax};
        \foreach \col in {0,1,2,3} {
            \pgfmathsetmacro{\x}{{"A","B","C","D"}[\col]}
            \node at (\chosenumx+\numenglishd+\chosedistancex*\col+\nx*\d,\chosenumy-\row*\chosedistancey+\nx*4*\chosedistancey) {\footnotesize\textcolor{mycolor}{\x}};
            %方案一:矩形码
            % \draw[mycolor] (\chosenumx+\numenglishd-0.5*\selectw+\chosedistancex*\col+\nx*\d,\chosenumy-\row*\chosedistancey+0.5*\selecth+\nx*4*\chosedistancey) rectangle ++(\selectw,-\selecth);
            %方案二:中括号码
            \draw[mycolor] (\chosenumx+\numenglishd-0.25*\selectw+\chosedistancex*\col+\nx*\d,\chosenumy-\row*\chosedistancey+0.5*\selecth+\nx*4*\chosedistancey) -- ++(-0.25*\selectw,0) -- ++(0,-\selecth) -- ++(0.25*\selectw,0);
            \draw[mycolor] (\chosenumx+\numenglishd+0.25*\selectw+\chosedistancex*\col+\nx*\d,\chosenumy-\row*\chosedistancey+0.5*\selecth+\nx*4*\chosedistancey) -- ++(0.25*\selectw,0) -- ++(0,-\selecth) -- ++(-0.25*\selectw,0);
        }
    }
   
    %矩形定位
    \foreach \row in{0,1,2,3} {
        \fill[black] (0.25,\chosenumy-\row*\chosedistancey+0.5*\selecth) rectangle ++(\selectw,-\selecth);
        \fill[black] (18.9,\chosenumy-\row*\chosedistancey+0.5*\selecth) rectangle ++(\selectw,-\selecth);
    }

    %填空题框
    \def\blankx{1.4}%框左上角横坐标
    \def\blanky{12.8}%框左上角纵坐标
    \def\blankw{16.9}%框的宽度
    \def\blankh{1.4}%框的高度
    \def\blanknumx{1.9}%第一个题号左上角横坐标
    \def\blanknumy{12}%第一个题号左上角纵坐标
    \pgfmathsetmacro{\distancew}{\numenglishd + 3*\chosedistancex + \distance}%相邻两个题号中心的水平距离
    \draw[black] (\blankx,\blanky) rectangle ++(\blankw,-\blankh);
    \node[anchor=north west, align=left, font=\fontsize{10pt}{9pt}\selectfont] at (\blankx+0.1, \blanky+0.6) 
        {\textbf{二、填空题}\\
        };
    \foreach \row in {0,1,2} {
        \node at (\blanknumx+\row*\distancew+0.1,\blanknumy) {\the\numexpr \row + 12 \relax.};
        \draw[mycolor] (\blanknumx+\row*\distancew+0.4,\blanknumy-0.2) -- ++(\distancew-0.8,0);
    }
    %解答题框
    \def\ebx{1.4}%框左上角横坐标
    \def\eby{10.7}%框左上角纵坐标
    \def\ebw{16.9}%框的宽度
    \def\ebh{9.5}%框的高度
    \draw[black] (\ebx,\eby) rectangle ++(\ebw,-\ebh);
    \node[anchor=north west, align=left, font=\fontsize{10pt}{9pt}\selectfont] at (\ebx+0.1, \eby+0.6) 
        {\textbf{三、解答题}\\
        };
    
    \node[text=mycolor] at (9.85,\bigy-\bigh+0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    
    %第15题
    \def\exx{2.7}%题号文字中心横坐标
    \def\exy{10.2}%题号文字中心纵坐标
    \node at (\exx,\exy) {15.(13分)};

    %补充矩形
    \fill[black] (\boxx+0.5,28.1) rectangle ++(\selectw,-\selecth);
    \fill[black] (\boxx+2.5,28.1) rectangle ++(\selectw,-\selecth);
    \fill[black] (\boxx+3.5,28.1) rectangle ++(\selectw,-\selecth);
    \fill[black] (\boxx+4.5,28.1) rectangle ++(\selectw,-\selecth);
    \fill[black] (\boxx+5.5,28.1) rectangle ++(\selectw,-\selecth);
    \fill[black] (\boxx+7.5,28.1) rectangle ++(\selectw,-\selecth);
\end{tikzpicture}

%----------------------第二页-------------------------------
    \newpage
\centering
\begin{tikzpicture}
    \useasboundingbox (0,0) rectangle (19.7,28.25);
    %第二页大框
    \def\bigx{1.2}
    \def\bigy{27.5}
    \def\bigw{17.3}
    \def\bigh{26.9}
    \draw[rounded corners=10pt,mycolor] (\bigx,\bigy) rectangle ++(\bigw,-\bigh);

    %解答题框
    \def\ebx{1.4}%框左上角横坐标
    \def\eby{26.9}%框左上角纵坐标
    \def\ebw{16.9}%框的宽度
    \def\ebh{25.7}%框的高度
    \draw[black] (\ebx,\eby) rectangle ++(\ebw,-\ebh);
    \draw (\ebx,\eby-0.25*\ebh) -- (\ebx+\ebw,\eby-0.25*\ebh);
    
    \node[text=mycolor] at (9.85,\bigy-\bigh+0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    \node[text=mycolor] at (9.85,\bigy-0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    
    %第16题
    \def\exx{2.7}%左上角文字中心横坐标
    \def\exy{26.4}%左上角文字中心纵坐标
    \node at (\exx,\exy-0.25*\ebh) {16.(15分)};
    \node at (\exx,\exy) {\textcolor{mycolor}{\textbf{(续15题)}}};
\end{tikzpicture}

%----------------------第三页-------------------------------
    \newpage
\centering
\begin{tikzpicture}
    \useasboundingbox (0,0) rectangle (19.7,28.25);
    \node[font=\fontsize{16pt}{16pt}\selectfont] 
        at (9.85,27.3)
        {\color{mycolor}\textbf{2025年普通高等学校招生全国统一考试}};
        % {2025年普通高等学校招生全国统一考试};
    \node[font=\fontsize{22pt}{22pt}\selectfont] at (9.85,26.3){\textbf{数学答题卡}};
    \node at (9.85,25) {试室号:\textcolor{mycolor}{\underline{\hspace{2cm}}} \hspace{0.6em}座位号:\textcolor{mycolor}{\underline{\hspace{2cm}}}\hspace{0.6em}姓名:\textcolor{mycolor}{\underline{\hspace{3.2cm}}} \hspace{0.6em} 班级:\textcolor{mycolor}{\underline{\hspace{3.2cm}}}};
    
    \def\numberx{1.35}%考生号左边界横坐标
    \def\numbery{23.8}%考生号左边界中心纵坐标
    \def\size{1}%格子大小
    \node[anchor=west] at (\numberx,\numbery) {考生号};
    \def\total{10}%考生号位数
    \def\numberD{1.5}%考生号左端边界与第一个方框的水平距离
    \def\Distance{1}%相邻两个格子的中心水平间距
    \foreach \col in {1,...,\total} {
        \draw[mycolor] (\numberx+\numberD+\col*\Distance-\Distance,\numbery+0.5*\size) rectangle ++(\size,-\size);
    }
    %第三页大框
    \def\bigx{1.2}
    \def\bigy{22.8}
    \def\bigw{17.3}
    \def\bigh{22.2}
    \draw[rounded corners=10pt,mycolor] (\bigx,\bigy) rectangle ++(\bigw,-\bigh);

    %解答题框
    \def\ebx{1.4}%框左上角横坐标
    \def\eby{22.2}%框左上角纵坐标
    \def\ebw{16.9}%框的宽度
    \def\ebh{21}%框的高度
    \draw[black] (\ebx,\eby) rectangle ++(\ebw,-\ebh);
    
    \node[text=mycolor] at (9.85,\bigy-\bigh+0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    \node[text=mycolor] at (9.85,\bigy-0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    
    %第17题
    \def\exx{2.7}%题号文字中心横坐标
    \def\exy{21.7}%题号文字中心纵坐标
    \node at (\exx,\exy) {17.(15分)};

\end{tikzpicture}

%----------------------第四页-------------------------------
    \newpage
\centering
\begin{tikzpicture}
    \useasboundingbox (0,0) rectangle (19.7,28.25);
    %第四页大框
    \def\bigx{1.2}
    \def\bigy{27.5}
    \def\bigw{17.3}
    \def\bigh{26.9}
    \draw[rounded corners=10pt,mycolor] (\bigx,\bigy) rectangle ++(\bigw,-\bigh);

    %解答题框
    \def\ebx{1.4}%框左上角横坐标
    \def\eby{26.9}%框左上角纵坐标
    \def\ebw{16.9}%框的宽度
    \def\ebh{25.7}%框的高度
    \draw[black] (\ebx,\eby) rectangle ++(\ebw,-\ebh);
    
    \node[text=mycolor] at (9.85,\bigy-\bigh+0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    \node[text=mycolor] at (9.85,\bigy-0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};

    %第18题
    \def\exx{2.7}%题号文字中心横坐标
    \def\exy{26.4}%题号文字中心横坐标
    \node at (\exx,\exy) {18.(17分)};
\end{tikzpicture}

%----------------------第五页-------------------------------   
    \newpage
\centering
\begin{tikzpicture}
    \useasboundingbox (0,0) rectangle (19.7,28.25);
    \node[font=\fontsize{16pt}{16pt}\selectfont] 
        at (9.85,27.3)
        {\color{mycolor}\textbf{2025年普通高等学校招生全国统一考试}};
        % {2025年普通高等学校招生全国统一考试};
    \node[font=\fontsize{22pt}{22pt}\selectfont] at (9.85,26.3){\textbf{数学答题卡}};
    \node at (9.85,25) {试室号:\textcolor{mycolor}{\underline{\hspace{2cm}}} \hspace{0.6em}座位号:\textcolor{mycolor}{\underline{\hspace{2cm}}}\hspace{0.6em}姓名:\textcolor{mycolor}{\underline{\hspace{3.2cm}}} \hspace{0.6em} 班级:\textcolor{mycolor}{\underline{\hspace{3.2cm}}}};
    
    \def\numberx{1.35}%考生号左边界横坐标
    \def\numbery{23.8}%考生号左边界中心纵坐标
    \def\size{1}%格子大小
    \node[anchor=west] at (\numberx,\numbery) {考生号};
    \def\total{10}%考生号位数
    \def\numberD{1.5}%考生号左端边界与第一个方框的水平距离
    \def\Distance{1}%相邻两个格子的中心水平间距
    \foreach \col in {1,...,\total} {
        \draw[mycolor] (\numberx+\numberD+\col*\Distance-\Distance,\numbery+0.5*\size) rectangle ++(\size,-\size);
    }
    %第五页大框
    \def\bigx{1.2}
    \def\bigy{22.8}
    \def\bigw{17.3}
    \def\bigh{22.2}
    \draw[rounded corners=10pt,mycolor] (\bigx,\bigy) rectangle ++(\bigw,-\bigh);

    %解答题框
    \def\ebx{1.4}%框左上角横坐标
    \def\eby{22.2}%框左上角纵坐标
    \def\ebw{16.9}%框的宽度
    \def\ebh{21}%框的高度
    \draw[black] (\ebx,\eby) rectangle ++(\ebw,-\ebh);
    \draw (\ebx,\eby-0.5*\ebh) -- (\ebx+\ebw,\eby-0.5*\ebh);
    
    \node[text=mycolor] at (9.85,\bigy-\bigh+0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    \node[text=mycolor] at (9.85,\bigy-0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    
    %第19题
    \def\exx{2.7}%左上角文字中心横坐标
    \def\exy{21.7}%左上角文字中心纵坐标
    \node at (\exx,\exy-0.5*\ebh) {19.(17分)};
    \node at (\exx,\exy) {\textcolor{mycolor}{\textbf{(续18题)}}};
\end{tikzpicture}

%----------------------第六页-------------------------------
    \newpage
\centering
\begin{tikzpicture}
    \useasboundingbox (0,0) rectangle (19.7,28.25);
    %第六页大框
    \def\bigx{1.2}
    \def\bigy{27.5}
    \def\bigw{17.3}
    \def\bigh{26.9}
    \draw[rounded corners=10pt,mycolor] (\bigx,\bigy) rectangle ++(\bigw,-\bigh);

    %解答题框
    \def\ebx{1.4}%框左上角横坐标
    \def\eby{26.9}%框左上角纵坐标
    \def\ebw{16.9}%框的宽度
    \def\ebh{25.7}%框的高度
    \draw[black] (\ebx,\eby) rectangle ++(\ebw,-\ebh);
    
    \node[text=mycolor] at (9.85,\bigy-\bigh+0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    \node[text=mycolor] at (9.85,\bigy-0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    
    %第19题
    \def\exx{2.7}%左上角文字中心横坐标
    \def\exy{26.4}%左上角文字中心纵坐标
    \node at (\exx,\exy) {\textcolor{mycolor}{\textbf{(续19题)}}};
\end{tikzpicture}
\end{document}

条形码版

\documentclass[UTF8, 11pt, a4paper, oneside]{ctexart}
\usepackage{amsmath, amsthm, amssymb, graphicx}
\usepackage[bookmarks=true, colorlinks, citecolor=blue, linkcolor=black]{hyperref}
\usepackage{geometry}
\usepackage{diagbox}
\usepackage{tikz}
\geometry{left=0.6cm, right=0.6cm, top=0.6cm, bottom=0.6cm}
\linespread{1.625}
\setcounter{page}{1}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\usepackage{upgreek} % 加载 upgreek 宏包
\usepackage{fancyhdr}
\usepackage{makecell}
\usepackage{caption}
\usepackage{float}
\usetikzlibrary{intersections}
\usetikzlibrary{calc}
\pagestyle{fancy}


\fancyhf{}

\usepackage{eso-pic}  % 用于在每页添加内容
\definecolor{mycolor}{RGB}{255,50,165}%主颜色,考试答题卡常用颜色有{255,0,0}、{255,25,25}、{255,0,255}、{255,50,165},为了环保,平时校内黑白印刷的时候想印得清楚一点也可以选黑色{0,0,0}
\AddToShipoutPictureFG{%
    \begin{tikzpicture}[remember picture, overlay]
        \fill[black] ([xshift=0.6cm, yshift=0.6cm] current page.south west) rectangle ++(10mm, 6mm);
        \fill[black] ([xshift=-0.6cm, yshift=0.6cm] current page.south east) rectangle ++(-10mm, 6mm);
        \fill[black] ([xshift=-0.6cm, yshift=-0.6cm] current page.north east) rectangle ++(-10mm, -6mm);
        \fill[black] ([xshift=0.6cm, yshift=-0.6cm] current page.north west) rectangle ++(10mm, -6mm);
        % 在页面底部放置页脚
        \node at (current page.south) 
            [anchor=south, yshift=0.6cm] 
            {\color{mycolor}\textbf{数学答题卡第\thepage 页(共6页)}};
            % {数学答题卡第\thepage 页(共6页)};
    \end{tikzpicture}%
}
\begin{document}
%----------------------第一页-------------------------------
\centering
\begin{tikzpicture}
    \useasboundingbox (0,0) rectangle (19.7,28.25);
    \node[font=\fontsize{16pt}{16pt}\selectfont] 
        at (9.85,27.3)
        {\color{mycolor}\textbf{2025年普通高等学校招生全国统一考试}};
        % {2025年普通高等学校招生全国统一考试};
    \node[font=\fontsize{22pt}{22pt}\selectfont] at (9.85,26.3){\textbf{数学答题卡}};
    \node[right] at (1.2,25) {姓名:\textcolor{mycolor}{\underline{\hspace{5cm}}}};
   
    %考生号
    \def\numberx{9.8}%考生号左边界横坐标
    \def\numbery{25}%考生号左边界中心纵坐标
    \def\size{0.7}%格子大小
    \node[anchor=west] at (\numberx,\numbery) {考生号};
    \def\total{10}%考生号位数
    \def\numberD{1.5}%考生号左端边界与第一个方框的水平距离
    \def\Distance{0.7}%相邻两个格子的中心水平间距
    \foreach \col in {1,...,\total} {
        \draw[mycolor] (\numberx+\numberD+\col*\Distance-\Distance,\numbery+0.5*\size) rectangle ++(\size,-\size);
    }

    %条形码框
    \def\Tx{10.8}
    \def\Ty{24.2}
    \def\Tw{7.7}
    \def\Th{2.3}
    \draw[mycolor,dashed,thick] (\Tx,\Ty) rectangle ++(\Tw,-\Th);
    \node[mycolor] at (\Tx+0.5*\Tw,\Ty-0.5*\Th) {\textbf{条形码粘贴区}};


    \def\selectw{0.5}%选项码的长
    \def\selecth{0.25}%选项码的宽


    %注意事项框
    \def\startx{1.2}%框的左上角横坐标
    \def\starty{24.2}%框的左上角纵坐标
    \def\squarew{9.3}%框的宽
    \def\squareh{4.5}%框的高
    \def\fontmarginx{0.1}%文字左右边距
    \def\fontmarginy{0.1}%文字上下边距
    \draw[mycolor] (\startx,\starty) rectangle ++(\squarew,-\squareh);
    \node[text width=9cm,align=left,anchor=north west] at (\startx+\fontmarginx,\starty-\fontmarginy)
        {\fontsize{8pt}{8pt}\selectfont\textbf{注意事项}:\\
            \hangindent=1.5em1.答题前,考生务必用黑色字迹的钢笔或签字笔将姓名和考生号填写在答题卡上。\\
            \hangindent=1.5em2.回答选择题时,选出每小题答案以后,用\hspace{0.1em}2B\hspace{0.1em}铅笔把答题卡上对应题目的答案标号涂黑。如需改动,用橡皮擦擦干净后,再选其它答案标号涂黑。回答非选择题时,将答案写在答题卡上指定区域内,超出答题区域的答案无效。\\
            \hangindent=1.5em3.正确填涂试卷类型,否则答案无效。\\
            \hangindent=1.5em4.答题卡保持卡面整洁,不要折叠和弄破。\\
        };
    
    %试卷类型
    \def\boxx{10.8}
    \def\boxy{21.5}
    \def\boxw{2.5}
    \def\boxh{1.8}
    \draw[mycolor] (\boxx,\boxy) rectangle ++(\boxw,-\boxh);
    \node[anchor=north west, align=left, font=\fontsize{9pt}{9pt}\selectfont] at (\boxx+0.1, \boxy-0.1) 
        {\textbf{试卷类型}:\\
            试卷A\\
            试卷B\\
        };
    %黑色矩形定位
    \draw[mycolor] (\boxx+1.5,\boxy-0.8) rectangle ++(\selectw,-\selecth);
    \draw[mycolor] (\boxx+1.5,\boxy-1.3) rectangle ++(\selectw,-\selecth);
    \fill[black] (0.25,\boxy-0.8) rectangle ++(\selectw,-\selecth);
    \fill[black] (0.25,\boxy-1.3) rectangle ++(\selectw,-\selecth);
    % \fill[black] (\boxx+1.5,28.1) rectangle ++(\selectw,-\selecth);

    %填涂样例
    \def\samplex{13.5}
    \def\sampley{21.5}
    \def\samplew{3.1}
    \def\sampleh{1.8}
    \draw[mycolor] (\samplex,\sampley) rectangle ++(\samplew,-\sampleh);
    \node[anchor=north west, align=left, font=\fontsize{9pt}{9pt}\selectfont] at (\samplex+0.1, \sampley-0.1) 
        {\textbf{填涂样例}:\\
            正确填涂:\\
            错误填涂:\\
        };
    \fill[black] (\samplex+1.7,\sampley-0.8) rectangle ++(\selectw,-\selecth);
    \draw[mycolor] (\samplex+1.7,\sampley-1.3) rectangle ++(\selectw,-\selecth);
    \draw[mycolor] (\samplex+2.4,\sampley-1.3) rectangle ++(\selectw,-\selecth);
    \fill[black] (\samplex+1.73,\sampley-1.4) -- (\samplex+1.45+\selectw,\sampley-1.3-\selecth)--(\samplex+1.65+\selectw,\sampley-1.05-\selecth)--(\samplex+1.6+\selectw,\sampley-1-\selecth)--(\samplex+1.43+\selectw,\sampley-1.2-\selecth)--(\samplex+1.27+\selectw,\sampley-1.1-\selecth) --cycle;
    \fill[black] (\samplex+2.35,\sampley-1.35) rectangle ++(0.6,-0.1);

    %缺考标记
    \def\lessx{16.8}
    \def\lessy{21.5}
    \def\lessw{1.7}
    \def\lessh{1.8}
    \draw[mycolor] (\lessx,\lessy) rectangle ++(\lessw,-\lessh);
    \node[anchor=north west, align=left, font=\fontsize{9pt}{9pt}\selectfont] at (\lessx+0.1, \lessy-0.1) 
        {\textbf{缺考标记}\\
        };
    \draw[mycolor] (\lessx+0.5*\lessw-0.5*\selectw,\lessy-1) rectangle ++(\selectw,-\selecth);
    %标记矩形
    \fill[black] (18.9,\lessy-1) rectangle ++(\selectw,-\selecth);

    %第一页大框
    \def\bigx{1.2}
    \def\bigy{19.1}
    \def\bigw{17.3}
    \def\bigh{18.5}
    \draw[rounded corners=10pt,mycolor] (\bigx,\bigy) rectangle ++(\bigw,-\bigh);

    %选择题框
    \def\chosex{1.4}%框左上角横坐标
    \def\chosey{18.4}%框左上角纵坐标
    \def\chosew{16.9}%框的宽度
    \def\choseh{2.7}%框的高度
    \draw[black] (\chosex,\chosey) rectangle ++(\chosew,-\choseh);
    \node[anchor=north west, align=left, font=\fontsize{10pt}{9pt}\selectfont] at (\chosex+0.1, \chosey+0.6) 
        {\textbf{一、选择题}\\
        };
    %选择题选项
    \def\chosenumx{1.9}%第一个题号左上角横坐标
    \def\chosenumy{17.87}%第一个题号左上角纵坐标
    \def\chosedistancey{0.55}%两个上下字母中心的垂直距离
    \def\numenglishd{0.8}%题号与其右侧选项字母中心的水平距离
    \def\chosedistancex{0.75}%两个左右相邻选项字母中心的水平距离
    \def\distance{2}%每一列D选项字母中心与右侧下一组题号水平留下的间隙
    \def\quantity{11}%选项的数量
    \pgfmathsetmacro{\d}{\numenglishd+3*\chosedistancex+\distance}
    \foreach \row in {0,...,\numexpr\quantity-1\relax} {
        \pgfmathtruncatemacro{\nx}{floor(\row/4)}
        \node at (\chosenumx+\nx*\d,\chosenumy-\row*\chosedistancey+\nx*4*\chosedistancey) {\the\numexpr \row + 1 \relax};
        \foreach \col in {0,1,2,3} {
            \pgfmathsetmacro{\x}{{"A","B","C","D"}[\col]}
            \node at (\chosenumx+\numenglishd+\chosedistancex*\col+\nx*\d,\chosenumy-\row*\chosedistancey+\nx*4*\chosedistancey) {\footnotesize\textcolor{mycolor}{\x}};
            %方案一:矩形码
            % \draw[mycolor] (\chosenumx+\numenglishd-0.5*\selectw+\chosedistancex*\col+\nx*\d,\chosenumy-\row*\chosedistancey+0.5*\selecth+\nx*4*\chosedistancey) rectangle ++(\selectw,-\selecth);
            %方案二:中括号码
            \draw[mycolor] (\chosenumx+\numenglishd-0.25*\selectw+\chosedistancex*\col+\nx*\d,\chosenumy-\row*\chosedistancey+0.5*\selecth+\nx*4*\chosedistancey) -- ++(-0.25*\selectw,0) -- ++(0,-\selecth) -- ++(0.25*\selectw,0);
            \draw[mycolor] (\chosenumx+\numenglishd+0.25*\selectw+\chosedistancex*\col+\nx*\d,\chosenumy-\row*\chosedistancey+0.5*\selecth+\nx*4*\chosedistancey) -- ++(0.25*\selectw,0) -- ++(0,-\selecth) -- ++(-0.25*\selectw,0);
        }
    }
   
    %矩形定位
    \foreach \row in{0,1,2,3} {
        \fill[black] (0.25,\chosenumy-\row*\chosedistancey+0.5*\selecth) rectangle ++(\selectw,-\selecth);
        \fill[black] (18.9,\chosenumy-\row*\chosedistancey+0.5*\selecth) rectangle ++(\selectw,-\selecth);
    }

    %填空题框
    \def\blankx{1.4}%框左上角横坐标
    \def\blanky{15}%框左上角纵坐标
    \def\blankw{16.9}%框的宽度
    \def\blankh{1.4}%框的高度
    \def\blanknumx{1.9}%第一个题号左上角横坐标
    \def\blanknumy{14.2}%第一个题号左上角纵坐标
    \pgfmathsetmacro{\distancew}{\numenglishd + 3*\chosedistancex + \distance}%相邻两个题号中心的水平距离
    \draw[black] (\blankx,\blanky) rectangle ++(\blankw,-\blankh);
    \node[anchor=north west, align=left, font=\fontsize{10pt}{9pt}\selectfont] at (\blankx+0.1, \blanky+0.6) 
        {\textbf{二、填空题}\\
        };
    \foreach \row in {0,1,2} {
        \node at (\blanknumx+\row*\distancew+0.1,\blanknumy) {\the\numexpr \row + 12 \relax.};
        \draw[mycolor] (\blanknumx+\row*\distancew+0.4,\blanknumy-0.2) -- ++(\distancew-0.8,0);
    }
    %解答题框
    \def\ebx{1.4}%框左上角横坐标
    \def\eby{12.9}%框左上角纵坐标
    \def\ebw{16.9}%框的宽度
    \def\ebh{11.7}%框的高度
    \draw[black] (\ebx,\eby) rectangle ++(\ebw,-\ebh);
    \node[anchor=north west, align=left, font=\fontsize{10pt}{9pt}\selectfont] at (\ebx+0.1, \eby+0.6) 
        {\textbf{三、解答题}\\
        };
    
    \node[text=mycolor] at (9.85,\bigy-\bigh+0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    
    %第15题
    \def\exx{2.7}%题号文字中心横坐标
    \def\exy{12.4}%题号文字中心纵坐标
    \node at (\exx,\exy) {15.(13分)};

    %补充矩形
    \def\filine{19}%个数
    \def\spaces{0.9}%间隙
    \def\xx{1.4}%起始横坐标
    \foreach \col in{1,...,\filine}{
        \fill[black] (\xx+\spaces*\col-\spaces,28.1) rectangle ++(\selectw,-\selecth);
    }

\end{tikzpicture}

%----------------------第二页-------------------------------
    \newpage
\centering
\begin{tikzpicture}
    \useasboundingbox (0,0) rectangle (19.7,28.25);
    %第二页大框
    \def\bigx{1.2}
    \def\bigy{27.5}
    \def\bigw{17.3}
    \def\bigh{26.9}
    \draw[rounded corners=10pt,mycolor] (\bigx,\bigy) rectangle ++(\bigw,-\bigh);

    %解答题框
    \def\ebx{1.4}%框左上角横坐标
    \def\eby{26.9}%框左上角纵坐标
    \def\ebw{16.9}%框的宽度
    \def\ebh{25.7}%框的高度
    \draw[black] (\ebx,\eby) rectangle ++(\ebw,-\ebh);
    \draw (\ebx,\eby-0.25*\ebh) -- (\ebx+\ebw,\eby-0.25*\ebh);
    
    \node[text=mycolor] at (9.85,\bigy-\bigh+0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    \node[text=mycolor] at (9.85,\bigy-0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    
    %第16题
    \def\exx{2.7}%左上角文字中心横坐标
    \def\exy{26.4}%左上角文字中心纵坐标
    \node at (\exx,\exy-0.25*\ebh) {16.(15分)};
    \node at (\exx,\exy) {\textcolor{mycolor}{\textbf{(续15题)}}};
\end{tikzpicture}

%----------------------第三页-------------------------------
    \newpage
\centering
\begin{tikzpicture}
    \useasboundingbox (0,0) rectangle (19.7,28.25);
    \node[font=\fontsize{16pt}{16pt}\selectfont] 
        at (9.85,27.3)
        {\color{mycolor}\textbf{2025年普通高等学校招生全国统一考试}};
        % {2025年普通高等学校招生全国统一考试};
    \node[font=\fontsize{22pt}{22pt}\selectfont] at (9.85,26.3){\textbf{数学答题卡}};
    \node[anchor=west] at (1.35,25) {姓名:\ \ \textcolor{mycolor}{\underline{\hspace{8cm}}} };
    
    \def\numberx{1.35}%考生号左边界横坐标
    \def\numbery{23.8}%考生号左边界中心纵坐标
    \def\size{0.8}%格子大小
    \node[anchor=west] at (\numberx,\numbery) {考生号};
    \def\total{10}%考生号位数
    \def\numberD{1.5}%考生号左端边界与第一个方框的水平距离
    \def\Distance{0.8}%相邻两个格子的中心水平间距
    \foreach \col in {1,...,\total} {
        \draw[mycolor] (\numberx+\numberD+\col*\Distance-\Distance,\numbery+0.5*\size) rectangle ++(\size,-\size);
    }

    %条形码框
    \def\Tx{11.5}
    \def\Ty{25.5}
    \def\Tw{7}
    \def\Th{2.1}
    \draw[mycolor,dashed,thick] (\Tx,\Ty) rectangle ++(\Tw,-\Th);
    \node[mycolor] at (\Tx+0.5*\Tw,\Ty-0.5*\Th) {\textbf{条形码粘贴区}};


    %第三页大框
    \def\bigx{1.2}
    \def\bigy{22.8}
    \def\bigw{17.3}
    \def\bigh{22.2}
    \draw[rounded corners=10pt,mycolor] (\bigx,\bigy) rectangle ++(\bigw,-\bigh);

    %解答题框
    \def\ebx{1.4}%框左上角横坐标
    \def\eby{22.2}%框左上角纵坐标
    \def\ebw{16.9}%框的宽度
    \def\ebh{21}%框的高度
    \draw[black] (\ebx,\eby) rectangle ++(\ebw,-\ebh);
    
    \node[text=mycolor] at (9.85,\bigy-\bigh+0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    \node[text=mycolor] at (9.85,\bigy-0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    
    %第17题
    \def\exx{2.7}%题号文字中心横坐标
    \def\exy{21.7}%题号文字中心纵坐标
    \node at (\exx,\exy) {17.(15分)};

\end{tikzpicture}

%----------------------第四页-------------------------------
    \newpage
\centering
\begin{tikzpicture}
    \useasboundingbox (0,0) rectangle (19.7,28.25);
    %第四页大框
    \def\bigx{1.2}
    \def\bigy{27.5}
    \def\bigw{17.3}
    \def\bigh{26.9}
    \draw[rounded corners=10pt,mycolor] (\bigx,\bigy) rectangle ++(\bigw,-\bigh);

    %解答题框
    \def\ebx{1.4}%框左上角横坐标
    \def\eby{26.9}%框左上角纵坐标
    \def\ebw{16.9}%框的宽度
    \def\ebh{25.7}%框的高度
    \draw[black] (\ebx,\eby) rectangle ++(\ebw,-\ebh);
    
    \node[text=mycolor] at (9.85,\bigy-\bigh+0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    \node[text=mycolor] at (9.85,\bigy-0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};

    %第18题
    \def\exx{2.7}%题号文字中心横坐标
    \def\exy{26.4}%题号文字中心横坐标
    \node at (\exx,\exy) {18.(17分)};
\end{tikzpicture}

%----------------------第五页-------------------------------   
    \newpage
\centering
\begin{tikzpicture}
    \useasboundingbox (0,0) rectangle (19.7,28.25);
    \node[font=\fontsize{16pt}{16pt}\selectfont] 
        at (9.85,27.3)
        {\color{mycolor}\textbf{2025年普通高等学校招生全国统一考试}};
        % {2025年普通高等学校招生全国统一考试};
    \node[font=\fontsize{22pt}{22pt}\selectfont] at (9.85,26.3){\textbf{数学答题卡}};
    \node[anchor=west] at (1.35,25) {姓名:\ \ \textcolor{mycolor}{\underline{\hspace{8cm}}} };
    
    \def\numberx{1.35}%考生号左边界横坐标
    \def\numbery{23.8}%考生号左边界中心纵坐标
    \def\size{0.8}%格子大小
    \node[anchor=west] at (\numberx,\numbery) {考生号};
    \def\total{10}%考生号位数
    \def\numberD{1.5}%考生号左端边界与第一个方框的水平距离
    \def\Distance{0.8}%相邻两个格子的中心水平间距
    \foreach \col in {1,...,\total} {
        \draw[mycolor] (\numberx+\numberD+\col*\Distance-\Distance,\numbery+0.5*\size) rectangle ++(\size,-\size);
    }

    %条形码框
    \def\Tx{11.5}
    \def\Ty{25.5}
    \def\Tw{7}
    \def\Th{2.1}
    \draw[mycolor,dashed,thick] (\Tx,\Ty) rectangle ++(\Tw,-\Th);
    \node[mycolor] at (\Tx+0.5*\Tw,\Ty-0.5*\Th) {\textbf{条形码粘贴区}};

    %第五页大框
    \def\bigx{1.2}
    \def\bigy{22.8}
    \def\bigw{17.3}
    \def\bigh{22.2}
    \draw[rounded corners=10pt,mycolor] (\bigx,\bigy) rectangle ++(\bigw,-\bigh);

    %解答题框
    \def\ebx{1.4}%框左上角横坐标
    \def\eby{22.2}%框左上角纵坐标
    \def\ebw{16.9}%框的宽度
    \def\ebh{21}%框的高度
    \draw[black] (\ebx,\eby) rectangle ++(\ebw,-\ebh);
    \draw (\ebx,\eby-0.5*\ebh) -- (\ebx+\ebw,\eby-0.5*\ebh);
    
    \node[text=mycolor] at (9.85,\bigy-\bigh+0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    \node[text=mycolor] at (9.85,\bigy-0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    
    %第19题
    \def\exx{2.7}%左上角文字中心横坐标
    \def\exy{21.7}%左上角文字中心纵坐标
    \node at (\exx,\exy-0.5*\ebh) {19.(17分)};
    \node at (\exx,\exy) {\textcolor{mycolor}{\textbf{(续18题)}}};
\end{tikzpicture}

%----------------------第六页-------------------------------
    \newpage
\centering
\begin{tikzpicture}
    \useasboundingbox (0,0) rectangle (19.7,28.25);
    %第六页大框
    \def\bigx{1.2}
    \def\bigy{27.5}
    \def\bigw{17.3}
    \def\bigh{26.9}
    \draw[rounded corners=10pt,mycolor] (\bigx,\bigy) rectangle ++(\bigw,-\bigh);

    %解答题框
    \def\ebx{1.4}%框左上角横坐标
    \def\eby{26.9}%框左上角纵坐标
    \def\ebw{16.9}%框的宽度
    \def\ebh{25.7}%框的高度
    \draw[black] (\ebx,\eby) rectangle ++(\ebw,-\ebh);
    
    \node[text=mycolor] at (9.85,\bigy-\bigh+0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    \node[text=mycolor] at (9.85,\bigy-0.3) {\small 请在各题目的答题区域内作答,超出黑色矩形边框限定区域的答案无效};
    
    %第19题
    \def\exx{2.7}%左上角文字中心横坐标
    \def\exy{26.4}%左上角文字中心纵坐标
    \node at (\exx,\exy) {\textcolor{mycolor}{\textbf{(续19题)}}};
\end{tikzpicture}
\end{document}
最新回复

请先登录后再回复 登录

uid:1 管理员组
关注
发帖 15
评论 10
粉丝 0
关注 0
发新帖
目录
使用 LaTeX 制作三张 A4 的全国卷答题卡