LaTeX 如何为每个页面设置不同的背景

How to set different backgrounds for each page in LaTeX

我试图在我的 LaTeX 文档的每一页中设置不同的背景。我尝试过使用 tikz、background 和我找到的许多其他软件包,但我做不到。

I.E.

第一页:\maketitle 有一个背景

第二页:\tableofcontents 背景不同

第三页及以下:具有其他背景的内容

[编辑 1]

有些地方我没有解释清楚。你的代码对我帮助很大,但我试图修改它并遇到了一些问题。

    \documentclass[a4paper, 12pt]{article}

\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{eso-pic}
\usepackage[spanish]{babel}
\usepackage[absolute,overlay]{textpos}
\usepackage{xcolor} \definecolor{letras_portada}{RGB}{229,238,245}




\begin{document}

\AddToShipoutPictureBG*{\includegraphics[width=\paperwidth,height=\paperheight]{First_page.png}}
\begin{textblock*}{15cm}(6.35cm,23cm) 
    \huge{\textcolor{letras_portada}{\textbf{Report}}}
\end{textblock*}

\cleardoublepage

\AddToShipoutPictureBG*{\includegraphics[width=\paperwidth,height=\paperheight]{Index.png}}
\paragraph{}
\clearpage

\AddToShipoutPictureBG{\includegraphics[width=\paperwidth,height=\paperheight]{Content.png}}
\tableofcontents
\clearpage

\section{section 1}
text example 1text example 1text example 1text example 1text example 1text example 1text example 1text example 1text example 1text example
\subsection{2}
text example 1text example 1text example 1text example 1text example 1text example 1
\subsubsection{3}
text example 1text example 1text example 1text example 1text example 1text example 1



\end{document}

我假装是第一页有我的标题(而不是 maketitle 我是文本),第二页有特定背景但没有文本,在第三页我想有 table 的内容。但是第二页消失了。

一种可能是 eso-pic 包。使用 \AddToShipoutPictureBG*{} 您可以更改当前页面的背景,使用 \AddToShipoutPictureBG{} 当前和所有后续页面的背景。

\documentclass{book}

\usepackage{graphicx}
\usepackage{eso-pic}

\author{names}
\title{title}

\begin{document}

\AddToShipoutPictureBG*{\includegraphics[width=\paperwidth,height=\paperheight]{example-image-duck}}
\maketitle

\cleardoublepage
\AddToShipoutPictureBG*{\includegraphics[width=\paperwidth,height=\paperheight]{example-image-a}}
\tableofcontents

\clearpage
\AddToShipoutPictureBG{\includegraphics[width=\paperwidth,height=\paperheight]{example-grid-100x100bp}}

\chapter{title}
text

\end{document}

要在单面文档类中添加仅背景页面,您可以使用这个快速技巧:

 \documentclass[a4paper, 12pt]{article}

\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{eso-pic}
\usepackage[spanish]{babel}
\usepackage[absolute,overlay]{textpos}
\usepackage{xcolor} \definecolor{letras_portada}{RGB}{229,238,245}




\begin{document}

\AddToShipoutPictureBG*{\includegraphics[width=\paperwidth,height=\paperheight]{example-image-a}}
\begin{textblock*}{15cm}(6.35cm,23cm) 
    \huge{\textcolor{letras_portada}{\textbf{Report}}}
\end{textblock*}
\mbox{}

\newpage

\mbox{}
\AddToShipoutPictureBG*{\includegraphics[width=\paperwidth,height=\paperheight]{example-image-b}}


\newpage

\AddToShipoutPictureBG{\includegraphics[width=\paperwidth,height=\paperheight]{example-image-c}}
\tableofcontents
\clearpage

\section{section 1}
text example 1text example 1text example 1text example 1text example 1text example 1text example 1text example 1text example 1text example
\subsection{2}
text example 1text example 1text example 1text example 1text example 1text example 1
\subsubsection{3}
text example 1text example 1text example 1text example 1text example 1text example 1

\newpage
\ClearShipoutPictureBG
\AddToShipoutPictureBG{\includegraphics[width=\paperwidth,height=\paperheight]{example-image-b}}
\mbox{}


\end{document}