You can do this in number of ways. I will show three more methods.
With tikz
:
\documentclass{article}
\usepackage{tikz}
\usepackage[top=2cm, bottom=2cm, outer=0cm, inner=0cm]{geometry}
\begin{document}
Some content
\tikz[remember picture,overlay] \node[opacity=0.3,inner sep=0pt] at (current page.center){\includegraphics[width=\paperwidth,height=\paperheight]{example-image}};
\clearpage
text
\end{document}
With eso-pic
:
\documentclass{article}
\usepackage{eso-pic,graphicx}
\usepackage[top=2cm, bottom=2cm, outer=0cm, inner=0cm]{geometry}
\begin{document}
Some content
\AddToShipoutPictureBG*{\includegraphics[width=\paperwidth,height=\paperheight]{example-image}};
\clearpage
text
\end{document}
\AddToShipoutPictureBG
(instead of \AddToShipoutPictureBG*
) puts the background in all pages.
With background
package:
\documentclass{article}
\usepackage[top=2cm, bottom=2cm, outer=0cm, inner=0cm]{geometry}
\usepackage[pages=some]{background}
\backgroundsetup{
scale=1,
color=black,
opacity=0.4,
angle=0,
contents={%
\includegraphics[width=\paperwidth,height=\paperheight]{example-image}
}%
}
\begin{document}
\BgThispage
Some content
\clearpage
text
\end{document}
With a bit of care you can set the float placement parameters to prevent floats within the region, here I set totalnumber
to 0. It is a global setting so you need to explicitly set it back at the end, you can not use a group to restore things. Also because of its global nature and the timing of the page breaking sometimes a bit of care needs to be taken into exactly where it is set. But in this case the "obvious" places of immediately surrounding the environment works:
\documentclass{scrbook}
\usepackage{lipsum}
\usepackage{mdframed}
\usepackage[demo]{graphicx}
\begin{document}\mainmatter\chapter{MWE}
\lipsum[1-3]
\begin{figure}\centering{\includegraphics[width=8cm,height=5cm]{exampleimg}
\caption{exampleimg}}\end{figure}
\setcounter{totalnumber}{0}
\begin{mdframed}
\lipsum[4-6]
\end{mdframed}%
\setcounter{totalnumber}{3}
\end{document}
Best Answer
Using
\clearpage
(\cleardoublepage
) instead of\newpage
forces floats to appear.