您好,当我运行以下代码时,绘图将应用于所有页面。是否有办法仅在第一页应用绘图。(请注意,代码不是我的,我从另一个用户的 stack exchange 中找到的)
\documentclass{article}
\usepackage[margin=0.5cm,bottom=2cm]{geometry}
\usepackage{kpfonts}
\usepackage{eso-pic}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\tcbset{
pccstyle/.style={
enhanced,flushright upper,
boxrule=1.4pt,
colback=white,colframe=black!50!yellow,
drop fuzzy midday shadow=black!50!yellow
}
}
\AddToShipoutPicture{% from package eso-pic: put something to the background
\AtPageCenter{% start the bar at the bottom right of the page
\put(-\LenToUnit{.465\paperwidth},-\LenToUnit{.4\paperheight}){% move it to the middle
%{\transparent{.5}{\includegraphics[width=20cm]{50th_mathematicsproof}}}
\begin{tcolorbox}[pccstyle,left=0mm,top=0mm,bottom=0mm]
%\includegraphics[width=20cm]{50th_mathematicsproof}
\end{tcolorbox}
}%
}%
\AtPageLowerLeft{% start the bar at the bottom right of the page
\put(\LenToUnit{\dimexpr\paperwidth-3cm},0){% move it to the top right
\color{blue}\rule{3cm}{\LenToUnit\paperheight}%
}%
\put(\LenToUnit{\dimexpr\paperwidth-2.7cm},\LenToUnit{17cm}){% move it to the top right
\color{gray}\scalebox{8}{$\sum$}
}%
\put(\LenToUnit{\dimexpr\paperwidth-2.5cm},\LenToUnit{12.5cm}){% move it to the top right
\color{gray}\scalebox{8}{$\int$}
}%
\put(\LenToUnit{\dimexpr\paperwidth-2.3cm},\LenToUnit{8.5cm}){% move it to the top right
\color{gray}\scalebox{8}{$e$}
}%
\put(\LenToUnit{\dimexpr\paperwidth-2.7cm},\LenToUnit{5.0cm}){% move it to the top right
\color{gray}\scalebox{8}{$\pi$}
}%
\put(\LenToUnit{\dimexpr\paperwidth-2.2cm},\LenToUnit{1.5cm}){% move it to the top right
\color{gray}\scalebox{8}{$i$}
}%
}%
}
\pagestyle{empty}
\begin{document}
\vspace*{1cm}
\mbox{}\hfill\scalebox{2}{
\begin{tcolorbox}[pccstyle,width=6.8cm]
{\bfseries\LARGE {Program Review} \par}
{\large \itshape Mathematics \par}
{\large Portland Community College }
\end{tcolorbox}
}
\vfill
\centering
\scalebox{2}{%
\begin{tcolorbox}[pccstyle,width=4.8cm]
{\scshape Fall 2008--Spring 2013}
\end{tcolorbox}
}
\newpage
Test
\newpage
test
\end{document}
答案1
eso-pic
提供其\AddToShipoutPictureFG
和\AddToShipoutPictureBG
例程的星号版本。这些星号版本仅在当前页面上打印其内容。
因此,使用\AddToShipoutPictureBG*
(即使放在序言中,它也只适用于第一页)。