我知道该eso-pic
包可用于将图片添加到每个页面,或单个页面。
但是如何将图片添加到最多页数?
理想行为:在每个页面上添加图片,但我可以使用(或其他类似方便的方法)eso-pic
“关闭”某些页面的图片。\thispagestyle{empty}
平均能量损失
\documentclass{report}
\pagenumbering{gobble}
\usepackage{eso-pic,color}
% Add colour footer
\AddToShipoutPictureBG{
\AtPageLowerLeft{%
\color{red}%
\rule{\pdfpagewidth}{2cm}%
}
}
\begin{document}
This is my nice title page.
I don't want a colour footer here.
\clearpage
I understand that eso-pic makes it easy to add pictures to every page, or a
single page. But what about adding pictures to \emph{most} pages?
\clearpage
Doing the good good science
\clearpage
For whatever reason (full page figure, table, whatever), I don't want a footer
here either.
\end{document}
思考
我知道内部\ESO@HookIBG
存储了所有要使用的图片命令,并且我可以使用 清除其内容\ClearShipoutPictureBG
。我想我可以删除单个页面的图片,如下所示:
- 捕获
\ESO@HookIBG
内容(\let
?) - 称呼
\ClearShipoutPictureBG
- 页面内容
\ESO@HookIBG
从 1 的捕获中恢复。
但我不确定如何真正实现这一点(以及如何通过将它挂接到\thispagestyle{empty}
或类似的东西上使它的使用更加方便。)
答案1
使用新的(当前)乳胶,你可以尝试这样的方法
\documentclass{report}
\pagenumbering{gobble}
\usepackage{eso-pic}
\usepackage{color}
% Add colour footer
\newif\ifmyfooter
\global\myfootertrue
\AddToShipoutPictureBG{
\AtPageLowerLeft{%
\ifmyfooter
\color{red}%
\rule{\pdfpagewidth}{2cm}%
\fi
\global\myfootertrue
}
}
\DeclareHookRule {shipout/background}{mylabel}{before}{eso-pic}
\begin{document}
This is my nice title page.
I don't want a colour footer here.
\clearpage
\AddToHookNext{shipout/background}[mylabel]{\global\myfooterfalse}
I understand that eso-pic makes it easy to add pictures to every page, or a
single page. But what about adding pictures to \emph{most} pages?
\clearpage
Doing the good good science
\clearpage
For whatever reason (full page figure, table, whatever), I don't want a footer
here either.
\AddToHookNext{shipout/background}[mylabel]{\global\myfooterfalse}
\end{document}