![tikz 中的网格考虑了分页符](https://linux22.com/image/381202/tikz%20%E4%B8%AD%E7%9A%84%E7%BD%91%E6%A0%BC%E8%80%83%E8%99%91%E4%BA%86%E5%88%86%E9%A1%B5%E7%AC%A6.png)
以下代码使用 Tikz 创建编号网格。我想将 << quadrill >> 环境适配到分页符。
实际上,网格不能在两个页面之间分成两部分。
\documentclass[a4paper,10pt,table]{book}
\usepackage{tikz,tikzpagenodes}
\usetikzlibrary{calc}
\usepackage[left=1.8cm,right=1.7cm,top=1.5cm,bottom=1.7cm,marginparwidth=0.8cm, marginparsep=0.4cm]{geometry}
\definecolor{quadrillgrey}{RGB}{179,182,183}
%Grid
\newcounter{NoQuadrill}
\setcounter{NoQuadrill}{1}
\newcommand{\quadrillseul}[1]{\smallbreak\begin{tikzpicture}[scale=0.5,grey]
\draw(0,0) grid (33.4,#1);
\end{tikzpicture}\medbreak}
\newcommand{\quadrill}[1]{\smallbreak\begin{tikzpicture}[scale=0.5,quadrillgrey]
\draw(0,0) grid (33.4,#1);
\node[anchor=north west] at (32.8,1.1) {\color{blue}\bfseries\Large{\thesection.\theNoQuadrill}};
\end{tikzpicture}
\refstepcounter{NoQuadrill}
\medbreak}
\newenvironment{Quadrill}[1]{\refstepcounter{NoQuadrill}\quadrill{#1}}{}
\begin{document}
\quadrill{12}
\end{document}