My intent is to have several different background images on the same (one) page.
I read background
package documents and found no answer (though I didn't really got an idea of what the anchors are for, maybe that's the answer I'm looking for but I really need some guidance).
For now I managed to perfectly add a single background image to any page I want with a great deal of control over that image and the only solution I came up with is to add another image to the same page with includegraphics
but that solution doesn't work the way I need it to work because it limits my ability to work with text and images on the same page. If a background image is layered behind the text, an image added with includegraphics
is always separated.
I tried to duplicate \backgroundsetup
command and use \BgThispage
twice within the same page but it returns an error.
Is there a practical way to have several different background images on one page?
% !TEX TS-program = LuaLaTeX
\documentclass[11pt,twoside,openany]{book}
\usepackage[
paperwidth=6in,
paperheight=9in,
inner=15mm,
top=15mm,
outer=20mm,
bottom=22mm,
heightrounded,
showframe,
]{geometry}
\usepackage[pagewise]{lineno}
\usepackage{fontspec}
\usepackage{microtype}
\usepackage[shortcuts]{extdash}
\usepackage{graphicx}
\usepackage[dvipsnames]{xcolor}
\usepackage{titlesec}
\usepackage[pages=some]{background}
\titleclass{\part}{top}
\titleformat{\part}{\filcenter\normalfont\large}{\thepart.}{20pt}{\LARGE}
\titlespacing*{\part}{0pt}{10pt}{40pt}
\titleclass{\chapter}{straight}
\titleformat{\chapter}[display]{\filcenter\normalfont\large}{\thechapter.}{6pt}{}
\titlespacing*{\chapter}{0pt}{30pt}{10pt plus 10pt}
\setmainfont{EB Garamond}
\setlength{\parskip}{0pt}
\let\cleardoublepage\clearpage
\pagestyle{plain}
\begin{document}
\vspace*{0mm}
\backgroundsetup{
scale=1,
color=black,
opacity=1,
angle=0,
position={50mm,-50mm},
contents={%
\includegraphics[width=3in,height=5in,keepaspectratio]{example-image}
}%
}
\BgThispage
\begin{center}
\vspace{10mm}
{\fontsize{36}{36}\bfseries {SOME TEXT ON PRETITLE PAGE}\par}
\vspace{15mm}
\end{center}
\begin{picture}(0,150)
\put(180,-150){\includegraphics[width=60mm,height=60mm,keepaspectratio]{example-image}}
\end{picture}
\clearpage
\frontmatter
\begin{titlepage}
\centering
\vspace*{10mm}
{\scshape\huge TITLE\par}
\end{titlepage}
\mainmatter
\pagenumbering{arabic}
\part{PART ONE}
\chapter{CHAPTER ONE}
\end{document}
Best Answer
It isn't clear what your issue is, any method that you use to add one image will let you add multiple. Most of your example appeared to be using unrelated package code so I omitted them here and just use
graphicx
needed to include the images.If you have an old latex release without the built in hooks you can use one of the packages such as
everyshi
that provided similar functionality.