如何将图片放入背景页的目录中?

如何将图片放入背景页的目录中?

我有一个简单的 Latex 代码

\documentclass[oneside]{book}

\usepackage{titletoc}

\begin{document}

\tableofcontents


\chapter{Chapter One}
\section{Section One One}
\section{Section One Two}
\section{Section One Three}
\section{Section One Four}

\chapter{Chapter Two}
\section{Section Two One}
\section{Section Two Two}
\section{Section Two Three}

\chapter{Chapter Three}
\section{Section Three One}
\section{Section Three Two}
\section{Section Three Three}
\section{Section Three Four}
\section{Section Three Five}

\chapter{Chapter 4}
\section{Section 4 One}
\section{Section 4 Two}
\section{Section 4 Three}
\section{Section 4 Four}
\section{Section 4 Five}

\chapter{Chapter 5}
\section{Section 5 One}
\section{Section 5 Two}
\section{Section 5 Three}
\section{Section 5 Four}
\section{Section 5 Five}

\chapter{Chapter 6}
\section{Section 6 One}
\section{Section 6 Two}
\section{Section 6 Three}
\section{Section 6 Four}
\section{Section 6 Five}

\chapter{Chapter 7}
\section{Section 7 One}
\section{Section 7 Two}
\section{Section 7 Three}
\section{Section 7 Four}
\section{Section 7 Five}

\end{document} 

我如何将图像(横跨整个页面)放在所有内容页面(如果有更多页面)的背景中,如下所示:

在此处输入图片描述

如果有人知道解决方案并给出示例,我将不胜感激。我希望解决方案与 Tikz 包一起使用。

答案1

eso-pic

在此处输入图片描述

\documentclass{book}

\usepackage{titletoc}

\usepackage{eso-pic,graphicx}

\begin{document}

\AddToShipoutPictureBG*{%
  \AtPageLowerLeft{%
    % Your background image here
    \includegraphics[width=\paperwidth,height=\paperheight]{example-image}%
  }%
}%
\tableofcontents

\chapter{Chapter One}
\section{Section One One}
\section{Section One Two}
\section{Section One Three}
\section{Section One Four}

\chapter{Chapter Two}
\section{Section Two One}
\section{Section Two Two}
\section{Section Two Three}

\chapter{Chapter Three}
\section{Section Three One}
\section{Section Three Two}
\section{Section Three Three}
\section{Section Three Four}
\section{Section Three Five}

\chapter{Chapter 4}
\section{Section 4 One}
\section{Section 4 Two}
\section{Section 4 Three}
\section{Section 4 Four}
\section{Section 4 Five}

\chapter{Chapter 5}
\section{Section 5 One}
\section{Section 5 Two}
\section{Section 5 Three}
\section{Section 5 Four}
\section{Section 5 Five}

\chapter{Chapter 6}
\section{Section 6 One}
\section{Section 6 Two}
\section{Section 6 Three}
\section{Section 6 Four}
\section{Section 6 Five}

\chapter{Chapter 7}
\section{Section 7 One}
\section{Section 7 Two}
\section{Section 7 Three}
\section{Section 7 Four}
\section{Section 7 Five}

\end{document} 

\AddToShipoutPictureBG*{<stuff>}添加<stuff>到当前页面的B确认G轮次,而无星号版本则\AddToShipoutPictureBG{<stuff>}添加<stuff>到当前页面以及后续页面。您可以使用 删除任何B确认G轮次材料\ClearShipoutPictureBG

相关内容