特定のページのページ境界、別の質問の回答へのフォローアップ

特定のページのページ境界、別の質問の回答へのフォローアップ

私はからの回答を使ってみました各ページに枠線を追加するページ境界線を作成し、機能させるには、特定のページからページ境界線を削除する方法があるかどうか疑問に思っています。

コメントで質問したいのですが、残念ながら評判が 50 ありません :(

ありがとう。

答え1

以下はあなたが引用した回答の拡張版です。

% noborderprob.tex SE 559677

% the following code mainly from SE 404749
\documentclass{article}

% PW added the folowing code
\usepackage{lipsum} 
\usepackage{ifthen}
\newboolean{borderon} 
\newcommand{\borders}{\setboolean{borderon}{true}}    % have borders
\newcommand{\noborders}{\setboolean{borderon}{false}} % no borders
\borders
% end of addition

\usepackage{calc}
\usepackage{eso-pic}

\newlength{\PageFrameTopMargin}
\newlength{\PageFrameBottomMargin}
\newlength{\PageFrameLeftMargin}
\newlength{\PageFrameRightMargin}

\setlength{\PageFrameTopMargin}{1cm}
\setlength{\PageFrameBottomMargin}{1cm}
\setlength{\PageFrameLeftMargin}{1cm}
\setlength{\PageFrameRightMargin}{1cm}

\makeatletter

\newlength{\Page@FrameHeight}
\newlength{\Page@FrameWidth}

% PW modified the \AddToShipoutPicture to output nothing for borderon=false
\AddToShipoutPicture{
  \ifthenelse{\boolean{borderon}}{%
  \thinlines
  \setlength{\Page@FrameHeight}{\paperheight-\PageFrameTopMargin-\PageFrameBottomMargin}
  \setlength{\Page@FrameWidth}{\paperwidth-\PageFrameLeftMargin-\PageFrameRightMargin}
  \put(\strip@pt\PageFrameLeftMargin,\strip@pt\PageFrameTopMargin){
    \framebox(\strip@pt\Page@FrameWidth, \strip@pt\Page@FrameHeight){}}}
{}}

\makeatother

\begin{document}

\section{Test}

% PW added the following code

\lipsum 

\lipsum 

\noborders % stop page borders

\lipsum

\borders % start page borders

\lipsum

\end{document}

これは境界線のあるページから始まります。境界線を止めるには、\noborders境界線をなくしたいページに置きます。\borders境界線を再び開始したいページに置きます。

関連情報