如何從頁面底部新增水平網格而無需偏移?

如何從頁面底部新增水平網格而無需偏移?

我試圖僅添加水平線,該水平線將從頁面底部開始,以 100pt 的間隙向頂部邁進。步驟無需與頁面的高度或頂部相符。

我正在嘗試以下操作。

\documentclass[parskip=true]{scrartcl}
\usepackage[automark,headsepline=true,footsepline=false]{scrlayer-scrpage}
\usepackage{tikz}
\usepackage[]{geometry}
\usepackage{blindtext}
\usetikzlibrary{arrows,shapes,backgrounds}
\begin{document}
\KOMAoptions{paper=432pt:329pt,paper=landscape}
\recalctypearea
\newgeometry{left=0mm,right=0mm,top=0mm, bottom=0mm}
    \begin{tikzpicture}[overlay][x=1pt,y=1pt]
        \noindent\draw[step=90pt,gray,very thick] (0,-329pt) grid (432pt,0pt);
    \end{tikzpicture}
\noindent\blindtext
\end{document}

我得到的是

在此輸入影像描述

答案1

如果您可以進行兩次編譯運行,則可以輕鬆地將左下角引用為current page.south west,然後執行一個\foreach循環,為每個 畫一條線100pt。代碼是:

\documentclass[parskip=true]{scrartcl}
\usepackage[automark,headsepline=true,footsepline=false]{scrlayer-scrpage}
\usepackage{tikz}
\usepackage[]{geometry}
\usepackage{blindtext}
\usetikzlibrary{arrows,shapes,backgrounds,calc}
\begin{document}
\KOMAoptions{paper=432pt:329pt,paper=landscape}
\recalctypearea
\newgeometry{left=0mm,right=0mm,top=0mm, bottom=0mm}
    \begin{tikzpicture}[remember picture,overlay,x=1pt,y=1pt]
        \foreach \position in {0,100,...,500}
        {
            \draw[cyan,thick] ($(current page.south west)+(0,\position)$) -- ++(432,0);
        }
    \end{tikzpicture}
\noindent\blindtext
\end{document}

結果如下: 在此輸入影像描述

相關內容